2022-09-29 08:12 AM
Hello,
I can successfully control my motor in torque mode and speed mode.
However sometimes (randomly ?), at the first call to MC_StartMotor1(), after encoder aligment, the motor starts to spin in the wrong direction, faster and faster up to its max speed.
This occurs more often in torque mode than in speed mode.
When this occurs, the estimated Iq current has the wrong sign (normally on my setup, a Iq > 0 gives a speed > 0).
So the PID in FOC_CurrControllerM1() effectively computes a command that will increase the torque in the wrong direction instead of a torque that would put it on the right direction.
Any clue about this wrong sign ?
What could I look at ?
Setup:
Thanks,
Solved! Go to Solution.
2022-10-05 07:44 AM
Okay, after investigation:
For the aligning the encoder, the MCSDK forces a stator magnetic field along the A phase, and then the rotor tends to align with this field.
However in some rare cases, the rotor is so that the rotor's field is at 180° of the A field: then there is nearly no torque generated during the alignement process, and after alignement, the 180° error induces a wrong sign on the rotor's angle, hence the wrong Iq sign and the reverse speed.
2022-09-29 08:13 AM
(At the beginning, I suspected a link with https://community.st.com/s/question/0D53W00001JANcuSAH/loss-of-control-whenever-the-motor-starts-at-some-specific-points)
2022-10-05 07:44 AM
Okay, after investigation:
For the aligning the encoder, the MCSDK forces a stator magnetic field along the A phase, and then the rotor tends to align with this field.
However in some rare cases, the rotor is so that the rotor's field is at 180° of the A field: then there is nearly no torque generated during the alignement process, and after alignement, the 180° error induces a wrong sign on the rotor's angle, hence the wrong Iq sign and the reverse speed.
2022-10-19 05:57 PM
Thank you for a valuable information.
I would like to modify the alignment code as follows:
The above problem would be resolved by the pre-alignment, where the rotor is positioned at 90 degree.
2022-11-17 02:18 AM
Interesting solution, have you tried this, and did it work? I am having the exact same issue on my design but I haven't found a good solution as yet.
2022-11-20 09:32 PM
Not yet I tried, but surely I'd need this kind of improvement. As far as I know, there are several methods for better alignment, or compensating alignment gap during motor running once after alignment.
2022-11-21 12:33 AM
I implemented such solution as a workaround and it really improved the success rate.
(However it will still fil e.g. under heavy load where the pre-alignement can't move enough the shaft or under elastic load, it's not a 100% reliable solution)