2 DOF Helicopter Courseware Sample For MATLAB Users
2 DOF Helicopter Courseware Sample For MATLAB Users
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 2 DOF Helicopter courseware materials are supplied in a format of the Laboratory Guide. The Lab
Guide contains lab assignments 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 following material provides an abbreviated example of in-lab procedures for the 2 DOF Helicopter
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 courseware materials you will receive with the plant.
TABLE OF CONTENTS
2.
The full Table of Contents of the 2 DOF Helicopter Laboratory Guide is shown here:
1. PRESENTATION
1.1. DESCRIPTION
1.2. PREREQUISITES
2. EXPERIMENT FILES OVERVIEW
3. MODELING
3.1. DYNAMICS
3.2. STATE-SPACE MODEL
4. CONTROL DESIGN
4.1. STATE-FEEDBACK
4.2. LINEAR QUADRATIC REGULATOR
4.3. ANTI-WINDUP
5. IN-LAB PROCEDURES
5.1. 2 DOF HELICOPTER LABVIEW FILES
5.2. CONTROLLER SIMULATION
5.2.1.
OBJECTIVES
5.2.2.
PROCEDURE
5.3. OPEN-LOOP IMPLEMENTATION
5.3.1.
OBJECTIVES
5.3.2.
PROCEDURE
5.4. CLOSED-LOOP POSITION CONTROL IMPLEMENTATION
5.4.1.
OBJECTIVES
5.4.2.
PROCEDURE: 2 DOF HELICOPTER
5.5. MODEL VALIDATION IMPLEMENTATION
5.5.1.
OBJECTIVES
5.5.2.
PROCEDURE
6. TECHNICAL SUPPORT
REFERENCES
When the integrator output voltage, v, is larger than the imposed integral saturation then the saturation
error becomes negative, es < 0. The saturation error gets divided by the reset time, Tr, and its result is added
to the integrator input. This effectively decreases the integrator input and winds-down the integrator. In the
simulation and experimental results the saturation limit of the integrator is set to 5 V and the reset time to 1
sec for maximum wind-down speed.
3.
4.
3. The subsystem labeled Desired Angle from Program is used to generate a desired pitch and yaw angle
while the Desired Voltage block feeds open-loop voltages. The Controller Switch block implements the
following switching logic:
(a) switch = 1: FF+LQR closed-loop control.
(b) switch = 2: FF+LQR+I closed-loop control.
(c) switch = 3: Apply open-loop voltage to pitch motor.
(d) switch = 4: Apply open-loop voltage to yaw motor.
When the switch is 1 or 2 the system runs in closed-loop and when it is 3 or 4 the user can command
voltages directly to the actuators. When the switch is made from the closed-loop mode to open-loop
mode the controller voltage values are latched and the Desired Voltage block shown in Figure 5.2 is
enabled. This is particularly useful when performing model validation and parameter tuning..
4. The interior of the 2DOF Helicopter - Closed-loop System Simulation subsystem is shown in Figure 5.3.
The LQR and LQR+I control blocks along with the nonlinear model are are described in Section 5.1 The
Controller Switch subsystem implements the logic to switch between the FF+LQR and FF+LQR+I
controllers and between the pitch and yaw open-loop modes.
5. Open the Matlab script called setup lab_heli_2d.m. This script sets the model parameters, control gains,
amplifier limits, and so on that are used in the 2 DOF Helicopter Simulink models supplied, such as
s_heli_2d_lqr_i.mdl. By default, VMAX_AMP_P, VMAX_AMP_Y, K_AMP, K_EC_P, and K_EC_Y is set to
match the configuration in the actual implementation section.
6. The saturation limit of the integrators that are used in the FF+LQR+I controller are set using the
variables SAT_INT_ERR_PITCH and SAT_INT_ERR_YAW. The reset time of the anti-windup loop can be
changed using Tr_p and Tr_y. For more information on the anti-windup algorithm see section 4.
7. Ensure the CONTROLLER TYPE is set to 'LQR AUTO' to generate the controller automatically. Set the
feedforward gain Kff = 1 V/V and the LQR and LQR+I Q and R weighting matrices as already given in the
script.
8. Run the Matlab script setup_lab_heli_2d.m to load the state-space model matrices, control gains, and
various other parameters into the Matlab workspace. The LQR and LQR+I controls gains should be
displayed in the Matlab Command Window.
9. Open the subsystem labeled Desired Angle from Program, shown in Figure 5.4, below
10. Ensure the pitch scope, theta (deg), the yaw scope, psi (deg), and the motor input voltage scope,
Vm_sim (V),are open. If not, go into the Scopes subsystem and double-click on those sinks.
11. To generate a desired pitch step of 20.0 degrees at 0.05 Hz frequency, set the Amplitude: Pitch (deg)
gain block to 10.0 degrees and Frequency input box in the Signal Generator: Elevation block to 0.05
Hz.
12. Click on the Start simulation button, or on the Start item in the Simulation menu, to run the closedloop system using LQR+I and the scopes should read as shown in Figure 5.5, Figure 5.6, and Figure
5.7. In each scope, the simulated pitch and yaw angles (purple trace) should track the corresponding
desired position signals (yellow trace). Also, examine the voltage in the Vm_sim (V) scope and
ensure the front (yellow plot) and back motor (purple plot) are not saturated. Recall that the
maximum peak voltage that can be delivered to the front motor by the VoltPAQ amplifier is 24 V.
3 DOF Helicopter
Qball-X4
3 DOF Hover
Qbot
Quanser Aerospace plants are ideal for intermediate or advanced level teaching. They are
also suitable for research relating to traditional or modern control applications of aerospace
engineering. For more information please contact [email protected].
2013 Quanser Inc. All rights reserved.
+1-905-940-3575
QUANSER.COM