Hello everyone,
I'm using a TMS320 microcontroller, with a PMSM motor, using a FOC control with TI functions. Sometimes, when my motor is at the beginning of movement, the system is a little bit unstable.
I found where the problem is, but I don’t know the reason. I explain step by step:
1-. When the motor stops, the currents PID, pid1_iq&pid1_id are quiet (obviously because the set values are 0), but the speed PID is changing (pid1_spd:Ui, Up, Saterr,…).
2.- Following the origin, I finish into the Speed measurement computation (see below)
void speed_frq_calc(SPEED_MEAS_QEP *v)
{
_iq Tmp1;
// Differentiator
// Synchronous speed computation
if ((v->ElecTheta < _IQ(0.9))&(v->ElecTheta > _IQ(0.1)))
// Q21 = Q21*(GLOBAL_Q-GLOBAL_Q)
Tmp1 = _IQmpy(v->K1,(v->ElecTheta - v->OldElecTheta));
else Tmp1 = _IQtoIQ21(v->Speed);
// Low-pass filter
// Q21 = GLOBAL_Q*Q21 + GLOBAL_Q*Q21
Tmp1 = _IQmpy(v->K2,_IQtoIQ21(v->Speed))+_IQmpy(v->K3,Tmp1);
if (Tmp1>_IQ21(1))
v->Speed = _IQ(1);
elseif (Tmp1<_IQ21(-1))
v->Speed = _IQ(-1);
else
v->Speed = _IQ21toIQ(Tmp1);
.// Update the electrical angle
v->OldElecTheta = v->ElecTheta;
// Change motor speed from pu value to rpm value (GLOBAL_Q -> Q0)
// Q0 = Q0*GLOBAL_Q => _IQXmpy(), X = GLOBAL_Q
v->SpeedRpm = _IQmpy(v->BaseRpm,v->Speed);
Why this is happening? Why the result is different if ElecTheta is between _IQ(0.9) and _IQ(0.1?)
As the encoder angle is 0 à ElecTheta is 0 à Tmp1= _IQtoIQ21(v->Speed); à tmp1 increases à v-speed increases à tmp1 increases…so the speed PID is in a loop
What happens? When I give the order to start to move, my system is unstable. But If I wait some seconds, the pid1_spd values stop to change, and everything work fine.
What is wrong? Maybe I need to reset the speed just before the movement order…I don’t know.
Thank you in advance. No doubt in ask me for more details.