Ball and Beam Courseware Sample For MATLAB Users
Ball and Beam Courseware Sample For MATLAB Users
Preparing laboratory experiments can be time-consuming. Quanser understands time constraints of teaching
and research professors. Thats why Quansers control laboratory solutions come with proven practical
exercises. The courseware is designed to save you time, give students a solid understanding of various
control concepts and provide maximum value for your investment.
Quanser course materials are supplied in two formats:
1. Instructor Workbook provides solutions for the pre-lab assignments and contains typical
experimental results from the laboratory procedure. This version is not intended for the
students.
2. Student Workbook contains pre-lab assignments and in-lab procedures for students.
This courseware sample is prepared for users of The MathWorks MATLAB/Simulink software in
conjunction with Quansers QUARC real-time control software. A version of the course materials for
National Instruments LabVIEW users is also available.
The courseware for Quanser Ball and Beam experiment is aligned with the requirements of
the Accreditation Board for Engineering and Technology (ABET), one of the most respected
organizations specializing in accreditation of educational programs in applied science,
computing, science and technology. The Instructor Workbook provides professors with a simple framework
and set of templates to measure and document students achievements of various performance criteria and
their ability to:
Apply knowledge of math, science and engineering
Design and conduct experiments, and analyze and interpret data
Communicate effectively
Use techniques, skills and modern engineering tools necessary for engineering practice
Quanser, Inc. would like to thank Dr. Hakan Gurocak from the Washington State University Vancouver, for
rewriting the original manual to include embedded outcomes assessment.
The following material provides an abbreviated example of pre-lab assignments and in-lab procedures for
the Ball and Beam experiment. Please note that the examples are not complete as they are intended to
give you a brief overview of the structure and content of the course materials you will receive with the
plant.
TABLE OF CONTENTS
2.
The full Table of Contents of the Quanser Ball and Beam Instructor Workbook is shown here:
1. INTRODUCTION
2. BACKGROUND
2.1. MODELING FROM FIRST PRINCIPLES
2.1.1.NONLINEAR EQUATION OF MOTION
2.1.2.ADDING SRV02 DYNAMICS
2.1.3.OBTAINING TRANSFER FUNCTION
2.2. DESIRED CONTROL RESPONSE
2.2.1.TIME-DOMAIN SPECIFICATIONS
2.3. BALL AND BEAM CASCADE CONTROL DESIGN
2.3.1.INNER LOOP CONTROLLER DESIGN: SRV02 PV POSITION CONTROLLER
2.3.2.OUTER LOOP CONTROLLER DESIGN
3. PRE-LAB QUESTIONS
4. LAB EXPERIMENTS
4.1. CASCADE CONTROL WITH IDEAL PD CONTROLLER
4.1.1.SIMULATION WITH NO SERVO DYNAMICS
4.1.2.SIMULATION WITH SERVO DYNAMICS
4.2. CASCADE CONTROL WITH PRACTICAL PD CONTROLLER AND SERVO DYNAMICS
4.2.1. SIMULATION WITH PRACTICAL PD CONTROLLER
4.2.2. IMPLEMENTATION WITH PRACTICAL PD CONTROLLER
4.2.3. CONTROLLER USING THE REMOTE SENSOR (OPTIONAL)
4.3. RESULTS
5. SYSTEM REQUIREMENTS
5.1. OVERVIEW FILES
5.2. SETUP FOR POSITION CONTROL SIMULATION
5.3. SETUP FOR POSITION CONTROL IMPLEMENTATION
6. LAB REPORT
6.1. TEMPLATE FOR CONTENT (CASCADE CONTROL WITH IDEAL PD CONTROL EXPERIMENTS)
6.2. TEMPLATE FOR CONTENT (CASCADE CONTROL WITH PRACTICAL PD CONTROL EXPERIMENTS)
6.3. TIPS FOR REPORT FORMAT
7. SCORING SHEET FOR PRE-LAB QUESTIONS
8. SCORING SHEET FOR LAB REPORT (IDEAL PD)
9. SCORING SHEET FOR LAB REPORT (PRACTICAL PD)
APPENDIX A BB01 INSTRUCTORS GUIDE
REFERENCES
Find the steady-state error of the Ball and Beam system given by the Pbb(s) transfer function.
The system is shown in Figure 3.1. The compensator is unity
C(s) = 1
(3.1)
Solution
Substituting the BB01 plant in 2.21 along with the compensator and reference input
defined above into the general error transfer function
(Ans. 3.5)
A-2
Figure 4.1: Simulink diagram used to simulate the outer closed-loop BB01 system.
The BB01 Nonlinear Model subsystem includes the Pbb(s) transfer function that was derived in Section 2.1.3.
Recall that in Section 2.1.2 the model had to be linearized in order to obtain the Pbb(s) transfer function. This
nonlinearity is re-introduced in the BB01 Nonlinear Model subsystem in order to represent the plant more
accurately and ensure the specifications can still be satisfied. The BB01 PD Position Control subsystem
contains the ideal PD compensator designed in Section 2.3.2. Note that it includes a Saturation block that
limits the SRV02 angle between 56 degrees.
IMPORTANT: Before you can conduct these experiments, you need to make sure that the lab files are
configured according to your system setup. If they have not been configured already, then you need to go to
Section 5.2 to configure the lab files first.
Simulation
The root locus of the forward path is plotted using Matlab and the closed-loop step position response of the
BB01 is simulated to verify that the specifications are met. As previously mentioned, the simulation is
performed using the nonlinear model of the Ball and Beam and the ideal PD controller that was designed.
1.
2.
3.
4.
Ensure the s_bb01_pos_outerr_loop Simulink diagram is open and setup as described in Section 5.2.
Enter the BB01 model gain found in Pre-Lab question 1 in the matlab Command Window as variable
K_ bb(e.g., type K_bb = 1 in the Matlab prompt).
In Matlab, enter the BB01 compensator gain K_c and the compensator zero, z, that were found in PreLab question 11.
K-1 Using Matlab, plot the root locus of BB01 loop transfer function when using the ideal PD
controller. Use the sgrid command to include the dashed lines that show the desired locations of the
poles. Ensure the poles go through the desired locations at the gain that was computed in the Pre-Lab
question 11.
Answer 4.1
Outcome
K-1
Solution
Students should use the Matlab commands tf and rlocus to plot the root locus of the
open-loop system. For instructors, run setup_srv02_exp04_bb01.m with
CONTROL_TYPE=AUTO,PLOT_RL = 1 and PD_TYPE = 0 to plot the root locus of the Ball
and Beam ideal PD loop transfer function picturedin Figure 4.2. Also illustrated is how the
poles move to the desired locations when the compensator gain is as computed in
Ans.3.20.
5. Select square in the Signal Type field of the SRV02 Signal Generator in order to generate a step
reference
6. Set the Amplitude (cm) slider gain block to 5 to generate a step with an amplitude of 5.0 centimeters
7. Open the load shaft position scope, theta l (deg), and the ball position scope, x (m).
8. Start the simulation. By default, the simulation runs for 25.0 seconds. The scopes should be
displaying responses similar to Figure 4.3 and Figure 4.4. In the x (m) scope, the yellow trace is the
desired ball position and the purple trace is the simulated response.