cancel
Showing results for 
Search instead for 
Did you mean: 

how to use speed_pos_fdbk.c to get current speed of motor ( development board EVALKIT-ROBOT-1)

CYu-X.1
Associate

Hello everyone, How to get current speed of motor,useing  speed_pos_fdbk.c  ,i try to use the functions in fig2 SPD_GetElSpeedDpp but I don't Know how to get the control Period ,It is written in the comments to use the SPD_CalcElectricalAngle ,but i can't find it 。or is there another way to get current speed of motor。

Thank you very much

0693W00000aH8zZQAS.png

0693W00000aH8yvQAC.jpg​ (fig1)​ motor Specification

0693W00000aH8z0QAC.jpg(fig2)​

1 REPLY 1
FouadB
ST Employee

We would like to sincerely apologize for the delay in replying to your post.
If your point is still relevant, all of the APIs are defined in the mc_api.[c,h] file.
To obtain the current average speed of the motor, use the following API: MC_GetMecSpeedAverageMotor1().
This API returns the most recent calculated average mechanical rotor speed, expressed in the unit specified by #SPEED_UNIT.
For instance, if RPM is the chosen unit, SPEED_UNIT should be defined as 60.

If you agree with my answer, please accept it by clicking on 'Accept as solution'."