Dear C2000 expert,
Regarding to Instaspin-FOC project, the pid loop for speed loop is paralleled path instead of serials, can you please help me know the reason?
static inline void PID_run_spd(PID_Handle handle,const _iq refValue,const _iq fbackValue,_iq *pOutValue)
{
PID_Obj *obj = (PID_Obj *)handle;
_iq Error;
_iq Up,Ui;
Error = refValue - fbackValue;
Ui = obj->Ui; // load the previous integral output
Up = _IQmpy(obj->Kp,Error); // Compute the proportional output
Ui = _IQsat(Ui + _IQmpy(obj->Ki,Error),obj->outMax,obj->outMin); // Compute the integral output
obj->Ui = Ui; // store the intetral output
obj->refValue = refValue;
obj->fbackValue = fbackValue;
*pOutValue = _IQsat(Up + Ui,obj->outMax,obj->outMin); // Saturate the output
return;
} // end of PID_run_spd() function