Skip to main content
cyt
Associate II
May 3, 2020
Question

Motor rotation become backward/negative direction problem

  • May 3, 2020
  • 1 reply
  • 705 views

I use FOC+Hall and try to start in forward direction by speed mode as below:

MC_ProgramSpeedRampMotor1(200/6, 200) 

MC_StartMotor1()

but the motor become backward direction

I found at STC_CalcTorqueReference() function, the return value SPD_GetAvrgMecSpeed01Hz() is very big such 3630

hMeasuredSpeed = SPD_GetAvrgMecSpeed01Hz( pHandle->SPD );

hence, the value of hTorqueReference is negative

hTorqueReference = PI_Controller( pHandle->PISpeed, ( int32_t )hError );

I found that the value of HALL_M1.CurrentSpeed become 32767(0x7FFF) at HALL_TIMx_CC_IRQHandler() when motor is not in rotation status.

since the value of HALL_M1.CurrentSpeed 32767, the hall direciton become negative, then the motor ration become backward direction.

anyone know the reason?

Thanks

This topic has been closed for replies.

1 reply

chaaalyy
Senior II
May 3, 2020

I never tried the hall sensors until now... But yesterday i found a horrible bug while experimenting with a quad encoder for position control. Maybe in your case, it´s something similar...

https://community.st.com/s/question/0D73W000000Piga/bugreport-mcsdk-543-and-temporary-fix?s1oid=00Db0000000YtG6&s1nid=0DB0X000000DYbd&emkind=chatterCommentNotification&s1uid=0050X0000089sTU&emtm=1588455523620&fromEmail=1&s1ext=0