Example: Bus Suspension Modeling in Simulink


Physical setup
Building the model
Open-loop response
Extracting the Model
Implementing Full State Feedback
Closed-loop response

Physical setup

Designing an automatic suspension system for a bus turns out to be an interesting control problem. When the suspension system is designed, a 1/4 bus model (one of the four wheels) is used to simplify the problem to a one dimensional spring-damper system. A diagram of this system is shown below:


Where:

* body mass (m1) = 2500 kg,
* suspension mass (m2) = 320 kg,
* spring constant of suspension system(k1) = 80,000 N/m,
* spring constant of wheel and tire(k2) = 500,000 N/m,
* damping constant of suspension system(b1) = 350 Ns/m.
* damping constant of wheel and tire(b2) = 15,020 Ns/m.
* control force (u) = force from the controller we are going to design.

Design requirements:

A good bus suspension system should have satisfactory road holding ability, while still providing comfort when riding over bumps and holes in the road. When the bus is experiencing any road disturbance (i.e. pot holes, cracks, and uneven pavement),the bus body should not have large oscillations, and the oscillations should dissipate quickly. Since the distance X1-W is very difficult to measure, and the deformation of the tire (X2-W) is negligible, we will use the distance X1-X2 instead of X1-W as the output in our problem. Keep in mind that this is an estimation.

The road disturbance (W) in this problem will be simulated by a step input. This step could represent the bus coming out of a pothole. We want to design a feedback controller so that the output (X1-X2) has an overshoot less than 5% and a settling time shorter than 5 seconds. For example, when the bus runs onto a 10 cm high step, the bus body will oscillate within a range of +/- 5 mm and return to a smooth ride within 5 seconds.

Building the Model

This system will be modeled by summing the forces acting on both masses (body and suspension) and integrating the accelerations of each mass twice to give velocities and positions. Newton's law will be applied to each mass. Open Simulink and open a new model window. First, we will model the integrals of the accelerations of the masses.

Next, we will start to model Newton's law. Newton's law for each of these masses can be expressed as:

These equations can be represented with gain blocks (for 1/M1 and 1/M2) and two summation blocks. There are three forces acting on M1 (one spring, one damper, and the input, u) and five forces acting on M2 (two springs, two dampers, and the input, u).

Now, we will add in the forces acting on each mass. First, we will add in the force from Spring 1. This force is equal to a constant, k1 times the difference X1-X2.

Now, we will add in the force from Damper 1. This force is equal to b1 times V1-V2.

Now we will add in the force from Spring 2. This force acts only on Mass 2, but depends on the ground profile, W. Spring 2's force is equal to X2-W.

Next, we will add in the force from Damper 2. This force is equal to b2 times V2-d/dt(W). Since there is no existing signal representing the derivative of W we will need to generate this signal.

The last force in the input U acting between the two masses.

You can download a model file for the complete system here.

Open-loop response

To simulate this system, first, an appropriate simulation time must be set. Select Parameters from the Simulation menu and enter "50" in the Stop Time field. 50 seconds is long enough to view the open-loop response. The physical parameters must now be set. Run the following commands at the MATLAB prompt: Run the simulation (Ctrl-t or Start on the Simulation menu). When the simulation is finished, double-click on the scope and hit its autoscale button. You should see the following output.

Extracting a Linear Model into MATLAB

A linear model of the system (in state space or transfer function form) can be extracted from a Simulink model into MATLAB. This is done through the use of In and Out Connection blocks and the MATLAB function linmod. We will extract only the model from the input U to the output X1-X2.

Save your file as "suspmod.mdl" (select Save As from the File menu). MATLAB will extract the linear model from the saved model file, not from the open model window. At the MATLAB prompt, enter the following commands:

You should see the following output, providing both state-space and transfer function models of the system. To verify the model extraction, we will generate an open-loop step response of the extracted transfer function in MATLAB. Enter the following command in MATLAB. You should see the following plot which is equivalent to the Scope's output.

Implementing Full State Feedback

In the Bus Suspension Control State Space example a full-state feedback controller was designed feeding back the following five states:
The controller used the following feedback gain matrix:
To implement this in Simulink, we will contain the open-loop system from earlier in this page in a Subsystem block.

Now we will generate the other state outputs from the subsystem.

The final, extra, state needs to be generated, which is the integral of Y1.

Since the state outputs will be used to form a vector, it is important that they be numbered in the right order.

Now, we will build a full-state feedback controller around the plant model. First, we need to create a vector signal out of the five scalar outputs in order to multiply by the feedback gain matrix K.

Now, we will close the loop.

You can download our version of the closed-loop system here.

Closed-loop response

To simulate this system, first, an appropriate simulation time must be set. Select Parameters from the Simulation menu and enter "2" in the Stop Time field. The design requirements included a settling time of less than 5 sec, and the system actually settles in 2 sec. The physical parameters must now be set. Run the following commands at the MATLAB prompt: The last step is to assign values to the feedback gain matrix K. Execute the following command at the MATLAB prompt. Run the simulation (Ctrl-t or Start on the Simulation menu). When the simulation is finished, double-click on the scope and hit its autoscale button. You should see the following output.


Simulink Examples
Cruise Control | Motor Speed | Motor Position | Bus Suspension | Inverted Pendulum | Pitch Controller | Ball and Beam

Bus Suspension Examples
Modeling | PID | Root Locus | Frequency Response | State Space | Digital Control | Simulink

Tutorials
MATLAB Basics | MATLAB Modeling | PID | Root Locus | Frequency Response | State Space | Digital Control | Simulink Basics | Simulink Modeling | Examples