Professional Documents
Culture Documents
Control System I
Control System I
Control System I
The Control System Toolbox provides algorithms and tools for the systematic analysis,
design and tuning of linear control systems. It accepts models in time and frequency
domain for 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 ti-
me 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 know-
ledge 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 degree program.
Representations of LTI systems
Theory of linear systems is a branch of applied mathematics and provides the mathema-
tical 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, capa-
citors, and inductors or mechanical systems composed of inertia/mass, damping (friction)
and springs.
The superposition principle (linearity property) postulates 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), exhibits 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 response merely delayed by ∆T . That is, if
the response due to input x(t) is y(t), then the response 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 h(t). The
output of the system y(t) for an arbitrary input x(t) is obtained by the convolution of the
input signal with the systems impulse response.
Z ∞
y(t) = x(t) ∗ h(t) = x(t − τ )h(τ )dτ (1)
−∞
Scientific Programming in Matlab
Version 1.0 Control System Toolbox I Page 2
where h(t) is the system’s response to an impulse signal x(t) = δ(t). The response y(t)
is obtained as a weighted average of the input function x(t) with the weighting function
h(−τ ) shifted by the time t. As t changes, the weighting function responds to different
parts of the input function.
This type of analysis is denoted as 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.
State-space models
A state-space representation models a dynamic system as a set of input, output and state
variables related by first-order differential equations. The term state space refers to the
space spanned by the state variables xi , merged into a state vector x = [x1 , . . . , xn ]. If
the continuous dynamical system is linear, time-invariant, and finite-dimensional, then
the differential and algebraic equations that form the state-space model may be written
in matrix form:
ẋ = Ax + Bu (2)
y = Cx + Du (3)
where the state matrix A, the input matrix B, the output matrix C, and the feed-
through D are matrices of appropriate dimensions, x is the state vector, and u and y are
the input and output vectors. The Figure 1 shows the block diagram representation of
the underlying linear state space differential and algebraic equations.
In case of SISO (single input, single output) systems the state-space model becomes
ẋ = Ax + bu (4)
y = c′ x + du (5)
where A is the n × n-system matrix, b and c are n × 1 input and output vectors and d
is a scalar. The remainder of this tutorial only considers SISO systems.
These Matlab commands support the design and analysis of LTI systems:
• ss: creates a state-space model, or converts other dynamic system models to state-
space models:
sys = ss(a,b,c,d)
where a,b,c,d are the system, input, output and the feed-through scalars respec-
tively. sys is an object of class @ss.
• step: generates the step response of a dynamic system. For the state space case,
zero initial state is assumed. When step is invoked with no output arguments, step
plots the step response.
• 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.
lsim(sys,u,t)
produces a plot of the time response of the dynamic system model sys to the input
time history u. The vector t specifies 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)
• gensig: generates customized input signals for the system. It supports the signal
forms sine wave (’sin’), square wave (’square’) and periodic pulse (’pulse’).
[u,t]=gensig(type,tau,Tf,Ts)
generates a scalar signal u of class type and with period tau (in seconds). Tf denotes
the time duration of the signal and Ts is the spacing between consecutive time
samples t.
• linearSystemAnalyzer: The interactive user interface for analyzing the time and
frequency responses of linear systems and comparing such systems is called with the
command:
linearSystemAnalyzer(sys)
Scientific Programming in Matlab
Version 1.0 Control System Toolbox I Page 4
– View and compare the response plots of SISO and MIMO systems, or of several
linear models at the same time.
– Generate time response plots such as step, impulse, and time response to ar-
bitrary inputs (see Figure 2). 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.
– Generate frequency response plots such as Bode, Nyquist, Nichols, singular-
value, and pole-zero plots (see Figure 2).
– Inspect key response characteristics, such as rise time, maximum overshoot,
and stability margins.
T ẋ + x = Ku (6)
characterized by the static gain K and the delay time constant T . Transform the
above equation into state space form
ẋ = ax + bu (7)
y = cx + d (8)
in that you compute the state-space model with scalars a, b, c and d in 8 in terms
of the original parameters K and T from:
a b c d
Generate the corresponding LTI system syspt1 with ss for the specific parameters
K = 1 and T = 2.
Figure 2: Linear system analyzer: step response and Bode diagram of two LTI systems
3) mandatory:
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
defined by
!
−1 −2
A = (11)
1 −1
!
1
b = (12)
0
c = (0 1) (13)
d = 0 (14)
polynomial is obtained from the determinant of the matrix sI −A. The poles coincide
with the eigenvalues of the matrix A and their location in the left or right half
complex plane determines whether the system is either unstable, asymptotically
stable or marginally stable.
Compute the eigenvalues si of the system matrix A with the command eig.
s1 s2
6) mandatory: Plot the step response of the second order LTI system syspt2.
7) mandatory: Generate the following input signals u(t) over the interval t ∈ [0, 10]
with a sample rate ∆t = 0.1 as vectors
8) mandatory: Plot the system response for the LTI system syspt2 over the interval
t ∈ [0, 10] for the following initial states and previously generated input signals.
!
1
• x01 = , u1 (t) = 0 (eigen motion)
0
!
0
• x02 = , u2 (t) = sin(t)
0
Scientific Programming in Matlab
Version 1.0 Control System Toolbox I Page 7
A transfer function represents the relation between the input and output of a linear time-
invariant system with zero initial conditions and zero-point equilibrium. For continuous-
time input signals x(t) and output y(t), the transfer function H(s) is the linear mapping
of the Laplace transform of the input, X(s) = L{x(t)}, to the Laplace transform of the
output Y (s) = L{y(t)}:
or
Y (s) L{y(t)}
H(s) = = (16)
X(s) L{x(t)}
A transfer function is defined by the numerator and denominator polynomial, where the
roots of the numerator correspond to the zeros of the LTI system and the roots of the
denominator to its poles.
An alternative representation is the specification in terms of zeros s0,i , poles sinf,i and
static gain k.
(s − s0,1 ) . . . (s − s0,m )
G(s) = k (19)
(s − s∞,1 ) . . . (s − s∞,n )
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
(s − 2)
G(s) = (20)
(s + 0.5 − 3.12i)(s + 0.5 + 3.12i)
The following Matlab commands support the definition of LTI systems in terms of transfer
functions and zero pole gain models:
sys = tf(num,den)
creates a continuous-time zero-pole-gain (zpk) model sys with zeros Z, poles P, and
gains K. sys is an object of class @zpk.
9) mandatory: Generate an LTI system with the Matlab function tf for the second
order SISO transfer function
K
G(s) = s2 2ξ
(21)
ω02
+ ω0
s +1
10) mandatory: Plot the system response for the LTI system over the interval t ∈ [0, 40]
with a sample rate ∆t = 0.1 for the input signal u(t) = cos(t).
note: in case of transfer function models you can not provide an initial state x0 for
the simulation with lsim.
11) mandatory: Convert the second order system described by the transfer function
in Eq. (21) to a state-space representation with ss and denote the system matrix
A, input vector b and output vector c in numerical form.
A = (22)
b = (23)
c = (24)
12) mandatory: Convert the state-space model in Eq. (24) into a zero-pole-gain repre-
sentation with zpk. Denote the poles s∞,1 , s∞,2 in numerical form.
s∞,1 = (25)
s∞,2 = (26)
Scientific Programming in Matlab
Version 1.0 Control System Toolbox I Page 9
• frd: A frd model sys with response data R specified at the frequency points in Freqs
can be created with the command
sys = frd(R,Freqs)
creates a Bode plot of the frequency response of a dynamic system model sys.
System Identification
The system identification 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 identification toolbox is beyond the scope of this
assignment.
• ssest: A state-space model using time or frequency domain data is estimated with
the command
sys = ssest(data,nx)
Scientific Programming in Matlab
Version 1.0 Control System Toolbox I Page 10
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.
14) optional: Identify a third order state-space model from the frequency response
model in the previous task with ssest.
15) optional: Generate the step response for the identified model.
16) optional: Superimpose the Bode plot of the identified 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 map is a graphical represen-
tation 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.
17) mandatory: Determine the poles (command pole), zeros (zero) and static gain
(dcgain) of the LTI system described by the transfer function
4s + 2
H(s) = (27)
s2 + 5.5s + 9
.
18) mandatory: Plot the pole zero map of the system with pzmap.
The following commands define serial, parallel and feedback interconnections of LTI sys-
tems:
sys = series(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 feedback transfer function H(s) becomes C(s) = 1+G(s)H(s) .
Analyzing Models
The Control System Toolbox allows you to analyze the time- and frequency-domain re-
sponses of one or more linear models using the LTI Viewer GUI (linearSystemanalyzer).
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:
The frequency response represents the response of a system to a stimulus in the frequency
domain. It is defined in terms of the magnitude and phase of the output signal as a
function of the frequency of the input signal. In other words, if the system is stimulated
with a sinusoidal input signal the response of a linear system is a sinusoidal signal at that
very same frequency but with a modulated magnitude and phase relative to the stimulus.
The magnitude of the frequency response is measured on a logarithmic scale in decibels
(dB) and the phase measured in radians or degrees, versus the frequency in radians/sec
or Hertz (Hz) of the stimulus. The frequency response is plotted either as:
• Bode (bode): generates two separate plots of magnitude and phase versus input
frequency
• 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
with frequency as a parameter
22) mandatory: Analyze the following closed loop model of the second order system
with the LTI viewer linearSystemAnalyzer.
1
G(s) = (1)
s2 +s+1
Determine the following characteristic in the time domain by inspecting the step
response plot.
Scientific Programming in Matlab
Version 1.0 Control System Toolbox I Page 13
• overshoot O =
• settling time ts =
• rise time tr =
• steady state yinf =