State Variable Models: Dorf and Bishop, Modern Control Systems
State Variable Models: Dorf and Bishop, Modern Control Systems
For example, the mass of a missile varies as a function of time as the fuel is
expended during flight. A multivariable system is a system with several input
and output.
The time-domain analysis and design of control systems utilizes the concept
of the state of a system.
The state of a system is a set of variables such that the knowledge of these
variables and the input functions will, with the equations describing the
dynamics, provide the future state and output of the system.
For a dynamic system, the state of a system is described in terms of a set of
state variables
[x1 (t ) x 2 (t ) x n (t )]
The state variables are those variables that determine the future behavior of
a system when the present state of the system and the excitation signals are
known. Consider the system shown in Figure 1, where y1(t) and y2(t) are the
output signals and u1(t) and u2(t) are the input signals. A set of state
variables [x1 x2 ... xn] for the system shown in the figure is a set such that
knowledge of the initial values of the state variables [x1(t0) x2(t0) ... xn(t0)] at
the initial time t0, and of the input signals u1(t) and u2(t) for t˃=t0, suffices to
determine the future values of the outputs and state variables.
dt 2 2
We can write the equations that describe the behavior of the spring-mass-
damper system as the set of two first-order differential equations.
dx1 This set of difefrential equations
x2 describes the behavior of the state of
dt
the system in terms of the rate of
dx 2 c k 1 change of each state variables.
x 2 x1 u ( t )
dt m m m
can be described in terms of
1 1 1
2
E1 L i L , E 2 c
2 2
i dt C v these variables.
c
2 2C 2
Therefore x1(t0) and x2(t0) represent the total initial energy of the network and
thus the state of the system at t=t0.
dv c
ic C u(t) i L
dt
Kirchhoff’s voltage low for the right-hand loop provides the equation describing
the rate of change of inducator current as
di L
L R i L v c
dt
The output of the system is represented by the linear algebraic equation
v0 R i L (t )
dv c dx1 1 1
C u(t) i L x 2 u(t)
dt dt C C
di L dx 2 1 R
L R i L v c x1 x 2
dt dt L L
Utilizing the first-order differential equations and the initial conditions of the
network represented by [x1(t0) x2(t0)], we can determine the system’s future
and its output.
The state variables that describe a system are not a unique set, and several
alternative sets of state variables can be chosen. For the RLC circuit, we
might choose the set of state variables as the two voltages, vC(t) and vL(t).
In an actual system, there are several choices of a set of state variables that
specify the energy stored in a system and therefore adequately describe the
dynamics of the system.
The column matrix consisting of the state variables is called the state vector
and is written as
x1
x
x 2
x n
Dorf and Bishop, Modern Control Systems
The vector of input signals is defined as u. Then the system can be
represented by the compact notation of the state differential equation as
x A x B u
This differential equation is also commonly called the state equation. The
matrix A is an nxn square matrix, and B is an nxm matrix. The state differential
equation relates the rate of change of the state of the system to the state of the
system and the input signals. In general, the outputs of a linear system can be
related to the state variables and the input signals by the output equation
yCxDu
Where y is the set of output signals expressed in column vector form. The
state-space representation (or state-variable representation) is comprised of
the state variable differential equation and the output equation.
We can write the state variable differential equation for the RLC circuit as
1
0 1
x C x u(t)
1 R C
0
L L
and the output as
y 0 R x
The solution of the state differential equation can be obtained in a manner
similar to the approach we utilize for solving a first order differential equation.
Consider the first-order differential equation
x ax bu
Where x(t) and u(t) are scalar functions of time. We expect an exponential
solution of the form eat. Taking the Laplace transform of both sides, we have
s X(s) x 0 a X(s) b U(s)
therefore,
x (0) b
X(s) U(s)
sa sa
t
x ( t ) eat x (0) ea ( t ) b u () d
0
We expect the solution of the state differential equation to be similar to x(t)
and to be of differential form. The matrix exponential function is defined
as
A2t 2 Ak t k
e At I At
2! k!
Dorf and Bishop, Modern Control Systems
which converges for all finite t and any A. Then the solution of the state
differential equation is found to be
t
x ( t ) e At x (0) e A ( t ) B u () d
0
t
x ( t ) ( t ) x (0) ( t ) B u () d
0
x A x B u
yCx
where y is the single output and u is the single input. The Laplace transform
of the equations
G (s) C(s)B
Example:
Determine the transfer function G(s)=Y(s)/U(s) for the RLC circuit as described
by the state differential function
1
0 1
x C x u , y 0 R x
1 R C
0
L L
R 1
1 s L
(s) sI A
1 C
1
s (s) 1 s
sI A 1 C
R L
s
L L R
(s) s 2 s
1
L LC
R
s
L 1 1
G (s) 0 R (s) C (s) C
1 s 0
L (s) (s)
R / LC R / LC
G (s)
(s) s s
2 R 1
L LC
Dorf and Bishop, Modern Control Systems
ANALYSIS OF STATE VARIABLE MODELS USING MATLAB
sys_ss=ss(sys_tf)
sys_tf=tf(sys_ss)
sys=ss(A,B,C,D) x Ax Bu
Y(s) G (s) U(s)
y Cx Du
The ss function
Y(s) 2 s2 8 s 6
G (s)
R (s) s 3 8 s 2 16 s 6
b=
8 4 1.5 2
u1
x1 2
A 4 0 , B 0
x2 0
0 x3 0
0 0 0
c=
1 y1
x1 x2 x3
1 1 0.75
d=
Continuous-time model.
8 4 1.5 2
A 4 0 0 , B 0
0 1 0 0
1
R(s) x1 x2
x3 Y(s)
2 1/s 4 1/s 1 1/s 0.75
-8
-4
-1.5
We can use the function expm to compute the transition matrix for a given
time. The expm(A) function computes the matrix exponential. By contrast the
exp(A) function calculates eaij for each of the elements aijϵA.
0 2 2
A , B , C 1 0 and D 0
1 3 0
The initial conditions are x1(0)=x2(0)=1 and the input u(t)=0. At t=0.2, the state
transition matrix is calculated as Phi =
y Cx Du
t t
t=times at which
y(t)=output response at t response is Initial conditions
computed
T: time vector (optional)
X(t)=state response at t
u=input
[y,T,x]=lsim(sys,u,t,x0)
Dorf and Bishop, Modern Control Systems
1
1
X
0.4
A=[0 -2;1 -3];B=[2;0];C=[1 0];D=[0];
0.2
sys=ss(A,B,C,D) %state-space model
0
x0=[1 1]; %initial conditions 0 0.2 0.4 0.6
Time (seconds)
0.8 1
t=[0:0.01:1]; 1
u=0*t; %zero input 0.8
[y,T,x]=lsim(sys,u,t,x0); 0.6
subplot(211),plot(T,x(:,1))
2
X
0.4
xlabel('Time (seconds)'),ylabel('X_1') 0.2
subplot(212),plot(T,x(:,2)) 0
0 0.2 0.4 0.6 0.8 1
xlabel('Time (seconds)'),ylabel('X_2') Time (seconds)
3 2.5
2 u=3*t 2
1
1
X
X u=3*exp(-2*t)
1 1.5
0 1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time (seconds) Time (seconds)
1 1
0.9
0.8
2
0.8
X
0.6
0.7
0.4
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time (seconds) Time (seconds)
Example: Dorf and Bishop, Modern Control Systems, p173.
Consider the head mount of a disk reader shown in
the figure. We will attempt to derive a model for the
system shown in Figure 5a. Here we identify the
motor mass M1 and the head mount mass as M2.
The flexure spring is represented by the spring
constant k. The force u(t) to drive the mass M1 is
generated by the DC motor. If the spring is
absolutely rigid (nonspringy), then we obtain the
simplifed model shown in Figure 5b. Typical
parameters for the two-mass system are given in
Table 1.
Motor q(t) Head y(t) y(t)
u(t)
mass mass
Head u(t)
Force position M=M1+M2
M1 M2
b1 b2 b1
Figure 5a Figure 5b
Table 1. Typical parameters of the two-mass model
Motor mass M1= 0.02 kg Friction at mass 1 b1=410x10-3 kgs/m Motor constant Km=0.1025 Nm/A
Flexure spring 10<=k<=inf Field resistance R=1 Ω Friction at mass 2 b2=4.1x10-3 kgm/s
Head mounting M2=0.0005 kg Field inductance L=1 mH Head position y(t)=x2(t)
Motor coil To develop a state variable model, we
V(s) U(s) Two-
mass choose the state variables as x1=q and
Km
Force system x2=y. Then we have
Ls R
2
q
y
k q y u ( t )
dq dq
M1 2 b1
dt dt dq dy x
x3 and x4 q x 3
d2y dt dt
k y q 0
dy
M2 2 b2 y x 4
dt dt
In matrix form, x Ax Bu y 0 0 0 1x
0 0 1 0 0
0 0
A
0 0 1 B
k / M1 k / M1 b1 / M1 0 1 / M1
0
k / M2 k / M2 0 b2 / M2
Note that the output is dy/dt=x4. Also, for L=0 or negligible inductance, then
u(t)=Kmv(t). For the typical parameters and k=10, we have
0 0 0 1 0
0 0 0 0 1
B , A
50 500 500 20.5 0
0 20000 20000 0 8.2
clc;clear
Velocity of Mass 2 (Head)
k=10; 3
B=[0;0;1/M1;0];C=[0 0 0 1];D=[0];
sys=ss(A,B,C,D) 1
y=step(sys,t);
0.5
plot(t,y);grid
xlabel('Time 0
0 0.5 1 1.5
(seconds)'),ylabel('ydot (m/s)') Time (seconds)
2 2
1.5 1.5
ydot (m/s)
ydot (m/s)
1 1
0.5 0.5
0 0
0 0.5 1 1.5 0 0.5 1 1.5
Time (seconds) Time (seconds)
2.5
k=100000 N/m
1.5
ydot (m/s)
0.5
0
0 0.5 1 1.5
Time (seconds)
THE DESIGN OF STATE VARIABLE FEEDBACK SYSTEMS
The time-domain method, expressed in terms of state variables, can also be utilized
to design a suitable compensation scheme for a control system. Typically, we are
interested in controlling the system with a control signal, u(t), which is a function of
several measurable state variables. Then we develop a state variable controller that
operates on the information available in measured form.
State variable design is typically comprised of three steps. In the first step, we
assume that all the state variables are measurable and utilize them in a full-state
feedback control law. Full-state feedback is not usually practical because it is not
possible (in general) to measure all the states. In paractice, only certain states (or
linear combinations thereof) are measured and provided as system outputs. The
second step in state varaible design is to construct an observer to estimate the
states that are not directly sensed and available as outputs. Observers can either
be full-state observers or reduced-order observers. Reduced-order observers
account for the fact that certain states are already available as system outputs;
hence they do not need to be estimated. The final step in the design process is to
appropriately connect the observer to the full-state feedback conrol low. It is
common to refer to the state-varaible controller as a compensator. Additionally, it is
possible to consider reference inputs to the state variable compensator to complete
the design.
x Ax Bu
rank B AB A 2 B A n 1B n
The matrix A is an nxn matrix an B is an nx1 matrix. For multi input systems,
B can be nxm, where m is the number of inputs.
Pc B AB A 2 B A n 1B
which is nxn matrix. Therefore, if the determinant of Pc is nonzero, the system
is controllable.
Example:
Consider the system
0 1 0 0
x 0 0 1 x 0 u , y 1 0 0 x 0u
a 0 a1 a 2 1
0 1 0 0 0 1
A 0 0 1 , B 0 , AB 1 , A 2 B a 2
a 0 a1 a 2 1 a 2
a 22 a1
0 0 1
Pc B AB A 2 B 0 1 a2
1 a 2 a 22 a1
The determinant of Pc =1 and ≠0 , hence this system is controllable.
Example.
x 1 2 x1 u , x 2 3 x 2 d x1
The output of the system is y=x2. Determine the condition of controllability.
2 0 1
x x u , y 0 1 x 0u
d 3 0
1 2 0 1 2
B and AB
0 d 3 0 d
1 2
Pc The determinant of pc is equal to d, which is
0 d nonzero only when d is nonzero.
0 0 0 1 0
0 0 0 0 1
B , A
50 500 500 20.5 0
0 20000 20000 0 8.2
Pc =
clc 1.0e+007 *
clear 0 0.0000 -0.0001 -0.0004
A=[0 0 1 0;0 0 0 1;-500 500 -20.5 0 0 0 0.1000
0.0000 -0.0001 -0.0004 0.0594
0;20000 -20000 0 -8.2]; 0 0 0.1000 -2.8700
B=[0;0;50;0];
rank_Pc =
Pc=ctrb(A,B)
rank_Pc=rank(Pc) 4
The system is
det_Pc=det(Pc) controllable.
det_Pc =
-2.5000e+015
OBSERVABILITY:
All the poles of the closed-loop system can be placed arbitrarily in the complex
plane if and only if the system is observable and controllable. Observability
refers to the ability to estimate a state variable.
x Ax Bu and y Cx
where C is a 1xn row vector, and x is an nx1 column vector. This system is
completely observable when the determinant of the observability matrix P0
is nonzero.
The observability matrix, which is an nxn matrix, is written as
C
CA
PO
n 1
C A
Example:
Consider the previously given system
0 1 0
A 0 0 1 , C 1 0 0
a 0 a1 a 2
Thus, we obtain
1 0 0
PO 0 1 0
0 0 1
The det P0=1, and the system is completely observable. Note that
determination of observability does not utility the B and C matrices.
2 0 1
x x u and y 1 1 x
1 1 1
We can check the system controllability and observability using the Pc and P0
matrices.
1 2
B and AB
1 2
Therefore, the controllability matrix is determined to be
1 2
Pc B AB
1 2
det Pc=0 and rank(Pc)=1. Thus, the system is not controllable.
C 1 1 and CA 1 1
C 1 1
Po
CA 1 1
det PO=0 and rank(PO)=1. Thus, the system is not observable.
y x1 x 2
However,
x 1 x 2 2x1 x 2 x1 u u x1 x 2
Thus, the system state variables do not depend on u, and the system is not
controllable. Similarly, the output (x1+x2) depends on x1(0) plus x2(0) and does
not allow us to determine x1(0) and x2(0) independently. Consequently, the
system is not observable.
1 1
clc 1 1
clear
A=[2 0;-1 1];
rank_Po =
C=[1 1];
Po=obsv(A,C) 1
rank_Po=rank(Po)
det_Po=det(Po) The system is not
det_Po =
observable.
0