Professional Documents
Culture Documents
1 12
Scilab Ninja
Control Engineering with Scilab
Like
Share
Share
(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
2 12
approach. In essence, we will perform frequency response shaping on the loop transfer function
to
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
and
. But this
(7)
i.e., when
approaches 0,
goes to 1, and vice versa. This conflict suggests that some tradeoffs
http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016
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.
and
and
. It is more convenient to
. So, in the above situation, we
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
distance, the poorer stability margin of the system. The circle in Figure 2 represents the magnitude
. Hence, when
, the curve of
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.
http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016
4 12
and
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
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:
MID: since
implies
, we have
; i.e., the bound on
. Hence
is created by inverting the bound on
implies
. For a stable,
in MID
, we have
; i.e., the bound on
. Hence
is the same as the bound on
implies
http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016
Figure 3 bounds on
5 12
and
Figure 4 bounds on
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
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
6 12
Example: let us design a controller for our same old robot joint driven by DC motor developed since the first
module
(9)
2.
below 1 Hz
3.
above 100 Hz
4.
(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
Figure 5 plot of
Figure 6
and
7 12
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
8 12
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
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
Figure 7 plot of
http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016
Figure 8
and
9 12
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
Figure 9 plot of
Figure 10
and
10 12
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
11 12
http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016
12 12
Problems
1. Show that the relationship between phase margin
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