What Are The Drone Anti-jamming Systems Technology?
MATLAB Suspension System Modeling and State-Space Control Design
1. Suspension: System Modeling
Key MATLAB commands used in this tutorial are: ss , step
Contents
Physical setup
System parameters
Equations of motion
Transfer function models
Entering equations in MATLAB
Physical setup
Designing an automotive suspension system is an interesting and challenging control problem.When the suspension
system is designed, a 1/4 model (one of the four wheels) is used to simplify the problem to a 1D multiple spring -
damper system.A diagram ofthis system is shown below. This model is for an active suspension system where an
actuator is included that is able to generate the control force U to control the motion of the bus body.
System parameters
(M1) 1/4 bus body mass 2500 kg
(M2) suspension mass 320 kg
(K1) spring constant of suspension system 80,000 N/m
(K2) spring constant of wheel and tire 500,000 N/m
(b1) damping constant of suspension system 350 N.s/m
(b2) damping constant of wheel and tire 15,020 N.s/m
(U) control force
Equations of motion
From the picture above and Newton's law, we can obtain the dynamic equations as the following:
2. (1)
(2)
Transfer function models
Assume that all of the initial conditions are zero, so that these equations represent the situation where the vehicle
wheel goes up a bump. The dynamic equations above can be expressed in the form of transfer functions by taking
the Laplace Transform.The specific derivation from the above equations to the transfer functions G1(s) and G2(s) is
shown below where each transfer function has an output of, X1-X2, and inputs of U and W, respectively.
(3)
(4)
(5)
(6)
(7)
or
(8)
Find the inverse of matrix A and then multiply with inputs U(s)and W(s) on the righthand side as follows:
(9)
(10)
When we want to consider the control input U(s) only, we set W(s) = 0. Thus we get the transfer function G1(s) as in
the following:
(11)
When we want to consider the disturbance input W(s) only, we set U(s) = 0. Thus we get the transfer function G2(s)
as in the following:
(12)
Entering equations in MATLAB
We can generate the above transfer function models in MATLAB by entering the following commands in the MATLAB
command window.
M1 = 2500;
M2 = 320;
K1 = 80000;
K2 = 500000;
b1 = 350;
b2 = 15020;
s = tf('s');
G1 = ((M1+M2)*s^2+b2*s+K2)/((M1*s^2+b1*s+K1)*(M2*s^2+(b1+b2)*s+(K1+K2))-
(b1*s+K1)*(b1*s+K1));
G2 = (-M1*b2*s^3-M1*K2*s^2)/((M1*s^2+b1*s+K1)*(M2*s^2+(b1+b2)*s+(K1+K2))-
(b1*s+K1)*(b1*s+K1));
3. Suspension: State-Space Controller Design
Key MATLAB commands used in this tutorial are: ss , step
Contents
Designing the full state-feedback controller
Plotting the closed-loop response
From the main problem, the dynamic equations in state-space form are the following where Y1 = X1 - X2.
(1)
(2)
(3)
For the original problem and the derivation of the above equations and schematic, please refer to the Suspension:
System Modeling page.
We want to design a feedback controller so that when the road disturbance (W) is simulated by a unit step input, the
output (X1-X2) has a settling time less than 5 seconds and an overshoot less than 5%. For example, when the bus
runs onto a 10 cm high step, the bus body will oscillate within a range of +/- 5 mm and will stop oscillating within 5
seconds.
The system model can be represented in MATLAB by creating a new m-file and entering the following commands
(refer to main problem for the details of getting those commands). We need to define the A, B, C, D matrices by
entering the following into the m-file:
m1 = 2500;
m2 = 320;
k1 = 80000;
k2 = 500000;
b1 = 350;
b2 = 15020;
A=[0 1 0 0
-(b1*b2)/(m1*m2) 0 ((b1/m1)*((b1/m1)+(b1/m2)+(b2/m2)))-(k1/m1) -(b1/m1)
b2/m2 0 -((b1/m1)+(b1/m2)+(b2/m2)) 1
k2/m2 0 -((k1/m1)+(k1/m2)+(k2/m2)) 0];
B=[0 0
1/m1 (b1*b2)/(m1*m2)
0 -(b2/m2)
(1/m1)+(1/m2) -(k2/m2)];
C=[0 0 1 0];
D=[0 0];
sys=ss(A,B,C,D);
Designing the full state-feedback controller
First, let's design a full state-feedback controller for the system.Assuming for now that all the states can be measured
(this assumption is probably not true but is sufficient for this problem), the schematic of the system is shown below.
4. The characteristic polynomial for this closed-loop system is the determinant of (sI-(A-B[1,0]'K)). Note that it's not sI-
(A-BK) because the controller K can only control the force input u but not the road disturbance W. Recall that our B
matrix is a 4 x 2 matrix, and we only need the first column of B to control U.
For this example,we have to use integral action to achieve zero steady-state error, so we add an extra state which is
int(X1-X2) = int(Y1). In reality the bus will eventually reach an equilibrium that yields a zero steady-state error. The
new states are X1, X1_dot, Y1, Y1_dot, and Y2. Also the state-space matrices, A, B, and C, become the following
after the addition of the new state.
Aa=[0 1 0 0 0
-(b1*b2)/(m1*m2) 0 ((b1/m1)*((b1/m1)+(b1/m2)+(b2/m2)))-(k1/m1) -(b1/m1) 0
b2/m2 0 -((b1/m1)+(b1/m2)+(b2/m2)) 1 0
k2/m2 0 -((k1/m1)+(k1/m2)+(k2/m2)) 0 0
0 0 1 0 0];
Ba=[0 0
1/m1 (b1*b2)/(m1*m2)
0 -(b2/m2)
(1/m1)+(1/m2) -(k2/m2)
0 0];
Ca=[0 0 1 0 0];
Da=[0 0];
sys=ss(Aa,Ba,Ca,Da);
Actually, there is a shortcut for MATLAB to achieve the same result.
Aa = [[A,[0 0 0 0]'];[C, 0]];
Ba = [B;[0 0]];
Ca = [C,0];
Da = D;
sys=ss(Aa,Ba,Ca,Da);
Add the above MATLAB code into the m-file. In this case, we treat the problem like a PID controller design. The
integral control is obtained from the new state. The proportional control is obtained from a gain on Y1 or X1-X2. The
direct derivative control of the output isn't possible, since derivative of Y1 or X1-X2 isn't a state. Instead we use the
derivative of X1, which is available for feedback. (While X1 maybe hard to measure, X1_dot could be obtained by
integrating the output of an accelerometer mounted on the bus.) It is similar to adding more damping to the velocity of
the oscillation of the bus suspension. Add the following MATLAB code for controller K in the m-file:
K = [0 2.3e6 5e8 0 8e6]
K =
0 2300000 500000000 0 8000000
We arrived at this value of the K, matrix by trial and error, adjusting the gain for derivative of X1, Y1 and integral of
Y1, as previously mentioned.
Plotting the closed-loop response
Looking at the schematic above again, we see that after adding the K matrix into the system, the state -space
equations become:
(4)
5. (5)
We can now obtain the closed-loop response by simply adding the following code into the m-file. Note that we need
to multiply B matrix by 0.1 to simulate the 0.1-m high step disturbance.
t = 0:0.01:2;
sys_cl = ss(Aa-Ba(:,1)*K,-0.1*Ba,Ca,Da);
step(sys_cl*[0;1],t)
title('Closed-Loop Response to a 0.1-m Step')
From the plot we see that the percent overshoot and settling time requirements are satisfied. Moreover the steady-
state error approaches zero as well. Therefore, we will determine that the response is satisfactory. Feel free to play
around with the gain for matrix K.