Anda di halaman 1dari 3

PID Controllers

Jeremy Orlo
Open Loop e
*4

T ( s) Controller

w
*4

H ( s) Plant

y *4

In terms of transfer functions: Y (s) = H (s) T (s) E (s). G(s) = H (s) T (s) is the open loop transfer function. Closed Loop + *4 P v
JT

e
*4

T ( s) Controller

w
*4

H ( s) Plant

y *4

v = input; y = output; e = v y = error. In terms of transfer functions: (G = open loop transfer function) Y = G (V Y ) Y = We dene G 1 V and E = V Y = V. 1+G 1+G

G . 1+G GCL is called the closed loop transfer function (this formula is known as Blacks Formula). GCL = Control Goal Starting from rest, make output y match input v bring error e to 0. Example y is the output of a spring system with input controlled by T . c as2 + bs + c T (s) = as + b + = = PID controller. s s 1 H ( s) = 2 = damped harmonic oscillator. s + ds + f as2 + bs + c G as2 + bs + c So, G(s) = , G = = , and CL s(s2 + ds + f ) 1+G s3 + ( a + d ) s2 + ( b + f ) s + c 1 s(s2 + ds + f ) = 3 . 1+G s + ( a + d ) s2 + ( b + f ) s + c

PID Controllers Stability We assume 1. d, f are positive. That is, we have a damped spring system. 2. a, b, c 0, with not all 0. That is, there is a controller. For the closed-loop system the Routh-Hurwitz theorem says: If c > 0 then GCL is stable (a + d)(f + b) > c. If c = 0 then GCL is stable.

Set-points Here we want to bring the output to a constant set-point v0 . In this case the input v is a step function: v (t) = v0 u(t). 1 1 v0 We see E (s) = V = . 1+G 1+G s In our example, assuming stability, the nal value theorem says 0 for c > 0 e() = lim sE (s) = f for c = 0. s 0 b+f (Valid if all poles of sE (s) are in the left half plane) We see if c > 0, i.e., if the PID really has an integrator, then the set-point is reached. Remark: There is also the initial value theorem lim sX (s) = x(0).
s

Matlab and Octave Let num = [an , . . . , a0 ] and den = [bm , . . . , b0 ]. In matlab the command step(num, den) will plot the unit step response of a an s n + . . . + a0 system with transfer function . b m sn + . . . + b 0 In Octave this takes two commands: sys = tf(num,den) step(sys). I think this works in matlab also. Also, both packages have the impulse function. 1 To nd the response to arbitrary input v , use Y = GCL V = sGCL V y = unit s 1 step response to sGCL V . Likewise e = unit step response to s V. 1+G

PID Controllers

Various combinations of P, I and D Fix [d, f ] = [3,1] Red: P only [a, b, c] = [0, 1, 0] asymptotic to y = .5, y (2) < .4. Green: P only [a, b, c] = [0, 15, 0] asymptotic to .9375, b large enough to get oscillatory behavior. Cyan: PD [a, b, c] = [1, 1, 0] asymptotic to y = .5, y (2) > .4. Longterm behavior determined by b. Blue: PI [a, b, c] = [0, 1, 1] Unit step response for various combinareaches set-point. tions of P, I and D. PID controllers with various values of c. [a, b] = [1, 1], [d, f ] = [3, 1]. c = 0: PD controller, asymptotic to .5 c = .2: No oscillation, asymptotic to set-point. c = 2: Oscillates, asymptotic to set-point. c = 4: Bigger amplitude oscillation asymptotic to set-point. c = 8: Periodic, not asymptotic to set-point. c = 20: Unstable, (second picture). Closed c=0 c=.2 c=2 c=4 c=8 c=20 loop transfer function poles poles: 3.414 0.586 0.000 poles: 3.435 0.430 0.135 poles: 3.599 0.201 0.718i poles: 3.751 0.124 1.025i poles: 4.000 0.000 1.414i poles: 4.532 0.266 2.084i Unit step response for large c (unstable).

Unit step response for PID controllers.

End of PID Controllers.

Anda mungkin juga menyukai