This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DSP的IQmath函数

#define   _IQsat(A, Pos, Neg)  __IQsat(A, Pos, Neg)

#define PID_MACRO(v)                     \
 v.Err = v.Ref - v.Fdb;          /* Compute the error */      \
 v.Up= _IQmpy(v.Kp,v.Err);        /* Compute the proportional output */  \
 v.Ui= v.Ui + _IQmpy(v.Ki,v.Up) + _IQmpy(v.Kc,v.SatErr); /* Compute the integral output */   \
 v.OutPreSat= v.Up + v.Ui;        /* Compute the pre-saturated output */  \
 v.Out = _IQsat(v.OutPreSat, v.OutMax, v.OutMin);  /* Saturate the output */     \
 v.SatErr = v.Out - v.OutPreSat;       /* Compute the saturate difference */  \
 v.Up1 = v.Up;           /* Update the previous proportional output */
#endif // __PIDREG3_H__
// Add the lines below if derivative output is needed following the integral update
// v.Ud = _IQmpy(v.Kd,(v.Up - v.Up1));
// v.OutPreSat = v.Up + v.Ui + v.Ud;
可以解释下v.Out = _IQsat(v.OutPreSat, v.OutMax, v.OutMin);这句话的意思吗,
个人理解IQsat是将v.OutPreSat限制在v.OutMax和 v.OutMin之间然后赋给v.Out,后面 v.SatErr = v.Out - v.OutPreSat;   v.SatErr结果为0吗?