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

Control Systems

Control Design: Loop shaping


L. Lanari

Sunday, November 30, 2014

Outline

specifications
open-loop shaping principle
lead and lag controllers
4 basic situations
sketch of PID controllers

Lanari: CS - Loop shaping


Sunday, November 30, 2014

Specifications (closed-loop)
Static

desired behavior w.r.t. order k inputs in terms of a maximum allowed absolute error
desired attenuation level w.r.t. constant disturbances acting on the forward loop
tracking of a sinusoidal reference
attenuation of sinusoidal disturbances and measurement noise

Dynamic

location of eigenvalues/poles in the complex plane


time domain specifications on the step response (mainly on the reference to output behavior)
frequency domain specifications through the resonance peak and the bandwidth (mainly on the
reference to output behavior)

Stability

location of eigenvalues/poles in the complex plane


robustness in terms of gain and phase margin

Lanari: CS - Loop shaping


Sunday, November 30, 2014

Specifications
CLOSED-LOOP System

Static

equivalent to

OPEN-LOOP System
presence of a sufficient number of poles in 0
and/or at the reference/disturbance angular
frequency sufficiently high gain (in absolute
value)
Necessary conditions require the following
structure in the controller

for sinusoidal
1
Kc
reference or
2
2
h
s +

s
disturbance

Dynamic
bandwidth B3 (and rise time tr)

!c crossover frequency

resonant peak Mr (and overshoot Mp)

PM phase margin

taken care by
R(s)

Kc
C(s) = h R(s)
s

Lanari: CS - Loop shaping


Sunday, November 30, 2014

d1

d2

+ +

C (s)
r

m+

Kc
sh

R (s)

P (s)

+
+

necessary part of the controller

C (s)
controller

Kc
sh

P (s)

R (s)

to be still chosen in order to satisfy the dynamic specifications

P (s)

extended plant

plant
Loop function L (s)

R (s)
dynamic
specifications

Lanari: CS - Loop shaping


Sunday, November 30, 2014

Kc
sh

P (s)

static
specifications
5

Open Loop Shaping


Basic idea: being the plant P (s) fixed, choose the controller C (s) to shape the loop function
frequency response L (j!)
L (j!)
C (s)
magdB

such that

with some desired


characteristics

phase
PM

C (s) = C1 (s)R (s)


C1 (s)

static specs

Kc
sh

R (s)

dynamic performance specs

static specs

Lanari: CS - Loop shaping


Sunday, November 30, 2014

hyp: the necessary part of the controller C (s) has been determined so we have the
extended plant
Kc

P (s) = C1 (s)P (s) = h P (s)


s

we need to determine C (s) so to satisfy also the dynamics specifications and ensure stability
specifications
!c* desired crossover frequency at which we want to have a phase margin of at least PM *
from the extended plant frequency response we need to check which action is necessary
both in terms of magnitude and phase by comparing the actual value of the magnitude and
phase at the future crossover frequency !c*

Amplification: we need to increase the magnitude at some frequency


Magnitude
Attenuation: we need to decrease the magnitude at some frequency

Lead: we need to increase the phase at some frequency


Phase
Lag: phase can be decreased at some frequency if necessary
we want P M P M
Lanari: CS - Loop shaping
Sunday, November 30, 2014

so if we have extra phase we can keep it


7

P (j)

attenuation needed
!c*

2 possible actions on the


magnitude at some frequency

|P (j)|dB

amplification needed

|P (j)|dB

maximum lag we can tolerate


lead (phase increase) needed
PM *
-

2 possible actions on the


phase at some frequency

P (j)

Lanari: CS - Loop shaping


Sunday, November 30, 2014

Remember that the static specifications have already been met (if we ensure stability) and
therefore we do not want to alter this first step.
Therefore, in general, we are not going to use a

zero in s = 0 to obtain a phase lead


pole in s = 0 to attenuate at some frequency
a gain smaller than 1 in magnitude to attenuate if we have a constraint on the loop gain from
the static requirements (while we may use a gain greater than 1 to amplify)

elementary functions that can provide these magnitude and phase contributions
lead
compensator

1 + a s
Ra (s) =
a s
1+ m
a

lag
compensator

i s
1+ m
i
Ri (s) =
1 + i s

a > 0
ma > 1

i > 0
mi > 1

both have unit gain so no magnitude change in ! = 0


Lanari: CS - Loop shaping
Sunday, November 30, 2014

Lead compensator

Magnitude (dB)

1 + a s
Ra (s) =
a s
1+ m
a

Phase (deg)

pole in

ma
a

zero

10
0
10
20

1
a

ma
a

pole

zero

45
0
45

pole

90

Lanari: CS - Loop shaping


Sunday, November 30, 2014

ma > 1

20

90

ma = 10

a > 0

zero in

1
a

10

Lag compensator

Magnitude (dB)

i s
1+ m
i
Ri (s) =
1 + i s

i > 0
mi > 1

20
10

1
i

0
10
20

pole

zero in

mi
i

pole in

1
i

zero
mi
i

Phase (deg)

90

mi = 10

0
45
90

Lanari: CS - Loop shaping


Sunday, November 30, 2014

zero

45

pole

11

Choice of R (s)
we assume C1 (s) (static specs) has already been chosen. Therefore we need to

by evaluating the actual values of the extended plant magnitude and phase at the desired
crossover frequency !c*, understand what action needs to be undertaken:

amplification or attenuation at !c*


phase lead or maximum allowed phase lag at !c*

choose the elementary function(s) Ra(s) and/or Ri(s) (since multiple actions can be
combined) needed

choose ma (or mi) and the normalized frequency !


deciding to obtain the desired action at !c* choose a (or i) so that
!c*a = !
frequency
chosen
at which we
want to obtain
the desired action

Lanari: CS - Loop shaping


Sunday, November 30, 2014

(or !c*i = !)

we solve
in a

12

Universal diagrams
25
16

1 + a s
Ra (s) =
a s
1+ m
a

ma > 1

12
10

20
8
magnitude (dB)

a > 0

14

15

4
3

10

2
5

0 1
10

for different values of ma

10

10
normalized frequency

10

70
16

60
50
phase (deg)

for Ri(s) just change sign


to the ordinates

14
12
10
8
6

40
4
30
3
20
2
10
0 1
10

Lanari: CS - Loop shaping


Sunday, November 30, 2014

10

10
normalized frequency

10

13

Case I
40

20

30

R a (j)

0
20
20
10

Magnitude (dB)

Magnitude (dB)

40

40
60
2
10

10

10
frequency (rad/s)

10

Phase (deg)

50
0

10
20

L(j )
30

90

40

PM *

180
200
270
2
10

specs

10

10
frequency (rad/s)

!c* = !c

60
2
10

10

30

actions needed:

10
frequency (rad/s)

10

frequency which coincides with the desired one


phase: increase the phase, in this case of exactly
PM *

90

L(j )

180
200

P (j)
270
2
10

Lanari: CS - Loop shaping

R a (j)

Phase (deg)

magnitude: as small amplification as possible in


order not to move the current crossover

Sunday, November 30, 2014

10

PM PM *
50

P (j)

50

10

10
frequency (rad/s)

10

14

example we need a phase lead of 25 with the smallest amplification possible


70
16

60

phase (deg)

50

25

Lanari: CS - Loop shaping


Sunday, November 30, 2014

40
4
30
20
2
10
0 1
10

we have chosen

10

10
normalized frequency

10

0.5 is the smallest (for


these plots) normalized
frequency at which we
obtain the desired phase
lead (for ma = 16)

25
16

14
12

10

20
8
magnitude (dB)

with the amplification of


1 dB at !c* = 0.3 rad/s
we choose a as
a = 0.5/0.3

desired
phase lead

ma = 16
! = 0.5
therefore to obtain
this lead of 25 together

several choices of ma are


possible (at different
normalized frequencies),
we need to find one
which is compatible with
the magnitude
requirement

14
12
10

15

4
3

10

smallest amplification
obtainable (around 1 dB)

2
5

0 1
10

1 dB
0

10

10
normalized frequency

10

15

Case II
40

|P (jc )|dB

20

0
20

P (j)

L(j )

20
10

40
60
4
10

10

10
10
frequency (rad/s)

10

10

50
Phase (deg)

30

Magnitude (dB)

Magnitude (dB)

40

R i (j )

20

40

PM *

180
200

specs

10

30

90

270
4
10

10

10
10
frequency (rad/s)

10

50
60
4
10

10

10

10
10
frequency (rad/s)

10

10

PM PM *

!c*

50
30

actions needed:
magnitude: attenuation of |P (jc )|dB
phase: since
P (jc ) + > P M

Phase (deg)

R i (j )
90

P (j)
L(j )

180

we can tolerate at most a lag of


P (jc ) + P M

Lanari: CS - Loop shaping


Sunday, November 30, 2014

200

270
4
10

10

10
10
frequency (rad/s)

10

10

16

example we need an attenuation of 17 dB and can tolerate a maximum lag of 7


- 25
negative
values

required attenuation

16
12

- 20

10

magnitude (dB)

3
2

0 1
10

10

16

- 40

6
4

Sunday, November 30, 2014

60 is the smallest (for


these plots) normalized
frequency at which we
obtain the desired
attenuation (for mi = 8)

- 20

Lanari: CS - Loop shaping

14
12
10

- 50
- 30

maximum allowed lag

10

- 70

negative
values - 60

we choose i as
i = 60/0.1

10
normalized frequency

phase (deg)

together with a lag


smaller than 7
at !c* = 0.1 rad/s

- 10

mi = 8
! = 60
therefore to obtain
this attenuation of 1 dB

several choices of mi are


possible (at different
normalized frequencies),
we need to find one
which is compatible with
the magnitude
requirement

- 15

we have chosen

14

- 10
0 1
10

10

10
normalized frequency

10

17

on the choice of the normalized frequency (case II)


basic consideration (see sensitivity functions): we usually want open-loop high gain at low
frequency, therefore anything that gives an excess of attenuation at low frequency should be
avoided if possible
case II with two alternative choices of the !
Ri1(s)

mi = 8

! = 70

Ri2(s)

mi = 8

! = 200

starts attenuation before strictly needed

80
0

70

R i1(j )

60

R i2(j )
P (j)

40
30

L 1 (j )

P (j)

L 2 (j )

20

Phase (deg)

Magnitude (dB)

50

10

90

L 1 (j )
L 2 (j )

0
180

R i1(j )

10

R i2(j )

200

20
30
4
10

10

Lanari: CS - Loop shaping


Sunday, November 30, 2014

10
frequency (rad/s)

10

10

10

10

10
frequency (rad/s)

10

10

both compensators solve the specifications


18

Case III
40

20
0

30

|P (jc )|dB

20
40
60
4
10

10

10
10
frequency (rad/s)

10

10

Phase (deg)

50
0

20

10

L(j )

20

R a (j) P (j)
40

PM *

180
200

specs

30

90

270
4
10

R a (j)

10

Magnitude (dB)

Magnitude (dB)

40

10

!c*

10
10
frequency (rad/s)

10

P (j)

50
60
2
10

10

10

10
frequency (rad/s)

10

PM PM *
50
30

actions needed:
magnitude: amplification of |P (jc )|dB
phase: since
P (jc ) + < P M

we need to obtain a phase lead of

P M P (jc ) +

Lanari: CS - Loop shaping


Sunday, November 30, 2014

Phase (deg)

R a (j)

90

180
200

L(j )

P (j)
270
2
10

10

10
frequency (rad/s)

10

19

example we need an amplification of 20 dB and a phase lead of at least 25


two choices

find a lead compensator that will give simultaneously the required amplification
and phase lead

usually requires a choice of the normalized frequency on the right-hand side


of the phase bell shape which gives poor robustness w.r.t. increases in the
crossover frequency since the phase of both the extended plant and the
compensator are decreasing at the chosen frequency
may be not easy to find

find a lead compensator that gives the required lead and gives some
amplification, integrate the required amplification with an additional gain Kc2
greater that 1.
This is usually possible since the static requirement (if any) asks for a gain
sufficiently high.

Lanari: CS - Loop shaping


Sunday, November 30, 2014

20

example we need an amplification of 20 dB and a phase lead of at least 25


70

Kc2Ra(s)

16

60

phase (deg)

50

25

8
6

40
4
30
3
20

desired
phase lead

2
10

we can choose

0 1
10

ma = 3
! = 0.9
therefore to obtain
this lead of 25 together

10

10
normalized frequency

10

Kc2 /
[Kc2 ]dB = 20 - 2.5

25
16

14
12

10

20
8
magnitude (dB)

with the amplification of


2.5 dB at !c* = 0.2 rad/s
we choose a as
a = 0.9/0.2

several choices of ma are


possible (at different
normalized frequencies),
we just keep the choice of
the normalized frequency
on the left of the bellshape

14
12
10

15

we can obtain an
amplification of 2.5 dB)

10

2
5

2.5 dB
Lanari: CS - Loop shaping
Sunday, November 30, 2014

0 1
10

10

10
normalized frequency

10

21

about the robustness issue


case III revisited with two alternative solutions (the gains have been chosen appropriately)
70
16

60

Kc1 Ra1 (j)

14
12

phase (deg)

ma = 6
! = 0.8

Kc2 Ra2 (j)

10

50

8
6

40

ma = 6
! = 7.5

4
30
3
20
2

left-hand side of the bell

right-hand side of the bell

10
0 1
10

10

10
normalized frequency

10

40
30

50

R a 1(j)

30

R a 2(j)

20

R a 2(j)

w.r.t. an increase of the


crossover frequency

R a 1(j)

Phase (deg)

Magnitude (dB)

10
0
10
20

L 2 (j )
90

L 2 (j )
30
180

L 1 (j )

40

10

10
frequency (rad/s)

L 1 (j )

P (j)

P (j)

50
60
2
10

200

10

270
2
10

10

10
frequency (rad/s)

10

solution 1 is more robust w.r.t. uncertainties in the !c


Lanari: CS - Loop shaping
Sunday, November 30, 2014

22

Case IV
40

|P (jc )|dB

20

0
20

20

R a (j)
10

40
60
2
10

10

10
frequency (rad/s)

10

50
Phase (deg)

30

Magnitude (dB)

Magnitude (dB)

40

10

R i (j )
20
30

90

40

PM *

180
200
270
2
10

specs

10

!c*

10
frequency (rad/s)

50
60
3
10

10

P
R a P
L = R i R a P
2

10

10
frequency (rad/s)

P (jc ) + < P M

we need to obtain a phase lead of at least

P M P (jc ) +

Lanari: CS - Loop shaping

R i (j )
Phase (deg)

magnitude: attenuation of |P (jc )|dB


phase: since

R a (j)

30

actions needed:

Sunday, November 30, 2014

10

PM PM *
50

10

90

180
200
P
R a P
L = R i R a P
270
3
10

10

10
frequency (rad/s)

10

10

23

example we need an attenuation of 8 dB and a phase lead of at least 25


we need to use both lead and a lag compensators but in the proper order

we choose the lead compensator first in such a way to obtain a phase increase of the
required 25 plus an extra (for example of 8) in order to compensate the lag that will be
introduced by the lag compensator
This lead function will also introduce, at the chosen frequency, an amplification of exactly
a (j )|dB
|R
c

the lag compensator will be chosen so to introduce an attenuation of


a (j )|dB
8 dB + |R
c

and a lag smaller than the extra 8 previously introduced


ma = 8
! = 0.8

34
2.5 dB

mi = 3.2
! = 20

-10.5 dB
< 8

(these numbers are just for illustration purposes and have not been verified)

Lanari: CS - Loop shaping


Sunday, November 30, 2014

24

PID controllers
3 basic heuristic actions
Proportional: the control action is set to be directly proportional to the system error (present)
Integral: the control action is set to be proportional to the system error integral (past)
Derivative: the control action is set to be proportional to the system error derivative (future)
output of the
controller
e (s)

m(t) = KP e(t) + KI

m (s)
CPID (s)

e( )d + KD e(t)

m(s)
CP ID (s) =
e(s)

ideal PID controller


transfer function

KI
KP +
+ KD s
s

1
KP 1 +
+ TD s
TI s

with

KP
TI =
KI
TD

KD
=
KP

widely spread
fixed structure with 3 tunable parameters KP KD KI
can be tuned automatically even with scarce knowledge of the (simple) plant
basic tuning refers only to static specifications

Lanari: CS - Loop shaping


Sunday, November 30, 2014

25

Derivative action is physical not realizable (improper transfer function) we need to approximate
add a high frequency pole in

KP
N
s=
N =
KD
TD
a
CD
(s)

TD s

=
TD
1+ N s

high frequency pole

Magnitude (dB)

60
40

tive
a
v
i
r
l de
a
e
d
i

20
0

approx

20
N = 10, 20, 50, 100
40
2
10

10

10
10
frequency (rad/s)

10

10

Phase (deg)

ideal derivative

approximated
derivative action
for various values of N

90

45
N = 10, 20, 50, 100
0
2
10

Lanari: CS - Loop shaping


Sunday, November 30, 2014

10

10
10
frequency (rad/s)

10

10

26

CaPID (s)
1
r

1
KI s

+
+ +

m
KP

P (s)

TD s

TD
1+ N s

Basic PID feedback control scheme


typical configurations

proportional
proportional + derivative (approximate)
proportional + integrative

Lanari: CS - Loop shaping


Sunday, November 30, 2014

27

PD configuration

30

CPa D (s)

= KP

sTD
1+
1 + s TND

= KP

1 + TD NN+1 s
N +1
1
+ N +1 TD N

1/ma

Magnitude (dB)

20
10
0
10 2
10

Phase (deg)

equivalent to a Lead compensator

KP = TD = 1, N = 10

1
1+
sTI

KP (1 + TI s)
=
TI
s

Magnitude (dB)

CP I (s) = KP

Sunday, November 30, 2014

10

10

10
10
frequency (rad/s)

10

10

10

KP = TI = 1

20

0
2

10

10

10

10
10
frequency (rad/s)

10

10
10
frequency (rad/s)

10

10

10

Phase (deg)

10

Lanari: CS - Loop shaping

10
10
frequency (rad/s)

40

zero in s = -1/TI + pole in s = 0


compensates the phase lag introduced by the pole in s = 0

45

0 2
10

PI configuration

10

28

Vocabulary

English

Italiano

lead compensator

funzione anticipatrice

lag compensator

funzione attenuatrice

phase lead

anticipo di fase

phase lag

ritardo di fase

attenuation

attenuazione

amplification

amplificazione

open-loop shaping

sintesi per tentativi

Lanari: CS - Loop shaping


Sunday, November 30, 2014

29

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