Home

Guideline

image

Contents

1. 4 4 4 Exercise Swing Up Control Design The preceding calculations should yield a Lyapunov derivative in the form a a V a ka du 30 where g Qup is real valued function that can be either negative or positive depending on the pendulum angle The swing up controller is an expression u that guarantees 30 will be negative or zero V dot E lt 0 for all values of E oup For example determine if V dot E lt 0 for the simple proportional controller u u where u 0 is a user defined control gain Substituting the control u inside 30 gives ay VE H Ea p ga 31 The equilibrium point E a 0 is shown as being unstable using the control u u because V dot E is not negative for all values of E oup Since either the function g Qup or Eloup can be negative 31 can become positive which means V E would not be a decreasing function and as a result E o is not guaranteed to approach zero In conclusion this control design is not suitable for swinging up the pendulum because there is no guarantee the proper acceleration u will be generated such that ou will converge Revision 01 Page 21 QNET Inverted Pendulum Laboratory Manual towards zero Determine and explain if E u O is stable using the following controllers and the V_dot E calculated in Exercise 4 4 3 1 u p E Qup where u20 is a user defined control gain 2 u i E 0 COS OLup 3 u W E Qup dotup t dt
2. QNET_ROTPEN_Lab_04_Inv_Pend_Control vi Please refer to Reference 2 for the setup and wiring information required to carry out the present control laboratory Reference 2 also provides the specifications and a description of the main components composing your system Revision 01 Page 24 QNET Inverted Pendulum Laboratory Manual Before beginning the lab session ensure the system is configured as follows QNET Rotary Pendulum Control Trainer module is connected to the ELVIS ELVIS Communication Switch is set to BYPASS DC power supply is connected to the QNET Rotary Pendulum Control Trainer module The 4 LEDs B 15V 15V 5V on the QNET module should be ON 5 2 Software User Interface Please follow the steps described below Step 1 Read through Section 5 1 and go through the setup guide in Reference 2 Step2 Run the VI controller ONET ROTPEN Lab 04 Inv Pend Control vi shown in Fig ure ae Open Loop Balance daa Swing Up poen Analysis Control Design contro Control Design impiementation Figure 7 QNET ROTPEN VI Step 3 Select the Identify Inertia tab and the front panel shown in Figure 8 should load Revision 01 Page 25 QNET Inverted Pendulum Laboratory Manual Step 4 ONET ROTPEN Freg Detector vi Cek Figure 8 Identifying Inertia of Pendulum VI The top right corner has a panel with an Acguire Data button that stops this VI and goes to the next stage of the
3. cos Otup Revision 01 Page 22 QNET Inverted Pendulum Laboratory Manual 4 u wsgn E Oup ddtup t dt cos Qup where sgn represents the signum function 4 4 5 Controller Implementation The controller that is implemented in LabView is u sat s se s p E a9 cos o jJ 32 max where sat is the saturation function and Uma represents the maximum acceleration of the pendulum pivot The signum function makes for a control with the largest variance and overall tends to perform very well However the problem with using a signum function is the switching is high frequency and can cause the voltage of the motor to chatter In Revision 01 Page 23 QNET Inverted Pendulum Laboratory Manual LabView a smooth approximation of the signum function to help prevent motor damage Given that the maximum motor input voltage is Vm 10V and neglecting the motor back electromotive force constant Km 0 calculate the maximum acceleration of the pendulum pivot Umax using the equations supplied in Section 4 4 2 The control gain u is an acceleration and it basically changes the amount of torque the motor outputs The maximum acceleration Umax is the maximum value that the control gain can be set 5 In Lab Session 5 1 System Hardware Configuration This in lab session is performed using the NI ELVIS system equipped with a QNET ROTPEN board and the Quanser Virtual Instrument VI controller file
4. inverted pendulum laboratory Also in the panel is the sampling rate for the implemented digital controller which is by default set to 200 Hz Adjust the rate according to the system s computing power The RT LED indicates whether real time is being sustained If the RT light goes RED or flickers then the sampling rate needs to be decreased and the VI restarted The VI can be restarted by clicking on the Acguire Data button and selecting the Identify Inertia tab again The scope plots the angle of the pendulum which is denoted by the variable a with respect to time The scope can be frozen for measuring purposes by clicking on the PAUSE PLOT button and a small voltage can be applied to the DC motor by clicking on PERTURB PENDULUM The moment of inertia of a pendulum that oscillates freely after being perturbed is given in 16 The frequency can be measured accurately by taking into account many samples over a large span of time The plot can be cleared by Revision 01 Page 26 QNET Inverted Pendulum Laboratory Manual selecting the PAUSE PLOT button in the top right corner to freeze the scope clicking right on the scope and selecting Clear Plot in the drop down menu The plot should now be initialized to t 0 and paused Un pause the scope by clicking on the RESUME PLOT button and click on the PERTURB PENDULUM button to apply a slight impulse on the pendulum Avoid perturbing the pendulum such that its oscillations exceed S 10
5. numerical value of the poles are given below the plot along with the resulting stability of the closed loop system The step response of the arm angle O t and the pendulum angle a t are plotted in the two graphs on the right side of the VI as shown in Figure 10 The rise time peak time settling time and overshoot of the arm response and the settling time of the pendulum angle response is given Further the start time duration and final time of these responses can be changed in the Time Info section located at the bottom right corner of the VI The balance controller will be designed by tuning the weighing matrix Q and implementing the resulting control gain K on the ROTPEN system The VI that runs the balance control is shown in Figure 11 Revision 01 Page 30 QNET Inverted Pendulum Laboratory Manual QNET ROTPEN Balance Controller vi Lab 4 QNET ROTPEN Inverted Pendulum Implement Balance Controller 2 24 Virad 32 47 Virad 1 03 Vifradis 4 08 Vitradis M oe 1 i 1 1 1 1 1 1 1 1 1 1 1 1 1 InRange 15 561 beak MANA Kei ANA SS YAA 681 169550 20 DE PAMA SE 13 uiis abu an theta deg L STOP Balance Controller Figure 11 Implement Balance Controller VI The pendulum angle measured by the encoder is shown in the above scope and the arm angle is plotted in the bottom scope The VI by default begins with a sampling rate of 400 Hz Adjust the rate according to the system s c
6. will be determined experimentally in this laboratory However the J that was calculated in ROTPEN Laboratory 3 Gantry is still used in this experiment for comparison purposes The viscous damping parameters of the pendulum B and of the arm Beg are regarded as being negligible in this laboratory Similarly in ROTPEN Laboratory 3 the linear equations of motion of the system are found by linearizing the nonlinear equations of motions or EOMs presented in 1 about the operation point a x and solving for the acceleration of the terms 0 and a For the state T x Xp x X XI 3 where x a x a 4 9 A a x E 23 3 Ot and 4 t 41 the linear state space representation of the ROTPEN Inverted Pendulum is S x t Ax t Bu x 5 V4 2C x t Du x Revision 01 Page 6 QNET Inverted Pendulum Laboratory Manual where u x V and the A B C and D matrices are State Space Matrix Expression 0 0 1 0 0 0 0 1 rM Ig KK JAMI 0 P p T t m p Pp 0 2 2 A JJ MI J JMrP JJ MI J JM P R p eq PP eq P P p eq Pp eq P p m MI g J M r MLKrK Pp eq p pp t m 0 JJ 4MIJ 4 MP QJ AMI JI JM PR p eq pp eq P p P eq Pp eq P p m 0 0 K J M 1 t P PP B JJ 24M 0J J MrR p eq P P eq P P m M IKr J J M i J J M R 1000 0100 2 0010 0001 0 0 Bg 0 0 Table 3 Linear State Space Matrices 4 1 2 LQR Control Design The problem of balancing an inverted pendulum is like
7. 0 which is the angle the pendulum will be swinging about in order to measure its frequency 4 3 2 Exercise Differential Equation Solution Solve the linear differential equation found in 13 for a t given that its initial conditions are d a 0 a sd Tn 14 The solution should be in the form a t o cos 2 tft 15 where f is the frequency of the pendulum in Hertz Revision 01 Page 14 QNET Inverted Pendulum Laboratory Manual 4 3 3 Relating Pendulum Inertia and Frequency Solving the frequency expression in 15 for the moment of inertia of the pendulum J should yield the equation 1 M 84 P 4 Rp 16 where M is the mass of the pendulum assembly l is the center of mass of the pendulum system g is the gravitational acceleration and f is the frequency of the pendulum Expression 16 will be used in the in lab session to find the pendulum moment of inertia in terms of the frequency measured when the pendulum is allowed to swing freely after a perturbation The frequency can be measured using Revision 01 Page 15 QNET Inverted Pendulum Laboratory Manual i f 1 5 17 where Nyc is the number of cycles within the time duration ti to to is the time when the first cycle begins and tj is the time of the last cycle 4 4 Pre Lab Assignment 3 Swing Up Control Design The controller using the Linear Quadratic Regulator technique in Section 4 1 balances the pendulum in the uprig
8. E oo o 2 2 2 M r sin 0 1 Ja M r J M L Ja 4 L M 5 bm cos 0 Bs 2 2 2 M r sin 0 1 Uum cM r J M L Ja where the torque generated at the arm pivot by the motor voltage Vm is K V K 2 O t t m m dt 2 output R m The ROTPEN model parameters used in 1 and 2 are defined in Table 2 Symbol Description Value Unit M Mass of the pendulum assembly weight and link kg combined 0 027 lp Length of pendulum center of mass from pivot m Lp Total length of pendulum 0 191 m r Length of arm pivot to pendulum pivot 0 08260 m Revision 01 Page 5 QNET Inverted Pendulum Laboratory Manual Symbol Description Value Unit Jin Motor shaft moment of inertia 3 00E 005 kg m Man Mass of arm 0 028 kg g Gravitational acceleration constant 9 810 m s Ja Equivalent moment of inertia about motor shaft kg m pivot axis 1 23E 004 Jp Pendulum moment of inertia about its pivot axis kg m Beg Arm viscous damping 0 000 N m rad s B Pendulum viscous damping 0 000 N m rad s Rn Motor armature resistance 3 30 Q K Motor torque constant 0 02797 N m Km Motor back electromotive force constant 0 02797 V rad s Table 2 ROTPEN Model Nomenclature The pendulum center of mass lj is not given in Table 2 since it was calculated in the previous experiment ROTPEN Laboratory 3 Gantry The moment of inertia parameter Jp is not given because it
9. Quanser NI ELVIS Trainer QNET Series QNET Experiment 04 Inverted Pendulum Control Rotary Pendulum ROTPEN Inverted Pendulum Trainer Co r SOS wean 9 p T TURPE sewaan LABVIEW Student Manual QNET Inverted Pendulum Laboratory Manual Table of Contents Laboratory Object V Seienn nana ba au a vs Bu 1 2 WR EPOOMCES cust sean Peni mu mama RTA an Nasa LARAS 1 3 ROTPEN Plant Presentation an ma ma ea man ia 1 3 1 Component Nomendlatute obatan ken ter dat sig es Eq ned dig Joss kan 1 3 2 ROTPEN Plant Description seriei sacs AB Nun Dana 2 d Re bab A SSISnmeliiso sng ln UN ide dde i dus te eh 3 41 Balance Control Designs eese eco dutem tac ce Coane Gees du usa RE Reli 3 Al Open Loop Modells en ni tque iode Ne eto Mie Ces ORB etu SSRN 3 4 1 2 LOR Control DeSIgri iias esce era nera aan alan dusun 7 4 1 3 Inverted Pendulum Control Specifications sene 9 4 2 Pre Lab Assignment 1 Open loop Modeling of the Pendulum 9 4 2 1 Exercise KIinematieS bana sh ite taste erede pta set im eod Eben akan 10 4 7 2 Bxercise Potential EME Ne Aan KE 11 2 2 3 Exercise Knee BBergy soe BENAR SN REA vases Ges 11 4 2 4 Exercise Lagrange of SYSTEM coe n da Tni ana An 12 4 2 5 Exercise Euler Lagrange Equations of Motions oooocc 12 4 3 Pre Lab Assignment 2 Finding Inertia of the Pendulum Experimentally 13 4 3 1 Exercise Lin
10. The frequency of the pendulum can be found using 17 re stated here cyc where n yc is the number of cycles within the time duration t to to is the time when the first cycle begins and t is the time of the last cycle Enter the measured number of cycles and the time duration as well as the calculated frequency and inertia using expression 24 in Table 4 Parameter Table 4 Experimental Inertia Parameters Step 5 Calculate the discrepancy between the experimentally derived inertia Jp in Table 4 and the inertia calculated analytically J in Pre Lab Exercise 4 3 from ROTPEN Gantry Laboratory 3 Enter the result below Discrepancy Value Unit 100 J 1 17 D p a ral Pp al List one reason why the measured inertia is not the same as the calculated result Revision 01 Page 27 QNET Inverted Pendulum Laboratory Manual Step 6 Click on the Acquire Data button when the inertia has been identified and this uae bring you to the Co ntrol Design tab shown in Figure 9 dulum_Control vi ROTPEN_L nv al Cl Th TEE sms Figure 9 Open Loop Stability Analysis Revision 01 Page 28 QNET Inverted Pendulum Laboratory Manual Step 7 Step 8 Step 9 Update the model parameter values in the top right corner with the pendulum center of mass lp calculated in ROTPEN Gantry Laboratory 3 as well as the pendulum s moment of inertia just identified The linea
11. a 24 Volt DC motor that is coupled with an encoder and is mounted vertically in the metal chamber The L shaped arm or hub is connected to the motor shaft and pivots between 180 degrees At the end of the arm there is a suspended pendulum attached The pendulum angle is measured by an encoder Revision 01 Page 2 QNET Inverted Pendulum Laboratory Manual 4 Pre Lab Assignments This section must be read understood and performed before you go to the laboratory session The first section Section 4 1 summarizes the control design method using the linear quadratic regulator technique to construct the balance control Section 4 2 is the first pre lab exercise and involves modeling the open loop pendulum using Lagrangian The second pre lab assignment in Section 4 3 develops the equations needed to experimentally identify the pendulum inertia Lastly the last pre lab exercise in Section 4 4 is designing the swing up control 4 1 Balance Control Design Section 4 1 1 discusses the model of the inverted pendulum and the resulting linear state space representation of the device The design of a controller that balances an inverted pendulum is summarized in Section 4 1 2 4 1 1 Open Loop Modeling As already discussed in the gantry experiment ROTPEN Laboratory 3 the ROTPEN plant is free to move in two rotary directions Thus it is a two degree of freedom or 2 DOF system As described in Figure 2 the arm rotates about the YO a
12. aining sufficient readings from the encoders when the pendulum is swinging up can result in the balance controller having difficulty catching the pendulum Revision 01 Page 34 QNET Inverted Pendulum Laboratory Manual Step 17 Step 18 Step 19 Step 20 Before running the swing up control ensure the pendulum is motionless and the pendulum encoder cable is not entangled in any way When ready click and hold the Activate Swing Up switch to enable the motor and run the swing up controller On the other hand ensure the button is released immediately when the pendulum goes unstable Tuning the swing up control gain is an iterative process Thus based on the behaviour and performance of the controller click on the Stop Controller button to return to the Swing Up Control tab and adjust the u accordingly Avoid setting setting the gain too high i e closer to Umax since it can make the pendulum swing up too rapidly and cause the balance controller to have difficulty catching the pendulum in order to balance it On the other hand the gain has to be sufficient to drive the pendulum within 30 degrees of its upright position Finally the pendulum can self erect in one swing with a properly tuned controller Once the pendulum can be swung up and balanced show the run to the teaching assistant and enter the resulting swing up control gain u and the balance control vector gain K in Table 6 The balance control gain is formatted i
13. balancing a vertical stick with your hand by moving it back and forth Thus by supplying the appropriate linear force the stick can be kept more or less vertical In this case the pendulum is being balanced by applying Revision 01 Page 7 QNET Inverted Pendulum Laboratory Manual torque to the arm The balance controller supplies a motor voltage that applies a torque to the pendulum pivot and the amount of voltage supplied depends on the angular position and speed of both the arm and the pendulum Recall that the linear quadratic regulator problem is given a plant model d gi A XC Butt 6 find a control input u that minimizes the cost function x t O x t u t R u t dt 7 0 where Q is an nxn positive semidefinite weighing matrix and R is an rxr positive definite symmetric matrix That is find a control gain K in the state feedback control law u Kx 8 such that the quadratic cost function J is minimized The Q and R matrices set by the user affects the optimal control gain that is generated to minimize J The closed loop control performance is affected by changing the Q and R weighing matrices Generally the control input u will work harder and therefore a larger gain K will be generated if Q is made larger Likewise a larger gain will be computed by the LQR algorithm if the R weighing matrix is made smaller Control Law Plant u t K x t 6 4 h 0 60 0 0 Vm Figure 3 Closed Loop Co
14. ctly actuated is a control variable Later the dynamics between the input voltage of the DC motor and the torque applied to the pendulum pivot will be expressed The Lagrange method will be used to find the nonlinear equations of motion of the pendulum Thus the kinematics potential energy and kinetic energy are first calculated and the equations of motion are found using Euler Lagrange Revision 01 Page 9 QNET Inverted Pendulum Laboratory Manual Figure 4 Free body diagram of pendulum considered a single rigid body 4 2 1 Exercise Kinematics Figure 4 is the pendulum of the ROTPEN system when being considered as a single rigid object It rotates about the axis zo at an angle a that is positive by convention when the pendulum moves in the counter clockwise fashion Further a 0 when the pendulum is in the vertical downward position Find the forward kinematics of the center of mass or CM of the pendulum with respect to the base frame ooxoyozo as shown in Figure 4 More specifically express the position x and y of the CM and the velocity xd and yd of the pendulum CM in terms of the angle a Revision 01 Page 10 QNET Inverted Pendulum Laboratory Manual 4 2 2 Exercise Potential Energy Express the total potential energy to be denoted as Ur a of the rotary pendulum system The gravitational potential energy depends on the vertical position of the pendulum center of mass The potential energy expressi
15. earize Nonlinear EOMs of Pendulum oooooo 14 4 3 2 Exercise Differential Equation Solution ooooo 14 4 3 3 Relating Pendulum Inertia and Freguency oooooo oo 15 4 4 Pre Lab Assignment 3 Swing Up Control Design oooooo oo 16 4 4 1 Exercise Re defining System Dynamics oooooo oo 17 4 4 2 Exercise Actuator Dy NANOS ne aan ans econ so cote ease NB NS 18 4 4 3 Lyapsnov Function REA NK BN nes 19 4 4 4 Swing Up Control Design 5 einan nana ana 21 4 4 5 Controller Implementation oooWoooomanaakaaaan 23 AUDENT REM 24 5 1 System Hardware Configuration uie esee et t ESTO SER rr sie E LES qa tto ede aue 24 5 2 S0ftWar D Ser DnterEae 8s shoes etae qa iita e NN EN hai 25 Document Number 576 Revision 01 Page i QNET Inverted Pendulum Laboratory Manual 1 Laboratory Objectives The inverted pendulum is a classic experiment used to teach dynamics and control systems In this laboratory the pendulum dynamics are derived using Lagrangian equations and an introduction to nonlinear control is made There are two control challenges designing a balance controller and designing a swing up control After manually initializing the pendulum in the upright vertical position the balance controller moves the rotary arm to keep the pendulum in this upright position It is designed usin
16. g the Linear Quadratic Regulator technique on a linearized model of the rotary pendulum system The swing up controller drives the pendulum from its suspended downward position to the vertical upright position where the balance controller can then be used to balance the link The pendulum equation of motion is derived using Lagrangian principles and the pendulum moment of inertia is identified experimentally to obtain a model that represents the pendulum more accurately The swing up controller is designed using the pendulum model and a Lyapunov function Lyapunov functions are commonly used in control theory and design and it will be introduced to design the nonlinear swing up control 2 References 1 ONET ROTPEN User Manual 2 NI ELVIS User Manual 3 ONET Experiment 03 ROTPEN Gantry Control 3 ROTPEN Plant Presentation 3 1 Component Nomenclature As a quick nomenclature Table 1 below provides a list of the principal elements Revision 01 Page 1 QNET Inverted Pendulum Laboratory Manual composing the Rotary Pendulum ROTPEN Trainer system Every element is located and identified through a unique identification ID number on the ROTPEN plant represented in Figure 1 below ID Description ID Description 1 DC Motor 3 Arm 2 Motor Arm Encoder 4 Pendulum Table 1 ROTPEN Component Nomenclature Figure 1 ROTPEN System 3 2 ROTPEN Plant Description The QNET ROTPEN Trainer system consists of
17. gy such that E 30 J The swing up control computes a pivot acceleration that is required to bring E down to zero and self erect the pendulum The control will be designed using the following Lyapunov function Revision 01 Page 19 QNET Inverted Pendulum Laboratory Manual 1 2 V E 5 E a 26 where E Qup was found in Exercise 4 4 1 By Lyapunov s stability theorem the equilibrium point E oup 0 is stable if the following properties hold 2 9 lt VCE for all values of E Oup 0 27 V E lt 0 3 t for all values of E Qup The equilibrium point E oup O is stable if the time derivative of function V E is negative or zero for all values of E Qup The function V E approaches zero when its time derivative is negative i e its a decreasing function and that implies its variable E Qup converges to zero as well According to the energy expression in 20 this means the upright angle converges to zero as well The derivative of V E is given by 0 0 g V E 28 Compute the Lyapunov derivative in 28 First calculate the time derivative of E oup 0 o Pe 29 and make the corresponding substitutions using the re defined dynamics in 19 that introduces the pivot acceleration control variable u When expressing the Lyapunov derivative leave E Qup as a variable in 28 and do not substitute the expression of E oup in 20 Revision 01 Page 20 QNET Inverted Pendulum Laboratory Manual
18. h is already given in 2 is d K v 500 n dt 22 output m The torque applied to the arm moves the pendulum pivot situated at the end of arm at an acceleration u thus Revision 01 Page 18 QNET Inverted Pendulum Laboratory Manual V oup B M s Er 23 where Mam is the mass of the arm and r is the length between the arm pivot and pendulum pivot These parameters are both defined in Table 2 As shown above in Figure 6 the resulting torque applied on the pivot of the pendulum from acceleration u is T end Gaye u l F end cos o 24 where l is the length between the pendulum CM and its axis of rotation and F Mu pend P 25 As depicted in Figure 6 the force acting on the pendulum due to the pivot acceleration is defined as being negative in the xo direction for a positive u going along the Xo axis The swing up controller computes a desired acceleration u and a voltage must be given that can achieve that acceleration Express the input DC motor voltage in terms of u using the above equations 4 4 3 Exercise Lyapunov Function The goal of the self erecting control is for Oup t to converge to zero or Oup t gt 0 in a finite time f Instead of dealing with the angle directly the controller will be designed to stabilize the energy of the pendulum using expression 20 The idea is that if E 0 J then ouplt gt 0 Thus the controller will be designed to regulate the ener
19. ht vertical position after it is manually rotated within a certain range about its upright vertical angle In this section a controller is designed to automatically swing the pendulum in the upwards vertical position Once the pendulum is within the range of the balance controller it kicks in and balances the pendulum The closed loop system that uses the swing up controller and the balance controller is depicted in Figure 5 Swing Up Controller u t g 6 a a Control Switch 8 0 h 0 8 0 0 Vm Balance Controller ux t Kx t Figure 5 Swing Up Balance Closed Loop System The swing up controller computes the torque that needs to be applied at the base of arm such that the pendulum can be rotated upwards It is a nonlinear control that uses the pendulum energy to self erect the pendulum The swing up controller will be designed using a Lyapunov function Lyapunov functions are often used to study the stability properties of systems and can be used to design controllers Revision 01 Page 16 QNET Inverted Pendulum Laboratory Manual 4 4 1 Exercise Re defining System Dynamics The controller that will be designed attempts to minimize an expression that is a function of the system s total energy In order to rotate the pendulum into its upwards vertical position the total energy of the pendulum and its dynamics must be redefined in terms of the angle z aM 18 resulting in the system show
20. n Table 6 as in 34 V rad V rad V rad s V rad s Table 6 Final Swing Up and Balance Control Gain Implemented Click on Stop Controller and the Swing Up Control tab should become selected If all the data necessary to fill the shaded regions of the tables is collected end the QNET ROTPEN Inverted Pendulum laboratory by turning off the PROTOTYPING POWER BOARD switch and the SYSTEM POWER switch at the back of the ELVIS unit Unplug the module AC cord Finally end the laboratory session by selecting the Stop button on the VI Revision 01 Page 35
21. n in Figure 6 Thus angle zero is defined to be when the pendulum is vertically upright The translational acceleration of the pendulum pivot is denoted by the variable u and is m s yo Oyp 0 Fpena COS Otup OxoYoZo Xo Oyp 1 2 Z9 Op Figure 6 New Angle Definition Re define the nonlinear pendulum eguations of motion found in Exercise 4 2 5 in terms of Olup e s ar a Trini x s u 19 and for the Lagrange calculated in Exercise 4 2 4 express energy E with respect to the upright angle E ap L aoe T l 20 Revision 01 Page 17 QNET Inverted Pendulum Laboratory Manual Given the pendulum is not moving the pendulum energy should be zero when it is vertically upright thus E 0 0 J and should be negative when in the vertically down position more specifically E 1 2 Mn he 21 4 4 2 Exercise Actuator Dynamics The swing up controller that will be designed generates an acceleration at which the pendulum pivot should be moving at denoted as u in Figure 6 The pendulum pivot acceleration however is not directly controllable the input voltage of the DC motor voltage of the ROTPEN system is the input that is controlled by the computer The dynamics between the acceleration of the pendulum pivot u and the input motor voltage Vm is required to supply the acceleration that is commanded by the swing up control The dynamics between the torque applied at the arm by the motor whic
22. ntrol System The closed loop system that balances the pendulum is shown in Figure 3 The controller computes a voltage Vm depending on the position and velocity of the arm and pendulum angles The box labeled Plant shown in Figure 3 represents the nonlinear dynamics given in 1 and 2 Similarly to the gantry experiment the LOR gain K is automatically generated in the LabView Virtual Instrument by tuning the Q and R matrix Revision 01 Page 8 QNET Inverted Pendulum Laboratory Manual 4 1 3 Inverted Pendulum Control Specifications Design an LQR control that is tune the Q weighing matrix such that the closed loop response meets the following specifications 1 Arm Regulation 6 t lt 30 2 Pendulum Regulation lo t lt 1 5 3 Control input limit Vm lt 10 V Thus the control should regulate the arm about zero degrees within 30 as it balances the pendulum without angle a going beyond 1 5 The arm angle is re defined to zero degrees 0 0 when the balance controller is activated Additionally the control input must be kept under the voltage range of the motor 10 Volts 4 2 Pre Lab Assignment 1 Open loop Modeling of the Pendulum In Reference 3 the full model representing the two degrees of freedom motion of the gantry was developed using Lagrange The following exercises deals instead with modeling only the pendulum shown in Figure 4 and assuming that the torque at the pendulum pivot which is not dire
23. omputing power The RT LED indicates whether real time is being sustained If the RT light goes RED or flickers then the sampling rate needs to be decreased and the VI restarted On the other hand make sure the sampling rate is not set too low Not attaining sufficient readings from the encoders can cause the digitally implemented controller to become unstable The Stop Controller button stops the control and returns the user to the control design tab where adjustments to the control can be made or the session can be ended The balance controller gain generated by LQR in the Control Design tab is displayed in the panel along the left margin of the VI The In Range LED indicates whether the pendulum is placed within the angular range that activates the balance control The STOP Balance Controller button disables the balance controller when it is pressed but does not stop the VI Step 12 For the Q and R weighing matrices Revision 01 Page 31 QNET Inverted Pendulum Laboratory Manual q 0 0 0 0 4 0 0 Q o o 0 ds 33 0 0 0 4 R 1 vary the q q2 q3 and q4 elements as specified in Table 5 and record the maximum amplitude range of the pendulum angle a and the arm angle 0 in the same table Thus in the Control Design tab adjust the Q matrix accordingly and then click on the Implement Balance Control tab to run the controller on the ROTPEN system A Ensure the pendulum is motionless before clicking on the Implement Balance Con
24. on should be 0 Joules when the pendulum is at a 0 the downward position and is positive when the a gt 0 It should reach its maximum value when the pendulum is upright and perfectly vertical 4 2 3 Exercise Kinetic Energy Find the total kinetic energy T of the pendulum In this case the system being considered is a pendulum that rotates about a fixed pivot therefore the entire kinetic energy is rotational kinetic energy Revision 01 Page 11 QNET Inverted Pendulum Laboratory Manual 4 2 4 Exercise Lagrange of System Calculate the Lagrangian of the pendulum d Lf Fats 7 U 9 where T is the total kinetic energy calculated in Exercise 4 2 3 and U is the total potential energy of the system calculated in Exercise 4 2 2 4 2 5 Exercise Euler Lagrange Equations of Motions The Euler Lagrange equations of motion are calculated from the Lagrangian of a system using Oo 0 where for an n degree of freedom or n DOF structure i 1 n qi is a generalized coordinate and Q is a generalized force For the 1 DOF pendulum being considered qi t a t and the generalized force is d Q T E P ac 11 where Tpena is the torque applied to the pendulum pivot The generalized force expression Revision 01 Page 12 QNET Inverted Pendulum Laboratory Manual 11 above becomes Qi Tpena since the viscous damping of the pendulum Bp is regarded as being negligible Calcula
25. ontrol Design tab Select the tab labeled Swing Up Control shown in Figure 12 The swing up control law being implemented is shown in the VI Set the maximum acceleration Umax that was calculated in Exercise 4 4 5 and can be set as well as the control gain for the swing up controller u Set the maximum acceleration of the pendulum pivot Umax to the value that was found in Exercise 4 4 5 and initially set the control gain to 5096 of the maximum acceleration thus set u 0 5 Umax Figure 12 Swing Up Controller Design VI Revision 01 Page 33 QNET Inverted Pendulum Laboratory Manual Step 15 Step 16 Click on the Implement Swing Up Control tab to run the swing up controller and the VI shown in Figure 13 should load ONET ROTPEN Swing Up Con Figure 13 Implement Swing Up Control VI The top panel has the Stop Controller button that stops the VI and goes back to the Swing Up Control tab where the swing up gain can be tuned Similarly to the balance controller implementation VI the Sampling Rate RT and Simulation Time is given By default the sampling rate is set to 350 Hz When the pendulum enters the range of the balance controller the In Range LED will become lit The scope displays the measured pendulum angle If the RT light goes RED or flickers then the sampling rate needs to be decreased and the VI restarted However it is very important to make sure that the sampling rate is not set too low Not att
26. r state space model matrices A and B on the top right corner of the front panel as well as the open loop poles situated directly below the state matrices are automatically updated as the parameters are changed Directly beneath the open loop poles in this VI it indicates the stability of the inverted pendulum system as being unstable as shown in Figure 9 According to the poles why is the open loop inverted pendulum considered to be unstable As depicted in Figure 9 the controllability matrix is shown in the bottom right area of the front panel along with an LED indicating whether the system is controllable or not The rank test of the controllability matrix gives rank B AB A B A3B 4 and is equal to the number of states in the system This verifies that the inverted pendulum is controllable and as a result a controller can be constructed Click on the Closed Loop System tab shown in Figure 10 to begin the LQR control design Revision 01 Page 29 QNET Inverted Pendulum Laboratory Manual Step 10 Step 11 ONET ROTPEN Lab 04 Inv Pendulum Control vi oo o oo disco 5 Figure 10 LOR Control Design Front Panel The Q and R weighing matrices and the resulting control gain K is in the top left corner of the panel Directly below the LOR Control Design section is a pole zero plot that shows the locations of the closed loop poles The
27. te the nonlinear equation of motion of the pendulum using 10 on the Lagrange calculated in Exercise 4 2 4 The answer should be in the form e o ar E Tend 12 where the function f represents the differential equation in terms of the position and acceleration of the pendulum angle a Do not express in terms of generalized coordinates 4 3 Pre Lab Assignment 2 Finding Inertia of the Pendulum Experimentally The inertia of the pendulum about its pivot point was calculated analytically using integrals in the previous gantry experiment ROTPEN Laboratory 3 In this laboratory the inertia of the pendulum is found experimentally by measuring the frequency at which the pendulum freely oscillates The nonlinear equation of motion derived in the previous exercise is used to find a formula that relates frequency and inertia The nonlinear equation of motion must first be linearized about a point and then solved for angle a Revision 01 Page 13 QNET Inverted Pendulum Laboratory Manual 4 3 1 Exercise Linearize Nonlinear EOMs of Pendulum The inertia is found by measuring the frequency of the pendulum when it is allowed to swing freely or without actuation Thus the torque at the pivot is zero Tpena 0 and the nonlinear EOM found in 12 becomes e Q 0 0 13 o 113 where f is the differential expression in 12 that represents the motions of the pendulum Linearize function 13 about the operating point a
28. trol tab and running the controller Also verify that the pendulum encoder cable is not positioned such that it will get entangled in the motor shaft However before implementing the updated LQR balance control with the newly changed Q matrix observe its effects on the a t and O t step responses Referring to the feedback loop in Figure 3 for the LQR gain T K Ik e k a k e k a 34 the control input u t that enters the DC motor input voltage is Ya k 0 i k a f i k 0 x k a 35 where kj is the proportional gain acting on the arm kp is the proportional gain of the pendulum angle k is the velocity gain of the arm and k is the velocity gain of the pendulum Observe the effects that changing the weighing matrix Q has on the gain K generated and hence how that effects the properties of the both step responses q4 Max lal deg Max 101 deg Table 5 LQR Control Design Revision 01 Page 32 QNET Inverted Pendulum Laboratory Manual Step 13 Re stating the balance control specifications given in Section 4 1 4 1 Arm Regulation 0 t lt 30 0 2 Pendulum Regulation la t lt 1 5 3 Control input limit Vm lt 10 V Find the qi q2 q3 and q elements that results in specifications 1 2 and 3 being satisfied Record the Q matrix elements used and the resulting angle limits in Table 5 Step 14 Click on the Stop Controller button to stop the balance control which returns to the C
29. xis and its angle is denoted by the symbol 0 while the pendulum attached to the arm rotates about its pivot and its angle is called a The shaft of the DC motor is connected to the arm pivot and the input voltage of the motor is the control variable Revision 01 Page 3 QNET Inverted Pendulum Laboratory Manual Figure 2 Rotary Pendulum System In the inverted pendulum experiment the pendulum angle a is defined to be positive when the it rotates counter clockwise That is as the arm moves in the positive clockwise direction the inverted pendulum moves clockwise i e the suspended pendulum moves counter clockwise and that is defined as a gt 0 Recall that in the gantry device when the arm rotates in the positive clockwise direction the pendulum moves clockwise which in turn is defined as being positive The nonlinear dynamics between the angle of the arm 0 the angle of the pendulum a and the torque applied at the arm pivot Toutput are Revision 01 Page 4 QNET Inverted Pendulum Laboratory Manual gp M g 1 r cos 0 1 a t dt ime 2 2 po 2 _ 2 Mr sin O t Ja Mr J M L Ja 2 d J M r cos 0 1 sin 0 1 4 oo Qus 2 2 2 Mr sin 0 1 J 7M J M L Ja J M l x p output p P output 2 2 2 2 Mr sin O t eM T J M L Ja 1 26 E 2 ab _ L M C g M r sin O t g M rg a t de 2 2 r Wr 2 M r sin 0 t J M r DJ M L Ja d 2 l M rsin 0 1 Ja

Download Pdf Manuals

image

Related Search

Guideline guideline guideline 401k guideline 401k login guidelines synonym guideline retirement guideline login guideline guru guidelines definition guideline central guideline calculator child support guidelines for pap smears by age guideline directed medical therapy guidelines international network guidelines esc guidelines heart failure guidelines epo guidelines hypertension guidelines 2024 guidelines diabetes guidelines discord guidelines endocarditis guidelines hepatitis c guidelines for offshore marine operations

Related Contents

PALMER - PPB10  Radica Games TOTAL MELTDOWN 74008 User's Manual  En savoir plus  取扱説明書  Havis-Shields KK-X-ST-RP User's Manual    LEGAL CASES MONITORING SYSTEM  Manuel d`utilisation    S-11 S-21W  

Copyright © All rights reserved.
Failed to retrieve file