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.

TI公司的PID程序,怎么感觉我所认知的PID不一样,求指教!(积分和微分的求法,怎么有点看不懂了)

Other Parts Discussed in Thread: CONTROLSUITE

void pid_reg3_calc(PIDREG3 *v)
{
// Compute the error
v->Err = v->Ref - v->Fdb;

// Compute the proportional output
v->Up = v->Kp*v->Err;                      

// Compute the integral output
v->Ui = v->Ui +v->Ki*v->Up + v->Kc*v->SatErr;

// Compute the derivative output
v->Ud = v->Kd*(v->Up - v->Up1);

// Compute the pre-saturated output
v->OutPreSat = v->Up + v->Ui + v->Ud;
// v->OutPreSat =(v->OutPreSat>>24);
// Saturate the output
if (v->OutPreSat > v->OutMax)
v->Out = v->OutMax;
else if (v->OutPreSat < v->OutMin)
v->Out = v->OutMin;
else
v->Out = v->OutPreSat;

// Compute the saturate difference
v->SatErr = v->Out - v->OutPreSat;

// Update the previous proportional output
v->Up1 = v->Up;
}

x 出现错误。请重试或与管理员联系。