National Instruments 370753C-01 Fan User Manual


 
Chapter 6 State-Space Design
© National Instruments Corporation 6-15 Xmath Control Design Module
Figure 6-4. Diagram of Plant for the Inverted Pendulum Problem
Figure 6-4 shows the pendulum at φ = 0 and φ > 0. The distance of the cart
from some initial reference point along the line of its motion is represented
by the state variable x. You can measure the angle φ and the distance x
easily—in fact, you will use measurements as your system outputs—but it
is more difficult to obtain accurate measurements of the rate at which x and
φ change.
Designating as the state vector, you can set up the system in
Xmath:
A = [0,1,0,0;21,0,0,0.8;0,0,0,1;0,0,0,-4];
B = [0,-2,0,1]';
C = [1,0,0,0;0,0,1,0];
D = [0,0]';
ipsys = system(A,B,C,D);
You design a regulator with the assumption that all four states are available.
Recalling that you defined the state vector as , you can decide
the weighting you want to associate with each state. Refer to the quadratic
performance index equation in the Linear Quadratic Regulator section for
more information. For this particular problem, your most important
performance goal is that the pendulum stay upright—that is, that φ be
tightly controlled to stay as close to zero as possible. You also might prefer,
though to a lesser extent, that you not have to move the cart over too great
a distance. Physical limitations, such as the size of the room in which the
experiment is conducted, should be considered.
If you are not particularly concerned about the speed of the cart across the
floor or that rate of change of the angle, you might define,
Rxx = diagonal([1,0,0.1,0]);
with the larger values in the matrix corresponding to states whose values
you care most about. Presuming you are not too worried about the size of
the input u you impart to the cart:
Ruu = 1e-5;
u
f
x
φφ
·
x x
·
[]
φφ
·
x x
·
[]