cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 Motor Control - need help finding/adjusting motion parameters

Angelo Quattrociocchi
Associate III

[VERSION]: MCWB v6.3.2
[TOOL]: STM32CubeMX v6.13.0, STM32CubeIDE v1.11.5
[BOARD]: STEVAL-PTOOL1V1
[PROJECT]: STEVAL-PTOOL1V1_6S_SL

I have the code generated by MotorControl Workbench compiling in STM32CubeIDE and it programs and runs the motor.  I managed to get the motor running at the speed I want, but I've been having a hard time making some adjustments to the parameters which are distributed through various folders and files.  In particular, I want to change the initial acceleration rate after boot up.  How/where is this controlled?

Thanks

1 ACCEPTED SOLUTION
6 REPLIES 6
MotorHobbyist
Associate III

Hey @Angelo Quattrociocchi .

You can refer to drive_parameters.h (see this screenshot)

Regards!

Screenshot 2025-04-30 102400.jpg

Angelo Quattrociocchi
Associate III

Thanks for your reply.  I've been trying to adjust many of the values in that file as well as many others, but am not able to change the acceleration.

Hello @Angelo Quattrociocchi 

In drive_parameters.h file, you can change the acceleration by acting on the below table with the following considerations:

- Phase 1 is the alignment step: its final speed must be 0

- At least three steps must be configured

- OBS_MINIMUM_SPEED_RPM must be less than the final speed of the last acceleration step

 

/****************************** START-UP PARAMETERS **********************/

/* Phase 1 */
#define PHASE1_DURATION 500 /* milliseconds */
#define PHASE1_FINAL_SPEED_UNIT (0*SPEED_UNIT/U_RPM)
#define PHASE1_VOLTAGE_RMS 4.15

/* Phase 2 */
#define PHASE2_DURATION 1000 /* milliseconds */
#define PHASE2_FINAL_SPEED_UNIT (600*SPEED_UNIT/U_RPM)
#define PHASE2_VOLTAGE_RMS 10.41

/* Phase 3 */
#define PHASE3_DURATION 500 /* milliseconds */
#define PHASE3_FINAL_SPEED_UNIT (600*SPEED_UNIT/U_RPM)
#define PHASE3_VOLTAGE_RMS 10.41

Regards

Thank you ADAVE.1, I have been adjusting those values to try to get it working smoother, but don't really know what I am doing.  Is there some documentation or reference information on how these phases work?

I also still get the motor just stopping sometimes.  Adjusting the tuning parameters can help, but it's still happening sometimes.  I tried to look through the code and headers to see where or why but haven't been able to get rid of it.  The serial Motor Pilot application doesn't seem to show values from the board correctly so it's not helpful.

Thanks

Thank you ADAVE.1, that was a very helpful document.  Somehow I never came across that during the research I was doing on this device and SDK.  But it helped me understand and adjust the parameters to get a pretty good and stable operation.

I still wish the Motor Pilot tool was working so I could visualize what's going on rather than recompile/reprogram, and 'listen' to the motor for each change.  I'm not sure if it's this chip that's not supported yet in the SDK?

Thanks