QUBE-Servo LQR Control Workbook (Student)

March 29, 2018 | Author: Rizkie Denny Pratama | Category: Matrix (Mathematics), Applied Mathematics, Physics & Mathematics, Mathematics, Electrical Engineering


Comments



Description

OPTIMAL LQR CONTROLTopics Covered • Introduction to state-space models. • State-feedback control. • Linear Quadratic Regulator (LQR) optimization. Prerequisites • Filtering Lab. • Balance Control Lab. • Rotary pendulum module is attached to the QUBE-Servo. QUBE-SERVO Workbook - Student Version v 1.0 In our case the state vector x is defined [ x= θ α θ˙ α˙ ]T (1.1 Background Linear Quadratic Regulator (LQR) theory is a technique that is ideally suited for finding the parameters of the pendulum balance controller in the Balance Control Lab.3) This control law is a state-feedback control and is illustrated in Figure 1. the LQR algorithm computes a control law u such that the performance criterion or cost function ∫ ∞ T J= (xref − x(t)) Q (xref − x(t)) + u(t)T Ru(t)dt (1. and the control gains are uniformly decreased. The reference signal xref is set to θr control strategy used to minimize cost function J is thus given by 0 0 u = K(xref − x) = kp. The design matrices Q and R hold the penalties on the deviations of state variables from their setpoint and the control actions. and the (1. Given that the equations of motion of the system can be described in the form x˙ = Ax + Bu.1: Block diagram of balance state-feedback control for rotary pendulum [ Since there is only one control variable. When an element of Q is increased. therefore. a larger penalty is applied to the aggressiveness of the control action. where A and B are the state and input system matrices.θ θ˙ − kd.1. and thus the specific control gain will be larger.1) 0 is minimized.α α − kd. It is equivalent to the PD control explained in the Balance Control lab. the cost function increases the penalty associated with any deviations from the desired setpoint of that state variable.α α. When the values of the R matrix are increased.Student Version 2 . ˙ ] 0 . QUBE-SERVO Workbook . respectively.2) . respectively.θ (θr − θ) − kp. R is a scalar. Figure 1. 0000 0 0 B = 0 0 49.0103 0 1. run the setup_qube_rotpen. 2. In the laboratory.m script. the LQR function computes the feedback control gain automatically.6091 1. In Matlab.2 In-Lab Exercises Construct a QUARCr controller similarly as shown in Figure 2. Figure 2.1493 QUBE-SERVO Workbook .Student Version v 1.0104 -0. C.7275 49. and D. In this experiment.0 . and the weighting matrices Q and R. The A and B matrices should be displayed in the Command Window: A = 0 0 0 0 0 0 149.2751 261.1: Simulink model used with QUARC run optimized balance controller The LQR theory has been packaged in the Matlabr Control Design Module. This loads the QUBE-Servo rotary pendulum state-space model matrices A.1 that balances the pendulum on the QUBE-Servo Rotary Pendulum system using a generated control gain K.1 LQR Control Design 1. the state-space model is already available. Given the model of the system. B. the effect of changing the Q weighting matrix while R is fixed to 1 on the cost function J will be explored.0000 0 -0.in the form of the state-space matrices A and B. 8. 0 0 0 1 generate gain K.1: • Using the angles from the Counts to Angles subsystem you designed in the Balance Control lab (which converts encoder counts to radians).m script in Matlab. is this what you expected? 2. Attach your response of the rotary arm. Build and run the QUARC controller. 4. desired arm angle. Manually rotate the pendulum in the upright position until the controller engages. Change the LQR weighting matrix to the following and generate a new gain control gain:   5 0 0 0 0 1 0 0  Q= 0 0 1 0 and R = 1. To generate a reference state. How does changing q11 affect the generated control gain? Based on the description of LQR in Section 2. construct the controller shown in Figure 2.1. generate the gain using Q = diag([5 1 1 1]) performed in Step 4 in Section 2. What do you notice about the location of the open-loop poles? How does that affect the system? 3. 7. set the Gain to 30 to make the arm angle go between ±30 deg. pendulum.1. 4. • Add the Signal Generator block in order to generate a varying. 0 0 0 1 Record the gain generated.3.Student Version 4 . The diag command specifies the diagonal elements in a square matrix. make sure you include a Gain block of [1 0 0 0]. Using the lqr function with the loaded model and the weighting matrices   1 0 0 0 0 1 0 0  Q= 0 0 1 0 and R = 1. and controller voltage.1.2. To apply the newly designed gain to the running QUARC controller.125 Hz 5. Use the eig command to find the open-loop poles of the system. 2. Use high-pass filters 50s/(s + 50) to compute the velocities θ˙ and α. 9. Load the gain designed in Step 3. 10. Using the Simulink model you made in the Balance Control lab. In Figure 2.2 LQR-Based Balance Control 1. Run setup_qube_rotpen. The scopes should read something similar as shown in Figure 2. Set the Signal Generator block to the following: • Type = Square • Amplitude = 1 • Frequency = 0. go to the Simulink model and select Edit | Update Diagram (or press CTRL-D). Give the value of the control gain generated.2. build state x given in Equation 1. Once the pendulum is balanced. In Matlab. 6. it is bundled in the subsystem called State X. ˙ • Add the necessary Sum and Gain blocks to implement the state-feedback control given in Equation 1. Make sure it is set as variable K in the Matlab workspace.2. QUBE-SERVO Workbook . Since the control gain is a vector. make sure the gain block is configured to do matrix type multiplication. Set the Gain block that is connected to the Signal Generator to 0. 3. 12. 15.2: QUBE-Servo rotary pendulum response 11. QUBE-SERVO Workbook . 14.. 13. Describe your experimental procedure to find the necessary control gain. Power off the QUBE-Servo if no more experiments will be performed in this session. Click on the Stop button to stop running the controller. overshoots) when the arm angle changes.Student Version v 1.0 . Attach the responses using this new control gain and briefly outline how the response changed. Adjust the diagonal elements of Q matrix to reduce how much the pendulum angle deflects (i.e.(a) Rotary Arm (b) Pendulum (c) Motor Voltage Figure 2. Examine and describe the change in the Rotary Arm (deg) and Pendulum (deg) scopes. List the resulting LQR Q matrix and control gain K used to yield the desired results. Ontario L3R 5H6 Canada info@quanser. For more information on the solutions Quanser Inc.com This document and the software described in it are provided subject to a license agreement. and b) You must keep intact all copyright notices for the Work and provide the name Quanser Inc. Quanser Inc. c) to distribute and publically perform the work including as incorporated in collections. The above rights may be exercised in all media and formats whether now known or hereafter devised. and to reproduce the work as incorporated in the collections.Student Version 6 . QUBE-SERVO Workbook . Neither the software nor this document may be used or copied except as specified under the terms of that license agreement. Quanser Inc. b) to create and reproduce adaptations provided reasonable steps are taken to clearly identify the changes that were made to the original work. for attribution.quanser. please visit the web site at: http://www. grants the following rights: a) The right to reproduce the work. These rights are granted subject to and limited by the following restrictions: a) You may not exercise any of the rights granted to You in above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. These restrictions may not be waved without express prior written permission of Quanser Inc. to incorporate the work into one or more collections. offers.com Phone: 1-905-940-3575 Fax: 1-905-940-3576 Printed in Markham. 119 Spy Court Markham.© 2014 Quanser Inc.. All rights reserved. and d) to distribute and publicly perform adaptations. Ontario.
Copyright © 2024 DOKUMEN.SITE Inc.