EE 4443/4329 - Control Systems Design Project: Updated:Tuesday, June 15, 2004
EE 4443/4329 - Control Systems Design Project: Updated:Tuesday, June 15, 2004
Lewis 1999
All rights reserved
x& = f ( x, u )
(1)
y = h ( x, u )
with x(t ) ∈ R n the internal state, u (t ) ∈ R m the control input, and y (t ) ∈ R p the
measured output. These equations are nonlinear and can capture very general system
behaviors. The nonlinear state equation follows in a natural manner from a physical
analysis of naturally occurring systems, using, for instance, Hamilton's equations of
motion or Lagrange's equation of motion
d ∂L ∂L
− =F,
dt ∂q& ∂q
with q (t ) the generalized position vector, q& (t ) the generalized velocity vector, and F(t)
the generalized force vector. The Lagrangian is L= K-U, the kinetic energy minus the
potential energy. Using Lagrange's equation, one can derive the nonlinear function
f(x,u). The output function h(x,u) depends on the measurements selected by the design
engineer.
Note that the SV model has m inputs, n states, and p outputs, so it can represent
complicated multivariable (multi-input/multi-output) systems such as modern aerospace
systems, automobiles, submarine vehicles, etc.
x& = Ax + Bu
y = Cx + Du
where A is the system or plant matrix, B is the control input matrix, C is the output or
measurement matrix, and D is the direct feed matrix. This description is said to be time-
invariant if A, B, C, D are constant matrices. These equations are obtained directly from
a physical analysis if the system is inherently linear.
1
If the system is nonlinear, then the state equations are nonlinear. In this case, an
approximate linearized system description may be obtained by computing the Jacobian
matrices
∂f ∂f ∂h ∂h
A( x, u ) = , B ( x, u ) = , C ( x, u ) = , D ( x, u ) = .
∂x ∂u ∂x ∂u
These are evaluated at a nominal set point (x,u) to obtain constant system matrices
A,B,C,D, yielding a linear time-invariant state description which is approximately valid
for small excursions about the nominal point.
Example 1
x1 = q (t ), x 2 = q& (t )
x&1 = x 2
1
x& 2 = − Lx 22 − gL sin x1 + u
m
where the control input is u(t)= τ(t). To solve the second-order differential equation one
requires two initial conditions, e.g. q (0), q& (0). Thus, there are two state components.
The state components correspond to energy storage variables. For instance, in this case
one could think of potential energy mgh (the third term in the differential equation,
which involves q (t ) ), and rotational kinetic energy mω 2 (the second term, which
involves ω = q& (t ) ).
This is a nonlinear state equation. One can place it into the form (1) simply by
noting that x = [x1 x 2 ] T and writing
2
⎡ x&1 ⎤ ⎡ x2 ⎤
⎢ x& ⎥ = ⎢ 1 ⎥ ≡ f ( x, u )
⎣ 2 ⎦ ⎢⎣− Lx 2 − gL sin x1 + m u ⎥⎦
2
⎡ 0 1 ⎤ ⎡0⎤
x& = ⎢ ⎥ x + ⎢ 1 ⎥u = Ax + Bu .
⎣− gL cos x1 − 2 Lx 2 ⎦ ⎢⎣ m ⎥⎦
Evaluating this at a nominal equilibrium point of x=0, u=0 yields the linear time-invariant
state description
⎡ 0 1⎤ ⎡0⎤
x& = ⎢ ⎥ x + ⎢ 1 ⎥u = Ax + Bu
⎣− gL 0⎦ ⎢⎣ m ⎥⎦
which describes small excursions about the origin.
The function f(x,u) is given by the dynamics of the system. By contrast, the
output function h(x,u) is given by which measurements the engineer decides to take.
3
COMPUTER SIMULATION
Example 2
To use 'ode23' one must write a function M-file that contains the state equations.
To simulate the nonlinear system in Example 1, one may use the M-file:
where we have assumed that L= 1m, m= 10 Kg. The control input is set to be a sinusoid.
Using vector operations one could write the simpler M-file:
Note that the semicolon is used to terminate each line to avoid printing to the screen
during computations.
Given this M-file, stored in a file named 'robot.m', let's say, the following
command lines compute and plot the time response over the time interval 0 to 20 sec:
4
0.15
0.1
0.05
-0.05
-0.1
-0.15
-0.2
0 2 4 6 8 10 12 14 16 18 20
A Phase-Plane plot is a graph of x(2) vs. x(1). To make this plot, one uses
plot(x(:,1),x(:,2))
and obtains the figure shown. Note the use of the colon to select an entire column in an
array.
0.15
0.1
0.05
-0.05
-0.1
-0.15
-0.2
-0.05 -0.04 -0.03 -0.02 -0.01 0 0.01 0.02 0.03 0.04 0.05
5
Using MATLAB, one is able to perform very quickly the most exotic of analysis,
simulation, and plotting tasks. An introduction to MATLAB and some excellent demos
are available at the MATLAB website www.mathworks.com. The next sample is taken
from Shahian and Hassul, "Control System Design Using MATLAB," Prentice-Hall,
1993.