U of M EE 4237 - Inverted Pendulum using Torsion Control System

Unformatted text preview:

DEPARTMENT OF ELECTRICAL ENGINEERING UNIVERSITY OF MINNESOTA EE 4237 State Space Control Laboratory Experiment 9: Inverted Pendulum using Torsion Control System Objective: 1. To study the LQR design and control implementation of Inverted Pendulum system. References: 1. ECP systems manual (Inverted Pendulum Accessory A51 for Model 205) Apparatus: 1. Inverted Pendulum Accessory A51 2. Torsion control model 205a 3. PC 4. Control Box Prelab Report: 1. What are the design steps in any LQR design? 2. Go through the given program and try to explain what is the functionality of the program. Postlab Report: • Answer the questions asked within or at the end of the procedure.35ecpChapter 5. Experiments5. Experiments 5.1 Model 205 Experiments 5.1.1 Numerical Plant Models In the experiments that follow, the pendulum is set to the following parameters: yr = 42 cm, ym = 32 cm (5.1-1) This is the same configuration used in the Self-guided demonstration. The expressions given in Chapter 4 may be used directly for control modeling except that they must be scaled by the appropriate system gains. The form of the transfer functions is N1(s)D(s)⎡ ⎣ ⎢ ⎤ ⎦ ⎥ Control Model= ksys'kencoder1N1(s)D(s)⎡ ⎣ ⎢ ⎤ ⎦ ⎥ Ch. 4 (5.1-2) N2(s)D(s)⎡ ⎣ ⎢ ⎤ ⎦ ⎥ Control Model= ksys'kencoder 4N1(s)D(s)⎡ ⎣ ⎢ ⎤ ⎦ ⎥ Ch. 4 (5.1-3) where k'sys is the system gain as defined in the Model 205 manual, divided by the Model 205 encoder gain, and kencoder1 and kencoder4 are the gains for encoders 1 and 4 respectively. The gains used in the numerical models that follow are given in Table 5.1-1. For the state space realizations, the scaling is accomplished by substituting for control effort T1=u= ucontroller counts ksys' (5.1-4) and for the angular position coordinates θi= θiencoder counts/ kencoder n, i=1,2; n=1,4 (5.1-5) (Here encoder #4 is associated with θ2 since encoders 2 and 3 are already assigned to other mechanism locations.) Table 5.1-1. Gains For Numerical Models Using the Model 205 Base Unit Parameter Value k'sys 0.00675 (N-m/count) kencder1 2546 (counts/radian) kencder4 2608 (counts/radian)36ecpChapter 5. Experiments Note that the gain k'sys will vary somewhat from system to system due to differences in amplifier gains and motor torque constants. For a more accurate model for a particular system the user should use the identified gain khw for that system according to the Model 205 manual. The subject gain is then found by k'sys = khw / 2546 (5.1-6) (i.e. for the example system presented in this manual, khw = 17.2 N-m/rad) In the expressions that follow, the angular coordinates are in units of encoder counts and the torque is in units of controller counts. 5.1.1.1. Inverted Configuration a) Transfer Functions θ1(s)T1(s)= 966.0s2−30,890s4+1.1242s3− 47.586s2− 35.948s (5.1-7) θ2(s)T1(s)= −806.3ss3+1.1242s2− 47.586s −35.948 (5.1-8) b) State Space Realization A = 01 000 −1.1242 −18.698 000 100 0.9384 47.586 0⎡ ⎣ ⎢ ⎢ ⎢ ⎢ ⎢ ⎤ ⎦ ⎥ ⎥ ⎥ ⎥ ⎥ , B = 0966.00−806.3⎡ ⎣ ⎢ ⎢ ⎢ ⎢ ⎢ ⎤ ⎦ ⎥ ⎥ ⎥ (5.1-9) ⎥ ⎥ where the state vector is as defined in Section 4.6 and the output matrix C may be chosen as per the analysis or implementation need. 5.1.1.2. NonInverted Configuration a) Transfer Functions θ1(s)T1(s)= 966.0s2+30,890s4+1.1242s3+ 47.586s2+ 35.948s (5.1-10)37ecpChapter 5. Experiments θ2(s)T1(s)= 806.3ss3+1.1242s2+ 47.586s + 35.948 (5.1-11) b) State Space Realization A = 01 000 −1.1242 −18.698 000 100 −0.9384 −47.586 0⎡ ⎣ ⎢ ⎢ ⎢ ⎢ ⎢ ⎤ ⎦ ⎥ ⎥ ⎥ ⎥ ⎥ , B = 0966.00806.3⎡ ⎣ ⎢ ⎢ ⎢ ⎢ ⎢ ⎤ ⎦ ⎥ ⎥ ⎥ (5.1-12) ⎥ ⎥ where the state vector is as defined in Section 4.6 and the output matrix C may be chosen as per the analysis or implementation need. Note from the transfer function denominators that the inverted plant is unstable and the noninverted one is stable. 5.1.2 Self-erecting Linear Quadratic Regulator Design In this experiment a linear quadratic controller is designed that minimizes the cost function1 J = x'Qx +u2rdt (5.1-13) We choose Q=C'C and C as the output θ1 exclusively, i.e. C = 1000⎡ ⎣ ⎢ ⎢ ⎢ ⎢ ⎢ ⎤ ⎦ ⎥ ⎥ ⎥ ⎥ ⎥ (5.1-14) so that the solution minimizes the error of the base position (the base position is regulated about the reference input) subject to the control effort weighting r. The control law has the form u= -Kx (5.1-15) Students may use Matlab to solve for the controller gain vector for various specified r. Matlab program will provide the closed loop poles and system step response for each case. We choose values of r equal to 1See for example Kwakernaak and Sivan, "Linear Optimal Control Systems", Wiley & Sons, 1972.38ecpChapter 5. Experiments{1000, 100, 10, 1, 0.1}, and choose the case with the highest closed loop bandwidth subject to the highest frequency system poles being less then or equal to 3 Hz2. Use one of the above obtained K values if it meets this criteria with appropriate r value. And enter the K value into the algorithm provided. An algorithm that implements this controller along with the self-inverting functionality is provided in InvPend205.alg and listed below. ;***********define user variables ************** #define kp_se q1 #define kd_se q2 #define kd_se_d q3 #define k1 q4 #define k2 q5 #define k3 q6 #define k4 q7 #define k2d q8 #define k4d q9 #define kpf q14 #define past_pos1 q15 #define past_pos4 q16 #define uval q17 #define Ts q18 #define gain q19 #define flag q20 #define se_cmd_pos q21 #define enc4_delta q22 #define sign q23 #define enc4_offset q24 #define enc4_inv q25 #define se_step_ampl q26 ;************Initialize variables**************** ;Set Sample period in "Setup Control Algorithm" dialog box same as below Ts=0.00884 kp_se=2; Proportional gain for noninverted control kd_se=.12; Derivative gain for noninverted control kd_se_d=kd_se/Ts; Derivative gain for given sample period flag=0 se_step_ampl=280; Step size for incrementally building noninverted swing amplitude se_cmd_pos=0 ;Gains k1-k4 are state feedback gains - DECOMMENT FOR THE DESIRED DESIGN/PLANT ;The following are LQR gains for the inverted plant k1=-.316 k2=-.107 k3=-1.01 k4=-0.174 ;Derivitive Gains for given sample period k2d=k2/Ts k4d=k4/Ts kpf=k1; Input scaling gain gain=1 2 While it is possible to


View Full Document

U of M EE 4237 - Inverted Pendulum using Torsion Control System

Download Inverted Pendulum using Torsion Control System
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Inverted Pendulum using Torsion Control System and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Inverted Pendulum using Torsion Control System 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?