cancel
Showing results for 
Search instead for 
Did you mean: 

MCSDK 5.Y.3: no electrical speed and no speed control with quadrature encoders, but behaves like position control

Quentin Ch
Associate III

Hello,

I struggling with MCSDK 5.Y.3 to control a 24V, 15 poles pairs, 300 rpm hooverboard-style BLDC motor, nearly no load, with a Nucleo F401 and a IHM08M1 power board.

I try to use FOC control with 526 PPR quadrature encoder as main sensor as I want to drive this motor at low RPM (< 10 RPM). I flash the generated code on the Nucleo and then use Motor Pilot to test.

Once the encoder alignment phase ends in Motor Pilot, I'm unable to control the motor: it does not even moves, whatever the direction and the speed I set through the GUI. I can hear some commutation noise, and the transistor on the IHM08 are slightly heating (~30°C after few min). I get no error in the GUI.

However, if I give some momentum manually to my motor, it starts to turns and stabilizes at the speed set in the GUI, but then changing the speed in the GUI does not change the speed of the motor. This behaviour happens in only one (the negative) direction: if I give momentum in the opposite direction, the motor simply stops slowly.

Stranger, if I take the encoder out of the motor shaft and turn it manually: then the motors follows the motion of the encoder, and with strong torque ! As if it was a position control instead of speed control (but in the code the mode is effectively SPEED_CONTROL, checked with debugger)...

With a debugger, I see that the variable corresponding to the electrical speed is never updated/used.

# This variable in the global struct is always 0
pMCl -> pSTC -> SPD -> InstantaneousElSpeedDpp 
 
# Only reference in the code:
__weak int16_t SPD_GetInstElSpeedDpp( SpeednPosFdbk_Handle_t * pHandle )
{
  return ( pHandle->InstantaneousElSpeedDpp );
}

Is there something missing in this version of the code ?

What am I doing wrong to get such behaviour ?

EDIT: exactly same behaviour with legacy MCSDK 5.4.8

1 ACCEPTED SOLUTION

Accepted Solutions
Quentin Ch
Associate III

Ok, never understood the root cause, but it got fixed when using another motor model (4 pole pairs, 3000rpm, 1024 PPR encoder)

View solution in original post

1 REPLY 1
Quentin Ch
Associate III

Ok, never understood the root cause, but it got fixed when using another motor model (4 pole pairs, 3000rpm, 1024 PPR encoder)