2019-09-21 03:57 PM
I would like to create a minimal 3 shunt PGA driven FOC control from an STM32F303CB chip.
It has 4 op-amps (I need 3) and 4 ADCs. I can see in CubeMX that I can set up 3 op amps in PGA mode gain 16 and 3 ADCs (ADC1,2,3) with TIM1 TRGO event, which gives me perfectly synchronous current conversions and one would think that would be ideal. I can then use a spare channels for the BUS voltage, or ADC4. The comparators can stack on top of the OPAMP input pins (sensible) and run the OC control. Great, I have a minimal sensorless FOC system, when I add a few gate drives (STDRIVE_601 in this case) and transistors (Whatever...cheap TO-252 FETs). This is a fantastic building block for "just give me a motor that spins with virtually no PCB space".
But on the MCWorkbench, this seems impossible. Embedded PGA only allows for 2 opamps, and in any case, they do not appear to be connected to the correct pins, which are not modifiable. The protection is assigned to other pins and inputs that . I can manually reassign to other ports, but... why not just use the comparators on the ADC shunt in pins and attach COMPx_INM to 1/4VREF?
The STEVAL ESC001 which uses this chip is remarkably confusing in that it uses external opamps, when it has the correct connections for the shunt ins on the internals, only the other OPAMP pins are taken up by useless (DAC, unconnected; Status, TIM1_CH3N) or easily moveable stuff. Confusion. Why has this been done? Why does this ESC use pointless external opamps?
I'm finding it quite perplexing that this use-case that seems obvious to me and the designers of the chip (surely it can't be coincidence that the peripherals are so perfectly placed and assigned to pins...) is not supported in the MC Workbench or eval boards.
The later ESC G4 has this layout, and in MC workbench there is the option for almost exactly this. I'd swap, except I've already got a whole load of other stuff working on the F303.
2019-09-21 04:00 PM
I observe there is a missing file in: C:\Program Files (x86)\STMicroelectronics\MC_SDK_5.4.1\Middlewares\ST\MotorControl\MCSDK\MCLib
For the G4 series there is:
r3_3_g4xx_pwm_curr_fdbk.c
But for the F3 series there is only:
r3_1_f30x_pwm_curr_fdbk.c and
r3_2_f30x_pwm_curr_fdbk.c (although the MCWB seems not to support this in the config gui...
2019-09-21 04:11 PM
I also got to this stage on PCB layout, so I'm a bit reluctant to change chips etc...
2021-06-21 11:17 PM
The question has been moved from the section "Motor Control Hardware" to the "STM32 Motor Control" section (the question is about the STM32 MC SDK).
Best regards