Department of Electrical Engineering EE361: Control Systems
Department of Electrical Engineering EE361: Control Systems
Lab
Name Roll No. Viva Total
Performance
Muhammad Hamza
BSEE18078
Shahid
65 35 100
𝑥−𝑥0 2
(𝑥−𝑥0)2
( )
𝑓(𝑥) = 𝑓 𝑥0 +
𝑑𝑓
𝑑𝑥
|
𝑥=𝑥0
1!
+
𝑑𝑓
𝑑𝑥
2 | 2!
+…
𝑥=𝑥0
( ) (
𝑓(𝑥)≈𝑓 𝑥0 + 𝑥 − 𝑥0 ) 𝑑𝑦𝑑𝑥 |𝑥=𝑥
0
Usually the process is simplified to only finding the linear term in the vicinity of the region of
interest and ignoring the higher order terms. The linear approximation can be found by
getting the first order derivative of the function at the point of interest and finding the line
which has the gradient equal to the first order derivative and passes through the point of
interest.
3.1.2 Example: Finding the Linear Approximation of a Quadratic Function
2
Figure 3-1 shows how a nonlinear function, such as a quadratic function 𝑦 = 𝑥 can be
approximated as a linear equation near a specific point 𝑥 = 𝑥0 on the curve. The linear
approximation is basically the line tangent to the curve at 𝑥 = 𝑥0. Notice that the tangent
line approximates the curve quite accurately but only near the point 𝑥0 and deviates
considerably as we move away from 𝑥0.
47
Figure 3-1: Linear approximation of a quadratic function [1]
Now the equation of this tangent line can be found through the linear approximation of the
Taylor series we discussed above,
( ) (
𝑓(𝑥)≈𝑓 𝑥0 + 𝑥 − 𝑥0 ) 𝑑𝑦𝑑𝑥 |𝑥=𝑥
0
2
Now for 𝑓(𝑥) = 𝑥 ,
𝑑𝑦
𝑑𝑥
| = 2𝑥0
𝑥=𝑥0
Therefore,
( )
𝑓(𝑥)≈𝑓 𝑥0 + 2𝑥0 𝑥 − 𝑥0 ( )
2
𝑦≈𝑥0 + 2𝑥0 𝑥 − 𝑥0 ( )
2
is the equation of the tangent line of 𝑓(𝑥) = 𝑥 at 𝑥0 and hence its linear approximation
near the point 𝑥0.
Now the graph of y against x is a straight line but it does not pass through origin, which is a
requirement of a linear model as we discussed above. So to convert it into a straight line
2
passing through origin, we need to apply a change of variable. Let δ𝑦 = 𝑦 − 𝑥0 and
δ𝑥 = 𝑥 − 𝑥0. So the equation becomes
δ𝑦 = 2𝑥0δ𝑥
48
3.2 Task 1: Pendulum on a Cart
Objective: Linearize the differential equations of a pendulum-on-cart system at its two
equilibrium points and compare the behavior of the linearized models using MATLAB.
Consider a rod pendulum mounted on a cart as shown in Figure 3-2. The cart’s wheels and
the pendulum’s joint are assumed to be frictionless for simplicity. An external force F acts
horizontally on the cart that moves with horizontal displacement x, and the pendulum makes
an angle θ with the downward vertical. Let the positive direction for linear motion be towards
the right and the positive direction for the angular motion be counterclockwise.
Mass 𝑚 0. 2 𝑘𝑔
49
By analyzing the mechanics of the cart-pendulum system, we can derive the following two
differential equations describing its motion under the influence of gravity and the external
force. [2]
2
𝑓 = (𝑀 + 𝑚)𝑥¨ + 𝑏𝑥˙ + 𝑚𝑙θ̈ cos 𝑐𝑜𝑠 θ − 𝑚𝑙θ̇ sin 𝑠𝑖𝑛 θ Equation
3-1
1. Pre-Lab How do you expect the pendulum to behave when it is at the vertically
downwards position (θ = 0) and given a slight push? [2 points]
When the pendulum is given a slight push from its vertically downward position (θ = 0), we
expect it to keep rotating about its axis of rotation in the counterclockwise direction
indefinitely until a balancing force is applied to the cart to make it stable.
2. Pre-Lab How do you expect the pendulum to behave when it is carefully balanced in an
upright position (θ = π) and then given a slight push? [2 points]
When the pendulum is given a slight push in its balanced upright position (θ = π), we expect
it to keep rotating about its axis of rotation in the clockwise direction indefinitely until a
balancing force is applied to the cart to make it stable.
In this task, we are interested only in small angles of the pendulum arm, because we want to
use a linear model for the pendulum and the linear approximation using the Taylor series is
valid only for small angles around θ0. For small angles of the pendulum arm, the dynamics of
2
the pendulum imply that θ̇ would also be small. So we can assume θ̇ ≈0 in this case. But the
equations still include the trigonometric functions, which make these equations nonlinear.
3. Pre-Lab Linearize the differential equations of the cart-pendulum system around the point
where θ = 0, and find the transfer function from the external force to the pendulum
angle. Beware that this linear approximation would be valid only for the values of theta
close to 0. You may follow the following steps.
i. Linearize the nonlinear functions sin 𝑠𝑖𝑛 (θ) and cos 𝑐𝑜𝑠 (θ) at θ = 0.
ii. Substitute linear approximations in the differential equations and apply the change of
variables if necessary.
iii. Take Laplace transform of Eq. 1.
iv. Take Laplace transform of Eq. 2 and make X(s) the subject.
v. Eliminate X(s) from both equations by substitution and find the transfer function
between Θ(𝑠) and 𝐹(𝑠). [5 points]
50
2
𝑓 = (𝑀 + 𝑚)𝑥¨ + 𝑏𝑥˙ + 𝑚𝑙θ̈ cos 𝑐𝑜𝑠 θ − 𝑚𝑙θ̇ sin 𝑠𝑖𝑛 θ
By linearizing the the system about (θ = 0)θis measured with vertical upward in
counter-clockwise direction, where θ = 0 + φand the system starts from rest so,
𝑐𝑜𝑠θ = 𝑐𝑜𝑠(0 + φ) ≈ 1
𝑠𝑖𝑛θ = 𝑠𝑖𝑛(0 + φ) ≈ φ
''
+ 𝑚𝑔𝑙φ =− 𝑚𝑙𝑥
Θ(𝑠) 0.06𝑠
𝐺0(𝑠) = =
𝐹(𝑠) −0.0132𝑠3−0.0024𝑠2+0.4166𝑠+0.0588
4. Create this transfer function in MATLAB using the given values of physical parameters
and plot its impulse response. Insert the plot here. Describe the behavior of the system in
your own words, mentioning the initial and final values, general shape of the curve and
whether the system is stable or unstable. [5
points]
51
As the impulse response shows, the pendulum-cart system is unstable as the pendulum
continues to rotate forever.
5. Pre-Lab Now linearize the differential equations of the cart-pendulum system around the
point θ=π and find a transfer function between angle and external force. You may use the
same steps as in part 3. [5 points]
By linearizing the the system about (θ = π)θis measured with vertical downward in
counter-clockwise direction, where θ = π + φand the system starts from rest so,
2 2 2
(𝐼 + 𝑚𝑙 )𝑠 Θ(𝑠) − 𝑚𝑔𝑙Θ(𝑠) = 𝑚𝑙𝑠 𝑥
2 2
𝐹(𝑠) = (𝑀 + 𝑚)𝑠 𝑥 + 𝑏𝑠𝑥 − 𝑚𝑙𝑠 Θ(𝑠)
By dividing Θ(𝑠) 𝑏𝑦 𝐹(𝑠),and substituting the values from the table 3-1, we get the following
transfer function:
Θ(𝑠) 0.06𝑠
𝐺π(𝑠) = = 3 2
𝐹(𝑠) 0.0132𝑠 +0.0024𝑠 −0.4166𝑠−0.0588
6. Create this transfer function in MATLAB using the given values of physical parameters
and plot its impulse response. Insert the plot here. Describe the behavior of the system in
your own words, mentioning the initial and final values, general shape of the curve and
stability or instability. [5
points]
52
As the impulse response shows, the pendulum-cart system is unstable as the pendulum
continues to rotate forever.
7. Describe and explain whether or not your results for parts 4 and 6 match with your general
perception of a cart-pendulum system in parts 1 and 2 respectively. [3+3 points]
● Yes, our results for parts 4 and 6 exactly match with our general perception of a
cart-pendulum system in parts 1 and 2 respectively. In part 1, we described that when
a slight push is given to the cart when the pendulum was at its vertically downward
position (θ = 0),it starts to rotate about the axis of rotation indefinitely in the
counterclockwise direction which is exactly shown by our impulse response.
● In part 2, we described that when a slight push is given to the cart when the pendulum
was at its vertically downward position (θ = π),it starts to rotate about the axis of
rotation indefinitely in the clockwise direction which is exactly shown by our impulse
response.
53
saturation, dead zone, and backlash, into a PMDC to show the effects of these nonlinearities
upon the linear system.
The response of a system which has a linear relation between the input and the output is
shown in the following figure. Notice that the response is a straight line that passes through
the origin.
Figure 3-4 shows some examples of physical nonlinearities. An electronic amplifier is linear
over a specific range but exhibits the nonlinearity called saturation at high input voltages. A
motor that does not respond at very low input voltages due to frictional forces exhibits a
nonlinearity called dead zone. Gears that do not fit tightly exhibit a nonlinearity called
backlash: The input moves over a small range without the output responding. [3]
54
Figure 3-5: Motor with saturation nonlinearity
When both the motors were driven by the same input sine wave of 8𝑉𝑝𝑘, both of them
continue their journey of angular motion the same time and with the same behaviour until the
motor with the saturation gets saturated at + 5𝑉.The motor without the saturation goes
upto + 8𝑉.When the negative cycle comes, both the motors show the same behaviour until
the saturation motor gets saturated at − 5𝑉,and the motor without it continues to increase its
speed and goes upto − 8𝑉.The process continues like this afterwards.
2. To examine how a motor with a dead zone nonlinearity behaves differently from an ideal
motor, we provide it with an input signal that has components both inside and outside the
dead zone. A sine wave signal with amplitude larger than the dead zone can serve for this
purpose well enough. Therefore, in this task we simulate a DC motor that has a small dead
zone for the input voltage, i.e. it does not respond to voltages smaller than 1 𝑉 in
magnitude. Build the model shown in Figure 3-6 in Simulink and observe the two graphs
of the motors’ speeds shown on the scope. Label the signals as shown in the diagram and
insert a Legend in the graph. Insert the graph here. Describe the difference between the
performance of the motor with and without the dead zone nonlinearity. [2
+ 2 points]
55
Figure 3-6: DC motor with a dead zone nonlinearity
When the input sine wave of 8𝑉𝑝𝑘is applied to both the motors, the motor without the
dead-zone continues its journey of angular motion along with the input sine wave and
behaves linearly with time. On the other hand, the motor with the dead zone does not respond
to very small voltages such as those below ± 1𝑉(𝑖𝑛 𝑡ℎ𝑖𝑠 𝑐𝑎𝑠𝑒).When the input sine wave
starts, i.e., its value is very small, the motor with the dead-zone is at the standstill position
whereas the other motor without the dead-zone continues to increase its speed with the input
wave. When the value of the input sine wave crosses 1𝑉,the motor with the dead-zone
responds.
3. Similarly, to demonstrate the output of a motor with backlash, we provide it with a suitable
input that makes its output come within and extends beyond its backlash band. Consider a
geared DC motor with backlash as shown in Figure 3-7. Build this system in Simulink and
observe the two graphs of the motors’ speeds shown on the scope. Label the signals as
shown in the diagram and insert a Legend in the graph. Insert the graph here. Describe
56
how the backlash in the gearbox affects the position of the output shaft. [2 + 2
points]
When the input pulse of period 3𝑠and5𝑉is applied to both the motors, the motor without the
backlash deadband responds linearly to the input waveform. It starts as the input is applied
and vice versa. However, the motor with the backlash deadband does not respond as quickly
as the one without the backlash, it rather takes some time to start or even stop. Even when the
voltage goes to zero, it does not really go to zero but takes a while to do so. This is because of
the flexibility present in the system which in this case is the gear system of the motor.
4. Suppose you are running a motor on a battery. As the battery discharges and its voltage
decreases, the motor slows down. But when the voltage is very low, the motor stops even
when the battery’s voltage is not zero. What type of nonlinearity is the motor exhibiting in
this example? [1 point]
57
When the voltage is very low but not zero, the motor stops. In this case, the motor is
exhibiting the characteristic of dead-zone which says that when the input voltage crosses a
certain threshold voltage, then only the motor starts and stops depending on the polarity of
the voltage due to the friction experienced by the motor’s rotor. In this example, when the
battery’s voltage falls below a certain value, the motor stops due to its dead-zone
non-linearity.
5. While playing with a remote-controlled car, you notice that it does not start moving
immediately when you press the forward button. Rather the wheel takes a split second to
come into motion. What type of nonlinearity may the motor of this car show in this
example? [1
point]
When we press the forward or the backward button on the remote, the motor of the
remote-controlled car takes a while to start. This is because of the fact that the motor in the
car shows the backlash behaviour which says that when an input is applied to the system,
due to the flexibility present in the system, it requires some time to start or even stop. This
is exactly shown by the remote control car.
6. When you play a song on your computer, the sound from the speaker becomes louder as
you crank up the volume setting. The loudness seems proportional to the volume setting in
the media player. However, you cannot keep turning the volume up indefinitely to make it
sound louder and louder. What kind of nonlinearity in the audio playback system causes
this behavior? [1
point]
We can not keep turning the volume up indefinitely to make the sound of the song louder and
louder because the speaker of our computer has reached its maximum loudness. Any further
turning the volume up will not make it louder. The speaker of our computer has some
saturation point, when it is not reached, the loudness increases with turning the volume up,
after that saturation, it does not respond linearly with the input, but rather becomes constant.
58
Assessment Rubrics
EE361: Control Systems – Lab 3
Method: Lab reports and instructor observation during lab sessions
Outcome Assessed:
a. Ability to conduct experiments, as well as to analyze and interpret data (P).
b. Ability to function on multi-disciplinary teams (A).
c. Ability to use the techniques, skills, and modern engineering tools necessary for
engineering practice (P).
59
Exceeds expectation Meets expectation Does not meet
Performance Marks
(5-4) (3-2) expectation (1)
Plans data collection Plans data collection Does not know how to
to achieve to achieve plan data collection to
5. Data experimental experimental achieve experimental
objectives, and objectives, and goals; data collected is
Collection [a]
conducts an orderly collects complete data incomplete and
and a complete data with minor error. contain errors.
collection.
Accurately conducts Conducts simple Unable to conduct
simple computations computations and simple statistical
and statistical analysis statistical analysis analysis on collected
using collected data; using collected data data; no attempt to
correlates with minor error; correlate experimental
experimental results to reasonably correlates results with known
6. Data Analysis known theoretical experimental results to theoretical values;
[a] values; accounts for known theoretical incapable of
measurement errors values; attempts to explaining
and parameters that account for measurement errors or
affect experimental measurement errors parameters that affect
results. and parameters that the experimental
affect experimental results.
results.
Uses computer to Uses computer to Does not know how to
7. Computer Use collect and analyze collect and analyze use computer to
[a] data effectively. data with minor error. collect and analyze
data.
Total
Signature: Signature:
Date: Date:
60