Home

QNET Rotary Pendulum Laboratory Manual

image

Contents

1. Signal Type yu 5 Amplitude 2 50 y 6 Petey doo kz 7 150 155 160 i 1 5 190 195 200 EE 8 Voltage V Input Voltage W 2 44 Disturbance OFF Figure 6 1 QNET ROTPENT Simple Modeling virtual instrument 6 3 Control Design VI The QNET ROTPENT Control Design VI enables users to design a balance controller and simulate its response The matrices for the state space model of the rotary inverted pendulum system is shown in the Symbolic Model tab and illustrated in Figure 6 2 The values of the variables used in the state space model can be changed In the Open Loop Analysis tab shown in Figure 6 3 the numerical state space model is displayed and the resulting open loop poles are plotted on a phase plane Based on this model a controller to balance the rotary inverted pendulum system can be designed using the Linear Quadratic Regulator LOR optimization technique as shown in the Simulation tab in Figure 6 4 The resulting closed loop inverted pendulum system can be simulated Table 4 lists and describes the main elements of the ROTPENT Control Design virtual instrument user interface Every element is uniquely identified through an ID number and located in figures 6 2 6 3 and 6 4 6 4 Swing Up Control VI The QNET Rotary Pendulum Trainer Swing Up Control VI implements an energy based control that swings up the pendulum to its upright vertical position a
2. 5 Compare the moment of inertia calculated analytically in Exercise 1 and the moment of inertia found experi mentally Is there a large discrepancy between them 6 Stop the VI by clicking on the Stop button Q DUANS E R 2 6 Results Fill out Table 1 with your answers from above Description Symbol Value Unit Section 2 4 Friction Positive Coulomb Friction Voltage Vip V Negative Coulomb Friction Voltage Vin V Section 2 5 Moment of Inertia Calculated inertia d kg m Experimentally found inertia Jp exp kg m Table 1 QNET ROTPENT Modeling results summary 3 BALANCE CONTROL DESIGN 3 1 Background A rich collection of methods for finding parameters of control strategies have been developed Several of them have also been packaged in tools that are relatively easy to use Linear Quadratic Regulator LAR theory is a technique that is suitable for finding the parameters of the balancing controller in Equation 4 1 in Section 4 Given that the equations of motion of the system can be described in the form t Ax Bu the LQR algorithm computes a control task u to minimize the criterion J a t Qz t u t Ru t dt The matrix Q defines the penalty on the state variable and the matrix R defines the penalty on the control actions Thus when Q is made larger the controller must work harder to minimize the cost function and the resulting control gain will be larger In our case the state v
3. amero pasyalan Figure 5 2 Hybrid swing up controller automaton lal gt yvlal gt n The circles in Figure 5 2 are called locations and represent the two different continuous system The arrows are called edges and represent the discrete jumps taken when certain condition are satisfied The angle used in the switching logic in Figure 5 2 is called the upright angle It is defined as zero when the pendulum is about its upright vertical position and expressed mathematically using Qup a mod 27 m The various switching parameters shown in Figure 5 2 can then be set as 2deg n 720deg s y 30deg Given that the pendulum starts in the downward vertical position it is in the swing up location of the hybrid automaton The swing up controller pumps energy into the pendulum until it swings within 2 deg of its upright vertical position Once the pendulum is within that that range and does not exceed 720 deg s in either direction the edge is taken to engage the balance controller It remain in the Balance PD control location until the pendulum goes beyond the 30 deg position range or beyond 720 deg s ONT ROTPENT Laboratory Manual Student Manual NMETNEIEENENIEMI 5 The 2 Swing Up Control VI virtual instrument used to run the swing up controller on the QNET rotary pendulum system is the same as the balance control given in Section 4 2 shown in Figure 4 1 5 10 11 12 13 3 Energy Contr
4. is small and balancing can be accomplished simply with a PD controller If we are also interested in keeping the arm in a fixed position a feedback from the arm position will also be introduced The control law can then be expressed as u kp o 0 9 kp o T ka 90 ka 4 1 where kp is the arm angle proportional gain amp is the pendulum angle proportional gain kg is the arm angle derivative gain and k4 a is the pendulum angle derivative gain The desired angle of the arm is denoted by 0 and there is no reference for the pendulum angle because the desired position is zero There are many different ways to find the controller parameters As discussed in Section 3 1 one method is based on LQR optimal control Initially however the behaviour of the system will be explored using default parameters When balancing the pendulum over a fixed point the arm tends to oscillate about that reference because of the friction present in the motor Due to friction the motor will not move until the control signal is sufficiently large and the generated torque is larger than the stiction see Section 2 1 for more details This means that the pendulum has to fall a certain angle before the motor moves and the net result is an oscillating motion Friction can be compensated by introducing a Dither signal at the input voltage of the DC motor The Dither signal used has the form Va Aasin fat Vao where A is the voltage amplitude
5. Frequency 0 20 Hz e Offset 0 0 deg Set the Q and R LQR weighting matrices to the following e Q 1 1 10 i e set first element of Q matrix to 10 e R 1 Changing the Q matrix generates a new control gain The arm reference in red and simulated arm response in blue are shown in the Arm deg scope How did the arm response change How did the pendulum response change in the Pendulum deg scope Set the third element in the Q matrix to 0 i e Q 3 3 0 Examine and describe the change in the Arm deg and Pendulum deg scope By varying the diagonal elements of the Q matrix design a balance controller that adheres to the following specifications e Arm peak time less than 0 75 s tp lt 0 75 s e Motor voltage peak less than 12 5 V V lt 12 5 V e Pendulum angle less than 10 0 deg a lt 10 0 deg Record the Q and R matrices along with the control gain used to meet the specifications in your report Attach the responses from the Arm deg Pendulum deg and Control Input V scopes when using your designed balance controller Does it satisfy the specifications Stop the VI by clicking on the Stop button 4 BALANCE CONTROL IMPLEMENTATION 4 1 Background Balancing is a common control task In this experiment we will find control strategies that balance the pendulum in the upright position while maintaining a desired position of the arm When balancing the system the pendulum angle a
6. Quanser Inc Acknowledgements Quanser Inc would like to thank the following contributors Dr Hakan Gurocak Washington State University Vancouver USA for his help to include embedded outcomes assessment and Dr K J Astr m Lund University Lund Sweden for his immense contributions to the curriculum content Contents 1 2 DUANS E R Introduction Simple Modeling 2 1 Background 2 2 Simple Modeling Virtual Instrument 2 3 Damping 15 min 24 Friction 15 min 2 5 Moment of Inertia 30 min 2 6 Results Balance Control Design 3 1 Background 3 2 Balance Control Design VI 3 3 Model Analysis 20 min 3 4 Control Design and Simulation 45 min Balance Control Implementation 4 1 Background 4 2 Balance Control VI 4 3 Default Balance Control 30 min 4 4 Implement Designed Balance Control 20 min 4 5 Balance Control with Friction Compensation 30 min Swing Up Control 5 1 Background 5 2 Swing Up Control VI 5 3 Energy Control 30 min 5 4 Hybrid Swing Up Control 20 min System Requirements 6 1 Overview of Files 6 2 Simple Modeling Laboratory VI 6 3 Control Design VI 6 4 Swing Up Control VI Lab Report 7 1 Template for Content Simple Modeling 7 2 Template for Content Balance Control Design 7 3 Template for Content Balance Control Implementation 7 4 Template for Content Swing Up Control 7 5 Tips for Report Format 1 INTRODUCTION Regulation and servo problems are very
7. Signal Generator section set e Amplitude 45 0 deg e Frequency 0 10 Hz e Offset 0 0 deg 11 Observe the behaviour of the system when a square wave command is given to the arm angle Why does the arm initially move in the wrong direction 12 Click on the Stop button to stop running the VI 4 4 Implement Designed Balance Control 20 min 1 Go through Section 3 4 and design a balance control according to the given specifications Remark It is recommended to use the experimental determined pendulum moment of inertia that was found in Section 2 5 2 Open the QNET ROTPENT Swing Up Control vi and ensure it is configured as described in Section 6 Make sure the correct Device is chosen 3 Run the QNET ROTPENT Swing Up Control vi The VI should appear similarity as shown in Figure 4 1 4 In the Signal Generator section set e Amplitude 45 0 deg e Frequency 0 20 Hz e Offset 0 0 deg 5 To implement your balance controller enter the control gain found in Section 3 4 in kp theta kp alpha kd theta and kd alpha in the Control Parameters section 6 Manually rotate the pendulum in the upright position until the n Range LED in the Control Indicators section turns bright green Ensure the encoder cable does not interfere with the pendulum arm motion 7 Attach the response found Angle Energy deg mJ and the Voltage V scopes Does your system meet the specifications given in Section 3 4 8 Click on the Stop butto
8. and cost effective teaching solutions to engineering educators All six QNET Trainers are offered with comprehensive ABET aligned course materials that have been developed to enhance the student learning experience To request a demonstration or quote please email info ni com 2012 Quanser Inc All rights reserved LabVIEW is a trademark of National Instruments INFO NI COM INFO QUANSER COM Quanser control solutions for teaching and research are made in Canada
9. control signal at the maximum acceleration of the pendulum pivot umar See Wikipedia for more information on potential energy kinetic energy control theory and nonlinear control 5 1 2 Hybrid Swing Up Control The energy swing up control in 5 5 or 5 6 can be combined with the balancing control law in 4 1 to obtain a control law which performs the dual tasks of swinging up the pendulum and balancing it As illustrated in Figure 5 1 this can be accomplished by switching between the two control systems Q DUAN SER Swing up energy control Rotary Pendulum Mir SE a im Pant Balance Control u K x x Figure 5 1 Swing up hybrid control This system can be modeled as a hybrid system Hybrid systems are systems with both continuous and discrete parts There are two continuous part the closed loop system using the swing up energy controller and the closed loop system using the PD balance controller The switching strategy is the discrete element that chooses which controller or system to run The switching logic can be obtained by determining a region in state space where the balancing works well Balancing control is then used inside this region and energy control is used outside the region Figure 5 2 is a called a hybrid automaton and for this specific task can be used to describe the system model and the switching logic la amp a s m Swing up la evan energy control
10. f4 is the sinusoid frequency and Vag is the offset voltage of the signal See Wikipedia for more information on PID and friction 4 2 Balance Control VI The virtual instrument used to run the balance controller and the swing up shown later on the QNET rotary pen dulum system is shown in Figure 4 1 B DUANS E R 08 QNET ROTPENT Swing Up Control vi Operate Tools Window Help gt QNET ROTPEN Swing Up Control Q Digital Scopes mea EE 620 h REI deo vo MEN Control Indicators Device NATIONAL 2 INSTRUMENTS evi Balance Control Parameters kp theta Virad 9 6 50 Ko aha Wrad Jano kd theta V s rad J 2 75 kd alpha v sirad 9 10 5 Swing Up Control Parameters Sampling Rate Hz m 100 0 Angle Energy deg mJ Arm Angle deg Pendulum Angle deg Pendulum Energy mJ 250 200 150 100 50 0 In Range lll mu mjs 2 J i375 Energy 7 m3 J Er mJ J 55 0 max accel m s 2 J 10 Corr 2 Signal Generator Signal Type m Amplitude J 0 0 deg Frequency joie Hz Offset Soo deg Disturbance C OFF PN Dither Signal D 15 20 25 time s Activate Swing Up Input voltage V L Model Parameters Djio oz7o 30 153 j 0 0800 9 0 0826 m J 0 000509 kg m 2 Jj 0 000698 kg m 2 J 9 0333 O2 20 25 gie 7o ohm L time s Amplitude V 9 0 00 Frequency Hz 9 5 00 Offset V 0 00 Figure 4 1 LabVIEW VI f
11. is to control the pendulum in such a way that the friction is constant The potential energy of the pendulum is Ep Mp glp 1 cos a 5 1 and the kinetic energy is 1 Ep 3 5 2 The potential energy is zero when the pendulum is at rest at a 0 in Figure 2 2 and equals 2M gl when the pendulum is upright at a 7 The sum of the potential and kinetic energy of the pendulum is 1 E PEL M gl 1 cosa 5 3 Differentiating 5 3 results in the differential equation E J 8 Mp g lp Sin a 5 4 Substituting the pendulum equation of motion given in Equation 2 1 for pendulum acceleration into Equation 5 4 gives E M ul acosa Since the acceleration of the pivot is proportional to current driving the arm motor and thus also proportional to the drive voltage we find that it is easy to control the energy of the pendulum The proportional control law u E E cosa 5 5 drives the energy towards the reference energy Notice that the control law is nonlinear because the proportional gain depends on the pendulum angle o Also notice that the control changes sign when changes sign and when the angle is 90 deg However for energy to change quickly the magnitude of the control signal must be large As a result the following swing up controller is implemented in the LabVIEW VI u Sat u Er E sign cos a 5 6 where is a tunable control gain and the sat function saturates the
12. that drives the motor The output variables are the angle of the pendulum and the angle of the motor Figure 1 1 QNET rotary inverted pendulum trainer ROTPENT There are three experiments simple modeling inverted pendulum balance control and swing up control The experiments can be performed independently Topics Covered e Modeling the pendulum e Balance control via state feedback euren uso ansa ST MEER e Control optimization LOR e Friction compensation e Energy control e Hybrid control Prerequisites In order to successfully carry out this laboratory the user should be familiar with the following e Transfer function fundamentals e g obtaining a transfer function from a differential equation e Using LabVIEW to run VIs B DUANS E R e SIMPLE MODELING 2 1 Background This experiment illustrates some control tasks for gantry cranes The gantry is a moving platform or trolley that transports the crane about the factory floor or harbor The load hangs from the crane using wires and is moved by the gantry crane Typically the problem is to move the load quickly and move it to the correct position The fast motion necessary for production makes it more difficult to move the load to the correct location given the swinging motions of the crane This problem can be mimicked using the rotary pendulum system by viewing the tip of the L shaped arm as the moving trolley and the pendulum tip as the load being carri
13. 4 Op Kt Km Mp lp 2 KE Km Rm 40 Jeq Mp lp 2 Mp r 2 Jp Jeq Jp Jeg Mp Ip 2 rA Mp lp g Deq Mp r 2 eq Jp 1 Mp Ip r Ke Km Rm eg Jp4 o Jeq Mp ip 2 Mp r 2 Jp Jeq Mp ip 2 Mp r 2 Jp Mp lp Kt r Rm Jeq Jp Jeq Mp Ip 2 Mp r 2 3p Figure 6 2 QNET ROTPENT Control Design VI Symbolic Model tab E DUANSER 13 08 0NET ROTPENT Control Design vi File Edit View Project Operate Tools Window Help QNET ROTPEN Control Design status code NATIONAL 15 A2 INSTRUMENTS ER Symbolic Model Open Loop Analysis Simulation Open Loop Eguation Pole Zero Map 1 0 0 1 0 0 0 0 IM 0 M 0 8 18 0 22374 0274296 0 a 23713 Mt 0 36 2091 0 0703703 0 2 11322 0 6 1000 Dt 0100 17 0010 0001 0 2 0 0 0 2 4 imaginary axis 0 4 0 64 0 8 1 0 i 1 i 1 8 0 6 0 4 0 2 0 0 0 2 0 4 0 6 0 real axis Figure 6 3 QNET ROTPENT Control Design VI Open Loop Analysis tab P 08 Q ROTP ontrol_Desig 5 Eile Edit View Project Operate Tools Window Help aa ae gt s m gp QNET ROTPEN Control Design 16 15 status code f s A NATIONAL 4 Ea INSTRUMENTS izata QUANSER i Symbolic Model Open Loop Analysis Simulation setpoint Signal Generator r SS am deg simula
14. NATIONAL INSTRUMENTS QUANSER INNOVATE EDUCATE STUDENT WORKBOOK QNET Rotary Inverted Pendulum Trainer for NI ELVIS Developed by Quanser Curriculum designed by Karl Johan str m Ph D Lund University Emeritus Jacob Apkarian Ph D Quanser Paul Karam B A SC Guanser Michel L vis M A Sc Quanser Jeannie Falcon Ph D National Instruments Curriculum complies with ABET DP ABET Inc is the recognized accreditor for college and university programs in applied science computing engineering and technology Among the most respected accreditation organizations in the U S ABET has provided leadership and quality assurance in higher education for over 75 years 2011 Quanser Inc All rights reserved Quanser Inc 119 Spy Court Markham Ontario L3R 5H6 Canada info guanser 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 www guanser 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
15. S Provide details of your calculations methods used for analysis for each of the following 1 Damping analysis in step 6 in Section 2 3 2 Finding friction in step 5 in Section 2 4 3 Calculating moment of inertia of pendulum in step 4 in Section 2 5 IV CONCLUSIONS Interpret your results to arrive at logical conclusions for the following 1 How well does the experimentally derived moment of inertia compare with analytically derived value in step 5 of Section 2 5 oo Gs n Siren EMEN 7 2 Template for Content Balance Control Design I PROCEDURE 1 Model Analysis e Briefly describe the main goal of the experiment e Briefly describe the experimental procedure in Step 6 in Section 3 3 2 Control Design and Simulation e Briefly describe the main goal of the experiment e Briefly describe the experimental procedure in Step 6 in Section 3 4 ll RESULTS Do not interpret or analyze the data in this section Just provide the results 1 LQR matrices and control gain found in Step 9 in Section 3 4 2 Simulated closed loop response plot from Step 10 in Section 3 4 Ill ANALYSIS Provide details of your calculations methods used for analysis for each of the following 1 Open loop poles in Step 6 in Section 3 3 2 Effect of changing moment of inertia on open loop poles in Step 8 in Section 3 3 3 Effect of changing LQR elements on response in Step 6 in Section 3 4 4 Effect of changing different LQR element on the r
16. ay of the pendulum energy mJ 6 Signal Type Type of signal generated for the arm refer ence signal i e desired angle of arm 7 Amplitude Reference position amplitude input box deg 8 Frequency Reference position frequency input box Hz 9 Offset Reference position offset input box deg 10 Disturbance Visa Apply simulated disturbance voltage V 11 Amplitude Aq Dither signal amplitude input box V 12 Frequency fa Dither signal frequency input box Hz 13 Offset Vao Dither signal offset input box V 14 kp theta kp 6 Arm angle proportional gain input box Virad 15 kp_alpha kpa Pendulum angle proportional gain input box V rad 16 kd theta kao Arm angle derivative gain input box V s rad 17 kd_alpha kaa Pendulum angle derivative gain input box V s rad 18 mu u Proportional gain for energy controller m s2 J 19 Er E Reference energy for energy controller mJ 20 Max accel Umax Maximum acceleration m s 21 Activate Swing Up When pressed down the energy controller that swings up the pendulum is engaged 22 Mp Mp Mass of pendulum assembly link weight kg 23 Ip ly Center of mass of pendulum assembly m link weight input box 24 Marm Marm Mass of rotary arm kg 25 r r Length from motor shaft to pendulum pivot m 26 Jp Jp Pendulum moment of inertia relative to pivot kg m2 27 Jeq Jeq Equivalent moment of inertia acting on the DC kg m2 motor shaft 28 Kt Ki DC motor current torque constant N m A 29 Rm Rm Electrical r
17. common but feedback can be used in many other useful ways The name task based control is used as a common classification of a wide variety of problems For instance stabilization of an unstable system can be considered a task based problem However it is a borderline example since it can also be viewed as a regulation problem The Segway transporter is a typical example where stabilization is a key task In that case stabilization is also merged with the steering functions Other examples are damping of a swinging load on a crane stabilization of a rocket during take off and the human posturing systems There are many examples of task based control in aerospace such as automatic landing and orbit transfer of satellites Robotics is a rich field for task based control with challenges such as collision avoidance motion planning and vision based control Task based control is typically more complicated than regulation and servoing but they may contain servo and regulation functions as sub tasks We have chosen the rotary pendulum system to illustrate task based control The QNET rotary inverted pendulum trainer is shown in Figure 1 1 The motor is mounted vertically in a metal chamber An L shaped arm is connected to the motor shaft and pivots between 180 degrees A pendulum is suspended on a horizontal axis at the end of the arm The pendulum angle is measured by an encoder The control variable is the input voltage to the pulse width modulated amplifier
18. e model of QNET rotary pendulum 3 2 2 Open Loop Analysis Tab The Open Loop Analysis tab on the VI is used to analyze the open loop stability of the QNET rotary pendulum System shown in Figure 3 2 ET ROTPEN Control Design 0 t 0 1 0 axidt 0 22 374 0 274296 0 x t 8 23713 u 0 36 2091 0 0703703 0 2 11322 0001 1000 0100 LIPPE Figure 3 2 LabVIEW VI used to analyze open loop stability of QNET rotary pendulum system QNET ROTPENT Laboratory Manual Student Manual 3 On 2 3 Simulation Tab the Simulation tab shown in Figure 3 3 users can generate the balance control gains for the QNET rotary pendulum system using LQR and simulate the closed loop system 08 Q ROTP 0 ol Desig File Edit View Project Operate Tools Window Help i gt a9 m pies QNET ROTPEN Control Design yas qo NATIONAL 0 sl INSTRUMENTS GUANSER Nan Symbolic Model Open Loop Analysis Simulation setpoint Signal Generator Tam dag on Signal Type fu Amplitude J 45 0 deg Control Input V 15 10 3 E 7157 D 1 D 10 Frequency Arc Hz Offset Aoa deg Amplitude iu Optimal Gain K 1 00 60 73 1 39 7 99 gt Figure 3 3 LabVIEW VI for QNET rotary pendulum balance control design 3 3 Model Analysis 20 min gt WwW N Cc Open the QNET ROTPENT C
19. ecessary details title course student name s etc Each of the reguired sections is completed Procedure Results Analysis and Conclusions e Typed e All grammar spelling correct e Report layout is neat e Does not exceed specified maximum page limit if any e Pages are numbered Equations are consecutively numbered Figures are numbered axes have labels each figure has a descriptive caption e Tables are numbered they include labels each table has a descriptive caption Data are presented in a useful format graphs numerical table charts diagrams e No hand drawn sketches diagrams References are cited using correct format REFERENCES 1 Quanser Inc QNET Rotary Pendulum Control Trainer User Manual 2011 Six GNET Trainers to teach introductory controls using NI ELVIS gt GNET DC Motor Control Trainer gt GNET HVAC Trainer gt QNET Mechatronic Sensors Trainer teaches fundamentals of DC motor control teaches temperature process control teaches functions of 10 different sensors gt GNET Rotary Inverted gt GNET Myoelectric Trainer gt QNET VTOL Trainer Pendulum Trainer teaches control using principles of teaches basic flight dynamics and control teaches classic pendulum control experiment electromyography EMG gt NI ELVIS I gt NI ELVIS II Quanser QNET Trainers are plug in boards for NI ELVIS to teach introductory controls in undergraduate labs Together they deliver added choice
20. ector x is defined x e a 4 al Since there is only one control variable R is a scalar and the control strategy used to minimize cost function J is given by u K z z kp 0 Or kpala T kaob ka The LOR theory has been packaged in the LabVIEW Control Design and Simulation Module Thus given a model of the system in the form of the state space matrices A and B and the weighting matrices Q and R the LQR function in the Control Design Toolkit computes the feedback control gain automatically In this experiment the model is already available In the laboratory the effect of changing the Q weighting matrix while R is fixed to 1 on the cost function J will be explored See Wikipedia for more information on optimal control 3 2 Balance Control Design VI The QNET ROTPENT Control Design VI has three tabs Each tab is explained in the following sections 3 2 1 Symbolic Model Tab The Symbolic Model tab shown in Figure 3 1 is used to setup the QNET rotary pendulum model B QUAN SER 08 0NET ROTPENT Control Design vi Bile ew Project Operate Tools Window Hep NET ROTPEN Control Design Mp 2 ip 2 r o Jeq Ip Op Kt Km4Mp Ip 2 Kt km Rm Jeq Mp Ip 2 Mp r 2 3p Geg p Jeq Mp lp 24 Mp r 2 3p Mp ip g Jeq Mp r 2 Jeq 3p f Mp ip r Kt km Rm Jeq 3p Jeq Mp Ip 2 Mp r 2 3p Jeq Mp Ip 2 Mp r 2 3p On m um joo o Yo Figure 3 1 LabVIEW VI to generate state spac
21. ed In this experiment we will begin by modeling the system and determine strategies to dampen the oscillations of the system M pg Figure 2 1 Free body diagrams of pendulum assembly Figure 2 1 shows the free body diagram of the pendulum assembly that is composed of two rigid bodies the pen dulum link with mass M and length L 1 and the pendulum weight with mass Mp2 and a length L 2 The center of mass of the the pendulum link and the pendulum weight are calculated separately using the general expression f px dz Tem pdx where z is the linear distance from the pivot axis and p is the density of the body The circle in the top left corner of Figure 2 1 represents the axis of rotation or the pivot axis that goes into the page The pendulum system is then expressed as one rigid body with a single center of mass as shown in Figure 2 2 TSS RET Lary Vans Se Va NN Figure 2 2 Free body diagram of composite pendulum The center of mass of a composite object that contains n bodies can be calculated using n ee Mi er i ia Mia nu where Zem is the known center of mass of body i and m is the mass of body i From the free body diagram in Figure 2 2 the resulting nonlinear equation of motion of the pendulum is Jy t Mp gl sin a t Mp ul cos a t 2 1 where J is the moment of inertia of the pendulum at the pivot axis zo M is the total mass of the pendulum assembly u is the linear acceleration of the pivot a
22. esistance of the DC motor arma 2 ture 30 Device Selects the NI DAQ device 31 Sampling Rate Sets the sampling rate of the VI Hz 32 Stop Stops the LabVIEW VI from running 33 Scopes Angle 0 a Scope with measured arm angle in red and deg pendulum angle in blue 34 Scopes Voltage Vin Scope with applied motor voltage in red V O DUANS E R Table 5 QNET ROTPENT Swing Up Control VI Components 7 LAB REPORT This laboratory contains three groups of experiments namely 1 Modeling 2 Balance control design 3 Balance control implementation 4 Swing up control For each experiment follow the outline corresponding to that experiment to build the content of your report Also in Section 7 5 you can find some basic tips for the format of your report 7 1 Template for Content Simple Modeling PROCEDURE 1 Damping e Briefly describe the main goal of the experiment e Briefly describe the experiment procedure in Step 6 in Section 2 3 2 Friction e Briefly describe the main goal of the experiment e Briefly describe the experiment procedure in Step 5 in Section 2 4 3 Moment of Inertia e Briefly describe the main goal of the experiment e Briefly describe the experiment procedure in Step 4 in Section 2 5 Il RESULTS Do not interpret or analyze the data in this section Just provide the results 1 Provide applicable data collected in this laboratory from Table 1 Ill ANALYSI
23. esponse in Step 8 in Section 3 4 IV CONCLUSIONS Interpret your results to arrive at logical conclusions for the following 1 Does lowering the moment of inertia of the pendulum have the expected result Step 8 in Section 3 3 2 Does the simulation match the specifications in Step 10 in Section 3 4 E DUANS E R 7 3 Template for Content Balance Control Imple mentation I PROCEDURE 1 Default Balance Control e Briefly describe the main goal of the experiment e Briefly describe the experimental procedure in Step 8 in Section 4 3 2 Implement Designed Balance Control e Briefly describe the main goal of the experiment e Briefly describe the experimental procedure in Step 7 in Section 4 4 3 Balance Control with Friction Compensation e Briefly describe the main goal of this experiment e Briefly describe the experimental procedure in Step 4 in Section 4 5 Il RESULTS Do not interpret or analyze the data in this section Just provide the results 1 Balance control response plot from step 7 in Section 4 4 Ill ANALYSIS Provide details of your calculations methods used for analysis for each of the following 1 Effect of changing offset in Step 8 in Section 4 3 Balance control analysis in Step 9 in Section 4 3 Balance control analysis when tracking step reference in 11 in Section 4 3 Examining the arm oscillation in Step 4 in Section 4 5 Explain what the Dither signal is doing in Step 6 in Sectio
24. h converges faster towards angle zero Why does one system dampen faster than the other 7 Stop the VI by clicking on the Stop button 2 4 Friction 15 minl 1 Run the QNET ROTPENT Simple Modeling vi 2 In the Signal Generator section set e Amplitude 0 V e Frequency 0 25 Hz e Offset 0 0 V 3 Change the Offset in steps of 0 10 V until the pendulum begins moving Record the voltage at which the pendulum moved 4 Repeat Step 3 above for steps of 0 10 V 5 Enter the positive Vp and negative voltage Vin values needed to get the pendulum moving Why does the motor need a certain amount of voltage to get the motor shaft moving 6 Stop the VI by clicking on the Stop button 2 5 Moment of Inertia 30 min 2 5 1 Pre Lab Questions 1 Find the moment of inertia acting about the pendulum pivot using the free body diagram Make sure you evaluate numerically using the parameters defined in the QNET ROTPEN User Manual 2 2 5 2 In Lab Exercises 1 Run the QNET_ROTPENT_Simple_Modeling vi 2 In the Signal Generator section set e Amplitude 1 0 V e Frequency 0 25 Hz e Offset 0 0 V 3 Click on the Disturbance toggle switch to perturb the pendulum and measure the amount of time it takes for the pendulum to swing back and forth in a few cycles e g 4 cycles 4 Find the frequency and moment of inertia of the pendulum using the observed results See Section 2 1 to see how to calculate the inertia experimentally
25. he Signal Generator section to perturb the pendulum In Swing Up Control Parameters change the reference energy Er between 5 0 mJ and 50 0 mJ As it is varied examine the control signal in the Voltage V scope as well as the blue Pendulum Angle deg and the red Pendulum Energy mJ in the Angle Energy deg mJ scope Attach the response of the Angle Energy deg mJ and Voltage V scopes In Control Parameters fix Er to 20 0 mJ and vary the swing up control gain mu between 10 and 100 m s J Describe how this changes the performance of the energy control Click on the Stop button to stop running the VI DUANS E R 5 4 Hybrid Swing Up Control 20 min 1 10 11 Open the QNET ROTPENT Swing Up Control vi and ensure it is configured as described in Section 6 Make sure the correct Device is chosen Run the QNET ROTPENT Swing Up Control vi The VI should appear similarity as shown in Figure 4 1 In the Balance Control Parameters section ensure the following parameters are set e kp theta 6 50 V rad e kp alpha 80 0 V rad e kd theta 2 75 V rad s e kd alpha 10 5 V rad s In the Swing Up Control Parameters section set e mu 55 m s J e Er 20 0 mJ e max accel 10 m s e Activate Swing Up OFF de pressed Adjust the Angle Energy deg mJ scope scales to see between 250 and 250 see the ROTPEN User Manual 2 for help Make sure the pendulum is hanging down motionless and the encoder cab
26. he hardware of the QNET Rotary Pendulum Trainer system and how to setup the system on the ELVIS QNET ROTPENT Workbook Stu This laboratory guide contains pre lab questions and lab dent pdf experiments demonstrating how to design and implement controllers on the QNET DCMCT system LabVIEW QNET ROTPENT Simple Modeling vi Apply voltage to DC motor and examine the arm and pen dulum responses QNET ROTPENT Control Design vi Design and simulate LOR based balance controller QNET_ROTPENT_Swing_Up_Control vi Swing up and balance pendulum Table 2 Files supplied with the QNET ROTPENT Laboratory 6 2 Simple Modeling Laboratory VI The ONET ROTPENT Simple Modeling VI is shown in Figure 6 1 It runs the DC motor connected to the pendulum arm in open loop and plots the corresponding pendulum arm and link angles as well as the applied input motor voltage Table 3 lists and describes the main elements of the ROTPENT Simple Modeling virtual instrument front panel Every element is uniquely identified through an ID number and located in Figure 6 1 Q DUANS E R 07 0NET ROTPENT Simple Modeling vi File Edit View Project Operate Tools Window Help eje wj QNET ROTPEN Simple Modeling INSTRUMENTS evi 4 0 sj 250 0 1 1 Arm Angle deg IGUANSER Angle deg Pendulum Angle deg 100 EE Scopes 1 3 Theta 1 EXNE 2 Current 0 5 A 3 P Voltage 13 y 4 Signal Generator
27. le is not interfering with the pendu lum In the Swing Up Control Parameters set the Activate Swing Up switch to ON pressed down position The pendulum should begin going back and forth If not click on the Disturbance button in the Signal Generator section to perturb the pendulum Turn off the Active Swing Up switch if the pendulum goes unstable or if the encoder cable interferes with the pendulum arm motion Gradually increase the reference energy Er in the Control Parameters section until the pendulum swings up to the vertical position What reference energy was required to swing up the pendulum Was this value expected Click on the Stop button to stop running the VI G SYSTEM REGUIREMENTS Reguired Hardware e NI ELVIS II or NI ELVIS I e Quanser QNET Rotary Inverted Pendulum Trainer ROTPENT See QNET ROTPENT User Manual 2 Required Software e NI LabVIEW 2010 or later e NI LabVIEW Control Design and Simulation Module e ELVIS II Users NI ELVISmx installs required NI DAQmx drivers e ELVIS I Users NI DAQmx ELVIS CD 3 0 1 or later installed E Caution Ifthese are not all installed then the VI will not be able to run Please make sure all the software and hardware components are installed If an issue arises then see the troubleshooting section in the QNET ROTPENT User Manual 2 6 1 Overview of Files File Name Description QNET ROTPENT User Manual pdf This manual describes t
28. n 4 5 O a A OO N Effect of increasing Dither signal frequency in Step 8 in Section 4 5 IV CONCLUSIONS Interpret your results to arrive at logical conclusions for the following 1 Whether the balance controller meets the specifications in Step 7 in Section 4 4 2 Effect of setting the Dither signal to the identified friction parameters in Step 9 of Section 4 5 7 4 Template for Content Swing Up Control I PROCEDURE 1 Energy Control e Briefly describe the main goal of the experiment e Briefly describe the experimental procedure in Step 7 in Section 5 3 2 Hybrid Swing Up Control e Briefly describe the main goal of the experiment e Briefly describe the experimental procedure in Step 9 in Section 5 4 Il RESULTS Do not interpret or analyze the data in this section Just provide the results 1 Pendulum response from Step 11 in Section 5 3 Ill ANALYSIS Provide details of your calculations methods used for analysis for each of the following 1 Energy at different pendulum position in Step 7 in Section 5 3 2 Effect of changing reference energy in Step 11 in Section 5 3 3 Effect of changing proportional gain in Step 11 in Section 5 3 IV CONCLUSIONS Interpret your results to arrive at logical conclusions for the following 1 Reference energy required to swing up pendulum in Step 10 of Section 5 4 5 DUANS E R 7 5 Tips for Report Format PROFESSIONAL APPEARANCE Has cover page with all n
29. n to stop running the VI 4 5 Balance Control with Friction Compensation 30 min 1 Go through steps 1 7 in Section 4 3 to run the default balance control The pendulum should be balancing 2 Inthe Signal Generator section set e Amplitude 0 0 deg e Frequency 0 10 Hz Q DUAN SER 10 e Offset 0 0 deg In the Dither Signal section set e Amplitude 0 00 V e Frequency 2 50 Hz e Offset 0 00 V Observe the behaviour of Arm Angle deg in the Angle Energy deg mJ scope Intuitively speaking can you find some reasons why the arm is oscillating Increase the Amplitude in the Dither Signal section by steps of 0 1 V until you notice a change in the arm angle response From the Voltage V scope and the pendulum motion what is the Dither signal doing Compare the response of the arm with and without the Dither signal Increase the Frequency in the Dither Signal section starting from 1 00 to 10 0 Hz How does this effect the pendulum arm response Set the Dither Signal properties according to the friction measured in Section 2 4 How does this effect the pendulum arm response Click on the Stop button to stop running the VI 5 SWING UP CONTROL 5 1 Background 5 1 1 Energy Control If the arm angle is kept constant and the pendulum is given an initial position it would swing with constant amplitude Because of friction there will be damping in the oscillation The purpose of energy control
30. nd a state feedback controller to balance the pendulum when in its upright position The main elements of the VI front panel are summarized in Table 5 and identified in Figure 6 5 through the corresponding ID number Description 1 Theta 9 Arm angle numeric display measured by deg encoder on motor 2 Alpha a Pendulum angle numeric display mea deg sured by encoder on pendulum pivot 3 Current Im Motor armature current numeric display A 4 Voltage Vin Motor input voltage numeric display V 5 Signal Type Type of signal generated for the input voltage signal 6 Amplitude Generated signal amplitude input box V 7 Frequency Generated signal frequency input box Hz 8 Offset Generated signal offset input box V 9 Disturbance Via Apply simulated disturbance voltage V 10 Device Selects the NI DAQ device 11 Sampling Rate Sets the sampling rate of the VI Hz 12 Stop Stops the LabVIEW VI from running 13 Scopes Angle 0 a Scope with measured arm angle in red deg and pendulum angle in blue 14 Scopes Voltage Vm Scope with applied motor voltage in V red Table 3 QNET ROTPENT Simple Modeling VI Components 08 0NET ROTPENT Control Design vi Elle Edit view Project Operate Tools Window Help 2 eje ONET ROTPEN Control Design QUANSER Symbolic Model Open Loop Analysis Simulation Model Parameters Symbolic A IMp 2 lp 2 r g eq p
31. ndulum linear state space matrix B 13 Symbolic C C Rotary pendulum linear state space matrix C 14 Symbolic D D Rotary pendulum linear state space matrix D 15 Stop Stops the LabVIEW VI from running 16 Error Out Displays any error encountered in the VI 17 Open Loop Equa Numeric linear state space model of rotary tion pendulum 18 Pole Zero Map Maps pole and zeros of open loop rotary pen dulum system 19 Signal Type Type of signal generated for the arm position reference 20 Amplitude Generated signal amplitude input box V 21 Frequency Generated signal frequency input box Hz 22 Offset Generated signal offset input box V 23 Disturbance Via Apply simulated disturbance voltage V 24 Q Q Linear quadratic weighting matrix that defines a penalty on the state 25 R R Linear quadratic weighting matrix that defines a penalty on the control action 26 Optimal Gain K K State feedback control gain calculated using LQR 27 Arm 9 Scope with reference in blue and measured deg in red arm angles 28 Pendulum a Scope with inverted pendulum angle in blue deg 29 Control Input Vin Scope with applied motor voltage in red V DUANS E R Table 4 QNET ROTPENT Control Design VI Components 08 QNET ROTPENT Swing Up Control vi File Edit View Project ej eu Operate Tools Window Help ONET ROTPEN Swing Up Control eb QUANSER Digital Scopes rm 1 EE 2 m Control Indicator
32. ol 30 min Open the QNET ROTPENT Swing Up Control vi and ensure it is configured as described in Section 6 Make sure the correct Device is chosen Run the QNET ROTPENT Swing Up Control vi The VI should appear similarity as shown in Figure 4 1 In the Balance Control Parameters section ensure the following parameters are set e kp theta 6 50 V rad e kp alpha 80 0 V rad e kd theta 2 75 V rad s e kd alpha 10 5 V rad s In the Swing Up Control Parameters section set e mu 55 m s J e Er 20 0 mJ e max accel 10 m s e Activate Swing Up OFF de pressed Adjust the Angle Energy deg mJ scope scales to see between 250 and 250 see the ROTPEN User Manual 2 for help Manually rotate the pendulum at different levels and examine the blue Pendulum Angle deg and the green Pendulum Energy mJ in the Angle Energy deg mJ scope The pendulum energy is also displayed numeri cally in the Control Indicators section What do you notice about the energy when the pendulum is moved at different positions Record the energy when the pendulum is being balanced i e fully inverted in the upright vertical position Click on the Stop button to bring the pendulum down to the gantry position and re start the VI In the Swing Up Control Parameters section turn ON the Activate Swing Up switch the pressed down posi tion If the pendulum is not moving click on the Disturbance button in t
33. on 2 2 Simple Modeling Virtual Instrument The virtual instrument for studying the physics of the pendulum when in the gantry configuration is shown in Figure 2 3 07 QNET ROTPENT Simple Modeling vi Eile Edit View Project Operate Tools Window Help gt QNET ROTPEN Simple Modeling NATIONAL Device Sampling Rate Hz INSTRUMENTS yr i 250 0 Ae IEN IGU NSER Angle deg Pendulum Angle deg 100 Digital Scopes Theta iis Ru deg Current o0 f A Voltage o1 y Signal Generator Signal Type m Amplitude Joco y Frequency Jo zs Hz 100 5 0 Offset j 0 00 y Voltage V Disturbance OFF Figure 2 3 LabVIEW VI for modeling QNET rotary pendulum 2 3 Damping 15 minl 1 Ensure the QNET ROTPENT Simple Modeling VI is open and configured as described in Section 2 2 Make sure the correct Device is chosen 2 Run the QNET ROTPENT Simple Modeling vi shown in Figure 2 3 3 Hold the arm of the rotary pendulum system stationary and manually perturb the pendulum 4 While still holding the arm examine the response of Pendulum Angle deg in the Angle deg scope This is the response from the pendulum system 5 Repeat 3 above but release the arm after several swings 6 Examine the Pendulum Angle deg response when the arm is not fixed This is the response from the rotary pendulum system Given the response from the pendulum and rotary pendulum system whic
34. ontrol Design vi Run the QNET ROTPENT Control Design vi The front panel of the VI shown in Figure 3 1 Select the Symbolic Model tab The Model Parameters array includes all the rotary pendulum modeling variables that are used in the state space matrices A B C and D Select the Open Loop Analysis tab shown in Figure 3 2 This shows the numerical linear state space model and a pole zero plot of the open loop inverted pendulum system What do you notice about the location of the open loop poles How does that affect the system Recommended In the Mode Parameters section it is recommended to enter the pendulum moment of inertia Jp be determined experimentally in Section 2 5 In the Symbolic Model tab set the pendulum moment of inertia Jp to 1 0 x 107 kg m Select the Open Loop Analysis tab How did the locations of the open loop poles change with the new inertia Enter the pole locations of each system with a different moment of inertia Are the changes of having a pendulum with a lower inertia as expected Reset the pendulum moment of inertia Jp back to 1 77 x 1074 kg m Stop the VI by clicking on the Stop button 3 DUANS E R 3 4 Control Design and Simulation 45 minl gt WwW N 10 11 Open the QNET ROTPENT Control Design vi Select the Simulation tab Run the VI The VI running is shown Figure 3 3 In the Signal Generator section set e Amplitude 45 0 deg e
35. or QNET rotary pendulum balancing control and swing up 4 3 Default Balance Control 30 min 1 Open the QNET ROTPENT Swing Up Control vi and ensure it is configured as described in Section 6 Make sure the correct Device is chosen 2 Run the QNET ROTPENT Swing Up Control vi The VI should appear similarity as shown in Figure 4 1 3 In the Signal Generator section set e Amplitude 0 0 deg e Frequency 0 10 Hz e Offset 0 0 deg 4 In the Balance Control Parameters section set e kp theta 6 5 V rad e kp alpha 80 V rad e kd theta 2 75 V rad s e kd alpha 10 5 V rad s 5 In the Swing Up Control Parameters section set e mu 55 m s2 J e Er 20 0 mJ e max accel 10 m s2 e Activate Swing Up OFF de pressed 6 Adjust the Angle Energy deg mJ scope scales to see between 250 and 250 see Reference 2 for help QNET ROTPENT Laboratory Manual Student Manual 7 Manually rotate the pendulum in the upright position until the In Range LED in the Control Indicators section turns bright green Ensure the encoder cable does not interfere with the pendulum arm motion 8 Vary Offset and observe the Arm Angle deg response in the Angle Energy deg mJ scope Do not set the Offset too high or the encoder cable will interfere with the pendulum arm motion 9 As the pendulum is being balanced describe the red Arm Angle deg and the blue Pendulum Angle deg responses in the Angle Energy deg mJ scope 10 In the
36. s EGRE Signal Generator Signal Type du 6 Amplitude oo deg i Frequency z looo te Offset deg 9 Disturbance QA 0 Dither Signal Amplitude VY Djo oo 1 1 Alpha Voltage In Range Eneray Offset V 99043 Figure 6 5 QNET ROTPENT Swing Up Control VI Frequency Hz js 42 Device Balance Control Parameters kp theta Vjrad TE 4 koaha tired Aoa N kd theta V srad jus kd alpha V sjrad Js 4 T7 Swing Up Control Parameters mu mjs 2 3 D 375 1 8 Er mJ Jos 1 9 max accel m s 2 er 10 2 0 Activate Swing Up qa 1 Model Parameters lo oz7o 22 po 1ss 0 0280 n 30 Jeq fio i Kt 0 0280 28 Rm 113 30 29 Sampling Rate Hz Angle Energy deg mJ 3 Arm Angle deg Pendulum Angle deg Pendulum Energy mJ 200 250 33 z00 250 5 0 1 55 Voltage V Input Voltage W 1 7 0 75 time s 1 8 0 1 8 5 QNET ROTPENT Laboratory Manual Student Manual EET SESS ID Label Symbol Description Unit 1 Theta 9 Arm angle numeric display measured by en deg coder on motor 2 Alpha a Pendulum angle numeric display measured deg by encoder on pendulum pivot 3 Current Im Motor armature current numeric display A 4 In Range Balance controller is engaged when this LED is turns bright green 5 Energy Numeric displ
37. tion Control Input V Signal Type 1 9 EE 277 EE o TJ m 27 29 50 4 Amplitude 1 60 0 20 g B z Ber 23 2 Frequency Ao an Hz 21 4 o Ne 7 Zo y 5 Offset d X 25 4 52 No 0 g y 3 d 44 Disturbance OFF gt 23 75 1 1007 1 1 1 1 sO 1 1 1 1 1 5 6 n 8 9 10 5 6 7 8 9 10 Q 24 rds Simulation Time Simulation Time fioo 0 00 0 00 0 00 Pendulum deg jooo 1 00 000 0 00 10 looo 0 00 1 00 0 00 28 looo 0 00 0 00 1 00 1 R 3 pn 3 1 00 8 o amp Optimal Gain K A 00 86 80 1 52 15 62 m 1 1 1 1 1 6 7 8 9 10 Simulation Time v gt Figure 6 4 QNET ROTPENT Control Design VI Simulationtab ID Label Symbol Description Unit 1 Mp My Mass of pendulum assembly link weight kg 2 Ip lp Center of mass of pendulum assembly m link weight input box 3 r r Length from motor shaft to pendulum pivot m 4 Jp Jp Pendulum moment of inertia relative to pivot kg m2 5 Jeg Jeq Equivalent moment of inertia acting on the DC kg m2 motor shaft 6 Bp Bp Viscous damping about the pendulum pivot N m s rad 7 Beq Be Equivalent viscous damping acting on the DC N m s rad motor shaft 8 Kt Ki DC motor current torque constant N m A 9 Km Km DC motor back emf constant V s rad 10 Rm Em Electrical resistance of the DC motor arma 9 ture 11 Symbolic A A Rotary pendulum linear state space matrix A 12 Symbolic B B Rotary pe
38. xis and I is the center of mass position as depicted in Figure 2 2 Thus as the pivot accelerates towards the left the inertia of the pendulum causes it to swing upwards while the gravitation force Mpg and the applied force Mpu the left hand terms in Equation 2 1 pull the pendulum downwards The moment of inertia of the pendulum can be found experimentally Assuming the pendulum is unactuated lin earizing Equation 2 1 and solving for the differential equation gives the expression J Mp glp P Af g 2 2 where f is the measured frequency of the pendulum as the arm remains rigid The frequency is calculated using Neyc f E 2 3 where n is the number of cycles and At is the duration of these cycles Alternatively J can be calculated using the moment of inertia expression J r dm 2 4 DUANS E R where r is the perpendicular distance between the element mass dm and the axis of rotation In addition to finding the moment of inertia this laboratory investigates the stiction that is present in the system The rotor of the DC motor that moves the ROTPEN system requires a certain amount of current to begin moving In addition the mass from the pendulum system requires even more current to actually begin moving the system The friction is particularly severe for velocities around zero because friction changes sign with the direction of rotation See Wikipedia for more information on center of mass inertia pendulum and fricti

Download Pdf Manuals

image

Related Search

Related Contents

Canada Occupational Health and Safety  B-Air CP-1 ETL BLUE Use and Care Manual  starten  Guida di consultazione rapida  SD400 Series UPGRADE KIT USER`S MANUAL    Hier beginnen HL-2135W /  DeLOCK 0.3m SATA III  CDA-9854L  D-303890 CLIP PG2 Istruzioni di installazione  

Copyright © All rights reserved.
Failed to retrieve file