Drive polarity in motor control workbench 5.2- does this work?
We have a custom board that uses an STM32F303 processor. The gate driver chosen for it is not the STEVAL-001ESC IC. The ST IC has the polarity of the low side driver 'active low'. The IC we are using has the low side driver as 'active high'. However, when we make this change, it looks like the phases are being turned on incorrectly.
Diffing the generated software with the only change being the MCW 5.2 update from active low to active high results in 5 files being changed, none of which are C or H files. It is .ioc, .elf, .log, etc files. The *.ioc file seems to show the correct changes, for example this:
MotorControl.PHASE_VL_POLARITY=L_ACTIVE_LOW
changed to this:
MotorControl.PHASE_VL_POLARITY=L_ACTIVE_HIGH
occurs also on the other 2 phases.
However, there seems to be no corresponding C or H code changes and the output to the gate drivers on the board seems to not change either. So it seems like it is perhaps not incorporating this change. We have successfully built and run the stock firmware for STEVAL-001ESC on that board, and are reasonably comfortable with the code.
Note that on this custom board, we have overriden the GPIO locks in the generated code and did a quick test to verify that the hardware / pinout was correct. In this case, we skipped the PWM and directly commanded the gate driver pins with the HAL_GPIO_WritePin function. In this case, where the set/reset is directly written to the pin, all the hardware worked correctly and the motor lurched as expected.
So, can anyone answer these:
- Is drive polarity in the MCW 5.2 GUI a supported feature?
- If so, how is that polarity being implemented? We don't see it in any of the C files.
- If not, can anyone suggest the best place to manually implement this in the generated code?
Thanks for your help (and Happy New Year!)