Fall 2014
Dr. Hatem Elaydi
Islamic University of Gaza
Electrical Engineering Department
EELE4360 Digital Control
Project I
Due Date: Room B541, 2:00 PM, Dec. 17, 2014
The system consists of an inverted pendulum mounted to a motorized cart. The inverted pendulum system
is unstable without control, that is, the pendulum will simply fall over if the cart isn't moved to balance it.
Additionally, the dynamics of the system are nonlinear. The objective of the control system is to balance the
inverted pendulum by applying a force to the cart that the pendulum is attached to.
In this case we will consider a two-dimensional problem where the pendulum is constrained to move in the
vertical plane shown in the figure 1. For this system, the control input is the force
horizontally and the outputs are the angular position of the pendulum
cart
that moves the cart
and the horizontal position of the
.
Figure 1: Inverted Pendulum
Assume the following quantities:
(M)
(m)
(b)
(l)
(I)
(F)
(x)
(theta)
mass of the cart
mass of the pendulum
coefficient of friction for cart
length to pendulum center of mass
mass moment of inertia of the pendulum
force applied to the cart
cart position coordinate
pendulum angle from vertical (down)
0.5 kg
0.2 kg
0.1 N/m/sec
0.3 m
0.006 kg.m^2
We want to design a controller to restore the pendulum to a vertically upward position after it has
experienced an impulsive "bump" to the cart. Specifically, the design criteria are that the pendulum return to
its upright position within 5 seconds and that the pendulum never move more than 0.05 radians away from
1
Fall 2014
Dr. Hatem Elaydi
vertical after being disturbed by an impulse of magnitude 1 Nsec. The pendulum will initially begin in the
vertically upward equilibrium,
= .
In summary, the design requirements for the inverted pendulum state-space are:
Settling time for
Rise time for
Pendulum angle
Steady-state error of less than 2% for
and
of less than 5 seconds
of less than 0.5 seconds
never more than 20 degrees (0.35 radians) from the vertical
and
Figure 2: Forces acting on the inverted pendulum
Summing the forces in the free-body diagram of the cart in the horizontal direction, you get the following
equation of motion.
…………………………………………………………………………………………(1)
Note that by summing the vertical forces for the cart, no useful information would be gained. Summing the
forces in the free-body diagram of the pendulum in the horizontal direction, the following expression for the
reaction force
is obtained.
…………………………………………………………………………(2)
By substituting this equation into the first equation, the first governing equations for this system is obtained.
…………………………………..………..……………(3)
To get the second equation of motion for this system, the forces perpendicular to the pendulum are summed
to produce eq. (4).
……………………………………...…………………(4)
2
Fall 2014
Dr. Hatem Elaydi
To get rid of the
and
terms in the equation above, sum the moments about the centroid of the
pendulum to get equation (5).
…………………………………………………………………………………(5)
Combining these last two expressions, the second governing equation is obtained
………………………………………………………………….(6)
Equations (3) and (6) are linearized about the vertically upward equilibrium position,
= . The following
small angle approximations of the nonlinear functions are obtained:
…………………………………………………………………………………..(7)
…………………………………………………………………………………...(8)
…………………………………………………………………………………………………….(9)
After substituting the above approximations into the nonlinear governing equations, the two linearized
equations of motion with
replacing
are derived
………………………………………………………………………………......(10)
…………………………………………………………………………………(11)
To obtain the transfer functions of the linearized system equations, the Laplace transform of the system
equations assuming zero initial conditions is applied. The resulting Laplace transforms are given in
equations (12) and (13)
………………………………………………………………(12)
……………………………………………………….(13)
To find our first transfer function for the output
and an input of
,
must be eliminated
……………………………………………………………………………..(14)
Then substitute the above into the second equation.
……..(15)
Rearranging, the transfer function is then the following
……………………………………………………..(16)
where,
………………………………………………………………………...(17)
From the transfer function above it can be seen that there is both a pole and a zero at the origin. These can
be canceled and the transfer function becomes the following.
3
Fall 2014
Dr. Hatem Elaydi
………………………..(18)
Second, the transfer function with the cart position
as the output can be derived in a similar manner to
arrive at the following.
………………………….(19)
The linearized equations of motion from above can also be represented in state-space form
…………………………………………………………...(20)
Discrete state-space
The first step in designing a digital controller is to convert the above continuous state-space equations to a
discrete form. We will accomplish this employing the MATLAB function c2d. This function requires that we
specify three arguments: a continuous system model, the sampling time (Ts in sec/sample), and
the 'method'. You should already be familiar with how to construct a state-space system from
and
,
,
,
matrices.
In choosing a sample time, assume that the closed-loop bandwidth frequencies are around 1 rad/sec for
both the cart and the pendulum, let the sampling time be 1/100 sec/sample. The discretization method we
will use is the zero-order hold ('zoh'). Now we are ready to use c2d function.
Requirements:
1.
Obtain the discrete state space Model
2.
Obtain the controllability and observability matrices and determine whether the system is
controllable and observable.
3.
Find the state feedback gain, L, that satisfy the system specifications
4.
Design a full order observer such as 4-10 times faster than the slowest controller pole(you can use
[-0.2 -0.21 -0.22 -0.23]).
5.
Simulate the system using Matlab
4
Fall 2014
Dr. Hatem Elaydi
Figure 3: State feedback system
Figure 4: Full-order observer design
5
© Copyright 2026 Paperzz