0% found this document useful (0 votes)
21 views22 pages

control systerm -Digital Pendulum

The document outlines an experiment involving a Digital Pendulum system, focusing on understanding its dynamic behavior, designing PID controllers, and real-time applications in a SIMO environment. It details objectives such as obtaining response plots, conducting identification experiments for the cart and pendulum models, and performing root locus analysis with various PID values. The document also discusses the theoretical background, apparatus, and exercises related to model testing, linearization, and controller design for both cart position and pendulum stabilization.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views22 pages

control systerm -Digital Pendulum

The document outlines an experiment involving a Digital Pendulum system, focusing on understanding its dynamic behavior, designing PID controllers, and real-time applications in a SIMO environment. It details objectives such as obtaining response plots, conducting identification experiments for the cart and pendulum models, and performing root locus analysis with various PID values. The document also discusses the theoretical background, apparatus, and exercises related to model testing, linearization, and controller design for both cart position and pendulum stabilization.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 22

Experiment: Digital Pendulum

Aim:
1. To understand the dynamic behavior of a SIMO system such as Digital Pendulum.
2. To design PID controllers to control the Cart position, and Inverted Pendulum
angle and to explain how PID designs are going to affect overall dynamic.
3. To understand the real-time application of control laws in a SIMO environment.

Objectives:
1. To understand the dynamic properties of the system, obtain response plots from
the non-linear simulation and root locus plots from the liberalized models.
2. Carryout two identification experiments to obtain a model to describe the
relations of moving Cart due to control voltage and a model to describe the
inverted Pendulum control due to control voltage.
3. Obtain the root locus plot with a PID controller closing the loop around the cart
position response and record performance parameters for different PID values.
4. 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:
Theory:
In this practical used Digital Pendulum Control set up.
The Digital Pendulum is a modern version of a classical control problem; that
of erecting and balancing a free-swinging pendulum in its inverted position
or moving a hanging pendulum in a controlled manner.
The cart on the track is digitally controlled using MATLAB™ software to swing
up and to balance the pendulum into an upright sustained position or to
move the cart with pendulum in an unperturbed down position. The cart
track is of limited length, imposing constraints on the control algorithm.

In pendulum mode the system is used to control the twin arm pendulum
from an initial position, hanging at rest with the cart in the center of its travel
along the track, to a final position with the pendulum upright and the cart
restored to its central position. In crane mode the control problem is to move
the position of the cart without undue movement of the pendulum. This
problem is typical of that experienced when controlling a gantry crane.
This is the system which have PID controller design, testing, tuning and
implementation on the model. Root locus technique is used to illustrate the
changes that PID controller tuning inflicts on the control system
performance. The designed
controllers are prepared in
SIMULINK™.

The phenomenological process


models are designed in SIMULINK™
to provide initial models for the user
to test. Model linearization is then
discussed and the uses of simple
dynamics analysis such as bode diagrams and poles and zeros maps are
introduced.

The pendulum workshop can be decided into 2 separate control problems.


First is the crane control problem, in which the goal is to move the cart into a
desired position with as little oscillations of the load as possible. The other is
to stabilized the inverted pendulum in an upright position. The crane controls
very often encountered in industrial applications where load movement is
incorporated. It is especially difficult to be realized when cranes are placed
on ships and sea waves introduce additional oscillations. The inverted
pendulum task can be seen as a self-erecting control problem, which is
present in missile launching and control applications. Furthermore, the
pendulum application involves swing-up control aspect if initially the
pendulum hangs freely in vertical position.
These two control problems (inverted pendulum and crane control) have one
very important difference, which is stability. The pendulum serving as a
crane is stable without a working controller. Due to energy loss through
friction and air resistance it will always end up in an equilibrium point.
The inverted pendulum inherently unstable. Left without a stabilizing
controller will not be able to stand in an upright position when distorted.

Pendulum Set Description and Pendulum Model


The movement of the cart is caused by pulling the belt in two directions by
the motor attached at the end of the rail. Applying voltage to the DC motor
we control the force, with which the cart is pulled. The Value of the force
depends on the value of the control voltage. The voltage is our control
signal. The two variables that are read from the pendulum through the
encoders are the pendulum position(angle) and the cart position on the rail.
The controller’s task will be to change the DC motor voltage depending on
these two variables, in such a way that the desired control task is
fulfilled(stabilizing in upright position, swinging or crane control ).
The phenomenological model of the pendulum is non-linear, that means that
at least one of the states (x and its derivative or θ and its derivative) is an
argument of a nonlinear function. Such a model to be presented as a transfer
function (a form of linear plant dynamics’ representation used in control
engineering) has to be liberalized.
Summing the forces working on the pendulum and cart system and the
moments we obtain the
following nonlinear equations of motion:
( m+ M ) ẍ +b ẋ +ml θ̈ cos θ−ml θ̇2 sin θ=F … … … . (1)

( I + M 2 ) θ̈−mgl sin θ+ ml ẍ cos θ−d θ̇=0 … … … ..(2)


Very often control algorithms are tested on such nonlinear models, However
for the purpose of
controller design the models are liberalized 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 from
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 terms of behavior
means that the plant left without any controller reaches an unwanted, very
often destructive state. Thus, for such plants it is useful to carry out
simulation tests on the models before approaching the real plant.
To complete the model given by motion equations (1) and (2), we must
introduce the value of all parameters such as
 Gravity
 Pole Length
 Cart Mass
 Moment of Initia
 Cart friction coefficient
 Pendulum damping coefficient
Two of the things have to be kept in mind when designing the controllers.
Both the cart position and the control signal are bounded in real time
application. The bound for the control signal is set to [-2.5V ... +2.5V] and
the generated force magnitude of around [ 20. ON...+ 20. ON]. The cart
position is physically bounded by the rail length and is equal to [-0.5m].
The pendulum is a SIMO plant — single input multiple output. The model
described by (1), (2) is still missing the translation between the force F and
the actual control signal, which is the — control voltage u that we supply
with the PC control card. Assuming the relation between the control voltage
u and the generated cart velocity is linear, we might add the velocity vector
generated by the motor to the model and ignore the F vector, or translate
the control voltage u to the generated force F under the assumption that
constant voltage will cause the cart to move with constant velocity:
du
F=k fu . … … … … . (3)
dt

where k fu is the gain between the u voltage derivative and the F force.
However, one must remember that derivative introduction in models
especially in Simulink may cause simulation problems.

Exercise 1: Nonlinear open loop model testing


Introduction:
Pendulum Simulink menu provides a nonlinear open loop model (pendmod
_nonlin.mld) described by equations (1) and (2)
Task:
The model was opened and checked the responses of the model with zero u
voltage applied. The initial pendulum angle θ0 was changed and observed
two equilibrium points. To change the initial angle double clicked the
‘Pendulum with DC motor' block then double clicked the 'Pendulum with DC
motor' block to gain access to its parameters. Small disturbances were
introduced to initial angles selection and obtained the responses.

For θ=0
For θ=π
For θ=2 π

By considering the above graphs it is clear that the……………..


Exercise 2 — Model linearization
Introduction:

Linearization of a given phenomenological model can be done for the


pendulum and in the given equations (1) and (2) we could substitute the
nonlinear functions (sine and cosine) with their linear equivalent. Such a
linearization in a working point is done with Taylor approximation of the
nonlinear functions. For small angle deviations in an equilibrium point of θ=0
(inverted pendulum) we can assume that the following functions can be
liberalized.
sin θ ≅ θ … … ..(4)
cos θ ≅ 1… … .. ( 5 )
2
θ̇ =0 … … … …(6)
Thus, the motion equations (1) and (2) take the form:
( m+ M ) ẍ +b ẋ +ml θ̈=F … … … … … … … ..(7)

( I + M I 2 ) θ̈−mglθ +ml ẍ +d θ̇=0 … … … … … …(8)


One must remember that equations (7) and (8) will only be valid for θ=0. For
the position where θ=π (crane control) the following substitutions have to be
made:
sin θ ≅ −θ …………. (9)
cos θ ≅−1 … … … … … ..(10)
θ̇=0…………… (11)
Thus, the motion equations (1) and (2) take the form:
( m+ M ) ẍ +b ẋ−ml θ̈=F … … … … … … … … … … (12)

( I + M I 2 ) θ̈+mglθ−ml ẍ +d θ̇=0 … … … … … … ..(13)


The linear model of the pendulum, just as the nonlinear has one input -
force F, and two outputs, which are the angle θ and the cart position x .
However, in the inverted pendulum task we are mostly interested in the θ
angle stabilization thus we may treat the cart position as an uncontrolled
output. With one input F and one output θ , two linear models in the form of
transfer functions can be obtained, each for small deviations of θ angle from
the two equilibrium points of,θ=[0 , π ]. Remember that the translation
between the control voltage and the force should be added (equation 3). Two
of the linear models described by the equations (7), (8) and (12), (13) have
been created called `pendmod_lin_stable.mdl’ and
`pendmod_lin_unstable.mdl '.

Task: Root Locus plots for stable and unstable model were plotted.
For Stable
For Unstable

According to the stability of two models it is clear that the…….


Exercise 3 — Cart and Inverted Pendulum model
identification
Introduction:
The first discrete model to be identified describes the relations of the
moving cart due to the control voltage. At this point the pendulum is ignored
and its movement is treated as a distortion. All real-time simulations are
carried out using a sampling time of Ts= 0.001 [s]. However, this
identification is carried out with the sampling time of Ts= 0.05[s]. For the
identification, the MATLAB System Identification Toolbox is used.
The identification experiment is carried out using the model called
CartIdent.mld. This model excites the real-time model and records its
response. The excitation signal is composed of several sinusoids and an
optional random signal block. The experiment lasts 20 seconds and two
signals are collected in a form of vectors and are available in the Workspace.
Task:
A discrete model was identified using the MATLAB identification interface.
Cart Model
Root Locus
Bode Plot

Natural Frequency =
Damping Ratio =

Does the system have a resonance frequency?


Inverted pendulum model identification
Inverted pendulum model identification is a difficult task mainly for one
aspect — stability. The inverted pendulum is unstable and has to be
identified with a running, stabilizing controller. The controller introduces
output noise and control signal correlation, which leads to model corruption.
This correlation can he broken by introducing additional excitation signal,
which is added to the control signal u . If the power of the signal r is
substantial comparing to the n noise power the proper model should be
identified.

Such approach will only allow for the linear model identification of the
transfer function between the voltage control signal u and the pendulum
angle 0, for small deviations of the angle around the equilibrium point of θ=0.
A closed loop system describing the relation between signal r and y are
identified:
−1
G(z )
T ( z )=
−1
… … … … …(14 )
1+C ( z ) .T (z )
−1 −1

where T ( z −1 ) is the complete system discrete transfer function describing the


relation between, C ( z −1 ) is the discrete controller transfer function and G(z−1 )
is the pendulum model discrete transfer function. The relation (14) can be
transformed to yield the pendulum model:
−1
T (z )
G ( z )=
−1
… … … … … … … … … … … .. ( 15 )
1−C ( z ) . T (z )
−1 −1

The identification experiment is carried out with the ‘InvPendIdent.mdl, The


excitation signal is composed of several sinusoids. The experiment lasts 40
seconds and two signals are collected in a form of vectors and arc available
in the Workspace.
Task:
The identification experiment was carried out with a sampling time of Ts
0.05[s] and data were collected.
Root Locus

Bode Plot
Open loop poles?
Comment on the stability of the system

Exercise 4 - PID Control of Cart Model Position


(Simulation and Real-Time)
Introduction
To design a PID controller, a model of the plant is needed. For this purpose,
we can use the continuous linearized model identified in exercise 3 and
design a continuous PID controller.
Task:
The continuous cart model root locus was opened. PID controller was defined
in the workspace and imported that into the root locus as the controller. PID
1=(P=27.84, I=50, D=3.9), PID 2=(P=20, I=6, D=3) and PID 3=(P=0.5,
I=0.1, D=1) were tried. Each parameter was changed and observed how it
influenced the closed loop damping, frequency and overall dynamics and
come up with a sensible PID design.
Bode plots and Root Locus were obtained.
For PID 1
Root Locus
Bode Plot
For PID 2
Root Locus

Bode Plot
For PID 3
Root Locus

Bode Plot
Comment on each PID result.
Identify the input frequency that introduces maximum lag to the system
Comment with respect to response performance parameters
Observe haw real time responses differ from the simulation result. Comment
on it.

Exercise 5 — PID Pendulum Stabilization


(simulation and real-time) Introduction:
The complete pendulum model is a SIMO system and therefore both position
and angle outputs have to be controlled with one input.

With Linear Quadratic Regulators out of the scope of these experiments, the
only option for PID pendulum Stabilization is to consider the system as two
SISO systems.
θ(s) x ( s)
G 1 ( s )= ∧G2 ( s )=
θdesired ( s) x desired (s)

To design a PID controller for G1, a model of the plant is needed. For this
purpose, we can use the continuous linearized model identified with
‘InvPendIdent’ in exercise 3 and design a continuous PID controller. PID
control of cart model position G2was performed in the previous exercise.
Task:
‘ModelInvertedPD.mld’ model was opened and the controller PID gains were
changed to see how they influence the control action. Understand the signal
weighting of the two PID controllers and comment.
Initial angle was varied to see how the controllers perform. Real time model
was run with above PID values with the ‘PendStabPD.mdl’.
Observe how real time responses differ from the offline simulation results.
And comment on it.

Exercise 6 — Swing up and hold system


Introduction
In the previous exercise we had to turn the pendulum to an upright position
and then the system took over the control of holding the pendulum upright.
However, a separate system can be incorporated into the model to bring the
pendulum to an upright position until the hold system takes over the control.
Task:
‘SwingHoldModel.mld’ mode was used for model simulation and
‘SwingHoldPendulum.mld’ mode used for real time control. Observe and
explain the swing-up controller bring the pendulum to the stabilization zone
where the stabilization controller takes over.
Change the swing up parameters to see how that influences the whole
control task. Observe any fault that you encounter when you run the real
time model. Comment how this can be improved.

You might also like