2025-11-17 8:54 AM
Hi,
I'm using a custom STSPINF0 based board and successfully profiled my motor. Using motor pilot, I have obtained a start-up profile which I've also implemented in Motor Control Workbench (6.3.1) as shown below:
I've interfaced STSPINF0 with nRF52832 over USART and I'm able to execute commands & receive data successfully.
But, motor runs and stalls with Fault_over/ Duration type fault when I execute MC_StartMotor1(). I think using this command my start-up parameters are not executed.
I want to know does Motor Workbench stored my start-up parameters in the firmware/ STM Cube IDE? If so, how I can start my motor using that stored start-up parameters?
Otherwise, please guide me how can I manually implement & execute my above start-up parameters in forms of following commands before executing MC_StartMotor1() over USART:
* - MC_ProgramSpeedRampMotor1()
* - MC_ProgramTorqueRampMotor1()
* - MC_SetCurrentReferenceMotor1()
Thanks
2025-11-18 3:03 AM
OK, I have been searching out and I see that my start-up has been saved in RevUpControlM1 handle.
So, does this mean that MC_StartMotor1() starts my motor using above handle? Executing my saved ramp?
If no, what is the correct procedure to call that handle "RUC_Exec(&RevUpControlM1);"?
If yes, then why Motor Pilot works to start my motor but MC_StartMotor1() does not?
My motor runs up to set motor RPM of 11000 but then goes into fault error no. 11 (duration).
What is the solution?
Thanks
2025-11-18 3:11 AM - edited 2025-11-18 3:32 AM
Are you referring to the below fault, for me it is showing 1, i am not sure why, but you have to reduce the PWM frequency as per the comment in MCSDK.
I understand when 0x11 it is doing OR operation of 0x10 and 0x01, so probably you are getting two faults
#define MC_DURATION ((uint16_t)0x0001) /**< @brief Error: FOC rate to high.*/
and
#define MC_START_UP ((uint16_t)0x0010) /**< @brief Error: Startup failed. */
You can also refer to the documentation
User Manual documentation available through "Workbench tool">About>Documentations>Documentation>"User manual" tab>"Firmware errors" link
2025-11-18 4:00 AM
Reducing the PWM or Increasing Execution Rate? Which one is good to go for? I disabled UART then it worked along with increasing the Execution Rate.
Thanks
2025-11-18 4:33 AM
Anyone who might get to this post, it is related to USART and its baud rate & NVIC Priority as well besides reducing PWM freq/ increasing execution rate.
2025-11-18 5:31 AM
Hello @x4ce,
FOC duration error is described in the FOC firmware errors chapter of the user manual, accessible through Workbench tool > About > Documentations > Documentation. It is related to CPU workload consumption. Therefore, all options that remove CPU tasks or provide more time between two high-frequency tasks reduce the occurrence of the FOC duration error.
2025-11-18 6:34 AM
Thanks for responding.
Yes, I've managed to get it working but it's surprising that same firmware worked with Motor Pilot with very high baud rate.
I'm currently using USART with an interrupt withou DMA. Do you thing using DMA will reduce CPU workload?
Thanks
2025-11-24 9:04 AM
Hello @x4ce,
The optimal solution is to decrease the PWM frequency or increase the Current Sensing Regulator execution time.