Beruflich Dokumente
Kultur Dokumente
1 13
Scilab Ninja
Control Engineering with Scilab
Like
Share
Share
http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016
2 13
http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016
3 13
Tracking Performance
From the comparison in Figure 2, we observe in the lowest gain case that the step response gradually rises to
the command level of 1. When the gain increases, the response is faster, but exceeds 1 further before settling
more in an oscillating fashion. The step responses from most dynamical systems behave quite the same. So
we can formulate time-domain parameters that can be used as control specifications like shown in Figure 3.
Consult an undergrad control text for definition of these parameters, some of them may have slight variants
among authors. For example, some may define rise time tr as the period the response goes from 0.1 to 0.9 of
the command value, while the settling time could be specified as the time the response stays within 0.05 or
0.02 of the command value.
http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016
4 13
(1)
, ,
correspond to the roots of its numerator and denominator, respectively. Certain feedback properties can be
determined from their locations. We will get back to this later.
At this point, let us do some trial and error design with the lead-lag compensator feedback diagram in Figure
4. Download leadlag_feedback.zcos, adjust the parameters
, ,
possible. Actually, there exists some design procedure for a lead-lag feedback system discussed in a standard
undergrad control textbook. At this point, consult one if you are hopeless. We will gradually learn about
control design after a few basics are made clear to the reader.
http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016
5 13
(2)
that yields the step response in Figure 5. Obviously, tracking performance is vastly improved, since now the
step response settles within 0.2 second, compared to 800 seconds when using only proportional gain.
(3)
http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016
6 13
Running the simulation with this compensator yields the response in Figure 6. This is an example of unstable
response, as the output oscillates out of bound. So, in the next section, we study in more detail this important
feedback property.
Closed-Loop Stability
We should have put this statement before anything else: a feedback system must be stable. An unstable
closed-loop system is not only useless, it can also cause harm to the operator and/or environment. Imagine an
output such as in Figure 6 would cause the robot arm to swing wildly and hit anything in the area.
As already well-known, for an SISO system like our DC motor robot joint, feedback stability can be checked
from the poles of a closed-loop transfer function. For a stable system, all such poles must lie in the left half of
complex plane. A system with pole(s) on the
marginally stable.
For example, in the diagram of Figure 4, the transfer function from
to
computed as
(4)
To form
in Scilab is straightforward
-->s=poly(0,'s');
-->P=syslin('c',1/(10*s^2+0.1*s));
-->C=syslin('c',20000*(s+0.01)/(s+100));
-->Tyr=C*P/(1+C*P)
Tyr =
2000
-------------2
2000 + 100s + s
http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016
7 13
plzr(Tyr)
which gives the plot shown in Figure 7. The poles are indicated by x symbol. (The round symbol marks the
origin of complex plane, not a zero, since this transfer function has none.) We conclude that the closed-loop
system is stable since all poles lie within the left half plane.
(2) to become
(5)
http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016
8 13
(6)
This transfer function is normally used in a few control design schemes such as classical method and QFT. It
is also used in the root-locus method. So we construct it in Scilab as before
-->C=syslin('c',20000*(s+0.01)/(s+100)^2);
-->L = C*P
L =
2000
---------------2
3
10000s + 200s + s
the poles travel towards the right half complex plane, resulting in closed-loop instability.
http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016
9 13
kmax =
1000.
on the
axis. The
reader should download leadlag2_feedback.zcos and verify that the output oscillates at this gain value.
Increasing the gain more should destabilize the system.
http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016
10 13
in the feedback
and plant output by d and y, respectively. So to compute attenuation level for the feedback model in Figure 9,
http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016
11 13
we need to derive the transfer function from the output disturbance to the plant output. With simple block
diagram manipulation, it can be shown this transfer function equals
(7)
This closed-loop transfer function is well-studied in control literature. It bears a specific name the sensitivity
transfer function, and is often denoted by capital letter
; i.e.,
(8)
So, to compute
in Figure 8, and display Bode magnitude plot, issue the following commands
-->s=poly(0,'s');
-->P=syslin('c',1/(10*s^2+0.1*s));
-->C=syslin('c',20000*(s+0.01)/(s+100));
-->L = C*P
L =
2000
-------2
100s + s
-->S=1/(1+L)
S =
2
100s + s
-------------2
2000 + 100s + s
-->gainplot(S)
This yields Figure 12. The phase of sensitivity function has no useful information so no need to plot it. Take a
note on the shape of sensitivity frequency system, which always looks more or less like this for a typical
system that has nonzero DC gain. Attenuation is good in the low frequency range, then the response goes to 0
dB as frequency increases. We will study how to formulate this curve as control specifications in later
module.
http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016
12 13
Summary
In this study module, we examine some important feedback properties, starting from step response in timedomain, which can be used to tune a commercial controller such as PID, or as specifications for custom
control design. The most important property of a feedback system is stability. We show how to determine
whether a system is stable by checking the poles of closed-loop transfer function. Root-locus is a technique to
observe how pole locations change as controller gain is adjusted. In the last section, we discuss disturbance
attenuation performance of a feedback system.
In the discussion, we explicitly give definitions for 2 important transfer functions, namely the loop transfer
function
in (6), and the sensitivity transfer function in (8). To anticipate the development in later
, is referred to as complementary
(9)
(9) is called an algebraic constraint. We will see in the next module how this relationship could make
feedback system design a challenge.
Supplement
http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016
13 13
leadlag_design.sce : a script file for lead-lag compensator design. Also plot frequency responses of
, and
http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016