cancel
Showing results for 
Search instead for 
Did you mean: 

Random Speed feedback errors

Mostafa_Soliman
Associate

Hello,

I am trying to control the speed of a PMSM with hall sensors. We are getting many random speed feedback errors that causes the drive to stop.

When I looked at the code (hall_speed_pos_fdbk.c), I was surprised to find that the parameter bMaximumSpeedErrorsNumber is pretty much useless. Whenever the fault will occur, the count is set to the maximum value and the drive trips. This makes the code extremely fragile in noisy environments. Is there any way to fix this?

else

{

bReliability = false;

pHandle->_Super.bSpeedErrorNumber = pHandle->_Super.bMaximumSpeedErrorsNumber;

/* If speed is not reliable the El and Mec speed is set to 0 */

pHandle->_Super.hElSpeedDpp = 0;

*hMecSpeedUnit = 0;

}

Thanks

2 REPLIES 2
GMA
ST Employee

Hello @Mostafa_Soliman,

If the root cause is reliability flag set to false (SensorIsReliable parameter). 
Could you check HALL signals with a scope in term of noise, levels, and if H1/H2/H3 signals have the correct behavior according to the "Sensor displacement" parameter? Refer to User Manual documentation available through "Workbench tool">About>Documentations>Documentation>"User manual" tab, "Hall sensor feedback processing" link.

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

Hello @Mostafa_Soliman,

In addition to @GMA 's answer, please be aware that if you use sensors, sensors must always be reliable. If you miss one event then your angle is shifted by 60 electrical degrees, and your computed speed is also wrong.

The code you highlighted is correct. As the parent component (_Super) does not have a Reliability member, the setting of pHandle->_Super.bSpeedErrorNumber to  bMaximumSpeedErrorsNumber will guarantee that the next call to SPD_IsMecSpeedReliable will return false, and this is what we want.

For your information the attribute bMaximumSpeedErrorsNumber is used differently in sensorless mode.

To answer to your remark: "This makes the code extremely fragile in noisy environments." From theoretical point of view, you cannot control a motor with sensors that miss events, the only thing you can do is to improve your electronic and filter your signals better to never miss any events.

Regards

Cedric