You are on page 1of 199

model

Table A.1 Franklin. This table is provided on the midterm and final exam

Table A.2, Franklin. This table


is provided on the midterm and
final exam

10

11

12

13

14

15

16

17

18

19

1 Modelling a Permanent Magnet DC


(PMDC) Motor
i

eA

, f , l

Js

Jl

Figure 1.1: Electro-mechanical equivalent circuit of Permanent Magnet Direct Current (PMDC) motor.
The inertia of the shaft is Js and load Jl . The effective inertia of the system J = Js + Jl .

We consider the PMDC motor system shown in Figure 1.1. To obtain its differential equation
model we apply Newtons Law at the output shaft:
(1.1)

J = f l ,

where J is the effective inertia of the motor system which is due to all rotating components (i.e.,
the shaft, rotor, and encoder), is the output shaft velocity, the electrical torque generated by
the PMDC motor, f is frictional torque, and l load torque. The latter is sometimes treated as
an unknown disturbance.
The electrical torque generated by the PMDC motor is linearly related to the armature
current i:
(1.2)

= Kt i,

where Kt is the motors torque constant.


Frictional torque f is modeled as a combination of viscous friction proportional to speed and a
constant Coulomb friction term:
f = Kf sgn() + b,

6= 0,

(1.3)

1 Modelling a Permanent Magnet DC (PMDC) Motor

where Kf is the Coulomb friction torque, b the viscous friction coefficient, and

1, x < 0
sgn(x) =
0, x = 0

1, x > 0
Combining (1.1) - (1.3) for > 0 yields
J

d
= Kt i b Kf l
dt

(1.4)

The dynamics for armature current i can be found by application of KVL and is given by
L

di
+ Ri = v Km ,
dt

(1.5)

v is the input voltage, Km the motors back-emf constant, L armature inductance and R armature
resistance. We denote the back-emf voltage as eA = Km . It can be shown that Km = Kt if stated
in MKS units. Hence, to simplify notation we replace Km with Kt from here on. Differential
equations (1.4) and (1.5) give the time domain dynamic model of the PMDC motor when > 0.
In order to reduce current ripple we add an additional external inductor L1 to the armature
circuit. The external inductor introduces a parasitic resistance R1 which adds to the armature
resistance of the motor. The model parameters L and R discussed above will include the circuit
parameters of the external inductor. The values used are L1 = 3.3 mH and R1 = 1.27 . These
values are taken from the data sheet (Model No. 1130-332K-RC). The datasheet for the motor
provides a resistance value of 3.99 and an inductance of 0.556 mH. Hence, nominal values are
R = 5.26 and L = 3.856 mH.
Depending on the sign of and the motor operates in four different modes that are denoted
as quadrants Q I, Q II, Q III, and Q IV. The forward motoring mode or Q I occurs when and
are positive. Consider a motor driving an inertial load which accelerates from rest in a positive
direction. During this period of acceleration eA and i are greater or equal to zero or in other
words power is transferred from the voltage source to the mechanical load.
Now consider the problem of decelerating the motor from a positive velocity to rest. This
process of braking requires a negative electrical torque which means a negative i which can be
obtained by adjusting v < eA . Initially , and therefore eA , remain positive until rest. Hence,
the motor is operating in forward braking mode or Q IV. Since < 0, power is absorbed into
the voltage source from the mechanical system. As expected eA i < 0 since the voltage source
absorbs power.
The two aforementioned modes of operation can be also explained if the motor is turning in

1 Modelling a Permanent Magnet DC (PMDC) Motor

Reverse Braking Forward Motoring

Q II
eA 0, i 0

QI
eA , i 0

Reverse Motoring Forward Braking

Q III
eA , i 0

Q IV
eA 0, i 0

Figure 1.2: Four Quadrant operation of a DC motor.

negative direction. This corresponds to reverse motoring (Q III) and reverse braking (Q II).
Evidently, in generating modes Q II and Q IV the motor transfers power from the mechanical
system to the voltage source. In contrast, in Q I and Q III the motor is in motoring mode since
power is fed to the mechanical system from the voltage source.
We take the Laplace transform of (1.4) and (1.5) with b = 0 and l = 0. Eliminating I gives
(s) =

LJs2

sL + R
Kt
Kf
V (s)
.
2
2
2
+ sRJ + Kt
LJs + sRJ + Kt s

(1.6)

Since for most motors e = L/R  1, we obtain an approximate first order model
(s) =

1
Kt
JR
s
Kt2

+1

V (s)

R
Kt2
JR
s
Kt2

Kf
+1 s

(1.7)

In our case we have e 0.7 ms. Defining the gain KV = 1/Kt and mechanical time constant
m = JR/Kt2 , we can transform (1.7) into a time constant form
R

KV
Kf
Kt2
(s) =
V (s)
m s + 1
m s + 1 s

(1.8)

We have J = 4.53 106 kg m2 , Kt = 35.2 mN m A1 gives m = 14.6 ms (as specified in the


motor data sheet) when we take R = 3.99 and m = 19.2 ms when we take R = 5.26 .

1 Modelling a Permanent Magnet DC (PMDC) Motor

ei

Ci

Pi

eA

Figure 1.3: Inner current control loop with Proportional-Integral (PI) controller.

1.1 Transfer functions used for velocity control


1.1.1 Current Mode Controller Design (Lab 3: Experiement I)
Current mode design treats the motor as two decoupled subsystems. The electrical subsystem
and mechanical subsystem.
Electrical Subsystem
Taking the Laplace transform of (1.3)
V (s) EA (s) = RI(s) + sLI(s).

(1.9)

For the problem of current control we denote V as the control input, I as the controlled output,
and EA as a disturbance input. Although we measure velocity and therefore could compute
EA , this would complicate the current control. The objective of current control is to regulate a
prescribed reference current I while rejecting disturbance input EA . Solving for I in (1.9) gives
I(s) =

1
1
V (s)
EA (s)
sL + R
sL + R

(1.10)

For control design we define the transfer function


Pi (s) =

I(s)
K
=
,
V (s)
e s + 1

(1.11)

where e = L/R is the electrical subsystem time constant and K = 1/R the gain of the electrical
subsystem.
Figure 1.3 depicts the current control with controller transfer function Ci . We denote the
current reference as i .

Modelling
a Permanent
3.1 Lab
3: Closed-loop
SpeedMagnet
ControlDC
for(PMDC)
a PMDCMotor
Motor

Hi (s) 1

Kt

1/(Js)

Figure 3.2.: Outer velocity control loop.


Figure 1.4: Outer velocity control loop.

The PI controller gains for the velocity PI controller


Mechanical Subsystem

Taking the Laplace transform of (1.4) and assuming


current dynamics are negligible (i.e.,
kp s + kthe
i
C
(s)
=

e = L/R 0) yields
s
Kf
sJ(s) = Kt I(s)
Tl (s)
> 0.
(1.12)

are denoted kp and ki . Figure 3.2 depicts the sclosed-loop


velocity control system. is the
Laplace transform of the reference speed .
Here, is treated as the system output whereas I is the control input. Static friction Kf /s is
The following
designsTlshould
be carefully
saved for
future labs
where
you will
Important
note:
assumed
to be
negligible.
Load torque
represents
an unknown
disturbance
which
should
be
be
required
to
reuse
the
designs.
compensated in control design. Using (1.12) we obtain

Tasks

Kt
1
(s) =
I(s)
Tl (s)
(1.13)
sJ of the velocity
sJ
Derive the closed loop transfer function
control loop by assuming Hi (s) = 1
and neglecting the disturbance torque. Bring it into standard form
The control design for the outer loop is based on the transfer function
n s

+ n2
H (s) =(s)
K
2nts. + n2
P (s) = s2 + =
I(s)
Js

(1.14)

Identifycontrol
, and
n in terms
of kp , kproblem
J. two simpler inner and outer loop designs.
i , Kt , and
A cascade
separates
the control
into

It is feasible to separate the inner and outer loop designs in a cascade control
since the bandwidth
Design the PI controller such that = 1/ 2 and n = 2 25 rad s1 .
of the inner loop is designed sufficiently high to make the dynamics of the inner loop negligible
from the
point ofthe
view
of the control
outer loop.
Thatshown
is, we in
canFigure
model3.2
thewith
innerHcurrent
a simple
Simulate
velocity
system
1 in as
Simulink
i (s) = loop
unity using
gain (i.e.,
H
(s)

1).
In
our
case
the
natural
frequency

of
the
velocity
loop
willthe
be
the transfer
function model (3.7). For the controller, use
the PID block and set
i
n
chosenderivative
50 times smaller
one of the
the PI
current
loop. Perform the simulation with a step
gain to than
zero the
to realize
controller.

1
Theouter
loop
controller
is
denoted
C
(s).
Figure
= 200 rad s . Plot the velocity response. 1.4 depicts the closed-loop velocity control
system. is the Laplace transform of the reference speed .
Implement the complete cascade control system in experiment. Combine the PI velocity
controller used in the previous item with the PI current control designed in the Section 3.1.2.
Perform the experiment with a step = 200 rad s1 . Superimpose the velocity response

5
33

1 Modelling a Permanent Magnet DC (PMDC) Motor

l KRt
e

C,V

P,V

Figure 1.5: Voltage Mode velocity control system.

1.1.2 Voltage Mode Controller Design (Lab 3: Experiment II)


When performing voltage mode velocity control (Lab 3: Experiment II) we use the transfer
function
KV
(s)
=
(1.15)
P,V (s) =
V (s)
m s + 1
and assume Kf = 0. Figure 1.5 shows the closed-loop velocity control system in Voltage Mode.
We denote the controller transfer function as C,V (s).

H,V (s) =

n s

+ n2

s2 + 2n s + n2

and identify , and n in kp0 , ki0 , m , and KV .

In order to compare with the Current Mode design take the gains of the PI controller

and ki0 such that = 1/ 2 and n = 2 25 rad s1 .

Implement and simulate the velocity control system shown in Figure 3.3 in Simuli
using the transfer function model (3.9). For the controller, use the PID block and set t
derivative gain to zero to realize the PI controller. Perform the simulation with a st
= 200 rad s1 .

Compute and provide a solution to minimize


the PO. Implement it in Simulink and r
6
the simulation again. Could the PO be minimized and why?

tangent line to step


response at t=0.
Slope is 1/tau

The underdamped step response 0 < < 1


We consider the general second order system with no zeros
H(s) =
and

n2
1
=
2
2
2
s + 2n s + n
(s/n ) + 2s/n + 1

(1)

H(s)
1
n2
s + 2n
1
=

=
s
s s2 + 2n s + n2
s s2 + 2n s + n2
|
{z
}
F1 (s)

The poles of F1 (s)


pare p1 = + jd = <(p1 ) + j=(p1 ) = n + jn

p1 = n jn 1 2 . We expand F1 (s) as
F1 (s) =

c1
c1
+
s p1 s p1

where
c1 = ((s p1 )F1 (s))|s=p1
Hence, |c1 | =

11
2
1 2

from lecture we have

and arg(c1 ) = cos1

We can also expand F1 as

p
1 2 and its conjugate

1
=
2

1 p
1 2

p
1 2 = sin1 . Hence, applying the formula

y(t) = 1 2|c1 |e<(p1 )t cos(=(p1 )t + arg(c1 ))


p
en t
=1 p
cos(n 1 2 t sin1 )
1 2
et
p
=1
cos(d t sin1 )
2
1
F1 (s) = A

(2)

(s + )
d
+B
2
2
(s + ) + d
(s + )2 + d2

where equating coefficients yields A = 1, B = /d . Hence,





1 H(s)
1
t
L {
} = 1 L {F1 (s)} = 1 e
cos(d t) +
sin(d t)
s
d

(3)

The expressions for the step response (2) and (3) are equivalent.

Time domain specs for underdamped step responses


See Figure 1 for the performance specs we will consider for a 2nd order underdamped response.

Figure 1: Performance specs for an underdamped step response.


Tp : peak time The peak time Tp is the time at which the step response reaches its global
maximum. We obtain an expression for Tp by taking the derivative of (3):
dy

= et (cos(d t) +
sin(d t)) et (d sin(d t) + cos(d t))
dt
d

 2
n

+ d sin(d t) = p
= et
et sin(d t)
2
d
1

h(t) =

Note that h(t) = L1 {H(s)} is in fact the impulse response of H(s). To obtain the time at which
the maximum of the step response y occurs we solve h(t) = 0:

 2

t
+ d sin(d t)
h(t) = 0 = e
d
which is satisfied by d t = k, k = 0, 1, 2, . . . . We know that k = 1 corresponds to the global
maximum of the step response. Hence,
Tp =

= p
d
n 1 2

P.O.: percent overshoot To obtain the P.O. of the step response we can substitute Tp into (3):

2
Mp = y(Tp ) = 1 eTp cos(d Tp ) + sin(d Tp ) = 1 + eTp = 1 + e/ 1
| {z } d | {z }
1

The percent overshoot of the response is


P.O. = 100

y(Tp ) fv
2
= 100 (y(Tp ) 1) = 100 e/ 1
fv

where fv = limt y(t) is the final or steady state value of y. Note that P.O. is only a function of
and we can invert the relation between P.O. and :
= q

ln(P.O./100)
2 + ln2 (P.O./100)

Figure 2 shows a graph of P.O. versus . P.O. decreases monotonically from 100% to 0 as increases.

P.O.
(%)

Figure 2: Underdamped 2nd order system step response. Graph of P.O. versus .

Ts : 1% settling time We can compute and estimate of the 1% settling time Ts which is the time
required to reach and remain within 1% of fv , the final value of the response.
To estimate Ts we use the lower envelope of the step response and equate it to 0.99:
1 eTs = 0.99
which yields
Ts =

ln 0.01
4.6
=
n
n

We remark that the exact dependence of Ts on is not continuous and can be obtained numerically
if desired.

Tr1 : 10-90 rise time The 10-90 rise time Tr1 is the smallest time for the response y(t) to go from
10 % to 90 % of its final value fv = limt y(t).
We take Franklins approximate relation for Tr1 given by
Tr1 =

1.8
n

This expression is relatively accurate near = 1/2 and ignores dependence. Other possibilities
exist for expressions for Tr1 as a function of and n .
Tr : 0-100 rise time The 0-100 rise time Tr is the smallest time for the response y(t) to go from
0 % to 100 % of its final value fv = limt y(t).
Since



Tr
cos(d Tr ) +
y(Tr ) = 1 = 1 e
sin(d Tr )
d
which implies

d
k tan1 (d /),

Since we want the first positive solution for Tr we have for k = 1


tan(d Tr ) =

Tr =

tan1 (
d

1 2
)

kZ

cos1
p
n 1 2

This expression is exact.


Recall the time scaling property of the Laplace transform
1
L{f (at)} = F (s/a),
a

a>0

(4)

which can be used to give us an interpretation for n as time scaling of the step response of the
normalized system
1

H(s)
= 2
s + 2s + 1

We observe
We define y(t) = L1 {H(s)/s}
as the step response of H.
H(s)
1
n
=
H(s/n )
s
n
s

(5)

Hence, using the time scaling property (4) and (5) we get



 
H(s)
1 1 n s
1
L
=
L
H
= y(n t)
s
n
s
n
This is an important observation since it states that step responses of H can be computed from
and then time scaled by n . It is convenient as it allows us to focus on the effect of
those of H
on the step response, since varying n simply changes the time scale of the response.
The following MATLAB program plots an underdamped step response of for = 1/2. The plot is
given in normalized time scale = n t and shown in Figure 3.

% MATLAB to generate Figure 3


tau_scale=linspace(0,20);
zet=.5;
bet=sqrt(1-zet^2);
s=tf(s);
h=1/(s^2+2*zet*s+1);
% Compute step response numerically, ie with theta=acos(zet)
% y=1-exp(-zet*tau_scale)/bet.*sin(tau_scale*bet+theta);
y=step(h,tau_scale);
plot(tau_scale,y,tau_scale,1-exp(-zet*tau_scale)/bet,--,...
tau_scale,1+exp(-zet*tau_scale)/bet,--,LineWidth,2)
xlabel(\omega_nt)
ylabel(y(t))

2.5

2
Envelope:1 + exp(n t)/

1 2

y(t)

1.5

0.5
Envelope:1 exp(n t)/

p
1 2

0.5

10
t

12

14

16

18

20

Figure 3: Underdamped 2nd order system step response for p


= 1/2. Note: the amplitude of the
response is bounded between the envelopes 1 exp(n t)/ 1 2 .
Effect of varying
The following MATLAB program plots the step response of a second order system (1) for =
.1, .2, .4, .6, .8, 1, 1.5. The output in normalized time = n t is shown in Figure 4. We make the
following remarks:

Rise times Tr , Tr1 decrease monotonically in (n = const.). For constant rise times Tr , Tr1
decrease for increasing n .
P.O. increases when decreases and P.O. = 0 for 1
Tp increases when increases and Tp does not exist for 1 (n = const.)
Ts decreases when increases for 0 < 1 and Ts increases for increasing 1 (n = const.)
For the underdamped case, the above observations are consistent with the formula
cos1
p
(0 100% rise time)
n 1 2
1.8
(10 90% rise time)
Tr1 =
n

Tp = p
n 1 2
p
P.O. = 100 exp(/ 1 2 )
4.6
Ts =
n
Tr =

% MATLAB to generate Figure 4


tau_scale=linspace(0,20);
zet=[.1 .2 .4 .6 .8 1 1.5];
s=tf(s);
for k=1:length(zet),
sys=1/(s^2+2*zet(k)*s+1); % normalize time
y(k,:)=step(sys,tau_scale);
end
plot(tau_scale,y,LineWidth,2)
xlabel(\omega_nt)
ylabel(y(t))

Adding a real pole to an underdamped 2nd order system


See Franklin Sec. 3.5. Using MATLAB we compare the step response of an underdamped 2nd order
system with a 3rd order system where an additional real pole has been added in the open left-half
plane:
n2
1
G(s) = 2
(6)
2
s + 2n s + n s/(n ) + 1
The third order system (6) has an additional real pole at s = n , > 0. Note that the
reason for taking the additional pole at s = n , is that > 0 measures how far the additional
pole is relative
p to the real part of the complex poles. When > 10 we say the complex poles
n jn 1 2 are dominant since it is the complex pole pair alone that largely determines
the shape of the response. MATLAB is used to compute step responses for the system with = 1/2
and various values of . We remark from Figure 5 that when = (when the system is second

1.8
=.1
1.6
=.2
1.4

underdamped < 1

=.4
=.6

1.2
=.8

y(t)

0.8

0.6
=1 (critically damped)

0.4

=1.5 (overdamped)
0.2

10
nt

12

14

16

18

20

Figure 4: 2nd order system step response for a range of


order) and = 10, we obtain essentially the same response and the real pole has little effect.
However, low values of (e.g. = 1) lead to well-damped responses which are quite different from
the underdamped second order system response.
Mathematically we observe the effect of the 3rd pole by performing the partial fraction of G(s)/s
where G(s) is given in (6):
bc
1
Bs + C
D
G(s)
=
= + 2
+
2
s
s(s + as + b)(s + c)
s s + as + b s + c

(7)

where a = 2n , b = n2 , c = n . Taking the inverse Laplace transform we get


L1 {

G(s)
} = 1 + K exp(n t) cos(d t + ) + D exp(ct),
s

K>0

Using the cover-up method we get


D=

c2

b
1
= 2
ac + b
( 2) + 1

Taking a common denominator in (7) and matching coefficients we get B and C


ac
2 ( 2)
B=c 2
= 2
c ca + b
( 2) + 1
and
C=c

a2 ca b
n (4 2 2 2 1)
=
c2 ca + b
2 ( 2) + 1

We observe that as the real pole at s = c tends to (i.e., ) then D 0, B 1,


C a = 2n . Hence, the effect of the additional pole on the step response becomes negligible
as increases.
% MATLAB to generate Figure 5
tau_scale=linspace(0,20);
zet=.5;
s=tf(s);
h=1/(s^2+2*zet*s+1);
resp(1,:)=step(h,tau_scale);
alpha_vals=[1 2 5 10 100];
for k=1:length(alpha_vals),
resp(k+1,:)=step(h*(1/(1+s/(alpha_vals(k)*zet))),tau_scale);
end
plot(tau_scale,resp,LineWidth,2)
xlabel(\omega_nt)
ylabel(y(t))

1.4
=100,
1.2
=10

y(t)

0.8

0.6
=5
0.4
=2
0.2
=1
0

10
nt

12

14

16

18

20

Figure 5: 3rd order system step response as a function of . Real pole at s = n . = 1/2.

Adding a zero to an underdamped 2nd order system


See Franklin Sec. 3.5. If we add a zero at s = n , R to the general 2nd order system (1)
we get
s/(n ) + 1
(8)
G(s) =
(s/n )2 + 2(s/n ) + 1
Figure 6 shows the step responses for various values of with = 1/2. As the zero at s = n
moves away from the real part of the complex poles (i.e., || is large), its effect on the response is
reduced. For example the response for || = 100 is indistinguishable from the case where = .
However, when 1 the zero will be close to the real part of the complex poles and it has a
substantial influence on the response. The major effect of the zero is to increase the peak value of
the step response (e.g. see = 2, 1/2). Mathematically we observe the same effect by performing
the partial fraction of (8) divided by s
G(s)
1 A(s + ) + Bd
= +
s
s
(s + )2 + d2
where as before d = n

p
1 2 , = n . Solving for coefficients A, B we obtain
A = 1,

and so

1 2
p
B=
1 2

L1 {G(s)/s} = 1 et (cos(d t) B sin(d t))


p
We remark that lim B = / 1 2 , and hence the step response tends to the 2nd order
underdamped case for large || as expected.
There is a significant change in the step response as the zero moves into the right-half plane ( < 0)
with an undershoot in the step response being observed. Any system with a zero in the open righthalf plane is said to be non-minimum phase and is typically more difficult to control. The following
MATLAB program provides step responses in normalized time as a function of .
% MATLAB to generate Figure 6
tau_scale=linspace(0,20);
zet=.5;
s=tf(s);
h=1/(s^2+2*zet*s+1);
expr(1,:)=step(h,tau_scale);
alpha_vals=[-100 -1 1/2 2 4 100];
for k=1:length(alpha_vals),
expr(k+1,:)=step(h*(1+s/(alpha_vals(k)*zet)),tau_scale);
end
plot(tau_scale,expr,LineWidth,2)
xlabel(\omega_nt)
ylabel(y(t))

2.5
=1/2
2
=2

y(t)

1.5

0.5

=4

=,100,100

0.5

=1

10
nt

12

14

16

18

20

Figure 6: 2nd order system step response with zero at s = n . = 1/2.

Example Example of computing time domain specs for an underdamped 2nd order systems
H(s) =

s2

1
+ 15s + 100

s=tf(s);
% define tf
H=1/(s^2+15*s+100);
[n,d]=tfdata(H,v);
wn=sqrt(d(end))
zet=d(2)/wn/2
% peak time
Tp=pi/wn/sqrt(1-zet^2)
% final value
fv=n(end)/d(end)
% percent overshoot
PO=100*exp(-zet*pi/sqrt(1-zet^2))
% peak value
M=fv*(1+PO/100)
% settling time 1% (approx)
Ts=4.6/zet/wn
% 10-90 rise time (approx)
Tr1=1.8/wn
% 0-100 rise time
Tr=(1/wn/sqrt(1-zet^2))*(pi-atan(sqrt(1-zet^2)/zet))
% compute various performance specs numerically and use a 1% settling time spec.
S=stepinfo(H,SettlingTimeThreshold,0.01)
wn =
10

zet =
0.7500

Tp =

0.4750

fv =
0.0100

PO =
2.8375

M =
0.0103

Ts =
0.6133

Tr1 =
0.1800

Tr =
0.3657

S =
RiseTime:
SettlingTime:
SettlingMin:
SettlingMax:
Overshoot:
Undershoot:
Peak:
PeakTime:

0.2288
0.6596
0.0090
0.0103
2.8369
0
0.0103
0.4728

plot step response


step(H)

Step Response
0.012

System: sys
Peak amplitude: 0.0103
Overshoot (%): 2.84
At time (sec): 0.476

System: sys
Settling Time (sec): 0.66

0.01
System: sys
Final Value: 0.01
System: sys
Rise Time (sec): 0.229

Amplitude

0.008

0.006

0.004

0.002

0.1

0.2

0.3

0.4
0.5
Time (sec)

0.6

0.7

0.8

0.9

Example Consider the system shown in Figure 1.


(a) The output step response y(t) for a unit step applied to r(t) is shown in Figure 2. Determine the
values of K and T from this step response.
(b) Lets suppose the value of K is increased, indicate what happens (if anything) to P.O. and Tp , Ts ,
and the steady-state error ess = lim (r(t) y(t)). We assume that the increased value of K still
keeps the closed-loop system stable.

K
s (Ts + 1)

+
R (s )

Y (s )

Figure 1: Closed-loop system

Step Response
1.4

Tp = 3 sec.
P.O.=4.32%

1.2

Amplitude

0.8

0.6

0.4

0.2

Time (sec)

Figure 2: Step response

10

Soln: (a) First we get the closed-loop transfer function


Y (s)
K/T
= 2
R(s)
s + s/T + K/T
This means that n2 = K/T and 2n = 1/T . Since P.O. = 4.32% we have
ln(P.O./100)
=p
= 0.707
2 + ln(P.O./100)2
Since Tp = /(n

p
1 2 ) and Tp = 3 s we obtain

n = q
= 1.48 r/s

2
3 1 (1/ 2)

Hence we have
1
= 0.478 s/r
2n
K = T n2 = 1.05 r/s
T =

(b) If K increases,pthen n increases


p and since n is constant, must decrease. Hence, P.O. increases.
2
Since Tp = /(n 1 ) = / n2 n2 2 and since n is constant, Tp decreases as n increases.
Since Ts = 4/(n ) (approximately) and because n is constant, Ts is unaffected (approximately) by an
increase in K.
The value of ess is
1
ess = lim
=0
s0 1 + G(s)
independent of K, where G(s) = K/(s(T s + 1)).
Example In an RLC circuit a transfer function is given by
G(s) =

1
LCs2 + RCs + 1

with LC = 104 sec./r2 and RC = 0.8 102 sec/r Suppose that C may increase or decrease from its
nominal value by a factor of 4, i.e. Cmax = 4C and Cmin = C/4.
(a) Find the maximum and minimum percent overshoots in the step response.
(b) What is the settling time (using the usual 1% criterion).
Soln:
(a)
LC = 104 (s/r)2 , RC = 0.8 102 s/r,

0.8 102
R
=
= 80 r/s
L
104

We remark the value of R/L is fixed. We rearrange the transfer function into a standard 2nd-order
form
G(s) =

s2 +

1
LC
R
1
s + LC
L

So
n2 =

R
1
and 2n =
LC
L

When C is its nominal value we have


n = 100 r/s, and = 80/200 = 0.4
When Cmax = 4C we have
n = 100/2 = 50 r/s, and = 80/100 = 0.8
When Cmin = C/4 we have
n = 100 2 = 200 r/s, and = 80/400 = 0.2
So the range of damping ratio is 0.2 0.8. Hence, the maximum P.O. is
P.O. = 100 e

0.2

10.22

= 52.7%

and the minimum P.O. is


P.O. = 100 e

0.8

10.82

= 1.52%

That is, 1.52% P.O. 52.7%.


(b) Since
2n =

R
R
= 80 r/s, so n =
= 40 r/s
L
L
Ts =

4
= 0.1 s
n

Note that Ts is fixed and is not affected by a change in C.

Example Consider the standard second order system:


G(s) =

n2
.
s2 + 2n s + n2

Suppose the poles of G(s) are limited to the triangular region in the complex plane with vertices 0 and
5 j10 (including the boundaries). This region is shown in Figure 3. For the step response of G(s), find
the minimum and maximum P.O., the minimum and maximum 1% Ts (settling time), and the minimum
and maximum Tp (peak time).

-5+j10

Im{s}

Re{s}

-5-j10
Figure 3: Pole region

Soln:
Percent overshoot P.O. From Figure 4, = tan1 2 = 63.4 degrees. For poles in the triangular region,
the lower bound on the damping ratio is:
cos = 0.45
For 1, the system is over(critically)-damped, so the minimum percent overshoot is P.O. = 0%;
In the case of 0.45 < 1, the system is underdamped, the maximum percent overshoot is:
when = 0.45, P.O. = 100e

1 2

= 20.5%

Hence we have
0 P.O. 20.5%
Settling Time Ts Because n 5 r/s, we have a lower bound on settling time (1%):
Ts =

4.6
0.92 s,
n

i.e. the minimum Ts is 0.92 s

Im{s}

-5+j10

Re{s}

-5-j10
Figure 4: Annotated pole region
Hence, Ts is bounded as
0.92 s Ts
p
Peak Time Tp From Figure 4 it is clear that d = n 1 2 10 r/s for the poles to lie in the triangular
region. Hence the peak time, Tp satisfies
Tp =

p
=
0.314 s
2
d
n 1

The value of Tp is bounded as


0.314 s Tp

is

consequence

Extract from Chapter 5 of Franklin's 5th edition


available on eclass (https://eclass.srv.ualberta.ca/
mod/resource/view.php?id=1617416). Here Rules 5
and 6 are as presented in this PDF. In the 6th and
7th edition, "rule 6" is in a modified form and "rule
5" is dropped.

45deg

eg1

1 of 1

file:///C:/Users/alanl/Documents/courses/360/2014/rl/html/eg1.html

s=tf('s');
L=1/s/((s+4)^2+16);
rltool(L);

Published with MATLAB R2013a

3/18/2014 10:20 PM

eg2

1 of 1

file:///C:/Users/alanl/Documents/courses/360/2014/rl/html/eg2.html

s=tf('s');
L=s*(s/5+1)/(2*s^3+10*s^2+20);
rltool(L);

Published with MATLAB R2013a

3/18/2014 10:22 PM

% ECE 360 - complex pole/zero - Bode plots: effect of damping ratio


clear all
% set(0,'DefaultAxesLineStyleOrder','-|o|:|+|--|x'); % for BW printing
% set(0,'DefaultAxesColorOrder',[0 0 0]);
%
zeta=[.05 .1 .20 .3 .5 .8];
num=1;
omeg=logspace(-1,1,200);
for k=1:length(zeta),
sys=tf(num,[1 2*zeta(k) 1]);
[mag(k,:),pha(k,:)]=bode(sys,omeg);
end
figure(1)
subplot(211)
semilogx(omeg,20*log10(mag))
legend('\zeta=.05','\zeta=.1','\zeta=.20','\zeta=.3','\zeta=.5','\zeta=.8')
ylabel('M(\omega) = 20 log |G(j\omega)| (dB)')
xlabel('\omega/\omega_n')
title('2nd order complex poles')
subplot(212)
semilogx(omeg,pha)
ylabel('\phi(\omega) (deg.)')
xlabel('\omega/\omega_n')

for k=1:length(zeta),
sys=tf([1 2*zeta(k) 1],1);
[mag(k,:),pha(k,:)]=bode(sys,omeg);
end
figure(2)
subplot(211)
semilogx(omeg,20*log10(mag))
legend('\zeta=.05','\zeta=.1','\zeta=.20','\zeta=.3','\zeta=.5','\zeta=.8')
ylabel('M(\omega) = 20 log |G(j\omega)| (dB)')
xlabel('\omega/\omega_n')
title('2nd order complex zeros')
subplot(212)
semilogx(omeg,pha)
ylabel('\phi(\omega) (deg.)')
xlabel('\omega/\omega_n')

Gain and Phase Margins


See Section 6.4 in Franklin. In order to determine a measure of how close a closed-loop system is
to being unstable we introduce the gain margin Gm and phase margin Pm . These two parameters
are a way to measure the closed-loops relative stability or stability margin.
We obtain Gm and Pm for the closed-loop system in Figure 1 in terms of the open-loop transfer
function G. We assume the K = 1 nominal closed-loop is stable, G is minimum phase, and
increase the gain K until it reaches a value Kmax at which the closed-loop is unstable. The gain
margin is then defined to be
Gm = 20 log Kmax
(1)
and has units of dB. Gm can be computed from the Bode plot of G using
Gm = 20 log |G(jcp )|
where cp is the phase crossover frequency satisfying
arg(G(jcp )) = 180
This follows because instability results from the characteristic equation having roots on the imaginary axis at some frequency cp and some gain K = Kmax
1 + Kmax G(jcp ) = 0 arg(G(jcp )) = 180
the magnitude condition gives
Kmax = 1/|G(jcp )|
And in dB we obtain
Gm = 20 log Kmax = 20 log |G(jcp )|
For a minimum phase G, Gm should be positive for closed-loop stability and negative if closed-loop
unstable.

Figure 1: Negative unity feedback system.


The phase margin Pm is the largest phase lag that can be added to G such that the closed-loop
remains stable. A phase lag is added to G by multiplying it by
ej , > 0 arg(ej ) =
Pm is the smallest such that the closed-loop characteristic equation has roots on the imaginary
axis:
1 + ej G(jcg ) = 0
(2)

where cg is the gain crossover frequency satisfying


|G(jcg )| = 1
From (2) we have
arg(ej ) + arg(G(jcg )) = 180
which implies
Pm = = arg(G(jcg )) + 180
Typically we desire Pm to be between 30 and 60 for sufficient phase margin. For a minimum phase
G, Pm should be positive for stability.
Example Consider
G(s) =

10
s(s + 1)(s + 5)

Find Pm , Gm , cp , cg .
Note that the nominal closed-loop system with K = 1 is stable. Although we could read the Gm
off the Bode plot of G, we find the max gain Kmax such that the closed-loop remains stable using
a Routh table
s3
s2
s1
s0

1
5
6
10K
K10
- 6 +5 0
10
0

If K = 3 then a row of zeros occurs on the s1 row. Hence, from (1) the gain margin is
Gm = 20 log 3 = 9.54 dB
The auxillary polynomial is P (s) = 6s2 + 30. Hence, the phase crossover frequency is cp =
To obtain the gain crossover frequency we solve

5 r/s.

|G(jcg )| = 1
The square of this equation is
2
2
100 = cg
(cg
+ 1)(cg + 25)
6
4
2
100 = cg
+ 26cg
+ 25cg

Solving numerically we obtain only one real solution cg = 1.23 r/s. The phase of G at this frequency
is
arg(G(jcg )) = 90 arctan cg arctan(cg /5) = 155
Hence, Pm = 180 155 = 25 .
Alternatively, we can use the Bode plots of G to determine Gm and Pm . MATLAB has a few ways
to obtain stability margins. One way is to plot the bode plots using
num=10;
den=conv(conv([1 0],[1 1]),[1 5]);
bode(tf(num,den)) % or ltiview(bode,tf(num,den))
and then right click in the figure and select Characteristics|All Stability Margins. The
results are show in Figure 2. The command margin can also be used.
2

100

Magnitude (dB)

50

System: untitled1
Gain Margin (dB): 9.54
At frequency (rad/s): 2.24
Closed loop stable? Yes

Gm
wcp

-50

-100
-90

System: untitled1
Phase Margin (deg): 25.4
Delay Margin (sec): 0.361
At frequency (rad/s): 1.23
Closed loop stable? Yes

Phase (deg)

-135

Pm
-180

wcg
-225

-270
10 -2

10 -1

10 0

10 1

10 2

Frequency (rad/s)

Figure 2: Gain and phase margin example.

Pm for a second order closed-loop system


We consider an open-loop tf
G(s) =

n2
,
s(s + 2n )

0 1, n > 0

in a negative unity feedback configuration shown in Figure 3. The tf from r to y is


Y (s)
G(s)
n2
= T (s) =
= 2
R(s)
1 + G(s)
s + 2n s + n2
Y(s)

+
R(s)

(3)

G(s)

Figure 3: Closed-loop
Using G(s) we can relate the phase margin to the damping ratio of the closed-loop tf T (s). First
we compute the gain crossover frequency cg of G(s), this frequency satisfies
|G(jcg )| = 1
3

We have

2
2

n

1 = |G(jcg )|2 =
jcg (jcg + 2n )
=

n4
2 ( 2 + 4 2 2 )
cg
cg
n

2
This provides a quadratic in = cg
:

( + 4 2 n2 ) n4 = 0
Solving for gives
2
= n2 (2 2
= cg

p
4 4 + 1)

Taking the positive solution we obtain


qp
cg = n
4 4 + 1 2 2
The plot of cg /n versus is given in Figure 4. We can now compute the phase margin Pm :
1

0.9

cg/n

0.8

0.7

0.6

0.5

0.4

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

Figure 4: Plot of cg /n versus


Pm = 180 + arg (G(jcg )) = 90 arctan
= arctan

cg
2n

2n
2
= arctan qp
cg
4 4 + 1 2 2
4

0.9

For the range 0 0.7 we can take a linear approximation


Pm 100 (deg)
A plot of Pm versus and its linear approximation are shown in Figure 5.
100

90

80

Pm (degrees)

70

60

50

40

30

20

10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

Figure 5: Plot of Pm versus . Exact relation and linear approximation.

Lead Controller Design


We consider the lead controller of the form
C(s) = K

sz
1 + s
= K
,
1 + s
sp

> 1, , K > 0

(4)

Note that C has a pole at p = 1/ and a zero at z = 1/( ). The parameter = p/z is called
the lead ratio. Since > 1 we have |z| < |p|. It is useful to think of the lead controller as a low-pass
filtered PD controller kp + kd s. That is,
CPDF (s) = kp +

kd s
(kp + kd )s + kp
=
,
s + 1
s + 1

kp , kd , > 0

Hence we have = , K = kp , = 1 + kd /(kp ).


We remark that Franklin (Eqn. (6.38)) takes a slightly different form for the lead controller
K

1 + s
,
1 + s

< 1, , K > 0
5

(5)

Evidently =
1 , = make (4) and (5) equivalent.
The phase of (4) is
() = arg C(j) = arctan( ) arctan( )

(6)

Hence
tan(()) = tan(arctan( ) arctan( ))
Using the identity tan(a b) =
tan(()) =

tan(a)tan(b)
1+tan(a) tan(b)

we get

( 1)

() = arctan
> 0 for > 1
2
1 + ( )
1 + ( )2

(7)

Since () > 0 the lead controller adds phase to a plant we put in series with it.
Setting the derivative of to zero gives the maximum phase lead of C. We use the expression (6):
0 (m ) = 0 =

2
1 + ( m )
1 + ( m )2

which is satisfied if
0 = (1 + ( m )2 ) + (1 + ( m )2 ) = 1 + ( m )2 (1 )
which implies the max phase occurs at frequency
1
m =

(8)

Note that log m = 12 (log |z| + log |p|). So on a log scale m is the midpoint between |z| = 1/( )
and |p| = 1/ . The frequency m is the geometric mean of the frequencies 1/ and 1/( ).
We can obtain the maximum phase of C from (7) and (8)
1
1
= arcsin
m = (m ) = arg(C(jm )) = arctan
+1
2
which is an increasing function of . The inverse function is useful for lead controller design
=

1 + sin m
1 sin m

(9)

The graph of (9) is in Figure 6. Normally we limit m 60 with more than one lead compensator
used if more phase is required.
The bode plots of C/K are in Figures 7 and 8 for = 1.5, 3, 8, 15. Here we use a normalized
frequency scale .
If we design
the lead controller such that the maximum phase contribution of C occurs at cg =
m = 1/( ) then an important value of the gain of C(j)/K is where
s

1+
|C(jm )/K| =
=
1 + 1/
or in dB
20 log |C(jm )/K| = 10 log
Also, note as we have |C(j)/K| , and the DC gain C(0)/K = 1
6

35

30

25

20

15

10

10

20

30

40

50

60

70

Figure 6: Equation (9) which relates maximum phased contribution m to lead ratio .
Example Consider a negative unity feedback shown system in Figure 9 with
P (s) =

103
s(s + 25)

and design a lead compensator (4) to achieve


DC performance: ess 1% for a ramp input.
Transient performance: PO < 10% for a step input.
The ramp tracking spec can be met by adjusting K in (4). At DC the factor
effect.
The velocity constant relates to ess by
1
= 0.01 Kv = 100
Kv

ess =
The velocity constant is

Kv = lim P (s)C(s) =
s0

Solving for K gives


K=

103 K
= 100
25

25 100
= 2.5
1000
7

1+ s
1+ s

in C has no

25
=1.5
=3
=8
=15
20

M() (dB)

15

10

0
2
10

10

10
(rad)

10

10

Figure 7: Bode Magnitude Plot of C/K for = 1.5, 3, 8, 15


70
=1.5
=3
=8
=15

60

() (deg)

50

40

30

20

10

0
2
10

10

10
(rad)

10

Figure 8: Bode Phase Plot of C for = 1.5, 3, 8, 15


8

10

R(s)

Y(s)
C(s)

P(s)

Figure 9: Negative Unity Feedback System


We use the approximate relation between Pm and for 2nd order underdamped systems: Pm = 100
where the damping ratio for P O = 10% is about = 0.6. Hence, a Pm = 60 is required.
First we compute the Pm for the so-called uncompensated system K P (s) = 2.5 P (s) to see how
much phase needs to be added. The gain crossover frequency cg is obtained from
2
2
cg
(cg
+ 252 ) = 106 2.52 cg = 47 r/s

Hence Pm = 180 + arg(P (jcg )) = 90 arctan(cg /25) = 28 .


If additional phase could be added without increasing the magnitude of the open-loop we would
s
add 32 for a Pm = 60 . However, we need to add a bit more phase since the magnitude of 1+
1+ s
increases cg . Hence we choose m = 38 which is an additional 6 and so that the lead ratio is
=

1 + sin m
= 4.2
1 sin m

Now lets compute the cg of the compensated system CP , call this frequency cgnew . The design
chooses cgnew = m and so
20 log |KP (jcgnew )| = 10 log
or

|KP (jcgnew )| = 1/

Taking the square of (10) we have


2
2
106 2.52 4.2 = cgnew
(cgnew
+ 252 )

which yields one positive solution m = cgnew = 69.3 rad/s. Hence, the time constant is
=

1
= 7.04 ms
m

and our lead compensator is therefore


C(s) = 2.5

1 + 2.96 102 s
1 + 7.04 103 s

We verify our compensated phase margin


Pm = 90 arctan(cgnew /25) + 38 = 58
9

(10)

which is close to the desired value Pm = 60 .


We remark that the closed-loop zero at 33.8 in the tf from r to y approximately cancels with
a closed-loop pole 39.3 and the dominant closed-loop poles are complex 63.8 j70.5 and this
justifies the use of the approximate formula Pm 100 and the relation between and PO which
is valid for underdamped 2nd order systems. We remark that the zero of the closed-loop could also
be canceled exactly by filtering the reference input (i.e., a so-called 2 DoF controller).
The following pages show the Bode plots for the uncompensated system K P (s) and the compensated system P (s)C(s). The last page provides the step response of the closed loop from r to
y.
We remark that an exact solution for Pm = 60 can be obtained for the lead design using MATLAB.
Although this design can only be performed numerically, it is generally more elegant as it avoid the
trial and error required when adding additional phase.
As before the design fixes m = cg so that
|C(jcg )P (jcg )| = 1
implies
|K P (jcg )| =

1
K
=
|C(jm )|

or taking the square of this equation gives


|K P (jcg )|2 =

Defining = 1 = 1/|K P (jcg )|2 we have


m = arcsin

1
1
= arcsin
+1
1+

Hence, a condition to achieve a desired phase margin Pm can be expressed in terms of cg as


1
Pm = 180 + arg(P (jcg )) + arcsin
1+
|
{z
}
arg(C(jm ))

This equation can be solved numerically in MATLAB using fsolve for a given uncompensated
plant K P . The function called during numerical solve is
function F = mfun(w)
global Pu Pmd Pa_2
% compute abs(kP(j*w))^2 which equals 1/alpha if w=wcg
aPusq=abs(freqresp(Pu,w))^2;
% Solve F=0
F=180+angle(freqresp(Pu,w))*180/pi+asind((1-aPusq)/(1+aPusq))-Pmd;
and the calling script

10

clear all
s=tf(s);
global Pu Pmd Pa_2
% uncompensated plant K*P(s)
P=1e3/s/(s+25);
K=2.5 % gain to ensure 1% steady-state ramp tracking
% Trial an error method
Pu=K*P;
[Gm,Pm,wcp,wcg]=margin(Pu)
% desired Pm=60 deg. Add an additional 6 deg
Pmd=60;
% Maximum Phase of lead controller
Pa=Pmd-Pm+6;
% determine lead ratio alpha
alpha=(1+sind(Pa))/(1-sind(Pa));
% Place wcg near freq where max phase of lead controller occurs
% by solving |KP(jwcgnew)|=1/sqrt(alpha)
wcgnew=max(real(sqrt(roots([1 25^2 -alpha*K^2*1e3^2]))))
tau=1/wcgnew/sqrt(alpha);
C=K*(1+tau*alpha*s)/(1+tau*s);
[Gm1,Pm1,wcp1,wcg1]=margin(C*P)
% exact design
% Maximum phase of lead controller
Pa_2=Pmd-Pm;
wcg_2=fsolve(@mfun,wcg);
alpha_2 = 1/abs(freqresp(Pu,wcg_2))^2
tau_2 = 1/wcg_2/sqrt(alpha_2)
C_2=K*(1+tau_2*alpha_2*s)/(1+tau_2*s);
[Gm2,Pm2,wcp2,wcg2]=margin(C_2*P)
wcg_2 =
7.1818e+001

alpha_2 =
4.7722e+000

11

tau_2 =
6.3740e-003
The above script also computes the trial and error design. We remark that the above design did not
consider the bandwidth of the closed-loop. We often want to maximize cg in order to maximize
this bandwidth. It is also possible to generalise the above numerical approach to include this
performance requirement. An example is available on e-class.

12

C(s)

PC

C
PC

69.3 rad/s

C(s)

C(s)

Lag Controller Design


We consider the lead controller of the form
C(s) = |{z}
K

sz
1 + s
=K
,
1 + s
sp

> 1, , K > 0

(11)

Note that C has a pole at p = 1/( ) and a zero at z = 1/ . The parameter = z/p is
called the lag ratio. Since > 1 we have |p| < |z|. It is useful to think of the lag controller as an
approximate PI controller when . That is
C(s) = K

s + 1/
s + 1/
kp s + ki
K
=
s + 1/( )
s
s

where kp = K, ki = K/ if or equivalently the pole p of the lag controller is placed at the


origin.
Clearly the phase of (11) is always negative and equal to
() = arctan

(1 )
< 0 for > 1
1 + ( )2

In fact the negative phase of C does not provide any useful benefit and normally 1/ is taken to
be sufficiently small so as not to affect closed-loop performance. Figure 10 shows the Bode plot of
C/K for = 1 and = 10.
Example Consider a negative unity feedback shown system in Figure 9 with
P (s) =

103
s(s + 25)

and design a lead compensator (4) to achieve


DC performance: ess 1% for a ramp input.
Transient performance: PO < 10% for a step input.
= 2.5 which gives the
As shown above we can meet the steady state error condition with K
uncompensated plant
(s) = 2500
KP
s(s + 25)
1+ s
Next we add 1+s
to adjust the phase margin. Since the Pm of the uncompensated system is

Pm = 28 with cg = 47rad/s, we find cgnew so that

Pm = 65 = 180 + arg(P (jcgnew )) = 90 arctan(cgnew /25)


which gives cgnew = 11.7rad/s. Note we have added an additional 5 to the phase margin to account
1+ s
for a small amount of phase lag from 1+s
.
We place 1/ one decade below cgnew to obtain
=

10
cgnew
16

= 0.859s

Bode Diagram
20

Magnitude (dB)

15

10

Phase (deg)

0
0

30

60
3
10

10

10
10
Frequency (rad/s)

10

10

Figure 10: Bode plots of a lag controller C/K with = 1, = 10.


is 1/ near
Note cgnew < cg . Since 1/ was chosen sufficiently small, this means the gain of C/K
cgnew and we can obtain from the approximate relation
(jcgnew )| =
|KP
which implies
= 7.77
The bode plot of CP is shown in Figure 11 where the phase margin spec is satisfied. An exact
design could also be performed numerically and is left as an exercise.

17

Bode Diagram

100

Magnitude (dB)

50

-50

System: untitled1
Phase Margin (deg): 60
Delay Margin (sec): 0.0894
At frequency (rad/s): 11.7
Closed loop stable? Yes

Phase (deg)

-100
-90

-135

-180
10 -2

10 -1

10 0

10 1

10 2

10 3

Frequency (rad/s)

Figure 11: Bode plots of open-loop system CP for the lag controller design.

18