dsp2812 pmsm foc之速度环电流环

//=================速度环PI===================================

            Speed_Ref=_IQ(SpeedRef);
			Speed_Fdb=Speed;

			Speed_Error=Speed_Ref - Speed_Fdb;//误差

			Speed_Up=_IQmpy(Speed_Kp,Speed_Error);//kp
			

			Speed_OutPreSat=Speed_Up+Speed_Ui;

			if(Speed_OutPreSat>Speed_OutMax)
				{
                    Speed_Out=Speed_OutMax;

            }
			else if(Speed_OutPreSatIQ_OutMax)
			{
                IQ_Out=IQ_OutMax;
		}
		else if(IQ_OutPreSatID_OutMax)   
			{
                ID_Out=ID_OutMax;
		}
		else if(ID_OutPreSat

 

你可能感兴趣的:(电机驱动)