MMAN3200 Linear Systems and Control
Linear Systems and Control
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
MMAN3200 Linear Systems and Control
ASSIGNMENT
Overview of the Assignment
This assignment focuses on the control of a pendulum system and is worth 20% of your total mark in
this course.
The due date to submit your assignment report to Moodle is Thursday 6am Week 9 (14 April).
Marks will be returned within 2 weeks after the submission deadline. You will complete this assignment
individually.
In this assignment, you will design a controller for an inverted pendulum system which is a nonlinear
system. We have learned in MMAN3200 how to control different LTI systems, but if we are given a
nonlinear system, we can linearize it around an equilibrium point and then design a controller so that
the closed-loop linearized system is stable. Then we can simulate the controller on the original nonlinear
system and if it works fine, we can implement it on the real physical system. We will do these steps in
this assignment. For simulations, we will use MATLAB.
1 Background
Consider the pendulum shown in Figure 1, where ℓ denotes the length of the rod and m denotes the mass
of the bob. We assume the rod is rigid and has zero mass. The pendulum is actuated by a DC motor
through a gear box. The motor can apply a torque input u that makes the bob move.
Let θ denote the angle subtended by the rod and the vertical axis through the pivot point as shown in
Figure 1. The pendulum can swing in the vertical plane and the bob of the pendulum moves on a circle
of radius ℓ. Using Newton’s second law of motion, we can write the equation of motion as
mℓθ¨(t) +mg sin(θ(t)) + bℓθ˙(t) = u(t), (1)
where g is the gravity constant and b is the friction constant.
MTRN9400
1
ℓ
Figure 1: Pendulum system
1
At t = 0, the bob has an initial angular position and angular velocity denoted by θ(0) and θ˙(0). Due to
these initial conditions, the gravitational force and the control input u, the pendulum starts to swing.
We are interested to control the pendulum system such that θ(t) converges to π as t → ∞, that is, the
pendulum forms an upright (inverted) position. In this case, the angular velocity θ˙(t) converges to zero.
2 Assignment Specification
This assignment is split into five components: a report style component and four other tasks. The marks
allocated to each part of the assignment are as follows:
• Part 1 (2.5 marks): Linearization and obtaining the transfer function.
• Part 2 (4 marks): Stability analysis of the open-loop system and a simple closed-loop system.
• Part 3 (5 marks): Lead/lag control design
• Part 4 (6 marks): PD control Design
• Report presentation (2.5 marks): The criteria for style component include good spelling and gram-
mar, appropriate technical language, logical structure including using headings and other conven-
tions, appropriate graphical and tabular presentation, caption for graphics and tables, and appro-
priate spacing that aids readability.
2.1 Part 1: Linearization and obtaining the transfer function (2.5 marks)
Since the system in (1) is nonlinear, we first need to linearize it; otherwise, we cannot find the transfer
function of the system.
(a) Linearize the system around θ = π and θ˙ = 0. This point is an equilibrium point of the nonlinear
system to which we aim the states of the system to converge (1 mark).
(b) Define θ˜ := θ − π and rewrite the linearized model in terms of θ˜, ˙˜θ and ¨˜θ (0.5 mark).
(c) Find the transfer function G(s) from the input u to the output θ˜ (1 mark).
2.2 Part 2: Stability analysis of the open-loop system and a simple closed-
loop system (4 marks)
The first step in designing a controller for a system is to understand the behavior of the plant, G(s).
Assume the system parameters are as follows:
• Length of the rod : 1 (m)
• Mass of the bob: 1 (kg)
• The gravitational acceleration : 9.81 (m/s2)
• The friction constant b: 0 (N)
(a) Find the location of the poles and zeros of G(s) and determine whether the plant is stable or not (1
mark).
2
(b) We now want to control the system using a proportional controller with gain K as shown in Figure 2.
Σ
+
−
Pendulum
System
− �
Figure 2: Unit feedback control system with a proportional controller
Use root locus method and determine the stability of the closed-loop system in Figure 2 for all values
of K (K ∈ (−∞,∞)). Add figure(s) from the root locus plot(s) that show how the closed-loop poles
change for all values of K. In your report, write the range of values such that the closed-loop system
is (i) stable, (ii) marginally stable, and (iii) unstable (3 marks).
2.3 Part 3: Lead/lag control design (5 marks)
In this part, we want to replace the proportional controller in Figure 2 with a lead and/or a lag compen-
sator.
(a) Without using MATLAB, explain whether a lead compensator and a lag compensator are good
choices to stabilize the closed-loop system (1 mark).
Hint: check whether the root-locus asymptotes in Part 2(b) are moved to the left or right by using
lead/lag compensators.
(b) Using the controlSystemDesigner app in MATLAB, find a lead or a lag compensator in the form
of
C(s) = K
s+ z
s+ p
(2)
such that the closed-loop system is stable and the step response of the system has a settling time
less than 0.7 seconds. You can only choose values for z and p which are between 0 and 10 (including
10). We consider a 2% settling time1 here and the MATLAB default threshold for settling time in
stepinfo command and controlSystemDesigner app is also 2%.
You need to add a screenshot from the root locus and the step response of the system in your report.
The step response should clearly show that the settling time is less than 0.7 seconds. You also need
to write the values for K, z and p in your report and explain in a few lines how you tuned the
compensator to achieve the desired specifications (4 marks).
Hint: To learn more about the controlSystemDesigner app, see the MATLAB workshop in week
6 from 1:17:50 and W7L1 lecture from 35:50. A brief explanation on using controlSystemDesigner
app is given below:
After opening the app, you need to choose the correct architecture for the closed-loop system and
define G(s) in the Workspace and import it to the app. Then you can add a compensator by
right-clicking on the root locus plot and choosing “Edit Compensator ...”. The settling time of
the step response is displayed by right-clicking on the step response, selecting “Characteristics” and
then“Settling Time”.
1The 2% settling time is defined as the time required for the output to reach an error band of ±2% of its final value.
3
2.4 Part 4: PD control design (6 marks)
In this part, we want to use a PD (proportional derivative) controller in the form of C(s) = Kp+Kds to
control the system.
(a) Choose values for Kp and Kd such that the specifications in Part 3(b) are satisfied
2. Add a step
response plot to your report and also write the values you found for Kp and Kd. No explanation on
how these values are chosen is needed (1 mark).
(b) Use the PD controller obtained in Part 4(a) to control the original nonlinear system in (1). For this
part, you should use the provided MATLAB file that graphically shows how the bob moves. Is the
step response of the original system similar to that of the linearized system in Part 4(a)? Explain
why they are/are not similar. Add a figure of the angular position to your report.
If the controller in Part 4(a) does not work on the original nonlinear system, modify the gains so
that the steady state error converges to zero. The settling time specification is not required to be
satisfied. Add a plot of the angular position and the gain values to your report (2 marks).
A brief instruction on how to modify the MATLAB file is given below.
Upon running the Asst part 4.m file, a figure will be plotted with a layout shown in Figure 3. You
only need to modify the controller section in lines 75 to 82 of the code. The control law u(t) is defined
in line 75.
Figure 3: Simulation layout
(c) In practice, DC motors cannot generate an infinitely large torque. If the torque calculated by the
controller u is larger than the maximum torque that the DC motor can generate, the torque will be
clipped. You can simulate this by uncommenting lines 77-82 of the MATLAB code. These lines of
the code will clip the torque at ±2 N.m.
2Kp and Kd can take any real value.