CMU
UM


Example: Solution to the Ball & Beam Problem Using Frequency Response Method

Open-loop Bode Plot
Phase-Lead Controller
Adding More Phase

The open-loop transfer function of the plant for the ball and beam experiment is given below:

The design criteria for this problem are:

To see the derivation of the equations for this problem refer to the ball and beam modeling page. A schematic of the closed loop system with a controller is given below:

Open-loop Bode Plot

The main idea of frequency based design is to use the Bode plot of the open-loop transfer function to estimate the closed-loop response. Adding a controller to the system changes the open-loop Bode plot, therefore changing the closed-loop response. Let's first draw the bode plot for the original open-loop transfer function. Create an m-file with the following code and then run it in the Matlab command window:
NOTE: Matlab commands from the control system toolbox are highlighted in red.

You should get the following Bode plot:

From this plot we see that the phase margin is zero. Since the phase margin is defined as the change in open-loop phase shift necessary to make a closed-loop system stable this means that our zero phase margin indicates our system is unstable. We want to increase the phase margin and we can use a lead compensator controller to do this. For more information on Phase and Gain margins please refer to the Frequency Response Tutorial.

Phase-Lead Controller

A first order phase-lead compensator has the form given below:

The phase-lead compensator will add positive phase to our system over the frequency range 1/aT and 1/T, which are called the corner frequencies. The maximum added phase for one lead compensator is 90 degrees. For our controller design we need a percent overshoot of 5, which corresponds to a zeta of 0.7. Generally zeta * 100 will give you the minimum phase margin needed to obtain your desired overshoot. Therefore we require a phase margin greater than 70 degrees.

To obtain "T" and "a", the following steps can be used.

1. Determine the positive phase needed:

2. Determine the frequency where the phase should be added (center frequency):

3. Determine the constant "a" from the equation below, this determines the required space between the zero and the pole for the maximum phase added.

4. Determine "T" and "aT" from the following equations:

Now, we can add our lead controller to the system and view the bode plot. Remove the bode command from your m-file and add the following:

You should get the following bode plot:

You can see that our phase margin is now 70 degrees. Let's check the closed-loop response to a step input of 0.25m. Add the following to your m-file:

You should get the following plot:

Although the system is now stable and the overshoot is only slightly over 5%, the settling time is not satisfactory. Increasing the gain will increase the crossover frequency and make the response faster. Make k = 5, your response should look like:

The response is faster, however, the overshoot is much too high. Increasing the gain further will just make the overshoot worse.

Adding More Phase

We can increase our phase-lead compensator to decrease the overshoot. In order to make the iterative process easier use the following program. Create an m-file and copy the function from your web-browser into it (make sure the function command starts in the first column of the m-file). With this m-file you can choose the phase margin, center frequency, and gain. Run your m-file with the following values and you should see the plots below on your screen.

The overshoot is fine but the settling time is just a bit long. Try different numbers and see what happens.

Using the following values the design criteria was met.

Note: A design problem does not necessarily have a unique answer. Using this method (or any other) may result in many different compensators. For practice you may want to go back and change the added phase, gain, or center frequency.


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.


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

Ball & Beam Examples
Modeling | PID | Root Locus | Frequency Response | State Space | Digital Control

Tutorials

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

8/12/97 CJC