Upload
mtanzania-mtanzania
View
31
Download
0
Embed Size (px)
Citation preview
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:
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
)()1(
)()1()()(
01
01
nkubkub
nkeakeakeaku
n
nn
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
Digital Control Algorithm for PID
Approximation
Integral Trapezoidal integration
Derivative Backward difference equation
Dr. Richard H. Mgaya
dt
deKedtKteKtu d
t
ip 0
)()(
21
1
2
2
2)(
kd
kd
pi
kdi
pk
eT
Ke
T
KK
TK
eT
KTKKuku
Digital Compensator Design
Techniques Employing the z-Transform
General PID Direct Digital Control Algorithm
Compensator transfer function:
where
Dr. Richard H. Mgaya
211 )()()()()( zzEzzEzEzzUzU
)1(1)(
)()(
2
1
21
zz
zz
z
zz
zE
zUzD
T
KTKK dip
2
T
KK
TK dp
i 2
2
T
Kd
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
where
Dr. Richard H. Mgaya
1)(
)()(
z
z
zE
zUzD
2
TKK ip
pi KTK
2
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
Cancel the slow pole:
Dr. Richard H. Mgaya
1
)/(
)(
)()(
z
z
zE
zUzD
1
)952.0()(
z
zzD
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
Dr. Richard H. Mgaya
Root Locus
Real Axis
Imagin
ary
Axis
-5 -4 -3 -2 -1 0 1 2-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
System: sys
Gain: 2.5
Pole: 0.705 + 0.221i
Damping: 0.706
Overshoot (%): 4.35
Frequency (rad/sec): 1.72
Digital Compensator Design
Techniques Employing the z-Transform
General PID Direct Digital Control Algorithm
Control algorithm:
Dr. Richard H. Mgaya
)(5.2 11 kkkk eeuu
0 1 2 3 4 5 60
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
Am
plit
ude
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:
PID Controller:
Dr. Richard H. Mgaya
RLK p
9.0
2
272.0
3.3
1
RLK
LK pi
RLK p
9.0
2
6.0
2
1
RLK
LK pi
RLKK pd
6.05.0
RAJAHHighlight
RAJAHHighlight
RAJAHHighlight
RAJAHHighlight
RAJAHHighlight
RAJAHPencil
RAJAHPencil
RAJAHPencil
RAJAHPencil
RAJAHPencil
RAJAHPencil
RAJAHPencil
RAJAHPencil
RAJAHPencil
RAJAHPencil
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
Open-loop step response:
Dr. Richard H. Mgaya
5.075.2
1
)(
)()(
2
sssU
sTsG
Step Response
Time (sec)
Am
plit
ude
0 5 10 15 20 25 300
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
System: sys
Time (sec): 0.47
Amplitude: 0.0763
Step Response
Time (sec)
Am
plit
ude
0 5 10 15 20 25 300
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
sL 47.0 37.0R
Digital Compensator Design
Techniques Employing the z-Transform
Example:
Calculations for PI parameters:
Using T = 0.25:
Control algorithm:
Dr. Richard H. Mgaya
1
)85.0(592.5)(
z
zzD
175.547.037.0
9.09.0
RLK p
330.047.037.0
272.0272.022
RLKi
and 592.5 758.4
11 758.4592.5 kkkk eeuu0 1 2 3 4 5 6 7 8 9
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
Step Response
Time (sec)
Am
plit
ude
Digital Compensator Design
Techniques Employing the z-Transform
Example:
Decreasing the gain decreases the overshoot but slows down the response
Dr. Richard H. Mgaya
and 5.0 425.0
0 5 10 15 20 25 300
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
Am
plit
ude
Digital Compensator Design
Techniques Employing the z-Transform
Direct Design Method of Ragazzini
Closed-loop transfer function of a controlled system, M(z)
If the desired closed-loop transfer function M(z) and the plant transfer function G(z) are known, Then,
Dr. Richard H. Mgaya
)()(1
)()(
)(
)()(
zDzG
zDzG
zR
zYzM
)(1
)(
)(
1)(
zM
zM
zGzD
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
Let D(z) = c(z)/d(z) and G(z) = b(z)/a(z) the closed-loop characteristic
polynomial:
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 - ) to be cancelled then,
Dr. Richard H. Mgaya
0)()(1 zDzG
0)()()()( zczbzdza
0)()()()()(0)()()()()()(
zbzczdzaz
zbzczzdzaz
a
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
For zero steady-state error
Dr. Richard H. Mgaya
)](1)[()( zMzRzE
)1(1
)](1[1
1lim 11
M
zMz
zze zss
1)1( M
Digital Compensator Design
Techniques Employing the z-Transform
Direct Design Method of Ragazzini
Steady-State Accuracy:
Final value theorem - steady-state error for ramp
LHopital rule to evaluate the limit z approaching 1
Dr. Richard H. Mgaya
1)1(
1)](1[
11lim
2
1
1
M
KzM
z
Tzze
v
zss
vz Kdz
dMT
1
1
TKdz
dM
vz
1
1
Digital Compensator Design
Techniques Employing the z-Transform
Direct Design Method of Ragazzini
Example: Consider the thermal plant transfer function for T = 0.25
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
Dr. Richard H. Mgaya
5026.048.1
)816.0(025.0)(
2
zz
zzG
21
3
3
2
2
1
10
32.08.01)(
zz
zbzbzbbzM
Digital Compensator Design
Techniques Employing the z-Transform
Direct Design Method of Ragazzini
Example:
Causality: b0 = 0 plant has one step pure delay
Steady-state step response requirements:
Velocity constant requirements
Dr. Richard H. Mgaya
21
21
32.08.01)(
zz
bzbzM
152.0
)1( 21
bb
M
1.01
)32.08.0(
)8.02)(()32.08.0(22
211
2
1
TKzz
zbzbbzz
dz
dM
vz
(i)
Digital Compensator Design
Techniques Employing the z-Transform
Direct Design Method of Ragazzini
Example:
Velocity constant requirements
But b1 + b2 = 0.52 from eqn (i)
Then
Closed-loop transfer function:
Dr. Richard H. Mgaya
21 32.08.01
628.0148.1)(
zz
zzM
1.052.0
)2.1)((52.02
211
1
bbb
dz
dM
z
628.052.0
148.1
12
1
bb
b
Digital Compensator Design
Techniques Employing the z-Transform
Direct Design Method of Ragazzini
Example:
Controller form
Substitution
Controller :
Dr. Richard H. Mgaya
)948.0)(1(
547.0
816.0
)952.0)(528.0(
025.0
148.1)(
zz
z
z
zzzD
)(1
)(
)(
1)(
zM
zM
zGzD
7736.06416.0132.1
)2749.03122.1027.2(92.45)(
23
23
zzz
zzzzD
Cancels Plant Dynamics Corrects Closed-loop Poles and Error Constant
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
M(z) must be selected such that it has a factor to cancel finite zeros of G(z), i.e., no poles of
Dr. Richard H. Mgaya
)(
)(
zG
zM
)(
)(
)(
)(
zG
zM
zR
zU
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
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
Dr. Richard H. Mgaya
21
11
2 5026.048.11
)816.01(025.0
5026.048.1
)816.0(025.0)(
zz
zz
zz
zzG
))(1()(1 1101 zaazzM (i)
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)
Solve a set of linear equation from i and ii
Dr. Richard H. Mgaya
1
1
1)816.01()( zdzzM
21
1 816.01)(1 zzdzM (ii)
11
101
0
816.0
1
da
daa
a
5507.0 ,4493.0 ,1 110 daa
RAJAHHighlight
Digital Compensator Design
Techniques Employing the z-Transform
Direct Design Method of Ragazzini
Example:
Closed-loop transfer function:
Controller
Confirming U(z)/R(z)
Dr. Richard H. Mgaya
21 4493.05507.0)( zzzM
)4493.01)(1(
5507.0
025.0
5026.048.11)(
11
1
1
21
zz
z
z
zzzD
4493.05507.0
)5026.048.1(028.22)(
2
2
zz
zzzD
2
2 )5026.048.1(028.22
)(
)(
)(
)(
z
zz
zG
zM
zR
zU
Digital Compensator Design
Techniques Employing the z-Transform
Direct Design Method of Ragazzini
Example:
Step response:
Dr. Richard H. Mgaya
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 50
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
Am
plit
ude
State-Space Representation
Solution to the State Vector Differential Equation
Consider the first-order differential equation
Laplace
Inverse
Note:
Dr. Richard H. Mgaya
)()( tbutaxdt
dx
)()()0()( sbUsaXxssX
)()0(
)( sUas
b
as
xsX
t
taat dbuexetx0
)( )()0()(
!!21
22
k
tataate
kkat
State-Space Representation
Solution to the State Vector Differential Equation Cont
Consider the state vector differential equation
Laplace
Pre-multiply (sI A)-1
Inverse
The expression eAt is called Transition Matrix (t)
Represents the natural response of the system:
Dr. Richard H. Mgaya
BuAxx
)()()0()( sBUsAXxssX
)()0()()( sBUxsXAsI
t
tAAt dBUexetx0
)( )()0()(
)()()0()()( 11 sBUAsIxAsIsX
1)()( AsIs
State-Space Representation
Solution to the State Vector Differential Equation Cont
Alternatively:
Thus,
The 1st term is the response to initial conditions
The 2nd term represent response to a forcing function
Characteristic equation:
Dr. Richard H. Mgaya
t
dBUttxttx0
)())(()0()()(
!!21)(
22
k
tAtAAtt
kk
0)( AsI
State-Space Representation
Discrete Solution to the State Vector Differential Equation
Discrete solution to state equation:
General form:
Note:
Dr. Richard H. Mgaya
)()( and )()()()()1( kTCxkTykTuTBkTxTATkx
!!21)(
22
k
TATAATTA
kk
)()()1(0
kTuBdekTxeTkx
T
AAT
BTBATA )( and )(
ATeTTA )()(
BTK
TABdeTB
k
kkT
AT
00)!1(
)(
Bk
TATAATTTB
kk
)!1(!3!21)(
1322
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
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
ux
x
x
x
1
0
32
10
2
1
2
1
State-Space Representation
Discrete Solution to the State Vector Differential Equation
(a) Characteristic equation, its roots, n and
Roots: s = -1, -2
Natural frequency and damping ratio
Dr. Richard H. Mgaya
32
1
32
10
0
0)(
s
s
s
sAsI
023)2()3()( 2 ssssAsI
06.1 ,32
/414.1 ,22
n
nn srad
2 ,1 s
State-Space Representation
Discrete Solution to the State Vector Differential Equation
(b) Transition matrix (s) and (t)
(s) is given as
Dr. Richard H. Mgaya
s
ssCofactor
s
ssMinor
1
23)(
1
23)(
A
AA
det
Adjoint 1
1)()( AsIs
)2)(1()2)(1(
1)2)(1(
2
)2)(1(
3
)(
ss
s
ss
ssss
s
s
State-Space Representation
Discrete Solution to the State Vector Differential Equation
(b) Transition matrix (s) and (t)
Partial fraction of (s):
Inverse Laplace:
Dr. Richard H. Mgaya
2
2
1
1
2
1
1
12
2
1
1
1
2
1
1
2
)(
ssss
sssss
tttt
tttt
eeee
eeeet
22
22
22
2)(
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:
Dr. Richard H. Mgaya
)0()()( xttx
0
1
22
2)(
22
22
tttt
tttt
eeee
eeeetx
)(2)(
2)(
2
2
2
1
tt
tt
eetx
eetx
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
State at the kth time step
Similarly,
Dr. Richard H. Mgaya
)()()1( kBukAxkx
1
0
1 )()0()(k
i
ikk iBuAxAkx
1
0
1 )()0()(n
i
inn iBuAxAnx
)1()2()1()0()0()( 21 nBAunABBuABuAxAnx nnn
State-Space Representation
Controllability
Matrix form:
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
The matrix is called the Controllability matrix
Dr. Richard H. Mgaya
)1(
)1(
)0(
)0()( 21
nu
u
u
BBABAxAnx nnn
nBBABArank nn AB 21
State-Space Representation
Controllability
Example: A linear discrete system is given as follows
Examine the controllability of the system
Controllability matrix:
Thus, uncontrollable
Dr. Richard H. Mgaya
BABrank
)(1
1
)(
)(
4.04.0
2.01
)1(
)1(
2
1
2
1ku
kx
kx
kx
kx
8.0
8.0
1
1
4.04.0
2.01AB
118.0
18.0B
rankABrank
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
Can the initial state x(0) be determine from the sequence of measurements y(0), y(1), y(n-1)output
Similarly,
Dr. Richard H. Mgaya
)()()1( kBukAxkx
)0()0()1( BuAxx
)()( kCxky
)0()0()1()1( CBuCAxCxy
1
0
1 )()0()(k
i
ikk iBuCAxCAky
State-Space Representation
Observability
In matrix form:
Output relationship: Set of nr linear equation with n unknown
Dr. Richard H. Mgaya
)0()0()1( CAxCBuy
)0()1()0()2( 2xCACBuCBuy
1
2
)1(
)2(
)1(
)0(
nCA
CA
CA
C
ny
y
y
y
)0()()1( 11
0
2 xCAiBuACny nn
i
in
State-Space Representation
Observability
Solution exists if the rank of the observability matrix is n
Example: Determine the observability of the inertial plant with
state equation given as
Dr. Richard H. Mgaya
n
CA
CA
CA
C
rank
n
1
2
)(2)(
)(
10
1
)1(
)1(2
2
1
2
1ku
T
T
kx
kxT
kx
kx
)(
)(10)(
2
1
kx
kxky
State-Space Representation
Observability
Observability matrix:
The system is unobsevable
Dr. Richard H. Mgaya
110
10
rank
AC
Crank
T
T