cancel
Showing results for 
Search instead for 
Did you mean: 

Count the motor's revolutions

Christophe65
Associate II

Hello,

I am controlling my motor with the Hall effect sensor first. I am not using any auxiliary sensor. I am able to control my motor correctly, and I can visualize the angle from the Hall sensor. I need to evaluate the number of turns the motor makes and be able to reset this counter to zero at the start. Thank you.

1 REPLY 1
GMA
ST Employee

Hello @Christophe65,

Plotting HALL_EL_ANGLE computed at "HALL_CalcElAngle(&HALL_M1);" call, an angle transition from positive value to negative value gives you an electrical lap, divided by pole pair value value gives you the mechanical lap.

GMA_0-1728490271404.png

Gpio are available to trig an interrupt to clear your local counter (as Start button feature).

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