Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 15

Department of Electrical Engineering

EE361L: Control Systems Lab

Course Instructor: Abdullah Mughees Date:

Lab Engineer: Muhammad Kashif Semester: Spring 2024

Session: 2021 – 2025 Batch: BSEE21

Lab 3: Linearization of Non Linear Systems

Name Roll No Lab Marks

Muhammad Mahad Azher BSEE21075

Graded on: _______________________________

Instructor’s Signature: _______________________________

1
Learning Outcomes
 Linearize the differential equations of a nonlinear system at given equilibrium points.
 Simulate and compare the linearized models of a nonlinear system at different
equilibrium points.
 Investigate the effect of incorporating practical nonlinearities in linear models.
3.1 Linearizing Nonlinear Systems
If the differential equation of an LTI system has nonlinear terms involving input or output
variables, we cannot take its Laplace transform and convert it into a transfer function.
Therefore, if we wish to use the transfer function techniques to analyze a system modeled by
a nonlinear differential equation, we must first linearize the differential equation, i.e., find
linear approximations of the nonlinear terms in the differential equation that represent the
original system well enough within certain bounds.
3.1.1 Converting a Nonlinear Model to a Linear Approximation
Linearization, in its essence is the representation of a nonlinear model as a linear
approximation in a small region of interest. It is important to appreciate that the linearized
models are valid for only for a small range of values in the neighborhood of the point at
which the linearization is performed.
To find the linear approximation of a nonlinear function f ( x ) , we expand it around a point
x=x 0 using Taylor series and consider only the linear terms in the Taylor polynomial.

| |
2
df x−x 0 d 2 f ( x−x 0 )
f ( x )=f ( x 0 ) + + 2 +…
dx x=x 0 1! dx x = x0
2!

f ( x ) ≈ f ( x 0 ) + ( x−x 0 )
dy
dx |
x=x 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
Figure 3-1 shows how a nonlinear function, such as a quadratic function y=x 2 can be
approximated as a linear equation near a specific point x=x 0 on the curve. The linear
approximation is basically the line tangent to the curve at x=x 0. Notice that the tangent line
approximates the curve quite accurately but only near the point x 0 and deviates considerably
as we move away from x 0.

2
Figure 3-1: Linear approximation of a quadratic function [9]

Now the equation of this tangent line can be found through the linear approximation of the
Taylor series we discussed above,

f ( x ) ≈ f ( x 0 ) + ( x−x 0 )
dy
dx |
x=x 0

Now for f (x)=x2 ,


dy
dx | x=x 0
=2 x 0

Therefore,
f ( x ) ≈ f ( x 0 ) +2 x 0 ( x−x 0 )
2
y ≈ x 0 +2 x 0 ( x−x 0 )

is the equation of the tangent line of f (x)=x2 at x 0 and hence its linear approximation near
the point x 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
passing through origin, we need to apply a change of variable. Let δy= y−x 02 and δx=x−x 0.
So the equation becomes
δy=2 x 0 δx

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.

3
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.

Figure 3-2: Pendulum on a cart

The pendulum and the cart have the following parameters.


Parameter Symbol Value Unit
Mass M 0.5 kg
Constant of friction b 0.1 Ns m
−1
Cart
Position x variable m
External force F variable N
Mass m 0.2 kg
Length to center of mass l 0.3 m
Pendulum
Moment of inertia I 0.006 kg m
2

Angle θ variable rad

Table 3-1: Physical parameters of an inverted pendulum


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. [10]
f =( M +m ) ẍ +b ẋ +ml θ̈ cos θ−ml θ̇2 sin θ Equation 3-1

( I +ml 2 ) θ̈+mgl sinθ +ml ẍ cos θ=0 Equation 3-2

4
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]
Ans: when given a slight push from 0 degrees to a pendulum it is only expected to go into the
direction of the push and then opposite and slowly return to its original position.

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]
Ans: From 180 degrees upright position if a pendulum is given a slight push it’ll certainly be
going towards the push direction, however after some back and forth movements its not
going to return back to its position it’ll still settle down at 0 degrees.
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
the pendulum imply that θ̇ would also be small. So we can assume θ̇2 ≈ 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 Θ(s) and F (s ). [5 points]

5
6
4.54 s
3
Θ( s) s −0.183 s+31.85 s+ 4.54
G0 ( s ) = =¿ ___________________________________
F ( s)

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]

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]

4.54 s
3 2
s + 0.183 s −31. 185 s−4.54
Gπ ( s ) ¿___________________________________

6. Create this transfer function in MATLAB using the given values of physical parameters
and plot its impulse response. Insert the plot here. [5
points]

7
7. 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]

8. Analysis 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+2
points]
Ans: Absolutely, my results in part 4 and 6 do match with parts 1 and 2 since ewe can see
from their impulse responses that the in the first part, I predicted that after time pendulum is
going to be back at its original position.
Moreover, about the second part I predicted it’ll also slowly come to the same position as
described in part 1 but will not return to its own carefully adjusted upright position of 180
degrees which is also proved by looking at the impulse response.
3.3 Task 2: Deviation from the Linear Behavior due to Nonlinearities
Objective: Use MATLAB to simulate nonlinearities due to saturation, dead zone and
backlash in a practical permanent magnet DC (PMDC) motor and observe how these
nonlinearities make the linear motor model deviate from its linear behavior.
In this section, we qualitatively examine the effects of nonlinearities upon the time response
of physical systems. In each of the following parts, we insert nonlinearities, such as
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.

8
Figure 3-3: A linear input-output relation

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. [11]

Figure 3-4: Three kinds of nonlinearities and their input/output graphs

1. Consider a motor driven by an amplifier that can provide a maximum of ± 5V to it. We


can simulate this system using a saturation nonlinearity and compare it to a motor that runs
without any saturation. Build the model shown in Figure 3-5 in Simulink and observe the
two graph 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 how the speed of
the saturated motor is different from the one without saturation. [4 points]

9
Figure 3-5: Motor with saturation nonlinearity

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 V in
magnitude. Build the model in shown in Figure 3-6 in Simulink and observe the two graph
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.
[4 points]

10
Figure 3-6: DC motor with a dead zone nonlinearity

3. Similarly, to demonstrate the output of a motor with backlash, we provide it with a suitable
input that makes its output comes 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
how the backlash in the gearbox effects the position of the output shaft. [4
points]

11
Figure 3-7: DC motor with backlash

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]
Ans: The motor in this example exhibits a phenomenon known as "saturation nonlinearity."
This occurs when the motor's performance saturates or reaches a limit at extreme operating
conditions, such as very low battery voltage. Despite a gradual decrease in voltage, the
motor's speed eventually reaches a point where further reductions in voltage no longer result
in proportional decreases in speed. Instead, the motor comes to a complete stop, indicating
saturation in its response to decreasing voltage.

12
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]
Ans: The motor in this remote-controlled car likely exhibits a "dead zone" nonlinearity. This
means that there is a range of input signals, in this case, the forward button press, where the
motor does not respond immediately or at all. Once the input signal exceeds a certain
threshold, the motor begins to respond and the wheels start moving. The dead zone represents
a region of nonlinearity where the motor's response is delayed or nonexistent until the input
surpasses a specific threshold.
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]
Ans: The audio playback system exhibits a "saturation nonlinearity." Initially, increasing the
volume setting leads to a proportional increase in loudness. However, at higher volume
levels, the system reaches a point of saturation were further increases in volume setting result
in diminishing increases in loudness. Eventually, the system reaches its maximum output
capability, and additional increases in volume setting do not produce any significant increase
in loudness. This behavior reflects the saturation of the audio system's response to increasing
input signals.

13
Assessment Rubric
Method:
Lab report evaluation and instructor observation during lab sessions.
Performanc CL Able to complete the Able to complete the Tasks completion
Marks
e O tasks over 80% (4-5) tasks 50 – 80% (2-3) below 50% (0-1)
Distracts or
Actively engages and Cooperates with
discourages other
cooperates with other other group
1. Teamwork 1 group members
group members in an members in a
from conducting
effective manner. reasonable manner.
the experiment.
2. Laboratory Respectfully and Observes safety
Disregards safety
safety and carefully observes rules and
disciplinary
1 rules and
safety rules and procedures with
rules procedures.
procedures minor deviation.
Needs guidance to
Selects relevant
select relevant Incapable of
equipment to the
equipment to the selecting relevant
3. Realization experiment, develops
of experiment
2 experiment and to equipment to
setup diagrams of
develop equipment conduct the
equipment
connection or experiment.
connections or wiring.
wiring diagrams.
Uses the equipment Unable to use
Uses each equipment
and components appropriate
and components as
4. Conducting with minor error. equipment, and
experiment
2 intended, conducting
Needs help in experiment is
the experiment
conducting substantially
perfectly.
experiment. wrong.
Plans data Does not know
Plans data collection
collection to how to plan data
to achieve
achieve collection to
experimental
5. Data experimental achieve
2 objectives, and
collection objectives, and experimental goals;
conducts an orderly
collects complete data collected is
and a complete data
data with minor incomplete and
collection.
error. contain errors.
Conducts
Accurately conducts computations and
Unable to conduct
simple computations analysis on
simple analysis on
and statistical analysis collected data with
collected data; no
6. Data using collected data; minor error;
2 attempt to correlate
analysis correlates reasonably
experimental
experimental results to correlates
results with known
known theoretical experimental
theoretical values.
values. results to known
theoretical values.

Uses computer to Does not know


Uses computer to
7. Computer collect and analyze how to use
2 collect and analyze
use data with minor computer to collect
data effectively.
error. and analyze data.

Total (out of 35)

25
26

You might also like