CMU
UM


Example: A State-space Controller for a Bus Suspension System

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:


For the original problem setup and the derivation of the above equations, please refer to the 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:

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 should be:


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 . Since in reality the bus will eventually reach an equilibrium that yields a zero steady-state error. New states become X1, Y1, and Y2. Also the state-space matrices, A,B,and C, after adding extra state change to be the following:

Actually, there is a shortcut for matlab to achieve the same result.

Add the above matlab code into the m-file. In this case, we treated the problem like 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 for 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, could be obtained by integrating the output of an accelerometer mounted on the bus.) It is similar to adding more damping to velocity of oscillation of the bus. Add the following matlab code for controller K in the m-file:

We arrive with this value of matrix with trial and error by adjusting gain for derivative of X1,Y1 and integral of Y1, as we 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:


We can now obtain the closed-loop response by simply adding the following code into your m-file. Note that we need to multiply B matrix by 0.1 to simulate 0.1 m high step disturbance:

Running the m-file in the command window, you should see the following plot:


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. But you will most likely get the response to have either large percent overshoot or very long settling time. But if you do find a better response, please email us with your results! We are always interested in different ways to solve our examples; we may include your solution in a future version of these tutorials.


User Feedback

We would like to hear about suggestions you have for improvement, difficulties you had with the tutorials, errors that you found, or any other comments that you have. This feedback is anonymous.


State Space 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

Tutorials

Basics | Modeling | PID | Root Locus | Frequency Response | State Space | Examples

Home Index Commands

6/25/97 PP 8/24/97 WM