Control System
Control System
Supervised By
Semester ___________________________
Revision History
Sr
Update Date Performed by
No.
Learning Outcomes
Theory CLOs:
After successfully completing this course, the students will be able to:
1. Apply the concept of physical laws to describe the dynamical behaviour and to analyze the
performance of Electrical, Mechanical and Electromechanical Systems. (PLO1, C4)
2. Analyze and improve the transient and steady state performance of different dynamical
systems using frequency response approach. (PLO2, C4)
3. Synthesis of classical controllers to improve the transient and steady state performance of
different dynamical systems according to the desired/given specifications. (PLO3, C5)
4. Evaluate a real-life control system problem in a systematic manner, which contains system
design, process information gathering through conduction of experiments/simulations with
appropriate consideration for safety and environmental considerations. (PLO3, C6)
Lab CLOs:
After successfully completing this course, the students will be able to:
1. Design of various linear control algorithms to control the performance of various systems to be
demonstrated both on simulation and the prototype. (PLO3, C5)
2. Follow the instructions to construct various Mechanical, Electrical and Electromechanical Systems
in simulations and using the hardware modules to Display their behaviour by sketching their plots
in runtime. (PLO5, P3)
3. Compile an effective Report using experimental results, aided by graphical and tabular data
analysis. (PLO10, A2)
PLO2
PLO3
PLO5
CLO1 x C4
CLO2 x C4
CLO3 x C5
CLO4 x C6
Lab CLO1 x C5
Lab CLO2 x P3
Lab CLO3 X A2
Lab 10
Lab 11
Lab 12
Lab 1
Lab 2
Lab 3
Lab 4
Lab 5
Lab 6
Lab 7
Lab 8
Lab 9
CLO
CLO4 C5 C5 C5 C5 C5 C5 C5 C5 C3 C4
CLO5 P2 P2 P3 P2 P3 P3 P3 P3 P3 P3 P3 P3
Grading Policy
The final marks for lab would comprise of Lab Assessment (25%), Lab Midterm (25%), and Lab Terminal
(50%).
Lab Assignments:
The minimum pass marks for both lab and theory shall be 50%. Students obtaining less than 50% marks
(in either theory or lab, or both) shall be deemed to have failed in the course. The final marks would be
computed with 75% weight to theory and 25% to lab final marks.
List of Equipment
1. Personal Computers for Simulation (Preferably Core i-5 or above)
2. NI ELVIS
3. QNET HVACT
4. Vertical Take-Off and Landing (VTOL) Complete Setup
5. Rotatory Pendulum Complete Setup
Software Resources
1. LabVIEW
2. Matlab
Lab Instructions
• This lab activity comprises of three parts: Pre-lab, Lab Tasks and Viva session.
• The students should perform and demonstrate each lab task separately for step-wise evaluation.
• Only those tasks that are completed during the allocated lab time will be credited to the students.
• Students are however encouraged to practice on their own in spare time for enhancing their skills.
1. Keep pathways clear and place extra items (books, bags, etc.) on the shelves or under the
worktables. If under the tables, make sure that these items cannot be stepped on.
2. Report all accidents, injuries, breakage of equipment and any defective item to the lab instructor
or staff immediately.
3. Make sure that the last connection to be made in your circuit is the power supply.
4. No part of a live circuit should be touched by the bare hand.
5. Do not disturb the system while it is executing a commanded trajectory.
6. Whenever you are reconfiguring the plant setup, be sure to check that your VI is not running and
that the amplifier box is turned off.
7. Keep the work area and workbench clear of the items not used in the experiment to avoid short
circuiting possibilities.
8. When unplugging a power cord, pull on the plug, not on the cable.
9. If in doubt about electrical safety, see the lab instructor. Information regarding safe use and
possible hazards should be studied carefully from instruction manual.
10. Be aware of emergency procedures, location of fire extinguisher and emergency exit.
11. It is prohibited to eat, drink and smoke in the lab. Do not run or engage in reckless behaviour in
or near the lab.
12. Make sure that equipment is turned OFF when not in use and before leaving the laboratory.
1.3.1 Introduction
“All models are wrong but some are useful” (George Box)
Mathematical Modelling means describing a physical system using mathematical concepts and language.
It is the first step in studying the behaviour of the system at hand. These mathematical models help the
designers in not only analysing an existing system but also designing new systems with more desirable
behaviour as per the specific needs of an application. Unfortunately, we can never make a completely
precise model of a physical system. There are always phenomena which we will not be able to model.
Thus, there will always be model errors or model uncertainties. But even if a model describes just a part
of the reality it can be very useful for analysis and design — if it describes the dominating dynamic
properties of the system.
There may be various representations of a mathematical model for a system each with their own inherent
advantages. After modelling a system, we will learn two representations of the developed model. Either
representation gives us insight into the system from a different perspective. Two of the most important
types of mathematical modelling that we are going to explore in this course are, Transfer Function and
State Space Modelling. In this lab, we will study only transfer function implementation of various physical
systems. We will study three types of systems which include Mechanical system, Electrical System and
Electronic System. First of all, we will derive the transfer function of these systems on paper, and after
that we will learn to implement these models on MATLAB/LabVIEW and finally we will see how to analyse
the systems through their mathematical models. For details, you can study chapter two of Control systems
by Ogata.
Fa(t) Fa(t)
(a) (b)
Figure 1.1
Let we apply a force 𝐹𝑎 (𝑡) on the mass 𝑀 and displace it from its mean position, say 𝑥0 , to a new position,
say 𝑥1 . At this point there will be other forces acting on the mass 𝑀 besides our applied force.
One of these three forces is Friction Force, 𝐹𝑓 (𝑡). For the simplicity we assume here that the wall friction
𝑏 is a viscous damper, that is, the friction force is linearly proportional to the velocity of the mass. In
reality, however, this friction force may behave as a coulomb damper, also known as dry friction, which is
a nonlinear function of the mass velocity. For a well-lubricated, sliding surface, the viscous friction is an
appropriate approximation. Hence for friction force, 𝐹𝑓 (𝑡)., we can write that
This friction force will obviously be in the reverse direction of applied force.
Another force acting on the mass is the spring force which is also in the opposite direction to the applied
force. According to Hook’s Law the extension of a spring is directly proportional to the applied load as
long as the load does not exceed spring’s elastic limits. Mathematically Hook’s law can be stated as
𝐹𝑠 (𝑡) = 𝑘𝑥(𝑡) (1.2)
Here 𝐹𝑠 (𝑡) is spring force, k is the spring constant and x is the displacement as a result of applied force.
from Figure 1.1(b) we note that there are a total of three forces acting on the mass M. So,
∑ 𝐹 = 𝐹𝑎 − 𝐹𝑓 − 𝐹𝑠 (1.4)
Putting (1.1) and (1.2) in (1.4) and then putting the resulting equation in (1.3) and rearranging the term,
we get
𝑑2 𝑥(𝑡) 𝑑𝑥(𝑡)
𝑀 2
+ 𝑏 + 𝑘𝑥(𝑡) = 𝐹𝑎 (𝑡) (1.5)
𝑑𝑡 𝑑𝑡
Equation (1.5) is a second-order linear constant-coefficient differential equation which completely models
the behaviour of the given shock absorber system. Converting it into transfer function representation
greatly eases the manipulation of the model and gives extended liberty to investigate various hidden
aspects of the system in rather greater detail. To make transfer function out of equation (1.5) first we
need to identify input and output variables from the model and then we need to take Laplace Transform
of the equation.
For the system given above we take applied force Fa to be input to the system and let displacement 𝑥(𝑡)
be output. So after taking Laplace transform we get following expression assuming zero initial conditions.
𝑋(𝑠)
Hence the transfer function 𝐹 will be,
𝑎 (𝑠)
𝑋(𝑠) 1 (1.8)
= 2
𝐹𝑎 (𝑠) 𝑀𝑠 + 𝑏𝑠 + 𝑘
Transfer function:
1
-------------------
200 s^2 + 25 s + 10
Note that we have also used while loop for our VI. Go to programming >> Structures >> while loop and
place it on your block diagram. If we have a transfer function object sys and we want to find the numerator
and denominator polynomials we can use the following command
>> [num, den] = tfdata(sys)
Please note that in transfer function model you have direct control over coefficients or weights of each
and every term involved in the system. By changing these parameters, we can observe the change in the
system response. You may remember from your DSP course that these weights in a filter transfer function
are of utmost importance and having direct access to these coefficients means that you can easily change
the gain response of the filter as per your requirement.
>> p = pole(sys)
>> z = zero(sys)
We can also use pzmap() function to find both poles and zeros in one go as
>> [p, z] = pzmap(sys)
When used without left-hand-side arguments, pzmap() command plots the poles and zeros in s-plane
where poles are represented by cross (×) and zeros are shown by circles (o).
We can also store the complete system in pole-zero-gain form in a single object. Explore the following
command
>> sys2 = zpk(z,p,k)
This command will create and store a mathematical model by using given locations of zeros (stored in z
vector), poles (stored in p vector) and a scalar value k.
Figure 1.3
As with transfer function model we have a reciprocal command for zpk() function that takes system object
as an input and returns zeros, poles and gain.
However, there are commands that can transform one model representation to the other. Explore the
following commands
You can now describe this system in LabVIEW either by tf() command or zpk() command. One very simple
way is shown in Figure 1.4 to get Transfer Function in LabVIEW.
Figure 1.4
𝑑𝑖 1 (1.9)
𝐿 + 𝑅𝑖 + ∫ 𝑖 𝑑𝑡 = 𝑒𝑖
𝑑𝑡 𝐶
Figure 1.5
If we are interested in observing the capacitor voltage, then our output will be
1 (1.10)
𝑒𝑜 = ∫ 𝑖 𝑑𝑡
𝐶
1 (1.11)
𝐿𝑠𝐼(𝑠) + 𝑅𝐼(𝑠) + 𝐼(𝑠) = 𝐸𝑖 (𝑠)
𝐶𝑠
1 (1.12)
𝐼(𝑠) = 𝐸𝑜 (𝑠)
𝐶𝑠
Now substituting (1.12) in (1.11), we will get the transfer function of this RLC Circuit
𝐸𝑜 (𝑠) 1 (1.13)
= 2
𝐸𝑖 (𝑠) 𝐿𝐶𝑠 + 𝑅𝐶𝑠 + 1
Operational Amplifiers are frequently used to amplify signals in sensor circuits. They are also used in filters
for compensation purpose. Another beauty of Op-Amps is that they can be easily cascaded with other
circuits because of their relatively high (near to infinity) input impedance.
An important fact about Op-Amps to remember is that as their input impedance is very high so the current
going into the Op-Amp is normally negligible. Also the voltage difference at the terminals of Op-Amp is
nearly zero. Considering these characteristics, we can write input and output equations for Op-Amp as
follows,
𝑣𝑖𝑛 − 𝑣′ (1.14)
𝑖1 =
𝑅
𝑑(𝑣 ′ − 𝑣𝑜𝑢𝑡 )
𝑖2 = 𝐶
𝑑𝑡
Since𝑣 ′ = 0, so
Taking Laplace transform and rearranging the terms gives the transfer function.
𝑉𝑖𝑛 (1.17)
= −𝐶𝑠𝑉𝑜𝑢𝑡
𝑅
𝑉𝑜𝑢𝑡 1 (1.18)
= −
𝑉𝑖𝑛 𝑅𝐶𝑠
This experiment will focus on modelling, identification, and position control of an armature-controlled DC
servomotor. In particular, we will first develop the governing differential equations and the Laplace
domain transfer function model of an armature controlled DC motor. Next, we will tend to the
identification of the unknown system parameters that appear in the transfer function model of the DC
servomotor. Finally, we will develop and implement a position-plus-velocity feedback controller to ensure
that the DC motor angular position response tracks a step command.
The motor, we would be discussing, is a permanent-magnet type and has a single armature winding.
Current flow through the armature is controlled by power amplifiers as in Figure 1.7 so that rotation in
both directions is possible by using one, or both of the inputs.
As the motor accelerates, the armature generates an increasing back-emf, Vb, which tends to oppose the
driving voltage Va . The armature current is thus roughly proportional toVa − Vb . If the speed drops (due
to loading) Vb reduces, the current increases and so does the motor torque. This tends to oppose the
speed drop. That is why this mode of control is called 'armature-control' and gives a speed proportional
to Va .
First, we observe that the torque of a permanent-magnet DC motor is directly proportional to its armature
current. Stating mathematically, we say,
𝑇𝑚 = 𝐾𝑡 𝑖𝑎 (𝑡) (1.20)
We also note that the back-emf produced in armature-controlled DC motor is directly proportional to the
angular velocity of armature. Thus,
𝑉𝑏 = 𝐾𝑏 𝜔𝑎 (𝑡) (1.21)
When the motor rotates and produces a torque as given in equation 1.22, there emerges a retarding
torque, because of friction, in response to𝑇𝑚 . If we assume the friction to be viscous friction, as we
assumed for the case of mass-spring model in previous labs, we get
Newton’s second law of motion, when translated into angular mechanics, takes the following form.
∑ 𝑇 = 𝐽𝛼(𝑡) (1.23)
Here 𝐽 is moment of inertia and 𝛼(𝑡) is angular acceleration. Putting value, we get
𝑑𝜔(𝑡)
𝑇𝑚 − 𝑏. 𝜔(𝑡) = 𝐽 (1.24)
𝑑𝑡
Or,
𝑑𝜔(𝑡) 1
= (𝐾𝑡 𝑖𝑎 (𝑡) − 𝑏. 𝜔(𝑡)) (1.25)
𝑑𝑡 𝐽
Now we turn to the electrical aspect of this motor. Applying Kirchhoff’s Voltage Law to Figure 1.8, we get,
𝑑𝑖𝑎 (𝑡)
𝑉𝑎 = 𝑅𝑖𝑎 (𝑡) + 𝐿 + 𝑉𝑏 (1.26)
𝑑𝑡
Substituting equation 1.21 and rearranging the terms gives,
𝑑𝑖𝑎 (𝑡) 1
= (𝑉𝑎 − 𝑅𝑖𝑎 (𝑡) − 𝐾𝑏 𝜔𝑎 (𝑡)) (1.27)
𝑑𝑡 𝐿
Equation 1.27 gives electrical equation of the motor. Combining these two equations results in a complete
model of armature-controlled DC motor.
b) Represent the system in Pole-Zero-Gain Form. Write down the expression below
Integrator Differentiator
c) Evaluate and plot poles and zeros of the systems. Write numeric value below
Integrator Differentiator
e) Comment on stability
Integrator Differentiator
b) Represent the system in Pole-Zero-Gain Form. Write down the expression below
c) Evaluate and plot poles and zeros of the system. Write numeric value below
e) Comment on stability
a) Implement the Simulink Model for Speed of the System on Matlab Simulink
c) Implement the Simulink Model for Position of the System on Matlab Simulink
(Please Note that Recommended stop time for simulink simulation is 3s at given parameter values)
Exercise 1:
Consider the Mass Spring System given in Pre Lab section. Find its step response using Simulink.
The student performance for the assigned task during the lab session was:
The student completed assigned tasks without any help from the
Excellent 4
instructor and showed the results appropriately.
The student completed assigned tasks with minimal help from the
Good 3
instructor and showed the results appropriately.
The student could not complete all assigned tasks and showed
Average 2
partial results.
Worst The student did not complete assigned tasks. 1
Primary concerns in control system design are performance and stability. In order to design and analyse
control systems, we must first establish adequate performance specifications. Performance specifications
can be presented in the time domain or the frequency domain. Time-domain specifications generally take
the form of settling time, percent overshoot, rise time, and steady-state error. Stability and frequency-
domain specifications are addressed in coming labs.
As we have learned so far, the advantages and disadvantages of open loop control systems over the closed
loop control systems. One of the major advantage of closed loop control system over the open loop
control system is that the closed loop control system is less sensitive to disturbance. In this pre lab session
we are going to prove it mathematically. We will also observe the same during the simulation in lab.
num1 num2
G1 (s) = , G2 (s) =
den1 den2
It will consume both transfer functions and the summing junction and give a single block between
𝑈(𝑠) 𝑎𝑛𝑑 𝑌(𝑠) equivalent to the consumed components. A similar way can also be performed for parallel
connection.
Now assume that 𝐺2 (𝑠) = 1, that means we have connected output back to the input directly without
any transfer function involved. It would result in a special feedback loop, called unity feedback, as shown
in Figure 2.5. Total transfer function, T(s), in this case would then be,
Y(s) G1 (s)
T(s) = =
U(s) 1 ∓ G1 (s)
Now we can use the same feedback command to calculate T(s),
>>𝑠𝑦𝑠 = 𝑓𝑒𝑒𝑑𝑏𝑎𝑐𝑘(𝑠𝑦𝑠1, 1)
a) Rise Time
Rise time refers to the time required for a signal to rise from a specified low value to a specified high value.
Typically, these values are 10% and 90% of the step height. The 0 − 100% rise time, 𝑇𝑟 , measures the
time to reach 100% of the input magnitude. Alternatively, 𝑇𝑟1 , may measure the time from 10% − 90%
of the response to the step input.
b) Peak Time
The peak time is the time required for the response to reach the highest peak of the overshoot. Peak time
is inversely proportional to the amount of overshoot.
c) Settling Time
The time required for the system’s output to settle within a certain percentage of the input amplitude
(which is usually taken as 2%) is called settling time. Settling time, 𝑇𝑠 , is calculated as
4
Ts =
ζωo
e) Steady-State Error
It is the difference between the desired final output and the actual one. Practically this difference can
never be reduced to zero. However, a suitable tolerance range may be defined to assume that the system
has reached its desired value. It is calculated as 𝑎𝑏𝑠(𝑑𝑐𝑔𝑎𝑖𝑛(1 − 𝑠𝑦𝑠𝑡𝑒𝑚)).
𝐶𝐷 (𝑆) 𝐺2 (𝑆)
=
𝐷(𝑆) 1 + 𝐺1 (𝑆)𝐺2 (𝑆)𝐻(𝑆)
Now examining the effect of reference input
The response to the simultaneous application of the reference input and disturbance can be calculated
by adding the individual responses
𝐺2 (𝑆)
𝐶(𝑆) = 𝐶𝑅 (𝑆) + 𝐶𝐷 (𝑆) = [𝐺 (𝑆)𝑅(𝑆) + 𝐷(𝑆)]
1 + 𝐺1 (𝑆)𝐺2 (𝑆)𝐻(𝑆) 1
Consider now the case where|𝐺1 (𝑠)𝐻(𝑠)| >> 1 𝑎𝑛𝑑 |𝐺1 (𝑠)𝐺2 (𝑠)𝐻(𝑠)| >> 1. In this case, the closed-
loop transfer function 𝐶𝐷 (𝑠)/𝐷(𝑠) becomes almost zero, and the effect of the disturbance is suppressed.
This is an advantage of the closed-loop system. On the other hand, the closed-loop transfer function
𝐶𝑅 (𝑠)/𝑅(𝑠) approaches 1/𝐻(𝑠)as the gain of 𝐺1 (𝑠)𝐺2 (𝑠)𝐻(𝑠) increases.This means that
if |𝐺1 (𝑠)𝐺2 (𝑠)𝐻(𝑠)| >> 1, then the closed-loop transfer function 𝐶𝑅 (𝑠)/𝑅(𝑠) becomes independent of
𝐺1 (𝑠) 𝑎𝑛𝑑 𝐺2 (𝑠)and inversely proportional to H(s), so that the variations of 𝐺1 (𝑠) 𝑎𝑛𝑑 𝐺2 (𝑠)do not affect
the closed-loop transfer function 𝐶𝑅 (𝑠)/𝑅(𝑠). This is another advantage of the closed-loop system. It can
easily be seen that any closed-loop system with unity feedback, 𝐻(𝑠) = 1, tends to equalize the input and
output.
The substation at the right of Figure 2.7 performs the task of taking the power provided by an electric
utility power plant and converting it into a form of power that the electric rail car can use to operate its
traction motors. The two terminals of this substation are connected via a trolley wire and the two rails
that the train runs on. The electric train has a spring-loaded arm called a pantograph on its roof that
touches the trolley wire, allowing electrical current to flow into a speed control system housed under the
train. This speed control system performs the task of varying the flow of electrical current to the traction
motors, enabling the car to move, before it eventually exits the motor through its wheels, then back to
the substation where it originated, thus completing an electrical circuit.
The speed control system of an electric train is shown in Figure 2.8. Our goal in this problem is to find the
closed-loop transfer function and investigate the response of ω to a commanded ωd . The first step in this
direction would be to apply block diagram reduction techniques learnt in previous labs to compute the
closed-loop transfer functionω/ ωd . We observe that closed-loop characteristic equation is second-order
with ωn = 52 and ξ = 0.012. Since the damping is low, we might expect the response to be highly
oscillatory as shown in Figure 2.9.
To quantitatively observe step response parameters of this system we may use CD Parametric Time
Response block which, in this case, yields,
RiseTime: 0.0202
SettlingTime: 6.2294
SettlingMin: 0.0728
SettlingMax: 1.9624
Overshoot: 96.2920
Undershoot: 0
Peak: 1.9624
PeakTime: 0.0605
Figure 2.12
The student performance for the assigned task during the lab session was:
The student completed assigned tasks without any help from the
Excellent 4
instructor and showed the results appropriately.
The student completed assigned tasks with minimal help from the
Good 3
instructor and showed the results appropriately.
The student could not complete all assigned tasks and showed
Average 2
partial results.
Worst The student did not complete assigned tasks. 1
The signal 𝑒(𝑡) represents the tracking error, the difference between the reference input 𝑟(𝑡) and the
actual output 𝑦(𝑡). This error signal will be sent to the PID controller, and the controller computes both
the derivative and integral of this error signal. The signal 𝑢(𝑡) just past the controller is now equal to the
proportional gain (𝐾𝑝 ) times the magnitude of the error signal plus the integral gain (𝐾𝑖 ) times the
integral of the error signal plus the derivative gain (𝐾𝑑 ) times the derivative of the error signal.
Note that these correlations may not be exactly accurate, because 𝐾𝑝 , 𝐾𝑖 , 𝑎𝑛𝑑 𝐾𝑑 are dependent on each
other. In fact, changing one of these variables can change the effect of the other two. For this reason, the
table should only be used as a reference when you are determining the values for 𝐾𝑖 , 𝐾𝑝 𝑎𝑛𝑑 𝐾𝑑 .
Figure 3.2 Step Response of the System with K_p=350,K_i=300 and K_d=50:
Lastly, keep in mind that you do not need to implement all three controllers (proportional, derivative, and
integral) into a single system, if not necessary. For example, if a PI controller gives a good enough response
(like the above example), then you don't need to implement a derivative controller on the system. Keep
the controller as simple as possible.
2. Implement the designed controller in MATLAB and analyse the response of your system before
and after designing the controller. Attach Matlab code and Results
1. Design a PID Controller to achieve the above criteria. Note down the values of proportional,
integral and derivative control gains calculated
2. Implement the designed controller in MATLAB and analyse the response of your system before
and after designing the controller. Attach Matlab code and Results
Exercise 1:
The open-loop transfer function of the DC Motor speed is
Ɵ̇ K
=
U (Js + b)(Ls + R) + K 2
For a 1 rad/sec step input, design a PID controller that satisfies the given criteria:
• Settling time less than 2 seconds
• Overshoot less than 5%
• Steady-stage error less than 1%
Exercise 2:
The open-loop transfer function of the DC Motor position is
Ɵ K
=
U s((Js + b)(Ls + R) + K 2 )
Figure 3.4
The student performance for the assigned task during the lab session was:
The student completed assigned tasks without any help from the
Excellent 4
instructor and showed the results appropriately.
The student completed assigned tasks with minimal help from the
Good 3
instructor and showed the results appropriately.
The student could not complete all assigned tasks and showed
Average 2
partial results.
Worst The student did not complete assigned tasks. 1
4.3.1 Introduction
The QNET vertical take-off and landing (VTOL) trainer is shown in Figure 4.1. The system consists of a
variable speed fan with a safety guard mounted on an arm. At the other end of the arm, an adjustable
counterweight is attached. This allows the position of the weight to be changed, which in turn affects the
dynamics of the system. The arm assembly pivots about a rotary encoder shaft. The VTOL pitch position
can be acquired from this setup. Some examples of real-world VTOL devices are helicopters, rockets,
balloons, and harrier jets. Aerospace devices are typically more difficult to model. Usually this will involve
using software system identification tools to determine parameters or actual dynamics. Due to their
inherent complexity, flight systems are usually broken down into different subsystems to make it more
manageable. These subsystems can be dealt with individually and then integrated to provide an overall
solution.
Figure 4.1
Figure 4.2
In cases where the actuator has relatively slow dynamics, such as an electromagnet with a large
inductance, it is favourable to design a current controller. Typically, a proportional-integral compensator
is used to regulate the current flowing in the load. This basically makes the actuator dynamics negligible
and simplifies the control design of the outer-loop. In this case, the voltage-current relationship of the
VTOL trainer motor can be described, in the time-domain, by the equation
𝑉𝑚 = −𝑅𝑚 𝑖𝑚 + 𝐿𝑚 𝑖𝑚
And by transfer function
𝑉𝑚 (𝑠)
𝐼𝑚 (𝑠) =
𝑅𝑚 + 𝐿𝑚 𝑠
Figure 4.3 shows the VTOL current control system implemented. The PI compensator computes the
voltage necessary to reach the desired current.
Figure 4.3
𝑠 2 + 2𝜉⍵𝑛 𝑠 + ⍵2𝑛
We need a proportional gain of
These gains can then be designed according to a desired natural frequency ⍵𝑛 and damping ratio 𝜉
Figure 4.4
Table 4-1
Table 4-2
Sr. Voltage (V) Current (I) Resistance (R=V/I)
1 4V
2 5V
3 6V
4 7V
5 8V
Average Resistance
8. Show and explain the effects of having no proportional gain. Attach a sample response
⍵𝑛 = 42.5 𝑟𝑎𝑑/𝑠
𝜉 = 0.7
Refer to section 5.4.2 (a) for calculations. Use the value of armature resistance as calculated in section
5.5.1 and inductance as given in the table below. Do all the calculations in the space provided below. Also
fill the table below.
Table 4-3
Parameter Value Unit
𝑅𝑚 ⍵
𝐿𝑚 53.8 mH
ξ 0.7
⍵𝑛 42.5 rad/s
𝑘𝑝,𝑐 V/A
𝑘𝑖,𝑐 V/(A.s)
Exercise 1
Design a PI controller to control the current drawn by propeller motor using the criteria given below and
validate the designed controller by using the calculated values of proportional and integral gain in current
control VI in terms of performance specifications. Attach the responses.
The student performance for the assigned task during the lab session was:
The student completed assigned tasks without any help from the
Excellent 4
instructor and showed the results appropriately.
The student completed assigned tasks with minimal help from the
Good 3
instructor and showed the results appropriately.
The student could not complete all assigned tasks and showed
Average 2
partial results.
Worst The student did not complete assigned tasks. 1
𝐽 = ∑ 𝑚𝑖 𝑟𝑖2
𝑖=𝑖
This is obtained by taking the Laplace Transform of Equation for angular motion and thrust torque of VTOL
𝐵 𝐾
given in previous section and solving for Ω(𝑠)/𝐼𝑚 (𝑠). Notice the denominator 𝑠 2 + 𝐽 𝑠 + 𝐽
matches the
characteristic second order transfer function. By determining the natural frequency of the system, one
can find the stiffness using
𝐾 = ⍵2𝑛 𝐽
Figure 5.2:LabVIEW virtual instrument used to find and validate a model for the QNET VTOL trainer
Table 5-1
a) Derivation of Model
1. Using the VTOL Trainer Model given in section 5.3.4 and the specifications enlisted in Table 5.2,
compute the moment of inertia acting about the pitch axis. Enter this value in Table 6.3. Show all
the calculations in the space provided below
Table 5-2
3. Using the equations presented in section 5.3.4 and equilibrium current found in section 5.4.1,
calculate the thrust current-torque constant 𝐾𝑡 . Enter this value in Table 5.3. Show all the
calculations below
4. Compute the VTOL Trainer Transfer Function based on the previously found parameters:
𝐾𝑡 , 𝐽, 𝐵, 𝑎𝑛𝑑 𝐾. Show all the calculations below
7. Enter the identified TF parameters into the Transfer Function Simulation Parameters section
8. Go through steps 7-9 in section 5.4.3(b). That is, bring the VTOL Trainer up to 0 degrees and then
feed ± 0.1 A
5.4.5 Results
Table 5-3
Parameters Symbol Value Units
Equilibrium Current 𝐼𝑒𝑞 𝐴
Torque Thrust Constant 𝐾𝑡 (𝑁. 𝑚)/𝐴
Moment of Inertia 𝐽 𝐾𝑔. 𝑚2
Viscous Damping 𝐵 (𝑁. 𝑚. 𝑠)/𝑟𝑎𝑑
Natural Frequency ⍵𝑛 𝑟𝑎𝑑
Stiffness 𝐾 (𝑁. 𝑚)/𝑟𝑎𝑑
Sys ID: Torque Thrust Constant 𝐾𝑡,𝑖𝑑 (𝑁. 𝑚)/𝐴
Sys ID: Viscous Damping 𝐵𝑖𝑑 (𝑁. 𝑚. 𝑠)/𝑟𝑎𝑑
Sys ID: Stiffness 𝐾𝑖𝑑 (𝑁. 𝑚)/𝑟𝑎𝑑
Exercise Question 1
Describe the major difference between VTOL setup and an actual helicopter, in terms of degree of
freedom. Does the system provide good realization of helicopter?
The student performance for the assigned task during the lab session was:
The student completed assigned tasks without any help from the
Excellent 4
instructor and showed the results appropriately.
The student completed assigned tasks with minimal help from the
Good 3
instructor and showed the results appropriately.
The student could not complete all assigned tasks and showed
Average 2
partial results.
Worst The student did not complete assigned tasks. 1
Where 𝑟𝑠𝑠 is the value of the steady-state reference and 𝑦𝑠𝑠 is the steady-state value of the process output
The block diagram shown in Figure 6.1 is general unity feedback system with a compensator 𝐶(𝑠) and a
transfer function representing the plant, 𝑃(𝑠). The measured output, 𝑌(𝑠), is supposed to track the
reference signal 𝑅(𝑠) and the tracking has to yield certain specifications.
And by solving for 𝐸(𝑠) the resulting closed-loop transfer function is obtained.
The error transfer function of the VTOL trainer when subject to step of
𝑅(0)
𝑅(𝑠) =
𝑠
and using the PID compensator
𝑘𝑖
𝐶(𝑠) = 𝑘𝑝 + 𝑘𝑑 𝑠 +
𝑠
𝑅0
𝐸(𝑠) =
𝑘
(𝑘𝑝 + 𝑘𝑑 𝑠 + 𝑠𝑖 ) 𝐾𝑡
𝑠 (1 + 𝐵 𝐾 )
𝐽 (𝑠 2 + 𝑠 + )
𝐽 𝐽
If transfer function is stable, then the steady-state error can be found using the final value theorem (FVT)
Using FVT, the steady-state error of the VTOL trainer closed-loop PID step response is
𝑠(𝑠 2 𝐽 + 𝐵𝑠 + 𝐾)
𝑒𝑠𝑠 = 𝑅0 (lim )
𝑠→0 𝑠 3 𝐽 + 𝐵𝑠 2 + 𝐾𝑡 𝑘𝑠 2 + 𝑠𝐾 + 𝐾𝑡 𝑘𝑝 𝑠 + 𝐾𝑡 𝑘𝑖
The transfer function representing the VTOL trainer position-current relation in previous lab session is
used to design the PID controller. The input-output relation in the time-domain for a PID controller is
𝑑
𝑢 = 𝑘𝑝 (𝜃𝑑 − 𝜃) + 𝑘𝑖 ∫ (𝜃𝑑 − 𝜃)𝑑𝑡 − 𝑘𝑣 (𝜃)
𝑑𝑡
Where 𝑘𝑝 is the proportional gain, 𝑘𝑖 is the integral gain and 𝑘𝑣 is the velocity gain. Remark that only the
measured velocity is used, i.e. instead of using the derivation of the error. The close-loop transfer function
from the position reference, 𝑟, to the angular VTOL position output, 𝜃, is
Comparing the characteristic polynomial in closed-loop transfer function of the VTOL with the above
equation yields the following expressions of gains
𝑝0 ⍵2𝑛 𝐽
𝑘𝑖 =
𝐾𝑡
−𝐵 + 𝑝0 𝐽 + 2𝜉⍵𝑛 𝐽
𝑘𝑣 =
𝐾𝑡
Figure 6.3
a) Theoretical Prediction
Calculate the theoretical VTOL Trainer steady-state error when using a PD control with 𝑘𝑝 = 2 and 𝑘𝑑 =
1 and a step amplitude of 𝑅0 = 4.0 𝑑𝑒𝑔𝑟𝑒𝑒𝑠. Use thrust current-torque and stiffness found in previous
Lab Session. Show all the calculation in the space provided below. Enter the value of calculated steady-
state error in Table 6.2
10. In the Signal Generator section set Amplitude (rad) to 0 rad and slowly decrement Offset (rad) t0
-8.0 rad.
11. Click on the Stop button to stop running the VI.
a) Theoretical Prediction
Calculate the theoretical VTOL Trainer steady-state error when using a PD control with 𝑘𝑝 = 2 , 𝑘𝑖 =
4.0 𝐴/(𝑟𝑎𝑑. 𝑠) and 𝑘𝑑 = 1 and a step amplitude of 𝑅0 = 4.0 𝑑𝑒𝑔𝑟𝑒𝑒𝑠. Use thrust current-torque,
stiffness and moment of inertia as found in previous Lab Session. For viscous damping refer to Table 5.2.
Show all the calculation in the space provided below. Enter the value of calculated steady-state error in
Table 6.2
b) Experimental Observation
1. Go through steps 1-8 in Section 6.5.1 (b) to run the PD controller
2. In the Position Control Parameters section, increment the integral gain until you reach 𝑘𝑖 =
4.0 𝐴/(𝑟𝑎𝑑. 𝑠).
3. Capture the VTOL device step response when using a PID controller and measure the steady-state
error. Enter this measured value in table 6.2. How does it compare with the computed value in
section 𝑎?
4. In the Signal Generator section set Amplitude (rad) to 0 rad and slowly decrement Offset (rad) t0
-8.0 rad.
5. Click on the Stop button to stop running the VI.
a) Theoretical Design
1. Find the natural frequency, ⍵n , and damping ratio, ξ, required to meet a peak time of 1.0 seconds
and a percent overshoot of 20%. Show all the necessary calculations below. Enter these values in
Table 6.2.
b) Experimental Validation
1. Open the QNET_VTOL_Flight_Control.vi. Make sure the correct device is chosen
2. Make sure that the VTOL counter-weight is placed as far from the propeller assembly as possible
without lifting the propeller itself. The base of the propeller assembly should rest lightly on the
surface of the QNET board.
3. Run the VI
4. In Position set point Section set:
𝐴𝑚𝑝𝑙𝑖𝑡𝑢𝑑𝑒 = 0.0 𝑑𝑒𝑔
𝐹𝑟𝑒𝑞𝑢𝑒𝑛𝑐𝑦 = 0.15 𝐻𝑧
𝑂𝑓𝑓𝑠𝑒𝑡 = 0.0 𝑑𝑒𝑔
5. In the Position Control Parameters section, enter PID gains found in Section 6.5.3(a)
6. Let the VTOL system stabilize about the 0.0 rad set point. Examine if the VTOL Trainer body is
horizontal. If not, then you can adjust the pitch offset by varying the VTOL offset control. By
default this is set to 25.0 degrees.
7. In Position set point Section set:
𝐴𝑚𝑝𝑙𝑖𝑡𝑢𝑑𝑒 = 2.0 𝑑𝑒𝑔
𝐹𝑟𝑒𝑞𝑢𝑒𝑛𝑐𝑦 = 0.40 𝐻𝑧
𝑂𝑓𝑓𝑠𝑒𝑡 = 2.0 𝑑𝑒𝑔
The VTOL trainer should be going up and down and tracking the square wave set point.
8. Capture the response of the VTOL system when using your designed controller
9. Measure the peak time and percent overshoot of the measured response. Show all the steps
below. Enter these values in Table 6.2. Are the VTOL Trainer response specifications satisfied?
10. If the specifications were not given, what could be done to improve the response?
11. In the Signal Generator section set Amplitude (rad) to 0 rad and slowly decrement Offset (rad) t0
-8.0 rad.
12. Click on the Stop button to stop running the VI.
Exercise Question 1
Design a PID controller to meet the following design criteria of VTOL pitch
Settling Time = 5 seconds
Percentage Overshoot = 5%
Validate the designed controller on experimental setup. Does it satisfy the design criteria?
The student performance for the assigned task during the lab session was:
The student completed assigned tasks without any help from the
Excellent 4
instructor and showed the results appropriately.
The student completed assigned tasks with minimal help from the
Good 3
instructor and showed the results appropriately.
The student could not complete all assigned tasks and showed
Average 2
partial results.
Worst The student did not complete assigned tasks. 1
The purpose of this experiment is to implement one of the most fundamental and traditional control
strategy – switch control or ON/OFF control– to control the temperature of the chamber in HVAC – an NI
laboratory setup available in the lab. Students will also be given a pleasant chance to get a hands-on
experience to implement the hysteresis gap in switch control operation where they will practically be able
to observe how switching speed can be adjusted by introducing the hysteresis gap which in turns leads to
the longer life of the plant. Moreover, mathematical model of the process will also be estimated
analytically and experimentally.
7.3.1 Introduction
The QNET heating and ventilation trainer (HVACT) is shown in Figure 7.1. The system consists of a Plexiglas
duct, with a heater in one end and a blower in the other end. The heater is a halogen lamp and the blower
is a variable-speed fan. There is a thermistor sensor placed inside the duct to measure the temperature
of the chamber and another thermistor sensor outside the chamber to measure the room temperature.
The temperature measured at the thermistor inside the chamber is to be controlled using the heater
voltage while the fan is run at a constant speed. Heat is transferred to the thermistor by radiation from
the heater and by convection from the air stream. Radiative heat transfer is highly non-linear and it is
therefore difficult to model the system by first principles. As a result, empirical tuning will be used to
control the system. This heat transfer plant is very similar to the systems that are used to control wafer
temperature in semiconductor manufacturing.
Figure 7.2: Block Diagram of the Heater System with Relay Feedback
The error, variable ‘e’ in Figure 7.2, is the difference between the reference temperature, 𝑇𝑟 and the actual
chamber temperature 𝑇𝑐 . The on-off controller is implemented using a relay switch with hysteresis, as
shown in Figure 7.3. The heater actuator is represented by a saturation block and the chamber plant is
represented by the transfer function P(s).
Figure 7.3: Input and Output Relation for an On-Off Controller with Hysteresis
The hysteresis width, ∆𝑇ℎ in Figure 7.3, has to be chosen such that a large measurement noise does not
generate any unintentional switches. As depicted in Figure 7.3, the output control signal voltage of the
on-off controller can be adjusted using a mean or offset 𝑉ℎ,𝑜𝑓𝑓 and an amplitude 𝑉ℎ,𝑎𝑚𝑝 .
In the experiment, the behaviour of the heater system will be investigated for different values of controller
parameters. More specifically, the control signal and the measured temperature will be observed.
7.4.1 Calibration
After powering up the ELVIS and before running any of the procedure, follow this procedure to calibrate
the QNET HVACT system.
1. Open the QNET_HVACT_On_Off_Control.vi
2. Make sure that the correct device is chosen.
3. Run the QNET_HVACT_On_Off_Control.vi shown in Figure 7.4.
4. The cooling fan is automatically activated when the Prototyping Board Power switch on the ELVIS
unit is ON. Let the actual temperature,𝑇𝑐 , in the Temperature (C) scope settle until it stops
decreasing.
5. Adjust the Temperature (C) scope scales to see both the reference and actual temperatures.
6. As illustrated in Figure 7.5, calibrate the temperature sensors by clicking on the Calibrate button.
This will align the chamber temperature, Tc, to the measured ambient temperature, Ta.
7. Activate the control by clicking on the Heater OFF button (in the top-right corner of Figure 7.5).
Figure 7.5: Calibrating the temperature in the QNET HVACT On-Off Control VI
1. Make sure the QNET_HVACT_On_Off_Control.vi is running and has been calibrated as instructed
in section 7.4.1.
2. In the Signal Generator section set:
𝐴𝑚𝑝𝑙𝑖𝑡𝑢𝑑𝑒 = 0 ᵒ𝐶
𝐹𝑟𝑒𝑞𝑢𝑒𝑛𝑐𝑦 = 0.008 𝐻𝑧
𝑂𝑓𝑓𝑠𝑒𝑡 = 0.5 ᵒ𝐶
3. Examine the actual temperature (red) and reference temperature (blue) responses in the
temperature (C) scope.
4. Gradually vary the offset in the Signal Generator between 0.5ᵒC and 2ᵒC. How is the reference
temperature,𝑇𝑟 in the temperature (C) scope is set? Attach a sample temperature response.
5. Vary the relay amplitude, 𝑉ℎ_𝑎𝑚𝑝, in the Control Parameters section. Explain how the heater
voltage affects the temperature variation and, in particular, observe the frequency and amplitude
of the chamber temperature. Attach a representative temperature response.
6. Explain the effect of changing the relay mean, 𝑉ℎ_𝑜𝑓𝑓. Attach a temperature response
7. Examine the effects of changing the relay width (or hysteresis), 𝐷𝑡ℎ, between 0.01ᵒC and 1.00ᵒC.
Give a short explanation and attach a temperature response with a narrow and wide hysteresis.
Exercise Question 1.
Give a real-world example of switch control operation and how a trade-off between hysteresis and better
control can improve the System’s life expectancy?
The student performance for the assigned task during the lab session was:
The student completed assigned tasks without any help from the
Excellent 4
instructor and showed the results appropriately.
The student completed assigned tasks with minimal help from the
Good 3
instructor and showed the results appropriately.
The student could not complete all assigned tasks and showed
Average 2
partial results.
Worst The student did not complete assigned tasks. 1
8.1 Objectives
• To Create the Mathematical Model of the QNET HVAC System
• To Design a PI Controller on the System
8.3.1 Introduction
During the previous lab, we developed mathematical model of the process and developed switch control
strategy to control the temperature of the chamber. In this experiment, we will move one step ahead to
implement a PI controller to control the process temperature. The controller aims to adjust the lamp
intensity to control the temperature through control input 𝑉ℎ . The reason as to why PID Controller is not
implemented instead of PI Controller can be best understood by examining the dynamics of the process.
To make the process fast enough, as per our requirements, we will need to have very sharp values of
control input which might in turn lead to damage the system.
8.3.2 Background
The oscillations that occur with on-off control can be avoided by using a linear proportional and
integrating controller. To design such a controller analytically a simple model representing the actual plant
is needed. Since the conditions shown in Figure 8.2 are representative for what happens when the
temperature is controlled, transfer function derived in previous experiment can be used for the model-
based approach to find the controller. The block diagram of the closed loop system is shown in Figure 8.1
𝐾𝑝 𝑏𝑠𝑝 𝑠 + 𝐾𝑖
𝐺∆𝑇𝑐 ,∆𝑇𝑟 (𝑠) = 𝐾𝑣
𝑠 2 + 𝐾𝑣 𝐾𝑝 𝑠 + 𝐾𝑣 𝐾𝑖
𝑠 2 + 𝐾𝑣 𝐾𝑝 𝑠 + 𝐾𝑣 𝐾𝑖
𝑠 2 + 2𝜉⍵0 + ⍵20
Where ⍵0 is the undamped closed-loop frequency and 𝜉 is the damping ratio. Comparing the two
characteristic equations gives us following expressions of the controller parameters
2𝜉⍵0
𝐾𝑝 =
𝐾𝑣
⍵20
𝐾𝑖 =
𝐾𝑣
Large values of ⍵0 give large values of controller gain. This implies noise will create large variations in the
control signal. The set-point weight parameter 𝑏𝑠𝑝 can be used to adjust the overshoot of the response.
The sensor signal is noisy and it is therefore necessary to filter the measured signal. A simple first order
filter has the transfer function
𝑇𝑐,𝑚𝑒𝑎𝑠
𝑇𝑐 =
𝑇𝑓 𝑠 + 1
Where 𝑇𝑐,𝑚𝑒𝑎𝑠 is the measured temperature from thermistor and 𝑇𝑓 is the transfer function time constant.
Increasing 𝑇𝑓 decreased the cut-off frequency and minimizes noises in the signal at the expense of
changing the shape of the signal.
Temperature control typically admits high controller gains. A consequence of this is that the controller
output may saturate and result in integrator windup. The heater is therefore useful to illustrate the
usefulness of integrator feedback.
8.4.1 Calibration
After powering up the ELVIS and before running any of the procedure, follow this procedure to calibrate
the QNET HVACT system.
1. Open the QNET_HVACT_PI_Control.vi
2. Make sure that the correct device is chosen.
3. Run the QNET_HVACT_On_Off_Control.vi shown in Figure 7.4.
4. The cooling fan is automatically activated when the Prototyping Board Power switch on the ELVIS
unit is ON. Let the actual temperature,𝑇𝑐 , in the Temperature (C) scope settle until it stops
decreasing.
5. Adjust the Temperature (C) scope scales to see both the reference and actual temperatures.
6. As illustrated in previous experiment, calibrate the temperature sensors by clicking on the
Calibrate button. This will align the chamber temperature, Tc, to the measured ambient
temperature, Ta.
7. Activate the control by clicking on the Heater OFF button (in the top-right corner of Figure 7.5).
1. Ensure the QNET_HVACT_PI_Control.vi is running and has been calibrated as instructed in section
7.4.1
2. In the Signal Generator section set:
𝐴𝑚𝑝𝑙𝑖𝑡𝑢𝑑𝑒 = 0.5 ᵒ𝐶
𝐹𝑟𝑒𝑞𝑢𝑒𝑛𝑐𝑦 = 0.02 𝐻𝑧
𝑂𝑓𝑓𝑠𝑒𝑡 = 1.5 ᵒ𝐶
6. Set 𝐾𝑝 to 0.5 𝑉/ ᵒ𝐶 and change the integral gain𝐾𝑖 between 0.25 𝑉/(ᵒ𝐶. 𝑠) and 2.0 𝑉/(ᵒ𝐶. 𝑠) and
observe its effect on the temperature control performance. Show the temperature response with
a low and high integral gain.
1. Ensure the QNET_HVACT_PI_Control.vi is running and has been calibrated as instructed in section
8.4.1
2. In the Signal Generator section set:
𝐴𝑚𝑝𝑙𝑖𝑡𝑢𝑑𝑒 = 0.75 ᵒ𝐶
𝐹𝑟𝑒𝑞𝑢𝑒𝑛𝑐𝑦 = 0.02 𝐻𝑧
𝑂𝑓𝑓𝑠𝑒𝑡 = 1.5 ᵒ𝐶
3. In Control Parameters section set:
𝐾𝑝 = 8 𝑉/ ᵒ𝐶
𝐾𝑖 = 4 𝑉/(ᵒ𝐶. 𝑠)
𝑏𝑠𝑝 = 1
𝑇𝑟 = 100s
4. What effect does increasing the anti-windup reset parameter have on the control signal and on
the temperature response? Attach a response of the temperature and heater voltage.
5. In the Control Parameters section, set 𝑇𝑟 = 1.0𝑠
6. What effect does decreasing 𝑇𝑟 have on the control signal and on the temperature response?
Attach a response of the temperature and heater voltage.
Exercise Question 1.
Describe the effects of following parameters on the temperature response observed during the
experiment
a) Proportional 𝐺𝑎𝑖𝑛 𝐾𝑝
b) Integral Gain 𝐾𝑖
The student performance for the assigned task during the lab session was:
The student completed assigned tasks without any help from the
Excellent 4
instructor and showed the results appropriately.
The student completed assigned tasks with minimal help from the
Good 3
instructor and showed the results appropriately.
The student could not complete all assigned tasks and showed
Average 2
partial results.
Worst The student did not complete assigned tasks. 1
The Root Locus method, as the name suggests, looks at the loci of the roots as some parameter of interest,
within the system, is varied. Since we already know that the position of the roots of the characteristic
equation strongly influence the step response of the system, we can find values of the parameter which
will position the roots appropriately, using the method of Root Locus. This method involves root locus
diagrams which the students are expected to have learnt in the theory class. In this lab we will use
Matlab’s powerful computing capability to find and trace root locus of a given system.
(s + 3)
1+K =0
s(s + 1)(s 2 + 4s + 16)
>>𝑝𝑙𝑜𝑡(𝑟, ’ − ’)
ζ = cos φ
In other words, lines of constant damping ratio are radial lines passing through the origin as shown in
Figure 4.3. For example, a damping ratio of 0.5 requires that the complex poles lie on the lines drawn
through the origin making angles of ± 60ᵒ with negative real axis. If the real part of a pair of complex
poles is positive, which means that the system is unstable, the corresponding ζ is negative. The damping
ratio determines the angular location of the poles, while the distance of the pole from the origin is
determined by the un-damped natural frequency ωn . The constant ωn loci are circles.
𝑠𝑔𝑟𝑖𝑑
𝑎𝑥𝑖𝑠 ([−2 2 − 2 2])
𝑎𝑥𝑖𝑠 (′𝑠𝑞𝑢𝑎𝑟𝑒′)
𝑡𝑖𝑡𝑙𝑒 (′𝐶𝑜𝑛𝑠𝑡𝑎𝑛𝑡 \𝑧𝑒𝑡𝑎 𝐿𝑖𝑛𝑒𝑠 𝑎𝑛𝑑 𝐶𝑜𝑛𝑠𝑡𝑎𝑛𝑡 \𝑜𝑚𝑒𝑔𝑎_𝑛 𝐶𝑖𝑟𝑐𝑙𝑒𝑠′)
𝑥𝑙𝑎𝑏𝑒𝑙 (′𝑅𝑒𝑎𝑙 𝐴𝑥𝑖𝑠′)
𝑦𝑙𝑎𝑏𝑒𝑙(′𝐼𝑚𝑎𝑔𝑖𝑛𝑎𝑟𝑦 𝐴𝑥𝑖𝑠′)
If only a particular constant ζ lines and particular constant ωn circles are desired, we may use the following
variant of sgrid command
Enter the following code into Matlab and show that the resulting plot is similar to the one shown in Figure
9.3.
𝑛𝑢𝑚 = [ 0 0 0 1 ]
𝑑𝑒𝑛 = [ 1 4 5 0 ]
𝑎𝑥𝑖𝑠 (′𝑠𝑞𝑢𝑎𝑟𝑒′)
𝑟𝑙𝑜𝑐𝑢𝑠 (𝑛𝑢𝑚 , 𝑑𝑒𝑛)
𝑎𝑥𝑖𝑠 ([− 3 1 − 2 2])
𝑠𝑔𝑟𝑖𝑑 ([0.5 , 0.707], [0.5 , 1.0 , 1.5])
𝑡𝑖𝑡𝑙𝑒 (′𝑅𝑜𝑜𝑡 𝐿𝑜𝑐𝑢𝑠 𝑃𝑙𝑜𝑡 𝑤𝑖𝑡ℎ \𝑧𝑒𝑡𝑎 = 0.5 𝑎𝑛𝑑 0.707 𝐿𝑖𝑛𝑒𝑠 𝑎𝑛𝑑 \𝑜𝑚𝑒𝑔𝑎_
= 0.5, 1.0 𝑎𝑛𝑑 1.5 𝐶𝑖𝑟𝑐𝑙𝑒𝑠′)
If we want to omit either the entire constant ζ lines or entire constant ωn circles, we may use empty
brackets [] in the arguments of the sgrid command. For example, if we want to overlay only the constant
damping ratio lines corresponding to ζ = 0.5 and no constant ωn circles to the root locus plot shown in
Figure 4.3, then we may use the command
And if you want to get the value of poles and gain at any particular point in root locus, you may use the
following command.
Click on any point in the root locus, you will get the value of Gain and Poles at that point
For routine design problems, the performance specifications (which relate to accuracy, relative stability,
and speed of response) may be given in terms of precise numerical values or in terms of qualitative
statements. In latter case the specifications may have to be modified during the course of design, since
the given specifications may never be satisfied (because of conflicting requirements) or may lead to a very
expensive system. Generally, the performance specifications should not be more stringent than necessary
to perform the given task.
For a system of the type we are studying (linear constant coefficient) if the input to a system is a sinusoid
at a particular frequency, then the output of the system is also a sinusoid at the same frequency, but
typically with a different amplitude or phase. Put another way, if the input to a system (described by the
transfer function H(s)) is 𝐴 · 𝑠𝑖𝑛(𝜔𝑡 + 𝜑) then the output is 𝑀𝐴𝑠𝑖𝑛(𝜔𝑡 + 𝜑 + 𝜃). This is likewise true for
cosine - only the magnitude and phase of the output relative to the input changes. This is shown below.
Figure 9.4
In this diagram the magnitude of the sinusoid has changed by a factor of M (which we will take to be a
positive real number) and the phase has changed by a factor of θ (a real number, not necessarily
positive). It is our task to find the value of M and θ for a particular system, H(s), at a particular frequency,
ω. We call M the magnitude of the system (or transfer function) at ω, and we call θ the phase of the
system at that frequency. Using complex impedances, it is possible to find the transfer function of a
circuit. For example, the circuit below is described by the transfer function, 𝐻(𝑠), where 𝑠 = 𝑗𝜔.
Figure 9.5
If we have a phasor representation for the input and the transfer function, the multiplication is simple
(multiply magnitudes and add phases). Finding the output becomes easy. Let's look at some examples:
Example 1
𝑉𝑖 = 3 sin(30. 𝑡) = 3 ∠ 0ᵒ
and the transfer function evaluates to
1 1 1
= = = 0.1 − 0.3𝑗 = 0.316 ∠ − 71.6ᵒ
1 + 𝑗. 0.1. ⍵ 1 + 𝑗. 0.1.30 1 + 3𝑗
The output is just the product of the input and the transfer function (evaluated as phasors). Thus the
magnitude will change by a factor of 0.316 (this is the gain of the system) and the phase will change by
−71.6° (this is the phase of the system).
𝑉0 = 𝑉𝑖 . 𝐻 = (3 ∠0ᵒ). (0.316∠ − 71.6ᵒ) = 0.95∠ − 71.6ᵒ = 0.95sin (30𝑡 − 71.6ᵒ)
Figure 9.6
Note that 𝑉0 has an amplitude of 0.95 and lags 𝑉𝑖 by72°. It is a phase "lag" because the output lags, or
follows, the input (the input goes up before the output so the output is following the input).
Example 2
Change input phase
𝑉𝑖 = 3 sin(30. 𝑡 + 40ᵒ) = 3∠40ᵒ
So the output is
1 1
𝑉0 = 𝑉𝑖 = 3∠40ᵒ. = 3∠40ᵒ(0.1 − 0.3j) = (3∠40ᵒ)(0.316∠ − 71.6ᵒ)
1 + 𝑗. 0.1. ⍵ 1 + j. 3
= 0.95∠ − 31.6ᵒ = 0.95sin (30t − 31.6ᵒ)
Figure 9.7: Both input and output have shifted 40° from those in Example 1.
Figure 9.8: Frequency has changed, magnitude of output has increased, but phase lag has decreased (to 45°).
Figure 9.9
Standard Bode plots are logarithmic on the frequency axis and plot the magnitude in dB's (decibels). We
can use these plots to determine the solutions to the examples 1 to 3 without resorting to algebra.
The frequency response of a system is presented as two graphs: one showing magnitude and one
showing phase. The phasor representation of the transfer function can then be easily determined at
any frequency. The magnitude of the output is the magnitude of the phasor representation of the
transfer function (at a given frequency) multiplied by the magnitude of the input. The phase of the
output is the phase of the transfer function added to the phase of the input.
Figure 9.10
a) Phase Margin:
It is the difference between your phase and −180 degrees of phase at the point where gain crosses 0𝑑𝑏
b) Gain Margin:
It is the difference between gain and 0𝑑𝑏 at the point where phase crosses −180 degrees
c) Gain Cross Over
The point where gain crosses 0𝑑𝑏 is called Gain Crossover Frequency
d) Bandwidth
It is the point where gain drops to −3𝑑𝑏
e) DC Gain
The magnitude in 𝑑𝑏𝑠 at 0 𝑟𝑎𝑑/𝑠𝑒𝑐 frequency
Normally, cascade (or series) compensation may be simpler than feedback (or parallel) compensation;
however, series compensation frequently requires additional amplifiers to increase the gain and/or to
provide isolation. Note that, in general, the number of components required in parallel compensation will
be less than the number of components in series compensation, provided a suitable signal is available. In
this lab we will discuss series compensation in detail.
If a sinusoidal input is applied to a network, and the steady-state output (which is also sinusoidal) has a
phase lead, then the network is called a lead network and the device to eliminate this phase lead is called
lead compensator. The amount of phase lead angle is a function of the input frequency. If the steady-state
output has a phase lag, then the network is called a lag network and the corresponding device to remove
this phase lag is called lag compensator. These compensators may be electronic devices, such as
operational amplifiers, or RC networks and amplifiers.
How is this accomplished? If you recall finding the asymptotes of the root locus that lead to the zeros at
infinity, the equation to determine the intersection of the asymptotes along the real axis is:
∑ poles − ∑ zeros
α=
(No. of poles) − (No. of zeros)
When a lead compensator is added to a system, the value of this intersection will be a larger negative
number than it was before. The net number of zeros and poles will be the same (one zero and one pole
are added), but the added pole is a larger negative number than the added zero. Thus, the result of a lead
compensator is that the asymptotes' intersection is moved further into the left half plane, and the entire
root locus will be shifted to the left. This can increase the region of stability as well as the response speed.
The control job is to automatically regulate the position of the ball on the beam by changing the angle of
the beam. This is a difficult task because the ball does not stay in one place on the beam but moves with
an acceleration that is proportional to the tilt of the beam. In control technology this system is open-loop
unstable because the system output (the ball position) increases without limit for a fixed input (beam
angle). Feedback control must be used to keep the ball in desired position on the beam.
The complete description of the dynamics of the ball rolling on the beam is quite complicated and for
control system perspective a simplified derivation is used to give a model that is good for controller design.
The force that accelerates the ball as it rolls on the beam comes from the component of gravity that acts
parallel to the beam. The dotted line in Figure 9.13 shows this force to be mgsinθ. The ball actually
accelerates along the beam by rolling, but we can simplify the derivation by assuming that the ball is
sliding without friction along the beam. Then, using the second law of Newton, the simplified ball and
beam model is,
d2 x
mgsinθ = m
dt 2
Where m is the mass of the ball, g is the gravitational constant, θ is the beam angle and x is the position
of the ball on the beam.
For small angles, sinθ ≈ θ, so the model becomes,
d2 x
= gθ
dt 2
This simple model of the ball and beam is a good approximation to the true system dynamics, and is the
one normally used in text books and design studies for controller design. Combining actuator and sensor
constants with the gravity constant, we get a single constant b. This represents the overall gain of the
response from control voltage input to measured output acceleration. The transfer function
representation of the above equation is
X(s) b
= (1)
Ɵ (s) s2
Where
−mgd
b=
J
L( 2 + m)
R
How does the lag controller shift the root locus to the right? The answer is the same as that to lead
compensator. Again recall finding the asymptotes of the root locus that lead to the zeros at infinity, the
equation to determine the intersection of the asymptotes along the real axis is
∑ poles − ∑ zeros
α=
(No. of poles) − (No. of zeros)
When a lag compensator is added to a system, the value of this intersection will be a smaller negative
number than it was before. The net number of zeros and poles will be the same (one zero and one pole
are added), but the added pole is a smaller negative number than the added zero. Thus, the result of a lag
compensator is that the asymptotes' intersection is moved closer to the right-half plane, and the entire
root locus will be shifted to the right.
It was previously stated that that lag controller should only minimally change the transient response
because of its negative effect. If the phase-lag compensator is not supposed to change the transient
response noticeably, what is it good for? The answer is that a phase-lag compensator can improve the
system's steady-state response. It works in the following manner. At high frequencies, the lag controller
will have unity gain. At low frequencies, the gain will be z/p which is greater than 1. This factor z/p will
multiply the position, velocity, or acceleration constant (𝐾𝑝 , 𝐾𝑣 , 𝑜𝑟 𝐾𝑎 ), and the steady-state error will
thus decrease by the factor z/p.
Ɵ̇ K
= (Js+b)(Ls+R)+K2
(2)
U
Y(s) K(s + 7)
T(s) = =
R(s) s(s + 5)(s + 15)(s + 20)
We want to design a feed-back controller for the system by using the root locus method and our design
criteria are 5% overshoot and 1 second rise time.
Design a controller in MATLAB which meets the given criteria. Show its response and verify that it meets
the designed criteria. Attach Matlab Code and Results
Exercise 1
Consider the following unity feedback system,
Design a Compensator to tailor the transient response as per the given criteria
𝑃𝑂 ≤ 10%
𝑇𝑠 ≤ 2𝑠
The student performance for the assigned task during the lab session was:
The student completed assigned tasks without any help from the
Excellent 4
instructor and showed the results appropriately.
The student completed assigned tasks with minimal help from the
Good 3
instructor and showed the results appropriately.
The student could not complete all assigned tasks and showed
Average 2
partial results.
Worst The student did not complete assigned tasks. 1
10.3.1 Introduction
We have been analyzing and designing control systems by using a transfer-function approach (which
allowed us to conveniently model the system, and use techniques such as root-locus, Bode plots and
Nyquist plots). These techniques were developed and studied during the first half of the twentieth century
in an effort to deal with issues such as noise and bandwidth issues in communication systems. Transfer
function methods have various drawbacks however, since they cannot deal with nonlinear systems, are
not very convenient when considering systems with multiple inputs and outputs and are difficult to use
for formulating ‘optimal’ control strategies. Starting in the 1950’s (around the time of the space race),
control engineers and scientists started turning to state-space models of control systems in order to
address some of these issues. These are purely time-domain ordinary differential equation models of
systems and are able to effectively represent concepts such as the internal state of the system, and also
present a method to introduce optimality conditions into the controller design procedure. This lab will
provide an introduction to the state-space approach to control design (sometimes referred to as “modern
control”).
Continuous state-space models use first-order differential equations to describe the system. We analyse
state-space models in the time domain. The following equations define a continuous state-space model.
State and output equations are given below:
x ′ = Ax + Bu
y = Cx + Du
Figure 1.1
where 𝑛𝑢𝑚_𝑖𝑛 must be specified for systems with more than one input. For example, if there is only one
input, then 𝑛𝑢𝑚_𝑖𝑛 = 1, if there are two inputs then 𝑛𝑢𝑚_𝑖𝑛 = 2, etc. For systems with only one input,
then the following code is allowed
[𝑛𝑢𝑚, 𝑑𝑒𝑛] = 𝑠𝑠2𝑡𝑓(𝐴, 𝐵, 𝐶, 𝐷)
Given the state-space equations:
𝑥1 ′ 0 1 0 𝑥1 0
[𝑥2 ′] = [ 0 0 1 ] [𝑥2 ] + [ 25 ] 𝑢
𝑥3 ′ −5 −25 −5 3 𝑥 −120
𝑥1
𝑦 = [1 0 0] [𝑥2 ]
𝑥3
Matlab produces the following system transfer function
25𝑠 + 5
𝐻(𝑠) = 3
𝑠 + 5𝑠 2 + 25𝑠 + 5
The Matlab implementation of this is given by
𝐴 = [0 1 0; 0 0 1; −5 − 25 − 5];
𝐵 = [0; 25; −120];
𝐶 = [1 0 0];
𝐷 = [0];
[𝑛𝑢𝑚, 𝑑𝑒𝑛] = 𝑠𝑠2𝑡𝑓(𝐴, 𝐵, 𝐶, 𝐷)
Full state feedback assumes the closed-loop dynamics of a system to be on the form:
x ′ = Ax + Bu
y = Cx + Du
If D=0, we can place the poles of the system arbitrarily by solving the characteristic equation, as long as
the system is controllable.
Then the open loop eigen values of the system are the roots of the characteristic equation given by
|𝑠𝐼 − 𝐴| = 0
Full state feedback is utilized by commanding the input vector u. Consider an input proportional to the
state vector.
𝑢 = −𝐾𝑥 (K is the state feedback gain matrix)
Substituting in state space equation we get:
x ′ = (A − BK)x
𝑦 = (C − DK)x
The eigen values of Full state feedback system is given by: |sI−(𝐴−𝐵K)
Comparing the terms of this equation with those of the desired characteristic equation yields the value of
the feedback matrix K which force the closed loop eigen values to the pole locations specified by the
desired characteristic equation.
To design a state feedback controller using the pole placement method, we first need to determine the
desired closed-loop poles. The desired closed-loop poles should be chosen to achieve the desired
performance of the system. For example, if we want the system to have a fast response time, we would
place the closed-loop poles far to the left in the complex plane.
Once we have determined the desired closed-loop poles, we can use the Ackerman's formula to calculate
the state feedback gain matrix, K. The Ackerman's formula is a recursive formula that can be used to
calculate K for any system that is controllable.
The following is an example of how to use the pole placement method to design a state feedback
controller for a simple linear system:
x' = Ax + Bu
y = Cx
We want to place the poles of the closed-loop system at s=−2±j2. To do this, we can use the following
MATLAB code:
u = -Kx
This will place the poles of the closed-loop system at s=−2±j2, which will give the system a desired
response.
Controllability is defined as the ability of a control system to reach a definite state from a fixed (initial)
state in a finite time. It is considered as an important property of the control system as it defines the
behaviour of the control system. A system is completely controllable if any initial state can be driven to
any final state in a finite time using only the available control inputs. This means that the controller has
the ability to manipulate the system's internal dynamics to achieve the desired output.
To check controllability and find the controllability matrix in MATLAB, you can follow these steps
1. Define your system in state-space representation. You need to have matrices A and B that
describe the system's dynamics.
2. Use the ctrb function to calculate the controllability matrix.
3. Check the rank of the controllability matrix to determine if the system is fully controllable.
if rank_Ctrb == n
disp('The system is fully controllable.');
else
disp('The system is not fully controllable.');
end
In this example, the code defines a simple 2-state system with matrices A and B. It then calculates the
controllability matrix Ctrb using the ctrb function and checks the rank of this matrix. If the rank is equal to
the number of states (n), the system is fully controllable. If the rank is less than n, the system is not fully
controllable.
You can replace the A and B matrices with those representing your own system to check its controllability.
If the rank of the controllability matrix is less than the number of states, it may indicate that additional
control inputs or modifications to the system dynamics are needed to achieve full controllability.
Overall, state feedback control is a powerful control method that can be used to achieve a wide range of
control objectives.
𝑑𝜔(𝑡) 1
= (𝐾𝑡 𝑖𝑎 (𝑡) − 𝑏. 𝜔(𝑡)) (eq. 1)
𝑑𝑡 𝐽
𝑑𝑖𝑎 (𝑡) 1
𝑑𝑡
= 𝐿
(𝑉𝑎 − 𝑅𝑖𝑎 (𝑡) − 𝐾𝑏 𝜔𝑎 (𝑡)) (eq. 2)
a) Using the above equations 1 & 2, Develop a state space model for a Dc motor system.
b) Design a full state feedback controller for a dc motor system to meet the following design criteria:
• Settling time less than 2 seconds
• Overshoot less than 5%
• Steady-state error less than 1%
Exercise 1:
Design a state feedback controller to yield a 16.3% overshoot and settling time of 4s by choosing
the third desired closed-loop pole to cancel the closed-loop zero.
The student performance for the assigned task during the lab session was:
The student completed assigned tasks without any help from the
Excellent 4
instructor and showed the results appropriately.
The student completed assigned tasks with minimal help from the
Good 3
instructor and showed the results appropriately.
The student could not complete all assigned tasks and showed
Average 2
partial results.
Worst The student did not complete assigned tasks. 1
The experiment illustrates some control tasks for gantry cranes. The gantry is a moving platform or trolley
that transports the crane about the factory floor or harbour. The load hangs from the crane using wires
and is moved by the gantry crane. Typically, the problem is to move the load quickly and move it to the
correct position. The fast motion necessary for production makes it more difficult to move the load to the
correct location given the swinging motions of the crane. This problem can be mimicked using the rotary
pendulum system by viewing the tip of the L-shaped arm as the moving trolley and the pendulum tip as
the load being carried. In this experiment we will begin by modelling the system and determine strategies
to dampen the oscillations of the system.
Figure 11.2
Where 𝑥 is the linear distance from the pivot axis and 𝑝 is the density of the body. The circle in the top-
left corner of Figure 11.2 represents the axis of rotation or the pivot axis that goes into the page. The
pendulum system is then expressed as one rigid body with a single centre of mass, as shown in Figure 11.3
Figure 111.3
The centre of mass of a composite object that contains n bodies can be calculated using
∑𝑛𝑖=𝑖 𝑚𝑖 𝑥𝑐𝑚,𝑖
𝑥𝑐𝑚 =
∑𝑛𝑖=𝑖 𝑚𝑖
where 𝑥𝑐𝑚,𝑖 is the known centre of mass of body 𝑖 and 𝑚𝑖 is the mass of body 𝑖. From the free-body
diagram in Figure 11.3, the resulting nonlinear equation of motion of the pendulum is
where 𝐽𝑝 is the moment of inertia of the pendulum at the pivot axis 𝑧0 ,𝑀𝑝 is the total mass of the
pendulum assembly, 𝑢 is the linear acceleration of the pivot axis, and 𝑙𝑝 is the centre of mass position as
depicted in Figure 11.3. Thus as the pivot accelerates towards the left, the inertia of the pendulum causes
it to swing upwards while the gravitation force 𝑀𝑝 𝑔 and the applied force 𝑀𝑝 𝑢 pull the pendulum
downwards.
𝑀𝑝 𝑔𝑙𝑝
𝐽𝑝 =
4𝑓 2 𝜋 2
Where 𝑓 is the measured frequency of the pendulum as the arm remains rigid. The frequency is calculated
using
𝑛𝑐𝑦𝑐
𝑓=
∆𝑡
Where 𝑛𝑐𝑦𝑐 is the number of cycles and ∆𝑡 is the duration of these cycles. Alternatively, 𝐽𝑝 can be
calculated using the moment of inertia expression
𝐽 = ∫ 𝑟 2 𝑑𝑚
Where 𝑟 is the perpendicular distance between the element mass𝑑𝑚, and the axis of rotation. In addition
to finding the moment of inertia, this laboratory investigates the friction that is present in the system. The
rotor of the DC motor that moves the system requires a certain amount of current to begin moving. In
addition, mass from the pendulum system requires even more current to actually begin moving the
system. The friction is particularly severe for velocities around zero because friction changes sign with the
direction of rotation.
Figure 111.4
11.3.1 Damping
1. Ensure the QNET ROTPENT Simple Modelling VI is open. Make sure the correct device is chosen
2. Run the VI
3. Hold the arm of the rotary pendulum system stationary and manually perturb the pendulum
4. While still holding the arm, examine the response of Pendulum Angle in Angle scope. This is the
response from the pendulum system
5. Repeat step 3 above but release the arm after several swings
6. Examine the Pendulum Angle (deg) response when the arm is not fixed. This is the response from
the rotary pendulum system. Given the response from the pendulum and rotary pendulum
system, which converges faster towards angle zero? Why does one system dampen faster than
other?
11.3.2 Friction
1. Run the QNET_ROTPENT_Simple_Modelling.vi
2. In the Signal Generator section set
𝐴𝑚𝑝𝑙𝑖𝑡𝑢𝑑𝑒 = 0 𝑉
𝐹𝑟𝑒𝑞𝑢𝑒𝑛𝑐𝑦 = 0.25 𝐻𝑧
𝑂𝑓𝑓𝑠𝑒𝑡 = 0.0 𝑉
3. Change the Offset in steps of 0.10 𝑉 until the pendulum beings moving. Record the voltage at
which pendulum moved.
4. Repeat step 3 above for steps of −0.10 𝑉
5. Enter positive 𝑉𝑓𝑝 and negative voltage 𝑉𝑓𝑛 values needed to get the pendulum moving. Why does
the motor need a certain amount of voltage to get the motor shaft moving? Enter these values in
table 12.2.
a) Theoretical Calculations
Find the moment of inertia acting about the pendulum pivot using the free body diagram. Make sure you
evaluate numerically using the parameters defined in the table below. Show all the calculations below.
Enter this value in Table 11.2
Table 111-1
5. Compare the moment of inertia calculated analytically in section 12.5.3(a) and the moment of
inertia found experimentally. Justify if there exists a large discrepancy between them.
11.3.4 Results
Table 111-2
Description Symbol Value Unit
Positive Coulomb Friction
𝑉𝑓𝑝 𝑉
Force
Negative Coulomb Friction
𝑉𝑓𝑛 𝑉
Force
Calculated Inertia 𝐽𝑝 𝑘𝑔. 𝑚2
Experimentally Found
𝐽𝑝,𝑒𝑥𝑝 𝑘𝑔. 𝑚2
Inertia
Exercise Question 1
An inverted pendulum is highly nonlinear system. Consider we want to design a linear controller to control
it. For this first of all we will need to linearize its mathematical model. Do you see any feasible point where
it could be linearized? What assumptions would we need to make?
The student performance for the assigned task during the lab session was:
The student completed assigned tasks without any help from the
Excellent 4
instructor and showed the results appropriately.
The student completed assigned tasks with minimal help from the
Good 3
instructor and showed the results appropriately.
The student could not complete all assigned tasks and showed
Average 2
partial results.
Worst The student did not complete assigned tasks. 1
𝐸𝑝 = 𝑀𝑝 𝑔𝑙𝑝 (1 − 𝑐𝑜𝑠 ∝)
And the kinetic energy is
1
𝐸𝑘 = 𝐽𝑝 ά2
2
The potential energy is zero when the pendulum is at rest at α = 0 (see free body diagram in lab 12), and
equals 2𝑀𝑝 𝑔𝑙𝑝 when the pendulum is upright at α = ±π. The sum of the potential and kinetic energy of
the pendulum is
1
𝐸 = 𝐽𝑝 ά2 + 𝑀𝑝 𝑔𝑙𝑝 (1 − 𝑐𝑜𝑠 ∝)
2
Differentiating above equation results in the differential equation
Substituting the pendulum nonlinear equation of motion given in lab 12 in above equation gives
𝐸 ′ = 𝑀𝑝 𝑢𝑙𝑝 ά 𝑐𝑜𝑠 ∝
Since the acceleration of the pivot is proportional to current driving the arm motor and thus also
proportional to the drive voltage we find that it is easy to control the energy of the pendulum. The
proportional control law
𝑢 = (𝐸𝑟 − 𝐸) ά 𝑐𝑜𝑠 ∝
However, for energy to change quickly the magnitude of the control signal must be large. As a result the
following swing-up controller is implemented in the LabVIEW VI
Where μ is a tuneable control gain and the 𝑠𝑎𝑡𝑢𝑚𝑎𝑥 function saturates the control signal at the maximum
acceleration of the pendulum pivot, 𝑢𝑚𝑎𝑥
This system can be modelled as a hybrid system. Hybrid systems are systems with both continuous and
discrete parts. There are two continuous part: the closed-loop system using the swing-up energy
controller and the closed loop system using the PD balance controller. The switching strategy is the
discrete element that chooses which controller, or system, to run. The switching logic can be obtained by
determining a region in state space where the balancing works well. Balancing control is then used inside
this region and energy control is used outside the region. Figure 12.2 is a called a hybrid automaton and,
for this specific task, can be used to describe the system model and the switching logic.
The circles in Figure 12.2 are called locations and represent the two different continuous system. The
arrows are called edges and represent the discrete jumps taken when certain condition are satisfied. The
angle used in the switching logic in Figure 12.2 is called the upright angle. It is defined as zero when the
pendulum is about its upright vertical position and expressed mathematically using
∝𝑢𝑝 =∝ 𝑚𝑜𝑑(2𝜋 − 𝜋)
The various switching parameters shown in Figure 12.2 can then be set as:
ɛ = 2 𝑑𝑒𝑔
𝜂 = 720 𝑑𝑒𝑔/𝑠
𝛾 = 30 𝑑𝑒𝑔
Given that the pendulum starts in the downward vertical position, it is in the swing-up location of the
hybrid automaton. The swing-up controller pumps energy into the pendulum until it swings within
±2 𝑑𝑒𝑔 of its upright vertical position. Once the pendulum is within that that range and does not exceed
720 𝑑𝑒𝑔/𝑠 in either direction, the edge is taken to engage the balance controller. It remains in the Balance
PD control location until the pendulum goes beyond the ±30 𝑑𝑒𝑔 position range or beyond ±720 𝑑𝑒𝑔/𝑠.
Exercise Question 1
Discuss the position sensor used in the system assembly to measure the pendulum and the arm position.
Propose a method if sensor was not available.
The student performance for the assigned task during the lab session was:
The student completed assigned tasks without any help from the
Excellent 4
instructor and showed the results appropriately.
The student completed assigned tasks with minimal help from the
Good 3
instructor and showed the results appropriately.
The student could not complete all assigned tasks and showed
Average 2
partial results.
Worst The student did not complete assigned tasks. 1