MATLAB Program 10–35 gives the unit-step response of the system given by Equation (10–179).
The resulting response curves are presented in Figure 10–55. It shows response curves
versust, versust, versust, versust,and versus t,where
the input r(t)to the cart is a unit-step function All initial conditions are set equal
to zero. Figure 10–56 is an enlarged version of the cart position versus t.The cart
moves backward a very small amount for the first 0.6 sec or so. (Notice that the cart velocity is
negative for the first 0.4 sec.) This is due to the fact that the inverted-pendulum-on-the-cart system
is a nonminimum-phase system.
yC=x 3 (t)DCr(t)= 1 mD.u yC=x 3 (t)D y#C=x 4 (t)D jC=x 5 (t)DC=x 2 (t)DuC=x 1 (t)DExample Problems and Solutions 851
MATLAB Program 10–35
% Unit-step response
A = [0 1 0 0;20.601 0 0 0;0 0 0 1;-0.4905 0 0 0];
B = [0;-1;0;0.5];
C = [0 0 1 0];
D = [0];
K = [-188.0799 -37.0738 -26.6767 -30.5824];
kI = -10.0000;
AA = [A-BK BkI; -C 0];
BB = [0;0;0;0;1];
CC= [C 0];
DD = D;
t = 0:0.01:10;
[y,x,t] = step(AA,BB,CC,DD,1,t);
x1 = [1 0 0 0 0]*x';
x2 = [0 1 0 0 0]*x';
x3 = [0 0 1 0 0]*x';
x4 = [0 0 0 1 0]*x';
x5 = [0 0 0 0 1]*x';
subplot(3,2,1); plot(t,x1); grid;
xlabel('t (sec)'); ylabel('x1')
subplot(3,2,2); plot(t,x2); grid;
xlabel('t (sec)'); ylabel('x2')
subplot(3,2,3); plot(t,x3); grid;
xlabel('t (sec)'); ylabel('x3')
subplot(3,2,4); plot(t,x4); grid;
xlabel('t (sec)'); ylabel('x4')
subplot(3,2,5); plot(t,x5); grid;
xlabel('t (sec)'); ylabel('x5')
Comparing the step-response characteristics of this system with those of Example 10–5, we
notice that the response of the present system is less oscillatory and exhibits less maximum
overshoot in the position response Ax 3 versustB. The system designed by use of the quadratic
optimal regulator approach generally gives such characteristics—less oscillatory and well damped.