Home
2 DOF Helicopter Lab Manual
Contents
1. Figure 4 4 Anti windup loop The integrator input shown in the windup loop is U U ei ky 5 04 0 Ens Va P T Q o QUANSER DRAFT Wednesday 6 July 2011 QUANSER Aerospace LABORATORY MANUAL 10 QUANSER When the integrator output voltage v is larger than the imposed integral saturation then the saturation error becomes negative e lt 0 The saturation error gets divided by the reset time T 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 QUANSER Aerospace LABORATORY MANUAL DRAFT Wednesday 6 July 2011 5 In Lab Procedure 5 1 2 DOF Helicopter Simulink Models The Simulink models supplied with the 2 DOF Helicopter contain various subsystems that im plement the model and controllers presented previously The 2DOF HELI FF LQR Controller subsystem implements the feed forward control and the LQR PID position controller discussed in section 4 The 2DOF HELI FF LQR Controller is a feed forward and proportional derivative control Thus it is the same as the FF LQR I algorithm developed except there is no integral ac tion The nonlinear feed forward control is constructed in the Pitch feed forward controller block The 2DOF HELI Nonlinear Model con
2. LQR I response under a step pitch reference The result should be similar to the response shown in Figure 5 22 Note that the steady state error is removed Pitch Angle Yaw Angle Input Voltage 24 Figure 5 22 Closed loop LQR I response under pitch reference step QUANSER QUANSER Aerospace LABORATORY MANUAL DRAFT Wednesday 6 July 2011 20 Set the Amplitude Pitch deg to 0 and Amplitude Yaw deg to 30 0 observe the LQR I response under a desired yaw step The obtained response should be similar to Figure 5 23 There is no steady state error but the controller saturates the yaw amplifier due to the large step reference o T 1 Pitch Angle Vv D gt gt ds o T fi Yaw Angle Input Voltage o T La i Figure 5 23 Closed loop LQR I response under yaw reference step 21 Alternatively the desired angle can be generated using the joystick To use the joystick set the Program Joystick switch shown in Figure 5 19 to 2 The rate at which the desired angle increases or decreases given a joystick position can be changed using the K_JOYSTICK_X and K_JOYSTICK_Y variables that are set in the setup_lab_heli_2d m script file and the using the Rate Command knob When starting set the Rate Command knob on the joystick to the midpoint position E Caution Do not switch from the Program to the Joystick from 1 to 2 when the controller is running Set
3. dashed blue line and the reference is the solid green line Notice in both the measured and simulated responses the pitch angle has a steady state error Pitch Angle 2 10 i T 0 g gt 10F 4 20 L L 1 L L 1 0 5 10 15 20 25 30 20 T T T T T 8 0 ip S oF El rama normama n rem nanman ay a a a ttt at A aa ana ra te a tina ta a nen r Nac 10 4 20 i fi i i 1 0 5 10 15 20 25 30 Figure 5 20 Closed loop LQR response under pitch reference step 15 Inside the Desired Angle from Program set the Amplitude Pitch deg to 0 and the Ampli tude Yaw deg to 50 The helicopter should tracking the commanded yaw angle 23 16 Figure 5 21 depicts the typical measured and simulated pitch and yaw response given a desired step yaw angle There is a steady state error in the yaw angle e El HA NS EFA DRAFT Wednesday 6 July 2011 QUANSER Aerospace LABORATORY MANUAL OX Pitch Angle Yaw Angle Input Voltage Figure 5 21 Closed loop LQR response under yaw reference step 17 Set Amplitude Yaw deg to 0 Both the pitch and yaw setpoints should now be zero 18 The steady state error can be removed using integral action Switch to the FF LQR I con trol by setting the control switch source block to 2 The pitch and yaw angle should both eventually converge to 0 degree 19 Set the Amplitude Pitch deg to 10 and the Pitch Constant deg to 0 to observe the
4. In the theta deg scope the desired pitch position is the yellow line the measured pitch position is the purple plot and the simulated pitch position is light blue trace Similarly for the yaw psi deg scope The Vm_actual V scope plots the voltage being applied to the pitch motor in yellow and yaw motor in purple 5 To identify the viscous rotary friction parameter in the yaw axis a voltage step command must be applied to the yaw motor In the Desired Voltage subsystem set the Signal Generator Yaw V block to 2 5 6 Change the control switch to 4 The yaw input motor voltage is now the control voltage used to stabilize the yaw angle w added to the commanded open loop voltage i e Vm p 2 5 The plot should resemble Figure 5 24 Vary QUANSER Aerospace LABORATORY MANUAL DRAFT Wednesday 6 July 2011 100 T T T T T 50f 4 ee 100 fi fi fi i i 0 Yaw Rate deg s o T L 205 4 Input Voltage o T L Figure 5 24 Identifying the viscous damping about the yavv axis 7 For calculating the viscous damping parameter B consider the linear equation describing the yaw motion in the 2 DOF Helicopter Maple worksheet or its HTML equivalent Given that the helicopter is rotating more or less at a constant speed it can be assumed that the acceleration is zero thus 7 t 0 Setting the acceleration to zero as well as the pitch angle to zero and then solving for the viscou
5. the program joystick switch to 2 before starting QUARC if the joystick is to be used 22 Gradually bring the helicopter back to starting position 23 Click on the Stop button on the Simulink diagram tool bar or select QUARC Stop from the menu to stop running the code 24 Power off the amplifier Q OR QUANSER DRAFT Wednesday 6 July 2011 QUANSER Aerospace LABORATORY MANUAL 26 QUAN O SERA 5 5 Model Validation Implementation 5 5 1 Objectives The objectives of running the model validation controller on the 2 DOF Helicopter are to e Verify that the nonlinear model which is summarized in Section 5 1 represents the actual device with reasonable accuracy e Roughly identify the rotary viscous friction parameter about pitch and yaw axis 5 5 2 Procedure Follow this procedure to identify the viscous rotary friction on the yaw axis and do model validation of the pitch 1 Follow the steps 1 to 11 given in 5 4 to run the q heli 2d ff Iqr i QUARC controller The helicopter should be at the starting point i e pitch of 30 degrees and yaw of 0 degrees 2 Run the LQR I controller by setting the control switch source block to 2 3 Inside the Desired Angle from Program set the Amplitude Pitch deg to 0 and the Pitch Constant deg to 0 The helicopter should be stabilized about a pitch and yaw angle of zero 4 In the Scopes subsystem double click on the theta deg psi deg and Vm_Actual V sinks
6. Diagram item Alternatively controller parameters can be updated by use the keystroke CTRL D whenever the Simulink model is active Pitch Angle Yaw Angle N o ak o a N N a w Input Voltage a T Figure 5 25 Open loop pitch step 12 Gradually bring the helicopter back to starting position 13 Click on the Stop button on the Simulink diagram tool bar or select QUARC Stop from the menu to stop running the code 14 Make sure the amplifier is turned off if the session is complete QUANSER Aerospace LABORATORY MANUAL DRAFT Wednesday 6 July 2011 6 Technical Support To obtain support from Quanser go to http www quanser com and click on the Tech Support link Fill in the form with all the requested software and hardware information as well as a descrip tion of the problem encountered Also make sure your e mail address and telephone number are included Submit the form and a technical support representative will contact you OS QUA NS ER DRAFT Wednesday 6 July 2011 QUANSER Aerospace LABORATORY MANUAL 30 Q QUANSER References 1 Quanser Inc QUARC User Manual 3 Quanser Inc VoltPAQ User Guide 2010 2 Quanser Inc Q2 USB Data Acquisition System User s Guide 2010 4 Quanser Inc 2D Helicopter User Manual 2011 QUANSER Aerospace LABORATORY MANUAL DRAFT Wednesday 6 July 2011
7. F Helicopter Open loop Analysis Program 1 Joystick 2 09 No Desired Multiport Switch No Simulation 2DOF HELI Open loop Voltage from Program Open loop voltage from Joystick Scopes Figure 5 15 Simulink diagram to run 2 DOF Helicopter in open loop with QUARC 3 Configure setup script Open the design file setup_lab_heli_2d m and ensure everything is configured properly The R JOYSTICR V X and K_JOYSTICK_V_Y parameters control the rate that a voltage command is generated The JOYSTICK_X_DZ and JOYSTICK_Y_DZ specify the deadzone of the joystick The deadzone is used to remove negligible joystick outputs due to noise or from small motions in the joystick handle 4 Execute the setup_lab_heli_2d m Matlab script to setup the workspace before compiling the diagram and running it in real time with QUARC 18 5 Open the 2DOF HELI subsystem Its contents are shown in Figure 5 16 This subsystem contains the QUARC blocks that interface with the hardware of the actual plant The Analog Output block sends the voltage computed by the controller to the DAQ device which drives the actuators and the Encoder Input block reads the encoder measurements O QUANSER QUANSER Aerospace LABORATORY MANUAL DRAFT Wednesday 6 July 2011 6 Configure DAQ Double click on the HIL Initialize block in the Simulink diagram and ensure itis configured for the DAQ device that is installed in your system By default the
8. QUANSER Laboratory Manual 2011 Quanser Inc All rights reserved Quanser Inc 119 Spy Court Markham Ontario L3R 5H6 Canada info quanser com Phone 1 905 940 3575 Fax 1 905 940 3576 Printed in Markham Ontario For more information on the solutions Quanser Inc offers please visit the web site at http Awww quanser com This document and the software described in it are provided subject to a license agreement Neither the software nor this document may be used or copied except as specified under the terms of that license agreement All rights are reserved and no part may be reproduced stored in a retrieval system or transmitted in any form or by any means electronic mechanical photocopying recording or otherwise without the prior written permission of Quanser Inc GUANSER QUANSER Aerospace LABORATORY MANUAL DRAFT Wednesday 6 July 2011 Contents 1 Presentation 2 1 1 Description 2 1 2 Prerequisites 2 2 Experiment Files Overview 4 3 Modeling 5 3 1 Dynamics 5 3 2 State Space Model 6 4 Control Design 8 4 1 State Feedback 8 4 2 Linear Quadratic Regular 8 4 3 Anti Windup 9 5 In Lab Procedure 11 5 1 2 DOF Helicopter Simulink Models 11 5 2 Controller Simulation 11 5 3 Open loop Implementation 18 5 4 Closed loop Position Control Implementation 21 5 5 Model Validation Implementation 26 6 Technical Support 29 OS QUA NS ER DRAFT Wednesday 6 July 2011 QUANSER Aerospace LABORATORY MANUAL Q
9. R Aerospace LABORATORY MANUAL DRAFT Wednesday 61 July 2011 3 Modeling 3 1 Dynamics The free body diagram of the 2 DOF Helicopter is illustrated in Figure 3 2 and it accompanies the Maple worksheet named 2 DOF Helicopter Equations mws or its HTML equivalent 2 DOF Heli copter Equations html The equations can be edited and re calculated by executing the worksheet using Maple 9 Fy a Yaw axis A o afra Pitch axis Figure 3 2 Simple free body diagram of 2 DOF Helicopter The 2 DOF Helicopter modeling conventions used are 1 The helicopter is horizontal when the pitch angle equals 6 0 2 The pitch angle increases positively 8 t gt 0 when the nose is moved upwards and the body rotates in the counter clockwise CCW direction 3 The yaw angle increases positively t gt 0 when the body rotates in the clockwise CW direction 4 Pitch increases 0 0 when the pitch thrust force is positive F gt 0 5 Yaw increases 7 gt 0 when the yaw thrust force is positive F gt 0 The Maple worksheet goes through the kinematics and dynamics of the system The Cartesian coordinates of the center of mass are expressed relative to the base coordinate system as shown in Figure 3 3 These resulting equations are used to find the potential energy and translational kinetic energy W QUANSER DRAFT Wednesday 6 July 2011 QUANSER Aerospace LABORATORY MANUAL Zo Z4 MN D w lt 0
10. UANSER 1 Presentation 1 1 Description The Quanser 2 DOF Helicopter experiment shown in Figure 1 1 consists of a helicopter model mounted on a fixed base with two propellers that are driven by DC motors The front propeller controls the elevation of the helicopter nose about the pitch axis and the back propeller controls the side to side motions of the helicopter about the yaw axis The pitch and yaw angles are measured using high resolution encoders The pitch encoder and motor signals are transmitted via a slipring This eliminates the possibility of wires tangling on the yaw axis and allows the yaw angle to rotate freely about 360 degrees Figure 1 1 Quanser 2 DOF Helicopter The modeling and position control design of the helicopter are summarized in section 3 In section 5 several procedures are outlined that show how to simulate the position controller and how to run this controller on the actual helicopter plant Further this section explains how to use the joystick to manually control the helicopter 1 2 Prerequisites In order to successfully carry out this laboratory the user should be familiar with the following e 2 DOF Helicopter main components e g actuator sensors the data acquisition card e g Q2 USB and the power amplifier e g VoltPaq as described in 4 2 and 8 respec tively QUANSER Aerospace LABORATORY MANUAL DRAFT Wednesday 6 July 2011 e Wiring the 2 DOF Helicopter plant with the am
11. block shown in Figure 5 16 is setup for the Quanser Q8 hardware in the loop board El q heli 2d open loop 2DOF HELI Eile Edit View Simulation Format Tools QUARC Help D Eg R gt P 22 S gt Fin Extemal vl His DB BEE amp Front Motor Quarc u pitoh 0 MI a Pitch AMP Voltage Limi Pitch amp Gain HIL Initialize Pre Compensation HIL 1 q8 0 HIL Back Motor Write 1 1 d Amplifier Enable HIL Write HIL 1 Voltage Limit Yawanip Gain Pre Compensation HL og Read Encoder Timebase uttheta_O 4 Encoder Resolution Bias x theta psi theta dot psi dot HIL Read Encoder Timebase HIL 1 Encoder Resolution Yaw wof 2 s 32 2 zetaf wotstwot2 Derivative Filter Pitch meP2 s s242 zetafwotstwot2 Derivative Filter Yaw Figure 5 16 2DOF HELI subsystem contains QUARC blocks that interface with hardware 7 The voltage sent to the Analog Output block is amplified by the amplifiers and applied to the power amplifiers attached motor Note that the control input is divided by the amplifier gain K_AMP before being sent to the DAQ board This way the amplifier gain does not have to be included in the mathematical model as the voltage output from the controller is the voltage being applied to the motor The amplifier and DAQ saturation blocks limit the amount of voltage that can be fed to the motor 8 Open the theta deg psi d
12. desired angle from Simulink 10 Click on QUARC Build to compile the code from the Simulink diagram 11 Select QUARC Start to begin running the controller The pitch propeller should start turning lightly IMPORTANT Be ready to click on the STOP button in the Simulink tool bar at any time to stop running the controller If using the VoltPAQ X2 you can also press down on the E Stop switch to disable the amplifier 12 By default the helicopter pitch angle command is initially set to 30 0 degrees In the Desired Angle from Program subsystem set the Amplitude Pitch deg to 10 and the Pitch Constant deg to 0 Gradually increase the pitch constant i e increment by steps of 10 degrees The helicopter should be tracking this reference position about its horizontal 13 Open the theta deg psi deg and Vm_actual V scopes in the Scopes folder In the theta deg scope the desired pitch position is the yellow line the measured pitch position is the purple plot and the simulated pitch position is light blue trace Similarly in the yaw scope psi deg yellow is the desired yaw purple is the measured yaw and light blue is the simulated yaw The Vm_actual V scope plots the voltage being applied to the pitch motor in yellow and yaw motor in purple 14 Figure 5 20 depicts the typical measured and simulated pitch and yaw response under a desired step pitch angle The measured response is the solid red line the simulation is the
13. eg SE SAS Asi EG F EES Figure 5 13 Simulated yaw response under a desired yaw step using LQR I 16 O QUANSER QUANSER Aerospace LABORATORY MANUAL DRAFT Wednesday 6 July 2011 Vm sim V Figure 5 14 Simulated front and back motor voltage under yaw reference step using LQR I 15 Try changing the desired elevation and travel angles to familiarize yourself with the con troller Observe that rate limiters are placed in the desired position signals to eliminate any high frequency changes This makes the control signal smoother which places less strain on the actuator Q Ro QUANSER DRAFT Wednesday 6 July 2011 QUANSER Aerospace LABORATORY MANUAL 5 3 Open loop Implementation 5 3 1 Objectives The objectives of running the 2 DOF Helicopter in open loop are to e Gain an intuition on the dynamics of the system in particular the coupling effect that exists between the pitch and yaw actuators e Obtain an idea on how difficult it is to control the apparatus in order to compare human operator performance with computer control 5 3 2 Procedure 1 Load the MaTLaB software 2 Open Simulink model q heli 2d open loop mdi shown in Figure 16 The model runs your actual 2 DOF Helicopter plant by directly interfacing with your hardware through the QUARC blocks described in 1 Ej q_heli_2d_open_loop File Edit View Simulation Format Tools QuaRC Help DicHus a F inf Extemal v Ets EQ Quanser 2 DO
14. eg and Vm V scopes in the Scopes folder These scopes display both the desired and measured angles of the Helicopter as well as the voltages being applied to the front and back motors 9 Ensure the helicopter has been setup and all the connections have been made as instructed in the 2 DOF Helicopter User Manual 10 Turn ON the amplifier For the VoltPAQ X2 the green LED on the amplifier should be lit 11 Inthe q_heli_2d_open_loop Simulink diagram make sure the Program Joystick block shown in Figure 5 15 is set to 2 in order to generate the desired voltage from the joystick 12 Click on QUARC Build to compile the code from the Simulink diagram QUA NS ER DRAFT Wednesday 6 July 2011 QUANSER Aerospace LABORATORY MANUAL 13 Select QUARC Start to begin running the controller IMPORTANT Be ready to click on the STOP button in the Simulink tool bar at any time to stop running the controller If using the VoltPAQ X2 you can also press down on the E Stop switch to disable the amplifier 14 Try to bring the helicopter body to a horizontal by pulling the joystick handle toward you This supplies a positive voltage to the pitch motor and causes the pitch angle to increase 15 As depicted in Figure 5 17 you will notice that the yaw angle moves clockwise in the positive direction as the voltage in the pitch motor increases Compensate for this coupling effect by moving the joystick arm to the left and apply a negative voltage t
15. eli_2d m Matlab script to setup the workspace before compiling the diagram and running it in real time with QUARC This file loads the model parameters of the 2 DOF Helicopter system calculates the LQR and LQR I feedback gains and sets various other parameters that are used such as the filter cutoff frequencies amplifier gain encoder sensitivities and the amplifier and DAQ board limits 5 Open the 2 DOF HELI subsystem shown in Figure 5 19 It contains the QUARC blocks that interface with the hardware of the actual plant The Analog Output block outputs the voltage computed by the controller to the DAQ board and the Encoder Input block reads the encoder measurements 6 Configure DAQ Double click on the HIL Initialize block located in the 2 DOF Helicopter Closed loop Actual System 2 DOF HELI subsystem contents are as shown in Figure 5 16 above and ensure it is configured for the DAQ device that is installed in your system By default the block is setup for the Quanser Q8 hardware in the loop board 7 Ensure the helicopter has been setup and all the connections have been made as instructed 22 in the 2 DOF Helicopter user manual 8 Turn ON the amplifier For the VoltPAQ X2 the green LED on the amplifier should be lit GUANSER QUANSER Aerospace LABORATORY MANUAL DRAFT Wednesday 6 July 2011 9 In the q heli 2d ff Iqr i Simulink diagram make sure the Program Joystick block shown in Figure 5 19 is set to 1 in order to generate the
16. eric procedures used in Lagrangian mechanics and resulting in the determination of a given system s equations of motion and state space representa tion It also contains data processing routines to save the ob tained state space matrices into a Matlab readable file setup_lab_heli_2d m The main Matlab script that sets the model control and configu ration parameters Run this file only to setup the laboratory setup_heli2d_configuration m Returns the 2 DOF Helicopter model parameters and encoder calibration constants HELI2D ABCD egqns m Matlab script file generated using the Maple worksheet 2 DOF Heli Equations mws It sets the A B C and D matrices for the state space representation of the 2 DOF Helicopter open loop system d heli2d Iqr m Matlab script that generates the position velocity controller gain R using LQR d heli2d Iqr i m Matlab function that the position integral velocity controller gain K using LQR s_heli_2d_ff_Iqr_i mdl Simulink file that simulates the open loop or closed loop 2 DOF Helicopter using a nonlinear model of the system q_heli_2d_ff_Iqr_i mdl Simulink file that implements the real time position controller for the 2 DOF Helicopter system q_heli_2d_open_loop mdl Simulink file that runs the 2 DOF Helicopter in open loop i e al lows user to command voltage directly to motors Table 1 Files supplied with the 2 DOF Helicopter experiment QUANSE
17. gure 5 6 is enabled This is particularly useful when performing model validation and parameter tuning QUANSER QUANSER Aerospace LABORATORY MANUAL DRAFT Wednesday 6 July 2011 4 The interior of the 2DOF Helicopter Closed loop System Simulation subsystem is shown in Figure 5 7 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 Els heli 2d ff Igr i 2 DOF Helicopter Closed loop System Simulation File Edit Yiew Simulation Format Tools QuaRC Help BS RRES 2DOF HELI FF LOR Controller Controller Switch Figure 5 7 Closed loop simulation of 2 DOF Helicopter 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_Iqr_i mdl By default VMAX_AMP_P VMAX AMP Y R AMP R EC P and K_EC_Y is set to match the configuration in the actual implementa tion 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
18. ion 5 4 1 Objectives The objectives of running the 2 DOF Helicopter in closed loop are to e Investigate the closed loop performance between the FF LQR and the FF LQR I con trollers running on the actual 2 DOF Helicopter plant e Compare the measured closed loop response with the simulated response 5 4 2 Procedure 2 DOF Helicopter Follow this procedure to run the FF LQR and the FF LQR I controllers on the actual helicopter plant 1 Load MatLaB 2 Open Simulink model q heli 2d ff Igr imdi shown in Figure 5 19 that implements the closed loop LQR and LQR I position controllers DRAFT Wednesday 6 July 2011 QUANSER Aerospace LABORATORY MANUAL QUANSER q_heli_2d_ff_Iqr_i File Edit view Simulation Format Tools QuaRC Help D S H8 Pe 1 2 gt Fin Extemal EH BR amp Quanser 2 DOF Helicopter Closed loop Actual and Simulated System Program 1 Joystick 2 Desired Angle from Program Multiport Desired Position Sulton from Joystick Desired Voltage 2 LOR 1 2 DOF Helicopter LORtI 3 2 Closed loop Actual System Pitch open loop 3 Yaw open loop 4 Scopes 2 DOF Helicopter Closed loop System Simulation 100 Figure 5 19 Simulink model used with QUARC to run the closed loop controller on the 2 DOF Helicopter 3 Configure setup script Open the design file setup_lab_heli_2d m and ensure everything is configured properly 4 Execute the setup_lab_h
19. levation block to 0 05 Hz Click on the Start simulation button or on the Start item in the Simulation menu to run the closed loop system using LQR I and the scopes should read as shown in Figure 5 9 Figure 5 10 and Figure 5 11 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 QUANSER Aerospace LABORATORY MANUAL DRAFT Wednesday 6 July 2011 the leg 6B PL ABE Bak a lt gt psi de SE Sf sie ED 8 F Figure 5 10 Simulated yaw response under pitch reference step using LQR I Vm sim V SE PDP MBB BS R DRAFT Wednesday 6 July 2011 QUANSER Aerospace LABORATORY MANUAL 13 To generate a desired yaw step of 100 degrees at 0 05 Hz frequency set the Amplitude Yaw deg block to 50 0 degrees and the Frequency input box in the Signal Generator Yaw block to 0 05 Hz 14 Run the simulation and the responses shown in Figure 5 12 Figure 5 13 and Figure 5 14 should be obtained The yaw voltage saturates the back amplifier at 15 V theta deg 6B Sf ABE Bak Figure 5 12 Simulated pitch response under a desired yaw reference step using LQR I psi d
20. lo Z2 N I 0 lt 0 gt Yo 23 lem y3 Mheli X3 Figure 3 3 Rinematics of the 2 DOF Helicopter 3 2 State Space Model The thrust forces acting on the pitch and yaw axes from the front and back motors are then defined Using the Euler Lagrange formula the nonlinear equations of motion of the 2 DOF Helicopter system are derived These equations are linearized about zero and the linear state space model A B C D describing the voltage to angular joint position dynamics of the system is found Given the state space representation t Ax Bu and y Ca Du the state vector for the 2 DOF Helicopter is defined aT o t v t a t vit 3 1 and the output vector is QUANSER QUANSER Aerospace LABORATORY MANUAL DRAFT Wednesday 6 July 2011 where 0 and w are the pitch and yaw angles respectively The corresponding helicopter state space matrices as derived in the Maple worksheet are Ts 1 0 0 1 By 0 0 B 0 0 0 0 D l oo oO _ Zu Jry Bo o ho No o e JTp JTp yy JTy Ivy 5 koj R where 2 ITp Jeg p T Mhelilem 2 JTy Jegy ag Mhetilem 10 0 0 Cerne 0 0 oh o The model parameters used in the A B matrices are defined in the 2 DOF Helicopter User Man ual DRAFT Wednesday 6 July 2011 QUANSER Aerospace LABORATORY MANUAL QUAN Q OS SER QUAN W SERA 4 Control Design 4 1 State Feedback In this section a state feedback contr
21. ntegral gains hos and k2 are used in the back motor regulator 4 2 Linear Quadratic Regular The control gains are computed using the Linear Quadratic Regular scheme The system state is first augmented to include the integrals of the pitch and yaw states a 0 p 6 ob fodt fat Using the feedback law u K di QUANSER Aerospace LABORATORY MANUAL DRAFT Wednesday 6 July 2011 the weighting matrices 200 0 0 0 0 0 0 150 0 0 0 0 ge 0 0 100 0 0 0 0 0 0 200 0 O 0 0 0 0 50 0 0 0 0 0 0 50 and 1 0 R h and the state space matrices A B found previously the control gain K 18 9 1 98 7 48 1 53 7 03 0 770 2 22 19 4 0 45 11 9 0 770 7 03 is calculated by minimizing the cost function ral uit Qa u Rudt 0 K k a Aiea k 3 k a k s kig k21 k22 k23 koa k25 koe 4 3 Anti Windup The helicopter system runs the risk of integrator windup Thatis given a large error in the between the measured and desired pitch angle 0 04 or between the measured and desired yaw angle Ww wq the integrator outputs a large voltage that can saturate the amplifier By the time the measured angle reaches the desired angle the integrator built up so much energy that it remains saturated This can cause large overshoots and oscillations in the response To fix this an integral windup protection algorithm is used Figure 4 4 illustrates the anti windup scheme implemented to control the pitch Actuator Model sat
22. o the yaw motor As illustrated the pitch is eventually stabilized at about 0 degrees when the pitch motor voltage is approximately 12 5 V and the yaw begins to stabilize when feeding a voltage of about 6 0 V to the yaw motor I som pitch deg 200 a My seccecees yaw deg H 4 a Figure 5 17 Effect of pitch on yaw 16 From this point now try decreasing the yaw voltage and observe its effect on the pitch angle 17 As depicted in Figure 5 18 applying a negative voltage to the yaw motor causes the pitch angle to decrease i e the helicopter nose goes down Similarly to the effect the pitch motor has on the yaw motion the voltage applied to the yaw motor generates a torque on the pitch axis 20 W QUANSER QUANSER Aerospace LABORATORY MANUAL DRAFT Wednesday 6 July 2011 50 T T T T I pitch deg ns nsn yaw deg 0 5 10 15 20 25 30 pitch V 4 Q F ceeenionenrmeaenenammetrrmmmmmmmmentnmemmmmmmmmetemmmmmmennmnbnnm sa yaw MV 4 gece st peepee iiis ESEE EE EROE Figure 5 18 Effect of yaw on pitch 18 Gradually bring the helicopter back to starting position 19 Click on the Stop button on the Simulink diagram tool bar or select QUARC Stop from the menu to stop running the controller 20 Ifthe laboratory session is complete power off the amplifier 5 4 Closed loop Position Control Implementat
23. oller is designed to regulate the elevation and travel angles of the 2 DOF Helicopter to desired positions However as will be shown the control structure is ba sically linear proportional integral derivative i e PID controller The control gains are computed using the Linear Quadratic Regular algorithm in Section 4 2 The state feedback controller entering the front motor us and the back motor u is defined Up _ i Uff ie Kenta ena l E with the proportional derivative gain k k k k Kane 1 1 1 2 1 3 vl k21 k22 k23 koa the desired state ta 64 va 0 OJ the integral control V be fan 21 dE kie ta 2 El i k2 5 ea 4 x 1 dt k26 fS za2 z2 dt 4 and the nonlinear feed forward control _ KffMheltiglem COS Xa Uf f K A pp The feed forward control compensates for the gravitational torque that forces the pitch angle down The system state x is defined in Equation 3 1 The variables 04 and Xa are the pitch and yaw setpoints i e the desired angles of the helicopter In state space the desired pitch is angle Xa 1 and the desired yaw is za 2 The gains k and k 2 are the front motor control proportional gains and the gains k2 and ho are the back motor control proportional gains Next k 3 and hia are the front motor control derivative gains and k2 and k2 4 are the back motor control derivative gains The integral control gains used in the front motor control are k 5 and k and the i
24. on the anti windup algorithm see section 4 7 Ensure the CONTROLLER TYPE is set to LQR AUTO to generate the controller automat ically Set the feed forward gain ky 1 V V and the LQR and LQR 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 con trol 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 8 below Q OR QUANSER DRAFT Wednesday 6 July 2011 QUANSER Aerospace LABORATORY MANUAL 10 11 12 14 QUANSER ci s_heli_2d_ff_lqr_i Desired Angle from Program File Edit View Simulation Format Tools QuaRC Help D H amp g Signal Generator Amplitude Pitch Pitch Pitch deg deg to rad Constant Pitch deg Signal Generator amplitude Yaw Yaw ge x_d rad Yaw deg deg to rad od vw Reference Constant Yaw Constant Figure 5 8 Desired Angle from Program subsystem 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 theScopes subsystem and double click on those sinks 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 E
25. plifier and data acquisition device as dis cussed in the 2 DOF Helicopter User Manual 4 e Designing a state feedback control using Linear Quadratic Regulator LQR e Using QUARC to control and monitor a plant in real time and in designing a controller through SimuLINK Q QUANSER OS DRAFT Wednesday 6 July 2011 QUANSER Aerospace LABORATORY MANUAL O QUANSER 2 Experiment Files Overvievv Table 1 below lists and describes the various files supplied with the 2 DOF Helicopter experiment File Name 2 DOF Helicopter Reference Manual pdf Description This manual is both the user and laboratory guide for the Quanser 2 DOF Helicopter specialty aerospace plant It contains informa tion about the hardware components specifications information to setup and configure the hardware system modeling control design as well as the experimental procedure to simulate and implement the controller 2 DOF Heli Equations mws Maple worksheet used to analytically derive the state space model involved in the experiment Waterloo Maple 9 or a later release is required to open modify and execute this file 2 DOF Heli Equations html HTML presentation of the Maple Worksheet It allows users to view the content of the Maple file without having Maple 9 installed No modifications to the equations can be performed when in this format quanser ind and quanser lib The Quanser Tools module defines the gen
26. s damping term gives the expression amp KyyVm y KypVm p y W t ave where the bottom term is the average velocity of the yaw angle From Figure 25 the voltage and average velocity found are 5 2 Vingy 7 65 V Vm p 11 36 V Day 0 9481 rad s Substituting these values into Equation 5 2 gives the equivalent viscous damping acting about the yaw axis By 0 319 N m s rad 8 Bring the helicopter back to 8 0 y 0 by setting the control switch block to 2 to run the LQR I controller 9 To apply a voltage directly to the pitch motor set the control switch source block to 3 10 Inthe Desired Voltage subsystem set the frequency of the Signal Generator Pitch V block to 0 4 Hertz the Amplitude Pitch V gain block to 0 2 and the Constant Pitch V to 0 11 As shown in Figure 5 25 the measured and simulated pitch angles are quite close The pitch viscous damping term B was estimated by tuning its value online as the controller is 27 running To do this enter a value for B in the Matlab command window for example Bp 0 8 Because the parameter change is made in Matlab and not directly in the Simulink model the controller that is running must be updated for the changes of this parameter to O QUANSER DRAFT Wednesday 6 July 2011 QUANSER Aerospace LABORATORY MANUAL 28 QUANSER take effect The change can be applied by clicking on the Edit menu in the Simulink model and selecting the Update
27. tains the nonlinear model summarized in section 3 The interior of the 2DOF HELI FF LQR Controller subsystem is displayed in Figure 5 5 As discussed in Section 4 the position and velocity states are multiplied by the corresponding ele ments of control gain K The state includes the integral of the pitch and yaw angles and those are multiplied by the integral gains in K Further the anti windup scheme shown in Figure 4 4 is implemented in the Pitch Integral Antiwindup and Yaw Integral Antiwindup blocks The Pitch feed forward controller and 2DOF HELI FF LQR Controller subsystems blocks are linked to 2 DOF Helicopter Simulink library Cl Link q_heli_2d_ff_Iqr_i 2 DOF Helicopter Closed loop Actual System 2DOF HELI FF LQR I Controller DAR gr Tools QuaRC Help Deas t Gir JExema i SHAS BAB Eile Edit view Simulation 2 DOF Helicopter Pitch Feed forward LQR Integrator Controller Pitch feed forward controller itch error yt El yaw enor gt Control Gain K u_lq_i_piteh 09 1 Pitch Integral Antiwidup Yaw Integral Antiwidup error theta rad error psi rad Figure 5 5 Subsystem that implements the FF LQR I controller 5 2 Controller Simulation Q o QUANSER DRAFT Wednesday 6 July 2011 QUANSER Aerospace LABORATORY MANUAL 5 2 1 Objectives e Investigate the closed loop position control performance of the FF LQR and FF LQR I
28. using a nonlinear model of the 2 DOF Helicopter system e Ensure the controller does not saturate the actuator 5 2 2 Procedure Follow these steps to simulate the closed loop response of the 2 DOF Helicopter 1 Load the MaTLaB software 2 Open the Simulink model called s_heli_2d_ff_Iqr_i madl shown in Figure 5 6 s_heli_2d_ff_Iqr_i File Edit Yiew Simulation Format Tools QuaRC Help Dice S SB BI ES RJ Ci fo Nom Es BE S Quanser 2DOF Helicopter Closed loop simulation Desired Angle from Program Desired Voltage 2 DOF Helicopter Scopes LOR 1 Closed loop System Simulation LORH 2 Pitch open loop 3 Yaw open loop 4 100 Figure 5 6 Simulink diagram used to simulate 2 DOF Helicopter system 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 12 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 Fi
Download Pdf Manuals
Related Search
Related Contents
APC BX1400U-FR uninterruptible power supply (UPS) User Manual - LR20 Issue 1.cdr Honey-Can-Do GAR-03265 Instructions / Assembly User Manual - the Naples Free-Net Instructions d`installation Kompernass PDS 150 Operating and Safety Instructions 5360 IP Telefone Manual de referência rápida Chapter 1 - Search Faculty タイムレコーダーの停電時の対応について Avocent SwitchView SC4 UAD KVM Switch Copyright © All rights reserved.
Failed to retrieve file