You are on page 1of 16

EXPERIMENT NO 01 (Nonlinear open loop model testing)

AIMS:
(i) To understand the dynamic behavior of a Single Input Multiple Output (SIMO) system.
(ii) To design PID controllers to control the cart position, and Inverted Pendulum angle and
to explain how PID designs are going to affect overall dynamics.
(iii) To understand the real-time application of control laws in a SIMO environment.

OBJECTIVES:
(i) Understand the dynamic properties of the system.
(ii) Obtain response plots from the nonlinear simulation and root locus plots from the
linearized models.
(iii) Obtain a model to describe the relations of the moving cart due to control voltage and a
model to describe the Inverted Pendulum control due to control voltage.
(iv) Obtain a root locus plot with a PID controller closing the loop around the cart position
response and record performance parameters for different PID values.
(v) Obtain a root locus plot with a PID controller closing the loop around the inverted
pendulum angle response and record performance parameters for different PID values.

APPARATUS:
(i) Pendulum model
(ii) Instrument set

THEORY:
Motor Mounting Arm Fixing
Plate Belt Screw
Sprocket Wheel
Centre Line

Feedback

Pendulum arms

Belt tension Ribbon Cable


adjustment bolts

Mounting
points for legs

Adjustable feet

1
Parameter Value

g - Gravity 9.81m S-2


l – Pole length (0.36 – 0.4) m
M – Cart mass 2.4 Kg
m – Pole mass 0.23 Kg
I – Moment of interior of the pole About 0.099Kgm2
b – Cart friction coefficient 0.05Nsm-1
d – Pendulum damping coefficient Negligible

Summing the forces working on the pendulum and cart system and the moments
we obtain the following nonlinear equations of motion:

(𝑚 + 𝑀)𝑥̈ + 𝑏𝑥̈ + 𝑚𝑙𝜃̈ cos 𝜃 − 𝑚𝑙𝜃̇ 2 sin 𝜃 = 𝐹

(𝐼 + 𝑚𝑙 2 )𝜃̈ − 𝑚𝑔𝑙 sin 𝜃 + 𝑚𝑙𝑥̈ cos 𝜃 + 𝑑𝜃̇ = 0

Assuming the relation between the control voltage ‘u’ and the generated cart velocity is linear,

𝑑𝑢
𝐹 = 𝑘𝐹𝑢 .
𝑑𝑡
Where, 𝑘𝐹𝑢 , is the gain between the ‘u’ voltage derivative and the F force.

Control algorithms are tested on such nonlinear models. However for the
purpose of controller design the models are linear and presented in the form of transfer
functions. Such a linear equivalent of the nonlinear model is valid only for small deviations of
the state values form their nominal value. Such a nominal value is often called the equilibrium
point. The pendulum has two of these, one is when Ɵ= 0(Inverted pendulum) and the other
when Ɵ=π (hanging freely-crane control)

The inverted pendulum is an unstable system which, in term of behavior, means that
the plant left without any controller riches a wanted. Thus for such plants it is useful to carry
out simulation tests on the model before approaching the real plant.

Two things have to be kept in mind when designing the controllers. Both the cart position
and the control signal are bounded in a real time application. The bound for the control signal is
set to [-2.5V..+2.5V] and the generated force magnitude of around [-20.0N+20.0N].The cart
position is physically bounded by the rail length and is equal to [-0.5m+0.5m].

2
PROCEDURE:
(i) The model was opened and checked the responses of the model with zero ‘u’ voltage
applied.

(ii) The initial pendulum angle 𝜃0 was changed and two equilibrium points were observed.

(iii) The ‘Pendulum with DC motor’ block was Double clicked to change the initial angle then
the ‘Pendulum with DC motor’ block was double clicked to gain access to its parameters.

(iv) Small disturbances were introduced to initial angles selection and the responses were
obtained.

OBSERVATIONS:
Graph 01: Angle 0+0.004 and zero voltage

Position

Angle

Control Voltage

3
Graph 02: Angle π+0.004 and zero voltag

Position

Angle

Control Voltage

DISCUSSION:
Graph 01 was taken from the downward equilibrium position of the
pendulum and the Graph 02 was taken from the upward position (Inverted pendulum position).
According to the Graph 01 and Graph 02, we can observe that time taken for the system to be
stable is different in above two positions when we apply a small angle change to the pendulum.

Time taken for the system to be stable is higher in Graph 02 with


compared to Graph 01.But in both situations the system was stable near the angle π position.
From above two positions, practically downward position was the stable position of the
pendulum. I.e. we can conclude that downward position is the angle π position and the upward
position (Inverted pendulum position) is the angle 0.004 position of the pendulum.

4
EXERCISE 2 (Model linearization)

PROCEDURE:
(i) Two linear models were run and the responses were compared.
(ii) Root locus plots were obtained for each model.

OBSERVATIONS:

Graph 01: Root locus plot for Linear Stable

5
Graph 02: Root locus plot for Linear Unstable

DISCUSSION:
According to the Graph 01 there was no any pole of the positive side of the real
axis and all the poles were located on the negative side of the real axis. Therefore the system
was stable.

In Graph 02, there was a one pole on the positive side of the real axis and other
poles were located negative side of the real axis. At least one pole or more were located on the
positive side of system could be considered as an unstable system.

6
EXERCISE 3 (Cart and Inverted pendulum model identification)

PROCEDURE:

Cart model identification


(i) The identification experiment was carried out and the data was collected.
(ii) The new workplace variable simout was noticed and for simplicity the input output data
was assigned to the u and y vectors:

u= detrend(simout(:,3));
y= detrend(simout(:,1));

(iii) A discrete model was identified using the Matlab identification interface.
(iv) The model structure was specified to be for example oe241.
(v) The model oe241was made available to the workspace.
(vi) The identified discrete model was needs to be transformed into an equivalent continuous
model and therefore following Matlab coding was used for that task (Cart_ident.m).

G_cart_dis=filt(oe241.b,oe241.f,0.05);
G_cart_con=d2c (G_cart_dis,’zoh’);

(vii) Finally the model was saved.


(viii) Open loop root locus plot and bode plot were obtained.

Inverted pendulum model identification


(i) The identification experiment was carried out with a sampling time of Ts=0.05[s] and data
was collected.
(ii) The new workspace variable simout was obtained and for simplicity the input output data
were assigned to u and y vectors.

u= detrend(simout(:,5));
y= detrend(simout(:,1));

(iii) A discrete model was identified using the Matlab identification interface.
(iv) The model structure was specified to be for example oe361.
(v) The model oe361 was made available to the workspace.
(vii) The identified discrete model was transformed into an equivalent continuous model by
using the following Matlab codes (Inv_pen_identification.m).

sysd=filt(oe361.b,oe361.f,0.05);
sysc=d2c(sysd,’zoh’);
(viii) The model was saved.
(ix) Then the following coding was used to perform the transformation from T(s) to G(s).
PID=tf([2 20 0.1],[1 0]);
G_cont=minreal(sysc/(1-PID*sysc));
(x) The open loop poles were determined by obtaining a root locus plot.

7
OBSERVATIONS:
Graph 01: Root locus plot for Cart Model

Graph 02: Bode plot for Cart Model

8
Graph 03: Root locus plot for Inverted Pendulum Model

Graph 04: Bode plot for Inverted Pendulum Model

9
DISCUSSION:

By considering the Root locus plot for cart model (Graph 01) we
can decide that the system was stable since all poles are in the negative side of the real axis.
The Damping ratio 0.7 value considered to be better value for control system. But in our
practical damping ratio was 0.872, It was considered as a better value for the system.

By considering the Root locus plot for Inverted pendulum model (Graph
03) we can decide that the system is unstable since there is a one pole in the positive side of
the real axis.

EXERCISE 4 (PID control of cart model position (simulation and real time))

PROCEDURE:
(i) The continuous cart model root locus was opened.
(ii) The PID controller was defined in the workspace and imported that into the root locus as
the controller. (P=27.84, I=50, D=3.9), (P=20, I=6, D=3) and (P=0.5, I=0.1, D=1),
(Cart_Ident.m file was used).
(iii) Each parameter was changed and how it influences the closed loop damping, frequency
and overall dynamics were observed and came up with a sensible PID design.
(iv) A bode plot of the closed loop system was obtained with the chosen PID values and the
Input frequency that introduces maximum lag to the system was identified.
(v) Then the controller was exported to the workspace and tested it using the offline simulation
of the nonlinear model of the cart with PID_cartmodelIN.mld. The change in response was
observed with above PID values.
(vi) The real time model was run with above PID values with the cartcontrol.mdl and the
operation of the PID design was observed.
(vii) The real time responses and the simulation results were observed.

10
OBSERVATIONS:
Graph 01: Root locus plot with PID (27.84, 50, 3.9)

Graph 01: Bode plot with PID (27.84, 50, 3.9)

11
Graph 02: Root locus plot with PID (20, 06, 03)

Graph 02: Bode plot with PID (20, 06, 03)

12
Graph 03: Root locus plot with PID (0.5, 0.1, 01)

Graph 03: Bode plot with PID (0.5, 0.1, 01)

13
DISCUSSION:
According to Graph 01, Graph 02 and Graph 03 we observed that all the
poles of each graph were located in the negative side of the real axis. I.e. the system was stable
in above situations with the corresponding PID values. Let’s compare Graph 01 and Graph 02,
In Graph 02 poles were located more close to the imaginary axis with compared with poles in
Graph 01. Therefore setting time of the system in Graph 02 was higher than the system in
Graph 01.I.e stability of Graph 02 was less than the Graph 01.

Now let’s compare Graph 02 and Graph 03, poles of Graph 03 were
located more close to the imaginary axis with compared with the poles in Graph 02. Therefore
setting time of the system in Graph 03 was higher than the system in Graph 02. I.e. the system
with Graph 03 was less stable than the system with Graph 02.When poles moves towards the
negative side of the real axis, setting time becomes lesser and the system becomes more and
more stable.so we could state the stability of the systems as Graph 01> Graph 02> Graph 03.
I.e. we could conclude that stability of the system was decrease when we decreased the PID
values.

EXERCISE 5 (PID pendulum stabilization (simulation and real time))

PROCEDURE:
(i) ModelInvertdPD.mld was opened and the controller PID gains were changed to see how
they influence the control action.
(ii) The signal weighting of the two PID controllers was understood and commented.
(iii) The initial angle was varied to see how the controllers perform.
(iv) The real time model was run with above PID values with the PendstabPD.mdl.
(v) To turn the pendulum has been prepared by hand in the counter-clockwise direction until it
reached the upright position.

EXERCISE 6 (Swing up and hold system)

PROCEDURE:
(i) The SwingHoldModel.mld was used for model simulation and
SwingHoldPendulum.mld for real time control.
(ii) The swing-up controller was observed and explained bring the pendulum to the
stabilization zone where the stabilization controller takes over.
(iii) The swing up parameters were changed to see how it influences the whole control
system

14
OVERALL DISCUSSION:
This was our first practical in control system. I did not familiar with
MATLAB software. While we were doing this practical, in personally I could not understand
properly. After I was written assignment, I got the idea about pendulum. However there was no
observation sheet exercise 05 and 06. But I was mentioned the procedure how to do the
exercise 05 and 06.
The digital Pendulum Control System provides experiments on an inverted
balanced pendulum using Digital control techniques. It has single input, single output, non-
linear system. The pendulum is Self-erecting and can also operate in crane mode

The cart on the track is digitally controlled to swing up [self-


erecting] and to balance the pendulum into an upright sustained position or to move the
cart with pendulum in an unperturbed down position. The pendulum-cart set-up consists
of a pole mounted on a cart in such a way that the pole can swing free only in vertical
plane. The cart is driven by a DC motor. To swing and to balance the pole the cart is
pushed back and forth on a rail of limited length. Balancing a pendulum requires, first,
knowledge of the pendulum's position, and second, a method of controlling the
pendulum. The PID controllers are the most reliable controllers used in the general
industrial applications. It has such an effect when increasing each of the controller values
of P, I and D we can identify the change of the system behavior as follows.

(i) Increasing P value to the system cause to increases the overshoot and also it
decreases the rise time and the steady state error. This also affects to the speed of the
system.

(ii) Increasing I value to the system cause to increases the overshoot and the settling
time but it decreases the rise time and fully eliminate the steady state error. This
normally keeps the steady state error 0.

(iii) Increasing D value to the system cause to decreases the overshoot and the settling
time.
It also makes the response of the system quicker.

o Effects of adding zeros,


(i) Pull root locus to the left.
(ii) Makes system more stable.
(iii) Speed up the settling of the response.

o Effects of adding poles,


(i) Pull root locus to the right.
(ii) Lower system relative stability.
(iii) Slow down the settling of the response.

o With Relevant to bode plots;

15
(i) If the gain cross over frequency is less than the phase cross over frequency
the system is stable.
(ii) If the phase cross over frequency is less than the gain cross over frequency
the system is unstable.

The transient response of a closed-loop system is completely determined by the location in the
s-plane of the closed-loop system poles and zeros

o Poles,

(i) At low frequencies (ω<p) have no effect.


(ii) At high frequencies (ω> p) cause a magnitude decrease (attenuation) of 20 dB per
frequency decade and a phase shift of −90◦

o Zeros,

(i) At low frequencies (ω<p) have no effect.


(ii) At high frequencies (ω>p) cause a magnitude increase (gain) of 20 dB per frequency
decade and a phase shift of 90◦
(iii) Complex poles and zeros can cause peaking or resonance.

Root Locus Analysis

The transient response of a closed-loop system is related to the location of the


closed loop poles. If the system has a variable loop gain, then the location of the closed-loop
poles depends on the value of the loop gain chosen.

In a root locus plot;

(i) Radial lines show constant damping ratio


(ii) Vertical lines show constant rate of decay
(iii) Horizontal lines show constant damping frequency
(iv) Circles show constant undamped natural frequency

Applications of digital pendulum

 Provide self-control for robotic models


 In some control ships
 To control cranes
 In missile launchers

16

You might also like