You are on page 1of 12

Module 3: Classical Loopshaping Design | Scilab Ninja

1 12

Scilab Ninja
Control Engineering with Scilab

Module 3: Classical Loopshaping Design


Tweet

Like

Share

Share

Module 3: Classical Loopshaping Design


This article is contained in Scilab Control Engineering Basics study module, which is used as course material
for International Undergraduate Program in Electrical-Mechanical Manufacturing Engineering, Department of
Mechanical Engineering, Kasetsart University.

Module Key Study Points


Understand the tradeoffs in feedback control design
Learn how to formulate design specs as bounds on frequency responses
Relationships between open-loop and closed-loop frequency responses
Perform basic frequency response shaping of loop transfer function
Recall from module 2, we define 3 important transfer functions
Loop :

(1)
Sensitivity :

(2)

Complementary Sensitivity :

(3)

that become the key players, especially for an approach of feedback control design commonly known as
classical control, since it originated from the 40 during WWII. This study module focuses on such

http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016

Module 3: Classical Loopshaping Design | Scilab Ninja

2 12

approach. In essence, we will perform frequency response shaping on the loop transfer function

to

yield the desired control specifications, often referred to as loopshaping*.


* We have to make a remark though, that this term is also used in some modern design scheme to shape the
closed-loop frequency responses directly. In this module we focus on shaping the open-loop transfer function
.
Before getting into the design procedure, we need to formulate the stability and performance requirements
from last module to a general SISO feedback diagram with exogenous signals injected at various points in the
loop, as shown in Figure 1.

Figure 1 a general SISO feedback diagram

Performance Criteria
The following closed-loop responses can be easily derived

(4)
(5)
(6)
Together with the plant, the transfer functions that play the roles in these expressions are the sensitivity
and complementary sensitivity

. Note that these two closed-loop transfer functions are functions of the

controller, so design criteria can be casted on them.


For example, good tracking performance requires that

approaches zero. From (5), it implies that

should be made small. Now, suppose that measurement noise


want this unwanted signal to affect the plant output
that

is prevalent in this system. We do not

. From (4), this noise rejection requirement implies

should be made small. So, we must design a controller to yield small

and

. But this

requirement violates the algebraic constraint

(7)
i.e., when

approaches 0,

goes to 1, and vice versa. This conflict suggests that some tradeoffs

have to be made in the control design specifications.


Fortunately, in normal situation the exogenous signals entering the feedback loop in Figure 1 have different
frequency spectrum that could ease off the problem considerably. We summarize them as follows:

http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016

Module 3: Classical Loopshaping Design | Scilab Ninja

3 12

(command input): common command signal is smooth and varies gradually with time, so it naturally lies
in low-frequency region.

(disturbance): a typical disturbance signal entering at the input or output of the plant also has lowfrequency spectrum, such as mechanical vibration, resonance, or in the robot joint case, the dynamic force
exerting from adjacent links.

(measurement noise): most sensors become noisy when frequency increases. So the measurement noise
generally lies in high-frequency region.

This allows us to cast frequency-dependent specifications to


represent them as magnitude of frequency responses
can make

and
and

. It is more convenient to
. So, in the above situation, we

small in low frequency region (for good tracking), and

small in high frequency

region (noise rejection).

Stability Criteria
Note: in the discussion that follows, we assume a stable, minimum-phase plant, such as the DC motor robot
joint used as our example. Some statements may not be valid for an unstable or non-minimum phase plant.
Stability requirement for classical control design can be explained clearly using relationship between the
magnitude of sensitivity
distance from

and Nyquist plot of

as shown in Figure 2. It can be shown that the

curve to the critical point -1 is inversely proportional to

. The shorter this

distance, the poorer stability margin of the system. The circle in Figure 2 represents the magnitude
. Hence, when

, the curve of

is inside the circle. As a result, control

design spec for stability can be made as a bound on the peak of sensitivity frequency response. Note that this
peak occurs at some mid frequency region before

converges to 1 and

roll-off.

Figure 2 relationship between sensitivity frequency response and Nyquist plot

http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016

Module 3: Classical Loopshaping Design | Scilab Ninja

4 12

Design Criteria Imposed on Loop Transfer Function


In some postmodern control strategy such as

synthesis, the stability and performance bounds discussed

above can be formulated into weighting functions on

and

directly. That strategy is also called

loopshaping (on closed-loop transfer functions). For the classical control design scheme, however, the
frequency response shaping is performed on the loop transfer function
converted to bounds on

. Hence, all the criteria must be

To summarize the stability and performance criteria on the closed-loop transfer functions, we separate them to
3 frequency regions LOW, MID, and HIGH. From the above discussion, we have the following design specs
LOW:

for good tracking and disturbance attenuation

MID: since

indicates poor stability. An upper bound on

the algebraic constraint that


HIGH:

implies

for measurement noise rejection performance.

Now, these closed-loop bounds can be converted to constraints on


LOW: for small

is needed. Note from

by using these relationships

, we have
; i.e., the bound on

. Hence
is created by inverting the bound on

MID: By means of Figure 2, the bound on

implies

is translated to stability margins criteria on

non-minimum phase plant, Bode gain-phase relationship is normally used in shaping

. For a stable,
in MID

frequency to have sufficient phase margin. More on this later.


HIGH: for small

, we have
; i.e., the bound on

. Hence
is the same as the bound on

implies

This can be summarized in Figure 3 and 4.

http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016

Module 3: Classical Loopshaping Design | Scilab Ninja

Figure 3 bounds on

5 12

and

Figure 4 bounds on

Bode Gain-Phase Relationship


The stability requirement on

in Figure 4 may need more explanation. Suppose there is no stability

requirement in terms of phase margin, we could make the magnitude of L to have its slope as steep as we
want to easily satisfy both the low and high frequency bounds. Such simplicity is not feasible due to a
constraint at the crossover frequency known as the Bode gain-phase relationship, which states that
For a stable, minimum-phase system, the phase of any transfer function

has a unique relationship

with its magnitude. On a log-log plot, if the slope of magnitude plot has a constant slope n over a decade of
frequency, then

(8)
This suggests a basic rule for stability of classical control design. For the closed loop system to have
sufficient phase margin, within some frequency region around crossover, the slope of

must be

approximately -1, or -20 dB/decade. This is depicted in Figure 4. may have higher slope in low and high
frequency regions to satisfy the performance bounds, but at crossover it should try to maintain -20 dB/decade
for some frequency band.
Now I hope the reader could grab the concept. No better way to understand classical control design than
experimenting with a problem set.

http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016

Module 3: Classical Loopshaping Design | Scilab Ninja

6 12

Example: let us design a controller for our same old robot joint driven by DC motor developed since the first
module

(9)

with the following design specs


1. steady state error is eliminated
2. low frequency disturbance is attenuated at least 0.01 below 1 Hz
3. high frequency measurement noise is attenuated 0.1 above 100 Hz
4. closed-loop stable, with phase margin at least 40 degrees
From the above discussion, this can be translated to stability and performance bounds
1.

has an integrator. Note that

already has one

2.

below 1 Hz

3.

above 100 Hz

4.

has at least 40 degrees phase margin, or

* Problem 1 asks you to derive this relationship


To aid this design problem, we write a specific script file lshape.sce. Download this file and open it with
SciNote. The variables for design specs 2 4 are initialized at the top of file, which you could later change to
modify the bounds to your own specs. Right now we stick with the given values.
Lets see how this script works. From module 2, we design a lead-lag compensator

(10)

that yields closed-loop stability and quite good tracking performance. This controller is the default when you
first download the script. So we start our experiment with it. Run the script from Scilab command prompt
-->exec('lshape.sce',-1)

to observe the frequency responses versus bounds in Figure 5 and 6. Loopshaping procedure uses Figure 5 as
a tool to design a controller, while Figure 6 is used to demonstrate the relationship between the frequency
responses and bounds from open-loop and closed-loop systems.

http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016

Module 3: Classical Loopshaping Design | Scilab Ninja

Figure 5 plot of

Figure 6

and

7 12

versus bounds from lshape.sce

versus bounds from lshape.sce

Notice from Figure 5 that, the lead-lag compensator (9) does not meet the low-frequency requirement. The
curve of

must be above the 40 dB line shown in magenta for all frequency less than 1 Hz. The text

http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016

Module 3: Classical Loopshaping Design | Scilab Ninja

in legend for LF bound also shows (violated!). As a result, the

8 12

curve in Figure 6 violates its LF

bound, where it should be below the -40 dB level for all frequency less than 1 Hz.
So we need to design a new controller, obviously with more LF gain and higher bandwidth, to meet the specs.
To demonstrate the Bode gain-phase relationship, lets do something crazy by choosing a controller with only
proportional gain of 60000. Figure 7 shows the resulting

, with its magnitude curve above the LF

bound and below the HF bound as desired. Checking the phase margin, however, we see that the system now
has zero phase margin. The magnitude of

(and

) in Figure 8 also violates the stability bound. Can you

explain what happens?


Go back to the Bode gain-phase relationship statement. This static gain controller results in the slope of
equals -40 dB/decade at crossover frequency. So its phase is -180 degree; i.e., no phase margin left.
Simulate this system to verify that the step response should oscillate indefinitely.

Figure 7 plot of

versus bounds with static gain

http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016

Module 3: Classical Loopshaping Design | Scilab Ninja

Figure 8

and

9 12

versus bounds with static gain

So, to design a controller that meets all specs, the curve of

must be above the LF bound, pass the

crossover at slope -20 dB/decade (and maintain this slope for as wide frequency range as possible to achieve
enough phase margin), and roll off below the HF bound.
We recommend that the reader should first try shaping the loop by his/her own controller to understand the
concept. If you dont succeed or your patience run out, lshape.sce comes with a sample controller

(11)

Uncomment the lines that create this controller, and run the script to see Figure 9 and 10. The responses
versus all stability and performance bounds confirm that this controller meets all the specs. The system has
phase margin equal 55 degrees. The bandwidth is about 25 Hz.

http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016

Module 3: Classical Loopshaping Design | Scilab Ninja

Figure 9 plot of

Figure 10

and

10 12

versus bounds from controller (10)

versus bounds from controller (10)

Use the Xcos model lshapesim.zcos in Figure 11 to simulate time-domain responses. What we want to verify
in particular is design specs no 2 and 3; i.e., disturbance and measurement noise attenuation. The disturbance
and measurement noise signals are set to

and

, respectively.

http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016

Module 3: Classical Loopshaping Design | Scilab Ninja

11 12

Figure 11 lshapesim.zcos Xcos model for time-domain response simulation


So with disturbance attenuation of 0.01 and noise attenuation of 0.1, both signals should make the output
oscillates at magnitude 0.1. Figure 12 and 13 confirms that both the specs are met.

Figure 12 disturbance attenuation response of controller (12)

http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016

Module 3: Classical Loopshaping Design | Scilab Ninja

12 12

Figure 13 measurement noise attenuation response of controller (12)

Problems
1. Show that the relationship between phase margin

and the maximum peak of

is given by

2. Use lshape.sce to design a controller to achieve disturbance attenuation performance of 0.001 (-60 dB).
Other specs remain the same.
3. Design a controller to achieve disturbance attenuation of 0.01 (-40 dB) for frequency below 10 Hz. Other
specs remain the same. Explain if you are unable to get a controller that meets these requirements.

Supplement
Control design using Bode plots MIT OpenCourseWare
Scilab tips: we have not discussed some commands in the CACSD group that may be helpful, such as
g_margin and p_margin , which are quite convenient for computing gain and phase margins, respectively.
Read Scilab help for usage of such commands.
Scilab/files used in this module
lshape.sce Scilab script file for loopshaping design
lshapesim.zcos Xcos model file for time-domain simulation
module3.zip : all Scilab and Xcos files used in this module.

http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016

You might also like