cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G431CB Source code ?

N_1
Associate II

Hy there,

I would like to ask you, if there is possible to get the basic source code that you are uploading to the STM32G431CB ? I am using it with that basic code, with a MOTOR PROFILER GUI. I am trying to change the motor rotation periodicly (eg. after 3 period the direction of the rotation should change IMMIDIATELY) but with the help of the GUI it changes very slow... I would like to modify the code, I just do not know, which code should I download?

Can you please send me the basic source code for STM32G431CB , motor rotation?

Thank you in advance,

N.

14 REPLIES 14

Thank you for your help, I find my type of devboard, but I can not build it properly. It misses "motorcontrol.h" file that I can not find anywhere :(

N_1
Associate II

Thank you Vincent, now my motor is spinning with the right speed. Can you please explain to me how to control is reserval?

​Hello,

The speed is signed, if you use the void MCI_ExecSpeedRamp( MCI_Handle_t * pHandle, int16_t hFinalSpeed, uint16_t hDurationms ) function.

Just changing the speed sign will change the direction. But beware of the following note:

 * @note A ramp cannot reverse the rotation direction if the Application is using

 * sensorless motor control techniques. If the sign of the hFinalSpeed parameter

 * differs from that of the current speed, the ramp will not complete and a Speed

 * Feedback error (#MC_SPEED_FDBK) will occur when the rotation speed is about to

 * reach 0 rpm.   

Best regards,

Vincent

PS: @Community member​ I've asked to have the UM2516 updated as per your recommendations.​ Cheers, Vincent

hello,

and what else could I use? I know if I wtop the motor and change the speed sign than it will rotate to another direction, I just need to change the direction immediately. Is there another function or a method to do it?

Thank you

Laurent Ca...
Lead II

Adding of STM32 Motor Control topic.

Best regards.