cancel
Showing results for 
Search instead for 
Did you mean: 

Starting Motor over UART or without Motor Pilot using MC_StartMotor1()

x4ce
Associate III

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:

Screenshot_62.png

 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

7 REPLIES 7
x4ce
Associate III

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

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

 

 

 

x4ce
Associate III

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

x4ce
Associate III

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.

GMA
ST Employee

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.

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA
x4ce
Associate III

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

GMA
ST Employee

Hello @x4ce,

The optimal solution is to decrease the PWM frequency or increase the Current Sensing Regulator execution time.

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA