cancel
Showing results for 
Search instead for 
Did you mean: 

Count rotation circles during motor rotation

N_1
Associate II

Hy dear helpers,

I am using STM32G431CB, I generated code with the help of motor control workbench. Everything works fine, but I can not count how many circles the motor rotated. 

I would like to do the following: Start the motor, do 5 whole circles, then stop.

I have sensorless mode, and I have to do this not by calculating the time, but by the actual mechanical statement of the motor.

Can you tell me how can I do this? Thank you all

1 ACCEPTED SOLUTION

Accepted Solutions
Fred V.
ST Employee

Hello,

What you are trying to do looks like position control. the current motor control SDK does not support this feature for sensorless configurations. However, starting with version 5.4.3 of the motor control SDK, an encoder based position control example is provided. May be you can build on that for your application. However, it requires that you use a quadrature encoder for position detection.

Best Regards,

Fred V.

View solution in original post

3 REPLIES 3
Fred V.
ST Employee

Hello,

What you are trying to do looks like position control. the current motor control SDK does not support this feature for sensorless configurations. However, starting with version 5.4.3 of the motor control SDK, an encoder based position control example is provided. May be you can build on that for your application. However, it requires that you use a quadrature encoder for position detection.

Best Regards,

Fred V.

N_1
Associate II

Thank you Fred. And is it possible to change the rotation direction of the motor immediately? (without any stop, just cyclic cw/ccw)

Thank you!

N

Laurent Ca...
Lead II

Dear @NN.2y​ 

As it is a new question, please open a new post if you still need to solve this question.

Best regards

Laurent Ca...