ME5012 Electronic Systems, Control and Computing - Assessment Coursework
Design of Feedback Controllers
Laboratory Exercise II (Two Sessions)
This exercise should be run in MATLAB 2019 or later versions. It makes use of the MATLAB Control
Toolbox.
Create a folder located in your Desktop named CLA50124.
Introduction
The procedure for designing industrial control systems can be broken down into the following stages:
i) Study system to be controlled - choose sensors and actuators
ii) Model resulting system to be controlled
iii) Linearize model.
iv) Simplify model if necessary
v) Analyze the resulting model, determine its properties
vi) Decide on performance specifications, decide on type of controller to be used
vii) Design controller to meet specifications
viii) Test controllers by simulation with full non-linear model of the plant
ix) Design hardware and software and implement controller
x) Tune controller on-line if necessary
The objective of the laboratory exercise is to use various techniques to analyse and design feedback
controllers for a simple system, that is to perform stages (iv) and (vi) of the above procedure.
You will design controllers for a simple plant modelled as a 3rd order system, G(s), of the form
k
G(s) =
s(T1s + 1)(T2s + 1)
The objective of the design is to obtain a feedback controller which achieves the performance specifications
on the step response of Mp ≤ 12% and tp ≤ 0.4 sec, with zero steady state error.
After system modelling and linearization, the next stage in the control system design procedure is to perform
some analysis of the plant. In this exercise, the analysis consists of looking at the open loop poles and zeros,
the open loop step response, the plant Bode plot and root locus. By means of the Bode plot, some stability
analysis on the system is also be performed to find out limiting values of controller gain.
For the controller design stage of this exercise, proportional controllers are designed using Bode plots. In
addition, a P+D controller is designed.
Figure 1: Closed loop system with proportional controller
1
ME5012 Electronic Systems, Control and Computing - Assessment Coursework
1. Analysis of the plant
NOTE - ALL THE OTHER SECTIONS OF THIS LABORATORY DEPEND UPON THE COMPLETION AND RESULTS
OF THIS SECTION.
Question 1.1 Using the formula from your notes, calculate the minimum damping ratio of the dominant
poles for an overshoot of Mp ≤ 12%. Show all of your working out.
Question 1.2 Using the formula from your notes, calculate the minimum damped frequency,
2
ω d = ω n 1− ζ , of the dominant poles for a peak time tp ≤ 0.4 sec.
Each student will use a different value of k, T1 and T2 to obtain the plant that will be used in this exercise.
Please ensure that you use your given values which are available in a file titled “Individual Values 2022”
on the Assignment page in Canvas.
In this exercise you will use the value from column (ex21).
To save the text from your session in a file, type
diary filename.doc
Define the plant, G(s), in transfer function form by
G=tf(k, [T1*T2, T1+T2, 1, 0])
Obtain the open-loop poles of the plant by
pole(G)
Plot the plant poles on the s-plane by
pzmap(G);
Question 1.3 Record the transfer function. Record and comment on the plant poles.
Question 1.4 What will happen if you try to obtain the plant open loop step response? (include plot).
Obtain the open loop impulse response by
impulse(G);
Question 1.5 Explain this response characteristics (include plot).
2
ME5012 Electronic Systems, Control and Computing - Assessment Coursework
2. Proportional controller design by Bode plot
In this section, a proportional controller
K(s) = kp
for the system shown in Figure 1 will be designed and the stability will be analysed using frequency domain
techniques.
Obtain the plant Bode plot by
bode(G);
Question 2.1 Explain the Bode plot characteristics.
Question 2.2 Find the limiting value of kp for system stability. Show the workings on the Bode plot.
Question 2.3 From the Bode plot, determine the value of kp required for Mp = 12% assuming
PM ≈ 100ζ for PM < 70deg
where PM is the phase margin. Show the working out on the Bode plot.
Input the calculated value of kp into the MATLAB workspace as a variable kp. Now calculate the closed loop
transfer function
k pG(s)
T (s) =
1+ k pG(s)
by
T=feedback(kp*G,1)
Now display the closed loop system step response by
step(T);
From the plot, measure Mp and tp.
Question 2.4 Record and comment on the closed loop transfer function. Comment on the response. Record
Mp and tp. Compare Mp to the value predicted from the Bode plot. Does your design meet the specifications?
Now obtain the Bode plot of the open loop compensated system L(s) = G(s)K(s) = kpG(s) by
bode(kp*G);
Obtain the gain margin GM , phase margin P M , and associated frequencies ωcg and ωcp by
[GM,PM,Wcg,Wcp] = margin(kp*G)
You can convert GM to decibels by
20*log10(GM)
Question 2.5 Record the gain margin, phase margin, and associated frequencies. Comment on the Bode
plot of the open loop compensated system. Show the gain and phase margins on the plot.
3
ME5012 Electronic Systems, Control and Computing - Assessment Coursework
3. PID/P+D controller design
PID controllers are the most commonly used type of industrial control. They are usually designed by trial and
error using a few simple rules.
Question 3.1 What will be the system type (Type 0, Type 1 or Type 2 etc) if a PID controller is used on this
plant? For zero steady state error (to unity step references) for this plant, is an integrator required in the
controller?
Question 3.2 What are the advantages and disadvantages of not using integral action (i.e. using P+D
control)?
For many mechanical control applications, the derivative of the output is available for measurement using
tachometers and other devices. However, for many applications, such a signal is simply not available (e.g.
process engineering applications), or prohibitively expensive to obtain. In such cases, the derivative signal
y ̇(t) should be approximated by
sY (s)
Y . (s) =
α s +1
where 1/α is greater than the system bandwidth. Making 1/α too large means that high frequency noise in
the measurement signal of y(t) is amplified.
The closed loop system is shown in Figure 2.
Figure 2: Closed loop system with P+D controller
The controller K(s) for this exercise is a P+D controller
skd k + s(kd + α k p )
K(s) = k p + = p
α s +1 α s +1
Now design the controller. Firstly, define α. A suggested value is α = 0.02
alpha=0.02
Define a proportional gain term kp in MATLAB workspace as a variable kp. Similarly, define a derivative gain
term kd, as a variable kd. Now define the transfer function K(s) of the controller by
K=tf([kd+alpha*kp, kp],[alpha, 1])
4
ME5012 Electronic Systems, Control and Computing - Assessment Coursework
Obtain the system open loop transfer function L(s) = G(s)K(s) by
L=K*G
Now obtain the system closed loop transfer function
G(s)K(s) L(s)
T (s) = =
1+ G(s)K(s) 1+ L(s)
by
T=feedback(K*G,1)
Now display the closed loop system step response by
step(T);
If the response does not meet the specifications, change kp and kd and repeat the procedure until a
satisfactory design is obtained.
Question 3.3 From the plot, measure Mp and tp. Does your design meet the specifications? Record the final
values of kp and kd. Record the transfer function K(s), the system open loop transfer function L(s) and the
closed loop transfer function T (s).
Obtain the Bode plot of the controller transfer function K(s) by
bode(K)
Question 3.4 Explain the Bode plot characteristics.
Obtain the Bode plot of the system open loop transfer function L(s) by
bode(L)
Obtain the gain margin GM, phase margin Pm, and associated frequencies ωcg and ωcp by
[GM,PM,Wcg,Wcp] = margin(L)
You can convert GM to decibels by
20*log10(GM)
Question 3.5 Record the gain margin, phase margin, and associated frequencies. Show the gain margin and
phase margin on the Bode plot.
Obtain the closed loop poles and zeros by
pole(T)
zero(T)
Plot the closed loop system poles and zeros on the s-plane by
pzmap(T);
Question 3.6 Record and comment on the closed loop poles and zeros.
To end recording, type
diary off