Control Systems Technology Lab Lecture N

Control Systems Technology Lab
Lecture Notes
Nicanor Quijano
The Ohio State University
Department of Electrical and Computer Engineering
2015 Neil Avenue, Columbus Ohio, 43210, USA
June 20, 2005

1

General Comments
• There are 9 laboratories, and each of them will cost 8% of the final grade (the pre-lab is 40% and the
lab-procedure is 60% of the total 8% for an specific lab). The final will be 28% of the final grade.
• The students will be rotated in different groups. Since we have eight students per section, the idea is
to rotate all of them in different groups, in order to avoid any kind of conflicts between them.
• Since in each lab the student will have a different partner, it is required to hand in a pre-lab per person.
However, the lab procedures required to be handed in the next session could be done independently or
per group.
• The last week of classes will be devoted to the final. This lab practical serves as a final examination
for ECE557. In this lab, we want to test the knowledge of the students in classical control design,
Simulink, and dSPACE. This final will be based on the knowledge acquired through the quarter, and

it is individual.
• The students should read the Lab manual before every lab session, and hand in the pre-lab assignment.
Sometimes, I will do a quiz at the beginning of the lab, asking simple questions regarding the lab
procedures and the last lab. I will announce these quices one week in advance.
• How should I save my files?? Normally all the students will have access to their z drive on the ECE
department. Therefore, the login will be the same as the one that any of the students does at CL260.
With the access to these drives, the students can save their files used in the lab, and also the data
necessary to generate a lab report.
• There are many ways to save data. One is described in the manual. There are others, and if you are
curious, you can go to Professor Kevin Passino’s webpage under ECE758, and you will see another
dSPACE tutorial developed before this one, and used for that course (see Section 4 for the URL).
• I am going to assume that nobody has any experience what is so ever with Simulink. For that, we are
going to start from the basics, and if you have any questions, let me know.

1

2

Laboratory 1


2.1

Introduction to Control Systems

The following sentences were extracted from [3, 2].
• Control engineering is based on the foundations of feedback theory and linear system analysis, and it
integrates the concepts of network theory and communication theory.
• The word “feedback” is a 20th century neologism introduced in the 1920s by radio engineering to
describe parasitic, positive feeding back of the signal from the output of an amplifier to the input
circuit.
• A control system is an interconnection of components forming a system configuration that will provide
a desired system response.
• Figure 1 shows the input-output relation that might exist between different blocks as it is shown.
Figure 1a) shows the open-loop configuration that utilizes an actuator in order to obtain a desired
response, but the process does not need a feedback such as the one shown in Figure 1b).
Input

Output

Actuating

device

Process

a) Open-loop system
Output
Controller

Comparison

Process

Input

Measurement

b) Closed-loop feedback system

Figure 1: Configurations.


2.2

History

The following selected historical developments of Control Systems is extracted from [3, 4].
• 1769: James Watt’s steam engine and governor is developed.
• 1868: Maxwell formulates a mathematical model for a governor control of a steam engine.
• 1927: Bode analyzes feedback amplifiers.
• 1932: Nyquist develops a method for analyzing the stability of systems.
• 1948: Evans developed the root locus technique.
• 1954: George Devol develops “programmed article transfer.” considered to be the first industrial robot
design.
• 1970: State variable models and optimal control developed.
• 1980: Robust control system design widely studied.
• 1994: Feedback control widely used in automobiles.
2

2.3

Laboratory Procedures


In the first lab we use Simulink and dSPACE in order to identify a simulated unknown transfer function.
For that, we use frequency domain system identification methods, in order to identify a second order system
in the form
kwn2
G(s) = 2
s + 2ζwn s + wn2
where k is the DC gain, ζ is the damping ratio, and wn is the undamped natural frequency. The transfer
function G(s) is the relationship in frequency domain between the output C(s), and the input R(s), in
Figure 2.

R(s)

G(s)

C(s)

Figure 2: Single open-loop system. R(s) is the input, C(s) is the output, and G(s) is the transfer function
that relates both input and output, everything in the frequency domain.
Without loss of generality, we will assume in the following analysis that k = 1. Figure 3 shows an

example of the frequency response of G(s). In this figure, we can see four important values: Mpw that is
the maximum magnitude, and it occurs at the resonant frequency wr ; also, we have that the system has a
bandwidth wB , when the magnitude reaches -3 dB. This bandwidth wB is “a measure of a system’s ability to
faithfully reproduce an input signal” [3]. Normally, this value is related to how fast the system can respond.
If wB increases, the rise time of the system will decrease. The maximum magnitude Mpw is related to the
overshoot of the system to a step input (shown in Figure 4), and hence its value is closely related to the
damping ratio ζ. If ζ ≤ √12 , then the magnitude Mr = Mpw can be computed as
Mr =

1




1−

ζ2

1
, ζ≤√

2

where the units of Mr = Mpw are not in dB. If k is not equal to 1, then the magnitude of resonance is not
anymore Mpw , but instead, it is the difference between Mpw and M0 = 20 log10 k, i.e., Mr = Mpw − M0 . To
compute wn when ζ ≤ √12 , we can use directly the resonance frequency wr , because this is related to the
undamped natural frequency through
wr = wn


1
1 − 2ζ 2 , ζ ≤ √
2

As an example of what we have described so far, let us see how we can determine the values for G(s)
24.4
in Figure 3. From this figure, we can see that wr = 0.5rad/sec, and that Mpw = 24.4dB = 10 20 = 16.6.
1
Therefore, applying the previous formulas, assuming that ζ ≤ √2 , we obtain
4Mr2 ζ 4 − 4Mr2 ζ 2 + 1 = 0
Solving this equation, we find that the roots are 0.9995, −0.9995, 0.0300, and −0.0300. Since the equation

is valid only for ζ ≤ √12 , we conclude that in this case ζ = 0.03. Finally, solving for wn , we have that
wn = 

wr
1−

2ζ 2

1
, ζ≤√
2

which finally gives that wn = 0.5. Clearly, these results are consistent with the plot shown in Figure 3.
But, in the lab, how could we obtain a bode plot? Well, the idea is to do a frequency sweep. The
system that was originally used in the lab needed a frequency range specified in page 14. However, I have
changed the so called “black box,” and instead of using these values for the frequency, we are going to use
the following ones: [0.1; 0.4; 0.7; 0.9; 1; 1.1; 1.3; 1.6; 1.9; 2.5; 3; 5; 10; 20; 30]. The idea is to use a sine wave as
3

Bode Diagram

30

20logMp

w

20
10
0

3 dB

Magnitude (dB)

10
20
30
40
50
600


wr

wB

Phase (deg)

45

90

135

180
10

1

0


1

10

10

Frequency (rad/sec)

Figure 3: Magnitude and phase characteristics for the second-order system G(s) =

0.25
s2 +0.03s+0.25 .

Step Response
2

1.8

1.6

1.4

Amplitude

1.2

1

0.8

0.6

0.4

0.2

0

0

50

100

150

200

250

300

350

400

Time (sec)

Figure 4: Step response for the second-order system G(s) =

0.25
s2 +0.03s+0.25 .

an input to this black box, and from dSPACE, we change the frequency of the sine wave every run, and we
save the data just obtained. Then, we can draw a magnitude bode plot with these values, and we are going
to obtain a figure similar to the on in Figure 3.
There is something that is not mentioned in the procedures. You have to add a RadioButton in the
ControlDesk of dSPACE in order to control the state of the simulation. On the “Tool window,” you will
find the “Variable list” associated to the elements in your Simulink model. There, you will find the variable
“simState” that you will drag and drop on the RadioButton developed to control the state of the simulation.
Once you do that, double click on this element, and change the states in order that you associate “STOP”
to a 0 state, and the state 2 to “START.” The state corresponding to 1 is “PAUSE” but you will not need

4

to pause the experiment. This RadioButton will allow the user to start and stop the experiment whenever
he/she wants. It is better to do that, because the user will know exactly when the experiment started, and
also it helps to have a complete set of data saved.

3
3.1

Laboratory 2
SAMPLING

“In the context of control and communication, sampling means that a continuous-time signal is replaced by
a sequence of numbers, which represents the values of the signal at certain times.” [1].
In general, from Figure 5 [1], we have that the continuous signal y(t), that is produced by the process, is
sampled and converted into a sequence of numbers by means of the ADC. After an algorithm or a decision
process is taken into account, we take the output (that is again a sequence of numbers), and we need then
to convert these numbers into a continuous signal. This reconstruction process is done via the DAC.
u(t)

y(t)

t

t
PROCESS

HOLD
SAMPLER

D/A

A/D

COMPUTER

u[n]

y[n]

t

t

Figure 5: Process of taking a continuous-time signal y(t) that is generated by a process, and convert it into
a sequence of numbers y[n]. The computer takes a decision that is converted into a sequence of numbers
u[n], which in turn is converted into the continuous-time signal u(t) that enters into the process.

We know that “very little is list by sampling a continuous-time signal if the sampling instants are sufficiently close, but much of the information about a signal can be lost if the sampling points are too far
apart.” [1].
When we sample a given signal, we are creating at the same time signals with different frequencies. Let
us say that we sample a signal at a frequency
ws =


Ts

where Ts is the sampling period. The new frequencies generated after the sampling are given by
wSa = kws ± w
where wSa is the sampled frequency, w is the frequency of the original signal that we sampled, and k is an
integer number.
This phenomenon, when we create new frequency components when we sample, is called ALIASING.
When we have that the sampling frequency ws is at least twice the bandwidth wN of the original signal,
5

then there is no loss of information between the original signal and the sampled one. Mathematically this
is known as the Nyquist sampling theorem, where wN is know as the Nyquist frequency, and normally is
defined as wN = w2s .
“After sampling, a frequency thus cannot be distinguished from its aliases. The fundamental alias for a
frequency w1 > wN = w2s is given by
w = |(w1 + wN )mod(ws ) − wN |
where mod(x, y) = x − f loor( xy ).y.
Example: f1 = 0.1 Hz,f2 = 0.9 Hz, fs = 1 Hz. One of the aliasing frequencies for f2 is given at
f = |mod(1.4, 0.5) − 0.5| = |0.4 − 0.5| = 0.1!!!
Figure 6 (taken from [1]) shows this effect, by using two different signals x1 (t) = sin(2πf1 t) and x2 (t) =
−sin(2πf2 t), with the given frequencies. This is an excellent example of who aliasing can affect the perfect
reconstruction of the signals.
1

0.8

0.6

0.4

0.2

0
−0.2
−0.4
−0.6
−0.8
−1

0

1

2

3

4

5

6

7

8

9

10

Figure 6: In this figure we see that two signals x1 (t) = sin(2πf1 t) (dashed), and x2 (t) = −sin(2πf2 t) (solid).
If we sample both signals with a period of 1 second, the value after the sampling will be the same at all
sampling instants.

4

Laboratory 3

This laboratory is self explanatory, and it does not require a lot of theory to develop previous the practice.
However, we are going to consider a small change in the procedure to make the lab more efficient. The
following changes have to be implemented during the practice.
• In page 37 of the laboratory procedures, they say that the simulation time should be 8 seconds. Instead
of using this value, we are going to use “inf” for the “Stop time” on the “Solver” tab for the “Simulation
Parameters.”
By using that, you are saying that the simulation can run all the time. To avoid that the process runs
forever, we are going to add some extra blocks to the Simulink model.
6

• On page 38, remember to set at 0 Volts the termination of DAC.
• At the end of page 38, they ask you to change the step input time to 7 seconds, and compile the model
in order to acquire that value and run the experiment again. This is one way to do it, but clearly it is
quite inefficient. What we are going to do is to add a couple of extra blocks as it is shown in Figure 7.

|u|
Clock

Abs

7.5
Stop time

>=

STOP

Relational
Operator

Stop Simulation

Figure 7: This is the Simulink model of the elements that have to be added in Figure 3.6 to make more
efficient your experiment.
As you can see, here we are adding five elements that will allow you to change the stop time from
dSPACE. Therefore, instead of changing the step input from the step function, we are going to stop
the simulation at the value given by the block “Stop time.” This block is a constant, hence you can
associate a numeric input in the ControlDesk of dSPACE in order to change this value. The idea is
that we do not need to compile the whole model again, that is a time consuming task.
• As in the other labs, there is something that is not mentioned in the procedures. You have to add a
RadioButton in the ControlDesk of dSPACE in order to control the state of the simulation. On the
“Tool window,” you will find the “Variable list” associated to the elements in your Simulink model.
There, you will find the variable “simState” that you will drag and drop on the RadioButton developed
to control the state of the simulation. Once you do that, double click on this element, and change
the states in order that you associate “STOP” to a 0 state, and the state 2 to “START.” The state
corresponding to 1 is “PAUSE” but you will not need to pause the experiment.
For another tutorial on dSPACE besides the one that you have in your lab procedure, go to:
http://www.ece.osu.edu/˜passino/dSPACEtutorial.doc.pdf

5

Laboratory 4

There are many references where we can learn the basics for the root locus analysis. In the next few lines,
we are going to take the ideas in [5].

5.1

STEADY-STATE ERRORS IN UNITY FEEDBACK CONTROL SYSTEMS

One useful way to characterize control systems, and that is the ability that the open loop transfer function
has in order to follow different inputs (e.g., step input, ramp input, parabolic input, etc.). As we are going
to see, the characterization of the systems in terms of the response of different inputs is useful in order to
determine the magnitudes of the steady-state errors. In general, we have that the open loop transfer function
G(s) has the form
(s + z1 )(s + z2 ) . . . (s + zm )
G(s) = K N
s (s + p1 )(s + p2 ) . . . (s + pn )
We say that a system is of type 0, 1, 2, . . . if N = 0, 1, 2, . . .. The important thing is that if we increase the
type number, then the accuracy is improved. However, increasing the type number generates some stability
problems.

7

For instance, if we have the block diagram in Figure 8, we know that we can write the following transfer
functions
G(s)
C(s)
=
R(s)
1 + G(s)
E(s)
1
=
R(s)
1 + G(s)
where R(s) represents the Laplace transform of the input, C(s) represents the Laplace transform of the
output, E(s) represents the Laplace transform of the error, and G(s) represents the Laplace transform of
the process. Therefore, the steady-state error is given by the final value theorem, we have that
ess = lim e(t) = lim sE(s) = lim s
t→∞

s→0

s→0

R(s)
1 + G(s)

Table 1 summarizes the steady-state errors for different inputs, and different type numbers.
ess
Type 0
Type 1
Type 2

Step Input r(t) = u(t)
1
1+K

Ramp Input r(t) = t

1
K

0
0

Parabolic Input r(t) = t2


1
K

0

Table 1: Steady-state errors for different inputs.

R(s)

+

E(s)

C(s)
G(s)

-

Figure 8: Block diagram for a unity feedback control system loop.

5.2

ROOT LOCUS ANALYSIS

Suppose that we have a system in the form of Figure 9, where the transfer function G(s) has a parameter
K that represents the gain of the controller. This parameter is strictly positive, otherwise we would have
a positive feedback case, which will lead us to change the angle condition in the next analysis. Therefore,
without loss of generality, we are going to assume in what remains that K > 0.

R(s)

+

E(s)

C(s)
G(s)

-

H(s)
Figure 9: Block diagram for a feedback control system.

8

The transfer function of the system is given by
G(s)
C(s)
=
R(s)
1 + G(s)H(s)

(1)

And, from here, we obtain the characteristic equation given by,
1 + G(s)H(s) = 0

(2)

We can rearrange Equation (2) in order to let the parameter of interest appearing as the multiplying factor
in the form
(s + z1 )(s + z2 ) . . . (s + zm )
1+K
=0
(s + p1 )(s + p2 ) . . . (s + pn )
where n > m, and of course, K > 0 is the parameter of interest. This method is also applicable to systems
that have parameters of interest other than the gain.
Basically, we have to follow a couple of steps in order to draw a root-locus. These steps are:
1. First, we need to locate the poles and zeros of G(s)H(s) on the s plane. Normally we draw the poles
with an x and the zeros with o.
2. Now, we start drawing the root loci on the real axis. Since the angle contribution of the complexconjugates poles and zeros of G(s)H(s) is 360◦ on the real axis. Then, we need to look only the poles
and zeros on the real axis. For that, we take a test point on the real axis, and if the total number of
poles and zeros to the right of this test point is odd, then this point lies on a root locus.
3. Now, we determine the asymptotes of root loci
σa = −




pi − z i
n−m

180(2k + 1)
n−m
where n is the number of finite poles of G(s)H(s), m is the number of finite zeros of G(s)H(s), and
k = 0, 1, . . . , n − m − 1.
β=±

4. The breakaway and break-in points can be found in the following ways:



1
1
=
σ b + pi
σ b + zi

or, suppose that the characteristic equation is given by
B(s) + KA(s) = 0
From this characteristic equation, we can derive the breakaway and break-in points by solving the next
equation
dK
B ′ (s)A(s) − B(s)A′ (s)
=−
ds
A2 (s)
5. Determine the angle of departure, θDep (angle of arrival, θArr ) of the root locus from a complex pole
(at a complex zero, respectively)


θDep = 180 −
αp +
αz
θArr = 180 −



αz +



αp

where αp and αz are the angles corresponding to the complex poles and zeros, respectively.
9

6. Now, we need to find the points where the root loci cross (or may cross) the imaginary axis. For that,
we use the Routh-Hurwitz’s stability criterion, and then, setting s = jw in the characteristic equation,
we solve the equations for the real and imaginary components, and obtain the w and K values. These
values will give us the frequency w where the root loci cross the imaginary axis, and the critical gain
K that will give us this result.
7. Now, in order to get a better sketch of the root locus, we need to take a couple of test point.
Some of the cases for the root locus can be seen in Figures 10 to 15.
Root Locus Editor (C)
20

15

10

Imag Axis

5

0

−5

−10

−15

−20
−30

−25

−20

−15

−10
Real Axis

−5

0

5

Figure 10: Root locus for the transfer function G(s) =

10

1
s3 +15s2 +50s .

Root Locus Editor (C)
15

10

Imag Axis

5

0

−5

−10

−15
−15

−10

−5
Real Axis

0

Figure 11: Root locus for the transfer function G(s) =

10

5

1
s3 +30s2 +325s+1250 .

Root Locus Editor (C)
2

1.5

1

Imag Axis

0.5

0

−0.5

−1

−1.5

−2
−4

−3

−2

−1

0
Real Axis

1

2

3

Figure 12: Root locus for the transfer function G(s) =

4

1
s4 +4s3 +6s2 +4s .

Root Locus Editor (C)
4

3

2

Imag Axis

1

0

−1

−2

−3

−4
−4

−3

−2

−1

0
Real Axis

1

2

Figure 13: Root locus for the transfer function G(s) =

6

3

4

1
s4 +6s3 +18s2 +24s+16 .

Laboratory 5

There are many references where we can learn the basics for the lag compensator. In the next few lines, we
are going to take the ideas in [3].

6.1

GENERAL COMMENTS

• Bode design method does not eliminate steady-state error because it only deals with improving the
phase margin of the system; in order to eliminate steady-state error, a gain is needed with the compensator and this is done in the root locus design method.
• The goal of this experiment is to perform lag control and therefore there is no need to achieve fast
11

Root Locus Editor (C)
40

30

20

Imag Axis

10

0

−10

−20

−30

−40
−40

−30

−20

−10

0

10

20

30

Real Axis

Figure 14: Root locus for the transfer function G(s) =

1
s4 +30s3 +250s2 +1000s .

Root Locus Editor (C)
20

15

10

Imag Axis

5

0

−5

−10

−15

−20
−40

−30

−20

−10
Real Axis

0

Figure 15: Root locus for the transfer function G(s) =

10

20

s+20
s4 +25s3 +200s2 +750s .

settling time, therefore aggressive gains should be avoided in favor of a small gain that assures only
steady-state error. The gain should not exceed a value of 5!!

7

FINAL ECE 557
• The idea of the lab final is to evaluate most of the concepts that the students learned during the
quarter.
• Each student will have one hour and a half to develop the test, that will consist on theoretical and
practical questions. These questions are closely related to the concepts developed on the pre-lab and
the lab procedures. Each student is allowed to bring ONE cheat sheet with all the information that
12

he/she considers important. This sheet will be handed in at the end of the exam.

References
[1] Karl J. Åström and Björn Wittenmark. Computer Controlled Systems. Prentice Hall, New Jersey, NJ,
1997.
[2] Stuart Bennet. A brief history of automatic control. IEEE Control Systems Magazine, 16(3):17–25, June
1996.
[3] Richard C. Dorf and Robert H. Bishop. Modern Control Systems. Addison-Wesley, Reading, MA, 1995.
[4] Gene F. Franklin, J. David Powell, and Abbas Emami-Naeini. Feedback Control of Dynamic Systems.
Addison-Wesley, Reading, MA, 1994.
[5] Katsuhiko Ogata. Modern Control Engineering. Prentice Hall, New Jersey, NJ, 2001.

13