Control System II
Control System II
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 the ti-
me and frequency domain. 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 master degree program.
PID Control
A proportional-integral-derivative controller (PID controller) is, due to its simplicity, still
widely employed for feedback control in industrial applications. The PID control rests
upon the residual error between a measured output of a process and a desired reference
signal. The control objective is to minimize the regulation error by adjusting the control
input based on the error signal.
The PID controller transfer function is composed of a proportional (P), integral (I) and
derivative (D) action with separate gains. The proportional term P depends on the present
error, the I action on the accumulated errors, and the action D responds to the rate of
change in error. The overall control action results from the weighted sum of these three
components with associated proportional gain Kp , integral gain Ki and derivative gain
Kd .
Z t
d
u(t) = Kp e(t) + Ki e(t)dt + Kd e(t) (1)
0 dt
C = pid(Kp,Ki,Kd,Tf)
3) mandatory: Generate the closed loop system by a serial connection (series) of the
controller and the process in conjunction with a unit feedback loop (feedback). Plot
the step response of the closed loop system and determine its, rise time, overshoot
and settling time with the command stepinfo.
PID controller tuning adjusts the control parameters (proportional, integral gain and
derivative gains) in order to optimize the closed loop control response, typically with
respect to the step response. Stability of the closed loop is a minimal requirement, but
additional criteria such as rise time, overshoot, settling time and steady state error in the
time domain or bandwidth, phase margin in the frequency domain are specified. Notice,
that these objectives are in general conflicting each other, for example a reduction in rise
time causes an increase in overshoot. Additional constraints are imposed by the available
magnitude of the control signal (saturation), which are violated in case of large errors and
gains. Therefore PID tuning, even though there are only three parameters which are easy
to interpret, remains complex as the criteria are in conflict.
The table shows the effects on the performance criteria when increasing the parameters
Kp ,Ki ,Kd independently.
Parameter Rise time Overshoot Settling time Steady-state error Stability
Kp Decrease Increase Small change Decrease Degrade
Ki Decrease Increase Increase Eliminate Degrade
Kd Minor change Decrease Decrease No effect Improve
In manual tuning first set Ki = 0 and Kd = 0. Increase the proportional gain Kp until the
output of the loop oscillates, then Kp should be set to approximately half of that value to
obtain a quarter amplitude decay type of response. Now increase Ki to compensate the
steady state error. Finally increase Kd (and possibly Kp ) to reduce the overshoot. Report
the rise time, settling time and overshoot (stepinfo).
Manually tune the PID controller C(s) by following the 3 steps listed below:
Scientific Programming in Matlab
Version 1.0 Control System Toolbox II Page 3
4) mandatory: Determine the critical (ultimate) proportional gain Ku and the os-
cillation period Pu at which the closed loop system becomes unstable. Then set
Kp = 0.5Ku to half of that value.
5) mandatory: Add an integral action to the PID controller to compensate the steady
state error. Increase the integral gain Ki of the PID controller to compensate the
steady state error with a settling time ts < 10s.
Ziegler Nichols constitutes a heuristic tuning method. As in manual tuning the Ki and
Kd gains are first set to zero. The proportional gain Kp is increased until it reaches the
critical (ultimate) gain, Ku , at which the output signal of the closed loop systems starts
to oscillate. The gains Kp , Ki , Kd of a P, PI or PID controller are determined w.r.t to the
ultimate gain Ku and the oscillation period Pu according to the following table.
controller type Kp Ki Kd
P 0.5Ku - -
PI 0.45Ku 1.2Kp /Pu -
PID 0.60Ku 2Kp /Pu Kp Pu /8
7) mandatory: Set the PID gains according to the Ziegler-Nichols heuristic and eva-
luate the closed loop response in terms of rise time tr , settling time ts and overshoot o
with stepinfo.
Use the PID Tuner GUI (pidTuner) to interactively design a SISO controller in the
feed-forward path of single-loop, unity-feedback control configuration. The PID Tuner
automatically designs a controller for your plant. You specify the controller type (P, I, PI,
PD, PDF, PID, PIDF) and form (parallel or standard). You can analyze the design using
a variety of response plots, and interactively adjust the design to meet your performance
requirements.
The closed loop response is assumed to comply with the following requirements:
• overshoot : o < 12 %
8) mandatory: Launch the PID tuner pidTuner to first design and tune a PI controller
for the closed loop system. What are the initial rise time, settling time and maximum
control signal? Hint: Open the window of characteristics in table form with the
button show parameters.
tr =
ts =
umax =
Reduce the rise time to ts < 2 s with the slider response time for interactive tuning.
What is the effect on the settling time? Apparently, it is not possible to meet all of
the specifications merely with a PI controller.
9) mandatory: Change the controller type to PIDF and try to meet the requirements
by tuning the closed loop response with the sliders response time and transient
behavior.
11) optional: Generate the feedback control system using serial (series) and feedback
(feedback) interconnection. Simulate (lsim) the response of the closed loop system
for a square signal (gensig) with a period T = 1 seconds.
SISO Tool
The SISO Design Tool provides the following components and tools
• The SISO Design Task Node is a user interface (UI) that facilitates the design
of compensators for single-input, single-output feedback loops through a series of
interactive panes.
• The Graphical Tuning Window, a graphical user interface (GUI) for displaying and
manipulating the Bode, root locus, and Nichols plots for the controller currently
being designed.
• A tool that automatically generates compensators using PID, internal model control
(IMC), or linear-quadratic-Gaussian (LQG) methods.
The SISO Design Tool supports, amongst others the following tasks and methods in
feedback control system design.
• Add compensator poles and zeros, lead/lag networks and notch filters.
A complete treatment of the SISO tool is beyond the scope of this tutorial, which merely
covers its most basic aspects and functionalities.
12) mandatory: Open the SISO Tool sisotool with the plant model from the previous
assignment.
13) mandatory: Determine the rise time of the closed loop step response (r→y) for a
unit feedback Gain (C=1).
14) mandatory: Determine the gain margin in the Bode plot (r→y) for a unit feedback
Gain (C=1).
15) mandatory: Convert the exported PIDF controller designed with the PID tool into
transfer function representation (tf). Import the PIDF controller (Architecture
-> System Data -> C) as the compensator.
16) mandatory: Include the following design requirements in the root locus plot and
verify that the closed loop poles comply with them.
Modify the gains as to move the closed loop poles to a valid region.
Scientific Programming in Matlab
Version 1.0 Control System Toolbox II Page 6
17) mandatory: Observe the step response of the closed loop system (r→y) (Analyis
Plots).
18) optional: Zoom in on the dominant poles and zeros of the closed loop system closest
to the origin of the root locus plot. Modify the closed loop gain in the root locus
plot by dragging the poles or zeros in the bode plot and observe the impact on the
step response (r→y).
19) mandatory: Automatically tune the PID controller using a classical design formu-
la such as Ziegler-Nichols method or Chien-Hrones-Reswick ( Tuning methods ->
PID Tuning: Tuning method: Classical Design Formulas -> Formula)
Pole Placement
Full state feedback, or pole placement, is a method employed in feedback control system
theory to place the closed-loop poles of a plant in predetermined locations in the complex
plane. Placing poles is desirable because the location of the poles corresponds directly
to the eigenvalues of the system, which control the characteristics of the response of the
system. In order to apply the method the plant has to be controllable. Given the state
space representation of a SISO (single input, single output) system
ẋ = Ax + bu (1)
y = c⊺ x (2)
where A denotes the n × n-system matrix, b and c are n × 1 vectors. A state feedback
controller
u = −k⊺ x (3)
with the n × 1 gain vector k is based upon a linear mapping between the state x and the
control u.
k = rank(A)
calculates the controllability matrix of the LTI state-space model sys. This syntax is
equivalent to executing:
Co = ctrb(sys.A,sys.B);
calculates the observability matrix of the state-space model sys. This syntax is equivalent
to executing:
Ob = obsv(sys.A,sys.C);
places the desired closed-loop poles p by computing a state-feedback gain matrix K. All
the inputs of the plant are assumed to be control inputs. The length of p must match the
row size of A.
Consider a state-space system defined by (A,B,C,D) with two inputs, three outputs, and
three states. You can compute the feedback gain matrix needed to place the closed-loop
poles at p = [-1 -1.23 -5.0] for an open loop system matrix A and input matrix B by
p = [-1 -1.23 -5.0];
K = place(A,B,p);
20) mandatory: Convert the plant from the previous assignment into a state space
representation (ss) and verify the controllability by computing the rank (rank) of
the controllability matrix (ctrb) depending on A and b.
21) mandatory: Compute a feedback gain k that places (place) the poles of the closed
loop system at [−2, −3 + i, −3 − i].
22) mandatory: Generate the closed loop system
ẋ = (A − bk)x + bu (4)
y = c⊺ x (5)
Scientific Programming in Matlab
Version 1.0 Control System Toolbox II Page 8
with ss and analyze the response for an initial state x0 = [0 0 1] without stimulus
(u = 0, t = 0) with lsim.
23) optional: You cannot implement the state-feedback law unless the full state x is
measured. In practice it is often difficult if not impossible to measure the full state x.
However, one can construct a state estimate such that the law retains similar pole
assignment and closed-loop properties. You achieve this goal by designing a state
estimator (or observer). Verify observability by computing the rank (rank) of the
observability matrix (obsv) depending on A and c.
24) optional: Use pole placement (place) to determine the state estimator gain l. The
poles of the estimator are supposed to be faster than those of the feedback control
loop. Place (place) the poles of estimator with system matrix A and output vector c
at [−4, −4 + i, −4 − i].
and L are typically designed using pole placement or LQG techniques. Generate a
state feedback controller with a state estimator (reg) according to the state-space
model of the plant, the state-feedback gain vector k, and the estimator gain vector l
computed with pole placement in the previous assignment. This yields the overall
regulator:
26) optional: Analyze the response for an initial state x0 = [0 0 1] without stimulus
(u = 0, t = 0) with lsim.