Maglev Courseware Sample For MATLAB Users
Maglev Courseware Sample For MATLAB Users
Course material
complies with:
PREFACE
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 courseware 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 is prepared for users of The MathWorkss MATLAB/Simulink software in
conjunction with Quansers QUARC real-time control software. A version of the course
material for National Instruments LabVIEW users is also available.
The courseware for Magnetic Levitation 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. Karl strom from Lund University, Sweden for his immense contribution
to the courseware content and 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 Magnetic Levitation 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 Magnetic Levitation Instructor Workbook is shown here:
1. INTRODUCTION
2. MODELING
2.1. BACKGROUND
2.1.1.ELECTRICAL EQUATIONS
2.1.2.NONLINEAR MODEL
2.1.3.LINEAR MODEL
2.2. PRE-LAB QUESTIONS
3. COIL CURRENT CONTROL
3.1. BACKGROUND
3.1.1.SECOND-ORDER RESPONSE
3.1.2.SPECIFICATIONS
3.1.3.COIL CURRENT CONTROL DESIGN
3.1.4.SET-POINT WEIGHTING
3.1.5.INTEGRAL WINDUP
3.2. PRE-LAB QUESTIONS
3.3. LAB EXPERIMENTS
3.3.1.CURRENT CONTROL SIMULATION
3.3.2.CURRENT CONTROL IMPLEMENTATION
3.4. RESULTS
4. BALL POSITION CONTROL
4.1. BACKGROUND
4.1.1.SPECIFICATIONS
4.1.2.BALL POSITION CONTROL DESIGN
4.2. PRE-LAB QUESTIONS
4.3. LAB EXPERIMENTS
4.3.1.BALL POSITION CONTROL SIMULATION
4.3.2.BALL POSITION CONTROL IMPLEMENTATION
4.4. RESULTS
5. SYSTEM REQUIREMENTS
5.1. OVERVIEW OF FILES
5.2. SETUP FOR COIL CURRENT CONTROL SIMULATION
5.3. SETUP FOR IMPLEMENTING COIL CURRENT CONTROL
5.4. SETUP FOR BALL POSITION CONTROL SIMULATION
5.5. SETUP FOR IMPLEMENTING BALL POSITION CONTROL
6. LAB REPORT
6.1. TEMPLATE FOR COIL CURRENT CONTROL REPORT
6.2. TEMPLATE FOR BALL POSITION CONTROL REPORT
6.3. TIPS FOR REPORT FORMAT
7. SCORING SHEETS
7.1. MODELING PRE-LAB QUESTIONS
7.2. CURRENT CONTROL PRE-LAB QUESTIONS
7.3. CURRENT CONTROL LAB REPORT
7.4. BALL POSITION CONTROL PRE-LAB QUESTIONS
7.5. BALL POSITION CONTROL LAB REPORT
APPENDIX A INSTRUCTORS GUIDE
A.1
PRE-LAB QUESTIONS AND LAB EXPERIMENTS
A.1.1. HOW TO USE THE PRE-LAB QUESTIONS
A.1.2. HOW TO USE THE LABORATORY EXPERIMENTS
A.2
ASSESSMENT FOR ABET ACCREDITATION
A.2.1. ASSESSMENT IN YOUR COURSE
A.2.2. HOW TO SCORE THE PRE-LAB QUESTIONS
A.2.3. HOW TO SCORE THE LAB REPORT
A.2.4 ASSESSMENT OF THE OUTCOMES FOR THE COURSE
A.2.5 COURSE SCORE FOR OUTCOME A
A.2.6 COURSE SCORES FOR OUTCOMES B, K AND G
A.2.7 ASSESSMENT WORKBOOK
A.3
RUBRICS
REFERENCES
Electrical Equations
As represented in Figure 2.1, the MAGLEV coil has an inductance Lc and a resistance Rc. Additionally, the
actual system is equipped with a current sense resistor, Rs, that is in series with the coil. The voltage sense,
Vs, is used to measure the current in the coil. The coil current can then be computed using the following
relationship
Using Kirchhoff's voltage law, we obtain the following first-order differential equation
(2.1)
where Rc is the coil resistance, Lc is the coil inductance, Ic is the coil current, vc is the applied coil voltage, and
Rs is the current sense resistance. This can be represented by the first-order transfer function
(2.2)
Solution
The normalized characteristic equation of the closed-loop transfer function in Equation
3.8 is
(Ans. 3.1)
Equating this with the standard second order system, Equation 3.1, gives the
expressions
And
A-2
Solve for kp,c and ki,c to obtain the control gain equations:
(Ans. 3.2)
And
(Ans. 3.3)
2. A-2 Based on the MAGLEV model parameters, Kc and c found in Section 2.2, calculate the control
gains needed to satisfy the time-domain response requirements given in Section 3.1.2.
Answer 3.2
Outcome
A-2
Solution
Substituting the model parameters found in Ans.2.3 and Ans.2.4 and the natural
frequency and damping ratio in Section 3.1.2, into Ans.3.2 and Ans.3.3 generates the
proportional and integral control gains:
(Ans. 3.4)
And
(Ans. 3.5)
Figure 4.1: Simulink model used to simulate ball position control response.
IMPORTANT: Before you can conduct these experiments, you need to make sure that the lab files are
configured. If they have not been configured already, then go to Section 5 to configure the lab files first.
1. Enter the current control PI gains in Matlab used in Section 5.2 as Kp_c and Ki_c.
2. Enter the feed-forward, proportional, integral and velocity control gains found in Section 4.2 in Matlab
as Kff_b ,Kp_b, Ki_b and Kv_b.
3. Set the Scale Factor Slider Gain to 1.
4. To generate a step reference, go to the Position Setpoint Signal Generator block and set it to the
following:
Signal type = square
Amplitude = 1
Frequency = 0.25 Hz
5. Set the Amplitude (m) gain block to 1e - 3 and the Operating Air Gap Position constant block to -xb0+1e3 to generate a step that goes between 8 and 10 mm (i.e., 1 mm square wave at 0.25 Hz with 9 mm
constant).
6. Open the Ball Position (mm), Coil Current (A), and Coil Voltage (V) scopes.
7. Start the simulation. By default, the simulation runs for 10 seconds. The scopes should be displaying
responses similar to Figure 4.3. Note that in the Ball Position (m) and Coil Current (A) scopes, the yellow
trace is the setpoint (or command) while the purple trace is the simulation.
8. B-5, K-2 Generate a Matlab figure showing the Simulated Ball Position response, the current, and the
input voltage.
Data Saving: Similarly as with s maglev pi, after each simulation run each scope automatically saves their
response to a variable in the Matlabrworkspace. The Ball Position (mm) scopes saves its response to the
data_xb variable. The Coil Current (deg) scope saves its response to the variable called data Ic and the
Coil Voltage (V) scope saves its data to the data_Vc variable.
Answer 4.4
Outcome
B-5
K-2
Solution
The simulation was ran correctly if a response similar to Figure Ans. 4.1 was obtained.
The closed-loop position response is shown in Figure Ans.4.1. You can generate this
using the plot_maglev_ball_rsp.m script.
9. K-1, B-9 Measure the steady-state error, the percent overshoot and the peak time of the simulated
response. Does the response satisfy the specifications given in Section 4.1.1? Keep in mind, due to the
Rate Limiter the setpoint is delayed 0.4 seconds. Take that into account. Hint: Use the Matlab ginput
command to take measurements off the figure.
Answer 4.5
Outcome
K-1
Solution
From the response shown in Ans.4.1, it is clear that the steady-state error is zero, thus
ess = 0
Taking measurements from the step that begins at 6.0 seconds, the response
overshoots up to 10.22 mm at 6.47 seconds and then settles down to 10.2 mm (i.e., 2%
of its final value) at 6.49 seconds. Using the equations given in Section 3.1.1, the settling
time is
ts = 6.49 6 = 0.49 s
Using Equation 3.3 with the measurement, we find that the percent overshoot of the
simulated ball position response is
B-9
The simulation settles to 10.2 mm in 0.49 sec given that the step takes 0.4 seconds to
rise form the 6 second mark. Thus the settling time is acceptable. However, the
overshoot goes above the desired percent overshoot listed in Section 4.1.1. Therefore
the response with the PIV+FF controller does not quite match the specifications.
Coupled Tanks
These plants are ideal for intermediate level teaching. The are also suitable for research
relating to traditional or modern control applications of process control. For more
information please contact info@quanser.com
2013 Quanser Inc. All rights reserved.
INFO@QUANSER.COM
+1-905-940-3575
QUANSER.COM