MC SDK4.3 PWM frequency >65kHz
I would like to run the Sensorless FOC firmware with a PWM frequency greater than 65kHz.
My hardware configuration:
Nucleo-F446RE -> X-Nucleo-IHM09M1 -> Custom power-stage with ICS current sensors and bus voltage measurement.
My software configuration:
ST MC SDK4.3 -> STM32F4xx_MC Library -> STM32F4xx_UserProject - SM32446E-EVAL
IAR Embedded Workbench IDE
I have successfully configured, compiled, uploaded and tested the sensorless FOC firmware with a PWM frequency of 30kHz. However, once the PWM frequency is increased above 65kHz, the compiler produces a number of warnings, and the controller is not able to drive the test motor.
I have inspected the source code for the firmware. The PWM_FREQUENCY is declared in Drive_parameters.h, with no type. All subsequent calls cast the value to uint16_t, which explains the 65kHz limit.
I have attempted to change the declaration of variables that will take the PWM_FREQUENCY and TF_REGULATION_RATE to uint32_t. I have worked through the variables one-by-one to check that everything still works with a PWM frequency of 30kHz. I can change all calls apart from one:
Once I change the 'hMeasurementFrequency' member of the SpeednPosFdhkParams_t structure in SpeedNPosFdbkClass.h from uint16_t to uint32_t, the code will compile but the motor will not run. I have unsuccessfully tried to identify operations that use .hMeasurementFrequency and determine why they won't work with a uint32_t value.
I would be incredibly grateful if someone with a more in-depth understanding of the SDK (and software debugging in general) would be able to assist me with figuring out how to modify the code.
Thank you in advance!
Greg
#foc-4.3 #foc-sdk-4.3.0 #motor-control-foc-library