Professional Documents
Culture Documents
In this page we will design a PID controller for the inverted pendulum system. In the design process we will assume a
single-input, single-output plant as described by the following transfer function. Otherwise stated, we will attempt to
control the pendulum's angle without regard for the cart's position.
where:
(M)
0.5 kg
(m)
0.2 kg
(b)
0.1 N/m/sec
(l)
0.3 m
(I)
0.006 kg.m^2
(F)
(x)
(theta)
For this problem the outputs are the cart's displacement ( in meters) and the pendulum angle ( in radians) where
represents the deviation of the pedulum's position from equilibrium, that is,
+ .
The design criteria for this system for a 0.2-m step in desired cart position
are as follows:
Pendulum angle
Discrete state-space
Our 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, note that it is desired that the sampling frequency be fast compared to the
dynamics of the system. One measure of a system's "speed" is its closed-loop bandwidth. A good rule
of thumb is that the sampling time be smaller than 1/30th of the closed-loop bandwidth frequency
which can be determined from the closed-loop Bode plot.
Assuming 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'). For further details, refer to the Introduction: Digital Controller Design page.
Now we are ready to use c2d function. Enter the following commands into an m-file. Running this m-file
in the MATLAB command window gives you the following four matrices representing the discrete time
state-space model.
M = 0.5;
m = 0.2;
b = 0.1;
I = 0.006;
g = 9.8;
l = 0.3;
(3)
(4)
This proves that our discrete system is both completely state controllable and completely state observable.