怎么编程让电机的q轴电流按正弦变化?
下面是程序
IQ电流PID调节控制
//======================================================================================================
IQ_Ref=IQ_Given;
IQ_Fdb=iq;
IQ_Error=IQ_Ref-IQ_Fdb;
IQ_Up=_IQmpy(IQ_Kp,IQ_Error);
IQ_Ui=IQ_Ui + _IQmpy(IQ_Ki,IQ_Up) + _IQmpy(IQ_Ki,IQ_SatError);
IQ_OutPreSat=IQ_Up+IQ_Ui;
if(IQ_OutPreSat>IQ_OutMax)
IQ_Out=IQ_OutMax;
else if(IQ_OutPreSat<IQ_OutMin)
IQ_Out=IQ_OutMin;
else
IQ_Out=IQ_OutPreSat;
IQ_SatError=IQ_Out-IQ_OutPreSat;
Uq=IQ_Out; |