CMU
UM


Example: Solution to the Cruise Control Problem Using Frequency Response

Bode plot and open-loop response
Proportional controller
Lag controller

The open-loop transfer function for this problem is :

The design criteria are:

Rise time < 5 sec
Overshoot < 10%
Steady state error < 2%

To see the original problem set, see the Cruise Control Modeling page.

Bode plot and open-loop response

The first step in solving this problem using frequency response is to determine what open-loop transfer function to use. Just like for the Root-Locus design method, we will only use a proportional controller to solve the problem. The block diagram and the open-loop transfer function are shown below.

In order to use a Bode plot, the open-loop response must be stable. Let Kp equals 1 for now and see how the open-loop response looks like. Create an new m-file and enter the following commands.

Running this m-file in the Matlab command window should give you the following plot.

As you can see, the open-loop system is stable; thus, we can go ahead and generate the Bode plot. Change the above m-file by deleting step command and add in the following command.

Running this new m-file should give you the following Bode plot.

Proportional controller

Let's see what system characteristics we can determine from the above Bode plot. Recall from the Root-Locus Tutorial, the bandwidth frequency (BW) (the frequency at the gain M(dB)=-6~-7.5dB) is roughly equals to the natural frequency (Wn). Using the equation,

the rise time (Tr) for our system can be determined to be extremely long since the gain shown above do not reach -6~-7.5dB. Moreover, we see from the Root-Locus Tutorial that the damping ratio is roughly equals to the phase margin (in degrees) divided by 100.

Since our phase margin is approximately 155 degrees, the damping ratio will be 1.55. Thus, we know that the system is overdamped (since the damping ratio is greater than 1). Finally, the steady-state error can be found from the following equation:

For our system, since the low frequency gain M(dB) is approximately -35dB, the steady-state error should be 98%. We can confirm these by generating a closed-loop step response.

In terms of the Bode plot, if we can shift the gain upward so that both the bandwidth frequency and the low frequency gain increase, then both the rise time and the steady-state error will improve. We can do that by increasing the proportional gain (Kp). Let's increase the proportional gain (Kp) to ,say, 100 and see what happens. Change the m-file to the following.

Running this m-file in the Matlab command window should give you the following Bode plot.

Now, the low frequency gain is about 6dB (magnitude 2) which predicts the steady-state error of 33%. The bandwidth frequency is about 0.1 rad/sec so that the rise time should be around 18 seconds. Let's take a look at the closed-loop step response and confirm these.

As we predicted, both the steady-state error and the rise time have improved. Let's increase the proportional gain even higher and see what happens. Change the m-file to the following and rerun it. You should get the following Bode plot.

Now, the low frequency gain is approximately 20dB (magnitude 10) that predicts the steady-state error of 9%, and the bandwidth frequency is around 0.6 that predicts the rise time of 3 sec (within the desired value). Thus, both the steady-state error and the rise time should have been improved. Again, let's confirm these by generating the closed-loop step response.

If you noticed, the steady-state error will eventually reach the desired value by increasing the proportional gain even higher. However, by the time the steady-state error reaches the desired value, the rise time becomes too fast (unrealistic for the real physical system). Thus, let's leave the Kp as it is and implement a lag controller to handle the steady-state error problem.

Lag controller

If you take a look at the "Lag or Phase-Lag Compensator using Frequency Response"section of the Lead and Lag Compensator page, the lag controller adds gain at the low freqencies while keeping the bandwidth frequency at the same place. This is actually what we need: Larger low frequency gain to reduce the steady-state error and keep the same bandwidth frequency to maintain the desired rise time. The transfer function of the lag controller is shown below.

Now, we need to choose a value for a and T. Recall from the "Lag or Phase-Lag Compensator using Frequency Response" page, the steady-state error will decrease by a factor of a. The value T should be chosen so that two corner frequencies will not be placed close together because transient response gets worse. So let a equals 0.05 and T equals 700 and see what happens. Copy the following m-file and run it in the Matlab command window. You should see the following Bode plot.

Since the low frequency gain has increased while the bandwidth frequency stayed the same, the steady-state error should be reduced and the rise time should stay the same. Let's confirm this by generating a closed-loop step response.

It may be hard to see, but there should be a green, dotted line across just below 10. This line shows the steady-state value of the step, and we can see that the steady-state error has been met. However, the settling time is too long. To fix this, raise the proportional gain to Kp=1500. This gain was chosen from trial-and-error that will not be described here in the interest of length. With this change made, the following Bode and step response plots can be generated.

As you can see, the overshoot is in fact zero, the steady state error is close to zero, the rise time is about 2 seconds, and the settling time is less than 3.5 seconds. The system has now met all of the design requirements. No more iteration is needed.


User feedback

We would like to hear about difficulties you had with the tutorials, suggestions you have for improvement, errors that you found, or any other comments that you have. This feedback is anonymous; include your email address if you want a reply.


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

Cruise Control Examples
Modeling | PID | Root Locus | Frequency Response | State Space | Digital Control: RL

Tutorials

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

HOME INDEX COMMANDS

8/26/97 DK