Control System I
Control System I
Exercises from
Page 1
The following exercises are supposed to be solved with MATLAB. Students who do not
have their own license of the software may use of the computers in the Retina Pool.If you
do not have a Retina account yet obtain one at the following link:
http://www.retina.e-technik.tu-dortmund.de/cms/de/Account/index.html
the class. It is your obligation to notify the teaching assistant once you completed the
code and to present it to him. The code has to shown during the class, later submissions
by email or in person are not accepted.
The Control System Toolbox provides algorithms and tools for the systematic analysis,
design and tuning of linear control systems. It accepts models of linear time invariant
systems in terms of
transfer functions
state-space models
pole-zero-gain models,
frequency-response models
There are interactive tools and command-line functions for the visualization in both time and frequency domains. You can tune compensator parameters using automatic PID
controller tuning, Bode loop shaping, root locus method, LQR/LQG design, and other
interactive and automated techniques. You can validate your design by verifying rise time,
overshoot, settling time, gain and phase margins, and other requirements.
It is assumed that you have a profound background in system theory, in particular knowledge about representations of linear time invariant systems, feedback control design and
analysis in the time and frequency domain. This background knowledge is provided in the
course control theory of the program.
Exercise 1 :
Representations of LTI systems
Linear time-invariant system is a branch of applied mathematics and provides the mathematical foundation for engineering applications such as signal processing and control
system design. It investigates the response of a linear and time-invariant system to an
arbitrary input signal. Examples of LTI systems are electrical circuits composed of resistors, capacitors, and inductors or mechanical systems composed of inertia/mass, damping
(friction) and springs.
WiSe 2015/2016
Exercises from
Page 2
The superposition principle (linearity property) means that the relationship between the
input and the output of the system is a linear map. If input x1 (t), generates the response
y1 (t), and input x2 (t) generates y2 (t) then the scaled and summed input a1 x1 (t) + a2 x2 (t),
produces the scaled and summed response a1 y1 (t) + a2 y2 (t).
Time invariance refers to the fact that an input applied to the system at T = 0 or at a
later instance T = T produces the identical output merely delayed by T . That is, if
the output due to input x(t) is y(t), then the output due to input x(t T ) is y(t T ). In
other words the output does not depend on the particular time the input is applied.
Any LTI system is characterized completely by the systems impulse response. The output
of the system for an arbitrary input is obtained by the convolution of the input signal with
the systems impulse response. This type of analysis is denoted as the the time domain
point-of-view. An LTI system can be analyzed in the frequency domain in terms of its
transfer function, which is the Laplace transform of the systems impulse response. The
output of the system in the frequency domain is given by the product of the transfer
function and the transform of the input. In other words, convolution in the time domain
is equivalent to multiplication in the frequency domain.
The Control System Toolbox utilizes the following model representations in the time and
frequency domain for linear time invariant systems:
state-space models
transfer function
zero pole gain models
frequency response data models
(1)
(2)
where the state matrix A, the input matrix B , the output matrix C , and the feedthrough
D are matrices of appropriate dimensions, x is the state vector, and u and y are the input
WiSe 2015/2016
Exercises from
Page 3
and output vectors. The gure 1 shows the block diagram representation of the underlying
linear state space dierential and algebraic equations.
In case of SISO (single input, single output) systems the state space model becomes
x = Ax + bu
y = c0 x + du
(3)
(4)
where A is the n n-system matrix, b and c are n 1 input and output vectors and d is
a scalar. In the remainder of this tutorial we only consider SISO systems.
The following commands will be used in the next sections:
ss: creates a state-space model, or converts other dynamic system models to state-
step: generates the step response of a dynamic system. For the state space case,
space model: sys = ss(a,b,c,d) where a,b,c,d are the system, input, output and
the feed-through scalars respectively.
zero initial state is assumed. When it is invoked with no output arguments, step
plots the step response on the screen.
lsim: simulates the (time) response of continuous or discrete linear systems to arbi-
trary inputs. When invoked without left-hand arguments, lsim plots the response
on the screen.
lsim(sys,u,t) produces a plot of the time response of the dynamic system model
sys to the input time history t,u. The vector t species the N time samples for
the simulation. The vector u is N xM , where M is the number of system inputs.
lsim(sys,u,t,x0) further species an initial condition x0 for the system states.
gensig: generates customized input signals for the system. it supports the signal
forms sine wave ('sin'), square wave ('square') and periodic pulse ('pulse').
Exercises from
WiSe 2015/2016
Page 4
[u,t]=gensig(type,tau,Tf,Ts)
here, Tf:time duration of the signal, Ts: the spacing between the time samples t.
1) mandatory: Generate a state space model for a rst order linear system. A P T1
element is a proportional transfer element with a rst order delay described by the
dierential equation.
T x + x = Ku
(5)
characterized by the static gain K and the delay time constant T . Transform the
above equation into state space form
(6)
(7)
x = ax + bu
y = x
Generate the corresponding LTI system syspt1 for the specic parameters K = 1
and T = 2.
2) mandatory: Use linearSystemAnalyzer to analyze the LTI system syspt1 and
plot its step response, impulse response and bode diagram.
3) mandatory: The step response of a system in a given initial state consists of the
time evolution of its outputs when its control inputs are Heaviside (unit) step functions. In control theory, step response is the time behavior of the outputs of a general
system when its inputs change from zero to one in a very short time.
Plot the step response of syspt1 from the command line with step.
4) mandatory: Generate an LTI system syspt2 for the second order state space model
dened by
A =
b =
c =
d =
1 2
1 1
1
0
(0 1)
0
(8)
(9)
(10)
(11)
Exercises from
WiSe 2015/2016
Page 5
s2
1
0
0
0
WiSe 2015/2016
Exercises from
Page 6
Y (s) = H(s)X(s)
or
H(s) =
L{y(t)}
Y (s)
=
X(s)
L{x(t)}
(13)
X(s) = L{x(t)} =
x(t)est dt
(14)
A transfer function is dened by the nominator and denominator polynomial, where the
roots of the nominator correspond to the zeros of the LTI system and the roots of the
denominator to its poles. Example:
G(s) =
s+2
s2 + s + 10
(15)
An alternative representation is the specication in terms of zeros s0,i , poles sinf,i and
static gain k.
G(s) = k
(s s0,1 ) . . . (s s0,m )
(s s,1 ) . . . (s s,n )
(16)
The above transfer function has a unit gain k = 1, a zero at s0,1 = 2 and two conjugate
complex poles at sinf,{1,2} = 0.5 3.12i with a zero pole gain representation
G(s) =
(s 2)
(s + 0.5 3.12i)(s + 0.5 + 3.12i)
(17)
tor(s) and denominator(s) specied by num and den. The coecients of the numerator and denominator polynomial are provided as a vector, e.g. the polynomial
s3 + 3s + 2 is dened by the vector [1 3 2].
Exercises from
WiSe 2015/2016
Page 7
8) mandatory: Generate an LTI system with the Matlab function tf for the second
order SISO transfer function
G(s) =
K
s2
02
2
s
0
+1
(18)
11) mandatory: Convert the state space model in Eq. (11) into a zero-pole-gain representation with zpk. Denote the poles s,1 , s,2 .
s,1 =
s,2 =
(19)
(20)
WiSe 2015/2016
Exercises from
Page 8
Frequency response models (frd) store, manipulate, and analyze frequency response data. An frd model stores a vector of frequency points with the corresponding complex
frequency response data you obtain either through simulations or experimentally.
frd: sys = frd(R,Freqs) creates an frd model SYS with response data R specied
at the frequency points in Freqs. The output sys is an object of class @frd.
model sys.
12) optional: the frequency response data in AnalyzerData.mat provided from Matlab. The variables freq and resp contain 256 test frequencies and the corresponding
complex-valued frequency response points, respectively.
Generate a frequency response model from the data with and generate its Bode plot
System identication
System identication uses statistical methods to estimate mathematical models of dynamical systems from experimental data. The purpose of system identication is to generate
models of dynamic systems which structure and/or parameters are dicult to derive from
rst principles. Parameter identication employs time-domain and/or frequency-domain
input-output data to identify transfer functions and state-space models.
The system identication toolbox enables you to identify the parameters and structure
of linear and nonlinear models from experimental data in the time or frequency domain.
A complete coverage of the system identication toolbox is beyond the scope of this
assignment.
The following commands will be utilized:
cy domain data.
data is either an iddata object containing input and output signals in the time
domain or a frequency response model (frd) containing recorded frequency data.
The optional parameter nx denotes the order of the state space model.
13) optional: Identify a third order state space model from the frequency response
model in the previous assignment with ssest.
Exercises from
WiSe 2015/2016
Page 9
14) optional: Generate the step response for the identied model.
15) optional: Superimpose the Bode plot of the identied model with the original
frequency response of the frd model.
Model characteristics
The Control System Toolbox provides commands to query model characteristics such as
the I/O dimensions, poles, zeros, and DC gain. A pole zero plot is a graphical representation of a rational transfer function in the complex plane which conveys fundamental
properties of an LTI system such as stability, causal system / anticausal system, region
of convergence (ROC), minimum phase / non minimum phase.
16) mandatory: Determine the poles pole, zeros zero and static gain dcgain of the
LTI system described by the transfer function
H(s) =
s2
4s + 2
+ 5.5s + 9
.
17) mandatory: Plot the pole zero map of the system with pzmap.
(21)
Exercises from
WiSe 2015/2016
Page 10
Exercise 2 :
Interconnecting linear systems
You can perform arithmetics on LTI models, such as addition, multiplication or concatenation. Addition performs a parallel interconnection in terms of superposition of parallel
signals, multiplication performs a serial interconnection in that the output of the rst LTI
becomes the input to the second LTI.
The following command enable interconnections of LTI systems:
feedback: sys = feedback(sys1,sys2), generates a model object sys for the negative feedback interconnection of model objects sys1 and sys2.
For an open loop system with transfer function G(s) the closed-loop transfer function
G(s)
with unit feedback becomes C(s) = 1+G(s)
For an open loop system with transfer function G(s) the closed-loop transfer function
G(s)
.
with unit feedback transfer function H(s) becomes C(s) = 1+G(s)H(s)
1) mandatory: Assume an integrator with the transfer function
G1 (s) =
1
s
(1)
s+1
s+2
(2)
Compute the transfer function of the parallel and serial connection of the two systems.
2) mandatory: Assume an integrator with the transfer function
G(s) =
1
s
(3)
Exercises from
WiSe 2015/2016
Page 11
1
s
(4)
s+1
s+2
(5)
Exercise 3 :
Analyzing Models
The Control System Toolbox allows you to analyze the time- and frequency-domain responses of one or more linear models using the LTI Viewer GUI. The LTI Viewer is a GUI
for viewing and manipulating the response plots of linear models. It displays the following
plot types for linear models:
Step and impulse responses (step, impulse)
Bode and Nyquist plots (bode, nyquist)
Nichols plots (nichols)
Singular values of the frequency response
Pole/zero plots (pzmap)
Response to a general input signal (lsim)
Unforced response starting from given initial states (only for state-space models)
(lsim)
Exercises from
WiSe 2015/2016
Page 12
Nyquist (nyquist) : magnitude and phase are visualized in a single polar plot with
frequency as a parameter
Nichols (nichols) : magnitude and phase are visualized in a single Cartesian plot
1) mandatory: Analyze the closed loop model of the second order system from the
previous assignment with the LTI viewer linearSystemAnalyzer.
G(s) =
s2
1
+s+1
(1)
Determine the following characteristic in the time domain by inspecting step response.
overshoot O =
settling time ts =
rise time tr =
steady state yinf =
s2
1
+s+1
(2)