03-04-2010 01:59 AM
Hi KF_,
It sounds that parameters are not defined in same way in matlab and Labview. You can try to do "open loop" step response test only to PID controllers. Set parameters to same values in LabVIEW and Matlab and then do a step response. If you get equal responses you can be sure that controllers are okay.
BR, Jim
03-04-2010 10:27 AM - edited 03-04-2010 10:31 AM
Hi snowforest,
Matlab is giving me some simulation trouble atm because the PID alone has more zeros than poles, but I am quite sure I didn't make errors on the parameter conversions, I checked it many times before I posted. Also I simulated it in Matlab with the command
s = tf('s'); H =(0.4413)/((55.56*s+1)*(21.74*s+1))*(20+20/77*1/s+20*15*s);
H=feedback(ss(H),1)
t=0:1:200
u=[1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]
k=lsim(H,u,t)
plot(t,k)
The transfer function is in a different form now but the same one as I gave, So here I cant make any mistakes regarding PID form.
Regards
KF_
03-05-2010 03:59 PM
The problem is solved! The D-action is the culprit. Because of the setpoint change with a step input, there is a discontinuity and the D-action doesn't respond well to this, giving a wrong input. With a PI-controller there is no problem.
Regards
KF_