Вы находитесь на странице: 1из 46

MODERN CONTROL

SYSTEMS ENGINEERING
COURSE #: CS421
INSTRUCTOR:
DR. RICHARD H. MGAYA

Date: October 25th, 2013

Digital Compensator Design


Techniques Employing the z-Transform
Governing difference equation algorithm:
u (k ) an e(k ) an 1e(k 1) a0 e(k n)
bn 1u (k 1) b0u (k n)

Design problem:
Selection of the coefficients ai and bi once the sampling interval T is
specified

Note: The control system designer must know whether the actuating
hardware will be able to respond to the magnitude of the control effort
generated by the algorithm in the digital processor
Modeling and digital simulations of the control system
Examination of the control effort required

Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
General PID Direct Digital Control Algorithm
Recap:
Proportional Control
Steady-state error was necessary in order to have a steady-state output

Proportional plus Integral


Integrator reduces the steady-state error to zero
However, integrator in the loop can create instability or overshoot i.e.,
poor system dynamics

Proportional plus Integral plus Derivative


Steady-state error reduced to zero
Improvement in system dynamics
Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
General PID Direct Digital Control Algorithm
Time domain PID Controller
t

de
u (t ) K p e(t ) K i edt K d
dt
0

Digital Control Algorithm for PID


Approximation
Integral Trapezoidal integration
Derivative Backward difference equation

KT K

u (k ) uk 1 K p i d ek
2
T

2K d
Kd
K iT

Kp
ek 2
ek 1
T
T
2

Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
General PID Direct Digital Control Algorithm
Compensator transfer function:
U ( z ) U ( z ) z 1 E ( z ) E ( z ) z 1 E ( z ) z 2
U ( z ) z 1 z 2 z 2 z
D( z )

1
E( z)
1 z
z ( z 1)

where

K iT K d

2
T
KT
2K d
i Kp
2
T

Kp

Kd
T
Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
General PID Direct Digital Control Algorithm
Compensator transfer function:
The compensators numerator is quadratic
May be chosen to cancel the slow pole

Approximation algorithm: Appropriate algorithm produces causal


control effort algorithm
Noncausal algorithms produces future values in the control effort

General PI
D( z )

where

U ( z ) z

E( z)
z 1

Kp

K iT
2

K iT
Kp
2

Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
General PID Direct Digital Control Algorithm
Example: Consider the thermal system given in the figure
below. Design a PI controller to have a steady-state error of
zero to step input
D( z )

U ( z) ( z / )

E( z)
z 1

Cancel the slow pole:


D( z )

( z 0.952)
z 1
Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
General PID Direct Digital Control Algorithm
Let be the controller gain:
Through trial-and-error plus root locus design = 2.5 for closed-loop
damping ratio of = 0.7 and T = 0.25
Root Locus
2

1.5
System: sys
Gain: 2.5
Pole: 0.705 + 0.221i
Damping: 0.706
Overshoot (%): 4.35
Frequency (rad/sec): 1.72

Imaginary Axis

0.5

-0.5

-1

-1.5

-2
-5

-4

-3

-2

-1
Real Axis

Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
General PID Direct Digital Control Algorithm
Control algorithm:
uk uk 1 2.5(ek ek 1 )
Step Response
1.4

1.2

Amplitude

0.8

0.6

0.4

0.2

Time (sec)

Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
Ziegler Nichols Tuning Procedure for PID
Process for determining the gain Kp, Ki and Kd for the
controller parameters , and
Experimental evaluation of the step responses of the plant to
be controlled
R the slope of the response
L the plant lag to the response

Tuning strategy:
Relationship between PID parameters to the values of R and L

Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
Ziegler Nichols Tuning Procedure for PID
PI Controller:
Kp

0.9
RL

Ki

1
0.272
Kp
3.3L
RL2

PID Controller:
0.9
RL
1
0.6
Ki
Kp
2L
RL2

Kp

0.6
K d 0.5 LK p
R

Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
Example: Use Ziegler-Nichols tuning strategy to design PI
controller for the thermal system with the following transfer
function same thermal system, in continuous form
G( s)

T ( s)
1
2
U ( s ) s 2.75s 0.5

Open-loop step response:


Step Response

Step Response

2
1.8

1.8
1.6

1.6
1.4

1.4
1.2

Amplitude

Amplitude

1.2
1
0.8

1
0.8

0.6

0.6
0.4

System: sys
Time (sec): 0.47
Amplitude: 0.0763

0.2
0

L 0.47 s

0.4
0.2
10

15
Time (sec)

20

25

30

R 0.37

10

15

20

25

30

Time (sec)

Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
Example:
Calculations for PI parameters:
Kp

0.9
0.9

5.175
RL 0.37 0.47

Ki

0.272
0.272

0.330
2
2
RL
0.37 0.47
Step Response
1.6

Using T = 0.25:

1.4

5.592 and 4.758

Control algorithm:
uk uk 1 5.592ek 4.758ek 1

1
Amplitude

5.592( z 0.85)
D( z )
z 1

1.2

0.8

0.6

0.4

0.2

Time (sec)

Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
Example:
Decreasing the gain decreases the overshoot but slows down
the response
0.5 and 0.425
Step Response
1.4

1.2

Amplitude

0.8

0.6

0.4

0.2

10

15
Time (sec)

20

25

30

Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
Direct Design Method of Ragazzini
Closed-loop transfer function of a controlled system, M(z)
M ( z)

Y ( z)
G ( z ) D( z )

R( z ) 1 G ( z ) D( z )

If the desired closed-loop transfer function M(z) and the plant


transfer function G(z) are known, Then,
1
M ( z)
D( z )

G( z) 1 M ( z)

Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
Direct Design Method of Ragazzini
Fundamental issues to consider:
Causality:
Current control effort depends only on the current and past inputs and
the past control effort
Causal M(z), must have a zero at infinity same order as the zero of the
plant, G(z), at infinity
M(z) must have as many pure delays as the plant G(z)
Zero at infinity in time domain implies that the pulse response of G(z) has
delay at least one sample interval

Causal controller current effort does not dependent on the future values
of the error
Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
Direct Design Method of Ragazzini
Stability:
Necessary conditions for stability:
Closed-loop characteristic equation

1 G ( z ) D( z ) 0
Let D(z) = c(z)/d(z) and G(z) = b(z)/a(z) the closed-loop characteristic
polynomial:

a ( z ) d ( z ) b ( z )c ( z ) 0
Let a common factor (z - ) be in the numerator D(z) and the denominator
of G(z). If the factor is the pole of G(z), (z - )a to be cancelled then,

( z )a ( z )d ( z ) ( z )c ( z )b( z ) 0
( z )a ( z )d ( z ) c ( z )b( z ) 0
Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
Direct Design Method of Ragazzini
Stability:
Common factor remain a factor of the characteristic polynomial
If is outside the unit circle, then the system is unstable
Therefore, if D(z) is not to cancel the poles of G(z) then the factors of
a(z) must be the factors of 1 M(z)
Similarly, if D(z) is not to cancel the zeros of G(z) such zeros must be
factors of M(z)
Constraints summary:
1 - M(z) must contain as zeros as all poles of G(z) that lies on or
outside the unit circle
M(z) must contain as zeros as all zeros of G(z) that lie on or outside the
unit circle
Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
Direct Design Method of Ragazzini
Steady-State Accuracy:
Final value theorem - steady-state error for unit step

E ( z ) R( z )[1 M ( z )]

z
ess lim z 1 1 z
[1 M ( z )]
z 1
1 M (1)
1

For zero steady-state error

M (1) 1

Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
Direct Design Method of Ragazzini
Steady-State Accuracy:
Final value theorem - steady-state error for ramp

Tz
1
ess lim z 1 1 z
[1 M ( z )]
2
Kv
z 1
M (1) 1
1

LHopital rule to evaluate the limit z approaching 1

dM
dz
dM
dz

1
Kv

1
K vT

z 1

z 1

Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
Direct Design Method of Ragazzini
Example: Consider the thermal plant transfer function for T = 0.25

G( z)

0.025( z 0.816)
z 2 1.48 z 0.5026

Design a controller to have closed-loop poles at 0.4 j0.4, i.e., d =


rad/s, = 0.58, zero steady-state error for a step input and a velocity
constant of Kv = 10/T
Soln:
Closed-loop transfer function from specs

b0 b1 z 1 b2 z 2 b3 z 3
M ( z)
1 0.8 z 1 0.32 z 2
Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
Direct Design Method of Ragazzini
Example:
Causality: b0 = 0 plant has one step pure delay

M ( z)

b1 z b2
1 0.8 z 1 0.32 z 2

Steady-state step response requirements:

M (1)

b1 b2
1
0.52

(i)

Velocity constant requirements

dM
dz

z 1

( z 2 0.8 z 0.32)b1 (b1 z b2 )(2 z 0.8)


1

0.1
2
2
( z 0.8 z 0.32)
K vT
Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
Direct Design Method of Ragazzini
Example:
Velocity constant requirements

dM
dz

z 1

0.52b1 (b1 b2 )(1.2)


0.1
2
0.52

But b1 + b2 = 0.52 from eqn (i)


Then

b1 1.148
b2 0.52 b1 0.628

Closed-loop transfer function:

M ( z)

1.148 z 0.628
1 0.8 z 1 0.32 z 2
Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
Direct Design Method of Ragazzini
Example:
Controller form

D( z )

1
M ( z)

G( z ) 1 M ( z )

Substitution

D( z )

Controller :

1.148 ( z 0.528)( z 0.952)


z 0.547
0.025
z 0.816
( z 1)( z 0.948)
Cancels Plant Dynamics

Corrects Closed-loop Poles and Error Constant

45.92( z 3 2.027 z 2 1.3122 z 0.2749)


D( z )
z 3 1.132 z 2 0.6416 z 0.7736
Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
Direct Design Method of Ragazzini
Example:
Step Response

Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
Direct Design Method of Ragazzini
Ripple Free Design:
Plant must be stable
For finite settling time, M(z) must be finite polynomial in z-1
Transfer function from the reference input R(z) to the control effort
U(z) must be of finite settling time in z-1

U ( z) M ( z)

R( z ) G ( z )

M(z) must be selected such that it has a factor to cancel finite


zeros of G(z), i.e., no poles of
M ( z)
G( z)
Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
Direct Design Method of Ragazzini
Ripple Free Design:
Example: Design a zero-ripple, finite settling time controller
for the thermal plant which will yield zero steady-state error to
a step reference input
0.025( z 0.816)
0.025 z 1 (1 0.816 z 1 )
G( z) 2

z 1.48 z 0.5026 1 1.48 z 1 0.5026 z 2

Soln:
Since G(z) has no free integrator in the form of 1 - z-1, then for zero
steady-state error M(z) must have that factor

1 M ( z ) (1 z 1 )(a0 a1 z 1 )

(i)
Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
Direct Design Method of Ragazzini
Ripple Free Design:
Example:
Plant is stable and hence for zero ripple controller M(z) must have a
factor for numerator terms of G(z)

M ( z ) (1 0.816 z 1 )d1 z 1
1 M ( z ) 1 d1 z 1 0.816 z 2

(ii)

Solve a set of linear equation from i and ii

a0 1
a1 a0 d1
a1 0.816d1

a0 1, a1 0.4493, d1 0.5507

Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
Direct Design Method of Ragazzini
Example:
Closed-loop transfer function:

M ( z ) 0.5507 z 1 0.4493z 2
Controller

1 1.48 z 1 0.5026 z 2
0.5507 z 1
D( z )
0.025 z 1
(1 z 1 )(1 0.4493z 1 )
22.028( z 2 1.48 z 0.5026)
D( z )
z 2 0.5507 z 0.4493
Confirming U(z)/R(z)

U ( z ) M ( z ) 22.028( z 2 1.48 z 0.5026)

R( z ) G ( z )
z2

Dr. Richard H. Mgaya

Digital Compensator Design


Techniques Employing the z-Transform
Direct Design Method of Ragazzini
Example:
Step response:
Step Response
1.4

1.2

Amplitude

0.8

0.6

0.4

0.2

0.5

1.5

2.5

3.5

4.5

Time (sec)

Dr. Richard H. Mgaya

State-Space Representation
Solution to the State Vector Differential Equation
Consider the first-order differential equation

Laplace

dx
ax(t ) bu (t )
dt

sX ( s ) x(0) aX ( s ) bU ( s )
X ( s)

Inverse
Note:

x(0)
b

U ( s)
sa sa
t

x(t ) e at x(0) e a ( t )bu ( )d


0

2 2
k k
a
t
a
t
e at 1 at

2!
k!

Dr. Richard H. Mgaya

State-Space Representation
Solution to the State Vector Differential Equation Cont
Consider the state vector differential equation
x Ax Bu

Laplace

sX ( s ) x(0) AX ( s ) BU ( s )
( sI A) X ( s ) x(0) BU ( s )

Pre-multiply (sI A)-1


X ( s ) ( sI A) 1 x(0) ( sI A) 1 BU ( s )

Inverse

x(t ) e At x(0) e A( t ) BU ( )d
0

The expression eAt is called Transition Matrix (t)


Represents the natural response of the system: ( s ) ( sI A) 1
Dr. Richard H. Mgaya

State-Space Representation
Solution to the State Vector Differential Equation Cont
Alternatively:
Thus,

A2t 2
Ak t k
(t ) 1 At

2!
k!
t

x(t ) (t ) x(0) (t )(t ) BU ( )d


0

The 1st term is the response to initial conditions


The 2nd term represent response to a forcing function

Characteristic equation:
( sI A) 0
Dr. Richard H. Mgaya

State-Space Representation
Discrete Solution to the State Vector Differential Equation
Discrete solution to state equation:
T

AT
A
x(k 1)T e x(kT ) e Bd u (kT )
0

General form:

x(k 1)T A(T ) x(kT ) B(T )u (kT ) and y (kT ) Cx(kT )

Note: A(T ) A and B(T ) B


A(T ) (T ) e AT
A2T 2
Ak T k
A(T ) 1 AT

2!
k!
T
Ak T k
AT
B(T ) e Bd
BT
k 0 ( K 1)!
0

AT 2 A2T 3
Ak T k 1
B(T ) 1T


B
2!
3!
(k 1)!

Dr. Richard H. Mgaya

State-Space Representation
Discrete Solution to the State Vector Differential Equation
Example: The state-space equation for a mass damper system is
given as follows
x1 0
x 2
2

1 x1 0
u

3 x2 1

Evaluate:
(a) Characteristic equation, its roots, n and
(b) Transition matrix (s) and (t)
(c) Transient response of state variables from initial conditions
y(0) = 0 and y`(0) = 0.1

Dr. Richard H. Mgaya

State-Space Representation
Discrete Solution to the State Vector Differential Equation
(a) Characteristic equation, its roots, n and
s 0 0
( sI A)

0 s 2

1 s

3 2

1
s 3

( sI A) s ( s 3) (2) s 2 3s 2 0

Roots: s = -1, -2
s 1, 2

Natural frequency and damping ratio


n2 2, n 1.414rad / s
2 n 3, 1.06
Dr. Richard H. Mgaya

State-Space Representation
Discrete Solution to the State Vector Differential Equation
(b) Transition matrix (s) and (t)
A1

Adjoint A
det A

( s ) ( sI A) 1

s 3 2
Minor
( s)

1
s

s 3 2
Cofactor ( s )
s
1

(s) is given as

s3

( s 1)( s 2)
( s)
1

( s 1)( s 2)

( s 1)( s 2)

( s 1)( s 2)

Dr. Richard H. Mgaya

State-Space Representation
Discrete Solution to the State Vector Differential Equation
(b) Transition matrix (s) and (t)
Partial fraction of (s):
2
1
1
1


s 1 s 2

s 1 s 2
( s)
2 1 1 1 2
s 1 s 2 s 1 s 2

Inverse Laplace:

2e t e 2t
(t )
t
2t
2 e e

e 2t

e t 2e 2t

Dr. Richard H. Mgaya

State-Space Representation
Discrete Solution to the State Vector Differential Equation
(c) Transient response of state variables from initial conditions
y(0) = 0, y`(0) = 0.1, x1(0) = 1, and x2(0) = 0
Transient response:
x(t ) (t ) x(0)

2e t e 2t
x(t )
t
2t

2
e

e 2t
e t 2e 2t

1

0

x1 (t ) 2e t e 2t
x2 (t ) 2(e t e 2t )

Dr. Richard H. Mgaya

State-Space Representation
Controllability
The possibility to drive the system from some arbitrary initial
condition x(0) to some specified final state x(n) in n sampling
intervals
Consider the general system
x(k 1) Ax(k ) Bu (k )

State at the kth time step


k 1

x(k ) A x(0) Ak i 1 Bu (i )
k

Similarly,

i 0
n 1

x(n) An x(0) An i 1 Bu (i )
i 0

x(n) An x(0) An 1 Bu (0) An 2 Bu (1) AB(n 2) BAu (n 1)


Dr. Richard H. Mgaya

State-Space Representation
Controllability
Matrix form:

u (0)
u (1)

x(n) An x(0) An 1 B An 2 B B

u
(
n

1
)

Set of n linear equation in mn unknowns


The left hand side quantities are known

Solution exists if the rank of matrix coefficient is same as the


unknown

rank An 1 B An 2 B AB B n

The matrix is called the Controllability matrix


Dr. Richard H. Mgaya

State-Space Representation
Controllability
Example: A linear discrete system is given as follows
x1 (k 1) 1
x (k 1) 0.4
2

0.2 x1 (k ) 1
u (k )

0.4 x2 (k ) 1

Examine the controllability of the system


Controllability matrix:
rank AB B

1
AB
0.4

0.2 1 0.8

0.4 1 0.8

0.8 1
rank AB B rank
1

0.8 1
Thus, uncontrollable
Dr. Richard H. Mgaya

State-Space Representation
Observability
The possibility to determine the states and the control effort
from measured output at different time intervals
Consider the general system
x(k 1) Ax(k ) Bu (k )
y (k ) Cx(k )

Can the initial state x(0) be determine from the sequence of


measurements y(0), y(1), y(n-1)output
x(1) Ax(0) Bu (0)

Similarly,

y (1) Cx(1) CAx(0) CBu (0)


k 1

y (k ) CA x(0) CAk i 1 Bu (i )
k

i 0

Dr. Richard H. Mgaya

State-Space Representation
Observability
In matrix form:

y (1) CBu (0) CAx(0)


y (2) CBu(0) CBu(1) CA2 x(0)
n 1

n 2 i
n 1
y
(
n

1
)

C
A
Bu
(
i
)

CA
x(0)

i 0

Output relationship: Set of nr linear equation with n unknown


y (0) C
y (1) CA

2
y (2) CA



y (n 1) CAn 1

Dr. Richard H. Mgaya

State-Space Representation
Observability
Solution exists if the rank of the observability matrix is n
C
CA

2
rank CA n


CAn 1

Example: Determine the observability of the inertial plant with


state equation given as
2

T
x1 (k 1) 1 T x1 (k )
x (k 1) 0 1 x (k ) 2 u (k )
2 T
2

x1 (k )
y (k ) 0 1

x
(
k
)
2

Dr. Richard H. Mgaya

State-Space Representation
Observability
Observability matrix:
CT
0 1
rank T rank
1

0 1
C A

The system is unobsevable

Dr. Richard H. Mgaya

Вам также может понравиться