PID controller parameters from IMC tuning giving unstable response

2 replies · 3K views · last reply
gfd43tg
Gold Member
Messages
949
Reaction score
48

Homework Statement


Textbook-style problem statement, Question 1 (4 points): transfer functions gp(s) = -0.2735/(s^2 + 6.035s + 4.146) and gd(s) = (14.23s + 68.25)/(s^2 + 6.035s + 4.146), with parts (a) to (c) on IMC PID tuning and Simulink simulation.


Homework Equations

The Attempt at a Solution


Hello,
I know for a second order process, the tuning parameters are given as ##k_{c} = \frac {\tau_{1}+\tau_{2}}{k_{p} \lambda}##, ##\tau_{I} = \tau_{1} + \tau_{2}##, and ##\tau_{D} = \frac {\tau_{1}+\tau_{2}}{\tau_{1} \tau_{2}}##
Code:
syms s
lambda = 1;
kp = -0.2735;
gp = kp/(s^2+6.035*s+4.146);
[num,den] = numden(gp);
factors = eval(solve(den,s));
tau1 = factors(1); tau2 = factors(2);
kc = (tau1+tau2)/(kp*lambda)
tauI = tau1+tau2
tauD = (tau1+tau2)/(tau1*tau2)

These are my process time constants
Code:
tau1 =

  -0.7906

tau2 =

  -5.2444
This gives my controller parameters
Code:
kc =

  22.0658tauI =

  -6.0350tauD =

  -1.4556

I go into simulink, and here is my model
Simulink block diagram of a unity-feedback loop: a Step block feeds a summing junction, then a PID Controller block, then Transfer Fcn1 with numerator num(s) and denominator s^2+6.035s+4.146, with the output branching to a Scope and back to the summing junction.

And here are my PID controller inputs
Simulink PID Controller block dialog, Main tab, showing Proportional (P) kc, Integral (I) kc/tauI, Derivative (D) kc*tauD, Filter coefficient (N) 100, and the compensator formula P + I(1/s) + D(N/(1+N(1/s))).

But I haven't figured out why my controller is not working, here is the output
Simulink scope plot of a closed-loop output: a yellow curve starts near 0, dips slightly below zero, rises to a peak near 5 around t=20, then swings with growing oscillations between the -5 and 5 limits, clipped at the axis edges, over time 0 to 100.
 
Attachments
  • Simulink scope plot of a closed-loop response: output rises from 0 to about 0.5 near t = 1, then falls to a minimum near -0.8 around t = 7 and rises again toward -0.2 at t = 10, x-axis 0 to 10, y-axis -1 to 1.
    upload_2015-11-3_14-52-0.png
    1.4 KB · Views: 509
I realized that ##\tau_{D} = \frac {\tau_{1} \tau_{2}}{\tau_{1} + \tau_{2}}##, but still my output is not correct even after changing my ##\tau_{D}## term

Simulation plot on a black background with grid lines: a yellow curve starts near zero, rises to about 50 near time 38, then drops steeply to about -145 by time 50. Axes run 0 to 50 horizontally and -150 to 100 vertically.
 
I figured it out. My time constants were not correct or in the right form