Part Number: TMS320F28379S
Tool/software: Code Composer Studio
Hi,
I am using "DCL_runPID_C4" and I am doing test for finding proper Kp. Ki and Kd value.
I set the parameter of PID as follow,
pid1.Kp = 5.0f;
pid1.Ki = 100;//0.015f;
pid1.Kd = 0;//1.35f;
pid1.Kr = 1.0f;
pid1.c1 = 188.0296600613396f;
pid1.c2 = 0.880296600613396f;
pid1.d2 = 0.0f;
pid1.d3 = 0.0f;
pid1.i10 = 0.0f;
pid1.i14 = 1.0f;
pid1.Umax = 1000.0f;
pid1.Umin = -1000.0f;
pid1.sps = &spid;
pid1.css = &cpid;
And my test control loop is as follow,
rk = 1000.0f; // initial value for control reference
lk = 0.0f; // control loop not saturated
while(1)
{
pos = EQEP_getPosition(EQEP1_BASE);
if (pos & 0x80000)
{
s_pos = (0xffffffff - pos);
}
else
{
s_pos = -pos;
}
yk = (float) s_pos;
// external clamp for anti-windup reset
DCL_runClamp_C1(&lk, 10.0f, -10.0f);
// run PID controller
uk = DCL_runPID_C4(&pid1, rk, yk, lk);
Duty = abs(uk) % 1001;
......
}
But, uk becomes zero at yk is 21000.0000f
I expected uk was zero at yk that is same with rk(=1000.0f)
What is the wrong of my expectation?
BR
Paul