Sunteți pe pagina 1din 11

Experiment 106.

pendulum 1 Objective

Stabilisation of a rotary inverted

This experiment is aimed at providing you with hands on experience of the design of a stabilising controller for a rotary inverted pendulum.

Introduction

The rotary motion inverted pendulum, which is shown in Figure 1, is driven by a rotary servo motor system (SRV-02) that is illustrated in Figure 2. The servo motor drives an independent output gear whose angular position is measured by an encoder. The rotary pendulum arm is mounted to an output gear. At the end of the pendulum arm is a hinge instrumented with another encoder. The pendulum attaches to the hinge. The second encoder measures the angular position of the pendulum. The system is interfaced by means of a data acquisition card and driven by Matlab R /Simulink R based real time software. Notice that the pendulum has two equilibrium points. A stable equilibrium at the point where the rod is vertical and pointing down. An unstable equilibrium at the point where the rod is vertical and pointing up. In this practical session, a control scheme will be designed to stabilise the pendulum around the unstable equilibrium point.

3
3.1

Mathematical modelling
Nonlinear model

Consider the diagram shown in Figure 3. A nonlinear model of this system, which can be derived by means of the Euler-Lagrange equations, is given by: (mp r2 + Jb ) + mp rlp cos() mp r2 lp sin = T mp lp cos()r mp lp sin()r + mp l2 mp glp sin = 0
p

(1)

where the symbols used are described in Table 1. Note that the zero position for and are dened as the pendulum being vertical up. A positive angle in the pendulum is dened for a fall to the right when looking at the pendulum from the motor shaft. A positive rotation of the arm is dened as clockwise when looking at the SRV-02 from above. Also note that parameter lp is half the pendulum length.

Figure 1: The rotary inverted pendulum

3.2

Linearised model

A linearised form of Equation (1) around the vertical (up) unstable equilibrium point is given by: mp rg 1 = + T Jb Jb (2) 2 g(Jb + mp r ) r = T lp Jb lp Jb This model is valid for small values of . In the Laplace domain, it is possible to write the transformed form of (2) as follows: 1 mp rg (s) + T (s) Jb Jb g(Jb + mp r2 ) r s2 (s) = (s) T (s) l p Jb lp Jb s2 (s) =

(3)

Table 1: Description of the mathematical model variables and parameters Variable Description Units Value T input torque from motor Nm mp mass of rod kg 0.125 lp distance from arm to the centre of gravity of rod m 0.1714 r length of pendulum arm m 0.2159 Jb Inertia of arm and gears kg m 0.0038 g Acceleration of gravity m/s2 9.8 Deection of arm from zero position rad Deection of pendulum from vertical UP position rad Angular velocity of rad/s Angular acceleration of rad/s2 Angular velocity of rad/s Angular acceleration of rad/s2

Figure 2: SRV02 servo-motor with the pendulum arm and connections where s is the Laplace variable, (s), (s) and T (s) represent the Laplace transforms of , and T , respectively. Dene the following auxiliary parameters: a= mp rg Jb 1 b= Jb g(Jb + mp r2 ) c= l p Jb r d= lp Jb

(4)

Pendulum rod

2l p
Pendulum arm

Figure 3: Diagram of the rotary inverted pendulum Then, Equation (3) can be rewritten as follows: s2 (s) = a(s) + bT (s) s2 (s) = c(s) dT (s) From Equation (5), we have that (s) can be written as follows: (s) = s2 d T (s) p2 (6) (5)

where p = c. Substituting in the rst sub-equation of (3), results in the following equation for (s): (s) = where z= bc ad b (8) b(s2 z 2 ) T (s) s2 (s2 p2 ) (7)

Table 2: Variables and parameters associated with the servo motor Variable Description Units Value T Torque generated by the servo-motor Nm v Voltage applied to the armature of the motor V R Armature resistance 2.6 Km Motor torque constant N m/A 0.00767 Kg Gear ratio 70 Angular velocity of the output gear rad/s

3.3

Torque equation

The torque T is generated by the DC servo-motor, which is activated by a voltage v applied to its armature. The generated torque is given by: T = t1 v t2 where t1 = (9)

Km Kg R (10) 2 2 Km Kg t2 = R and the parameters and variables are described in Table 2. In the Laplace domain, the torque equation (9) can be written as follows: T (s) = t1 v(s) t2 s(s) where T (s), v(s) and (s) are the Laplace transforms of T , v and , respectively. (11)

3.4

Transfer function from v(s) to (s)

Substituting Equation (9) into Equation (7) and solving for (s) gives: t1 b(s2 z 2 ) v(s) s(s3 + t2 bs2 p2 s t2 bz 2 ) So that the transfer function from v(s) to (s) is: (s) = Gv, (s) = t1 b(s2 z 2 ) s(s3 + t2 bs2 p2 s t2 bz 2 ) (12)

(13)

3.5

Transfer function from (s) to (s)

If we divide equation (6) by equation (7), we obtain the transfer function from (s) to (s): ( d )s2 (s) G, (s) = = 2b 2 (14) (s) s z 5

u(s)

Gv , ( s)

(s)

G , ( s )

( s)

Figure 4: Block diagram of the linearised model of the inverted pendulum including the servomotor, gearbox and pendulum arm

3.6

Block diagram of the linearised model

A block diagram of the linearised model is shown in Figure 4.

Procedure

You should sketch all the root locus diagrams and write down the transfer functions found with Matlab R as you work through the dierent tasks on your log book. Please note that the servo and pendulum can rotate quite quickly, so be careful when starting and operating the system.

4.1

Task 1

Introduce the values of the parameters given in Tables 1 and 2 as relevant variables in the Matlab R workspace. Calculate the values of the auxiliary parameters a, b, c, d, z, p, t1 and t2 . Use the tf command1 to dene the transfer functions Gv, and G, as objects in the Matlab R workspace (see Equations (13) and (14) ). Hint: To do this, it is useful to dene the Laplace variable s in the Matlab R workspace as follows: >> s= tf( [1, 0], [0, 1]); Then, transfer function Gv, may be dened in Matlab R , as follows: >> G_V_theta=b*t1*(s^2-z^2)/(s*(s^3+t2*b*s^2-p^2*s-t2*b*z^2));

4.2

Task 2

Consider the block diagram given in Figure 5, where C (s) is a Proportional+Derivative (PD) compensator, with the following transfer function: C (s) = K,p 1 +
1

T,d s 1 s+1 N

= K,p +

K,d s 1 s+1 N

(15)

Type >> help tf for help on this command

v(s) -

(s)

(s)

Gv , ( s )

G , ( s )

C ( s )

Figure 5: Block diagram of the inner control loop on where K,p , is the proportional gain, T,d is the derivative time constant and K,d = K,p T,d is the derivative gain. Note that the derivative action has a lag with time constant 1/N , which is included to avoid amplifying high frequency signals. Assume that the values of the compensator parameters are K,p = 1 and K, = 1.42 and N = 50. Use the feedback command2 to compute the closed loop transfer function GA,B between points A and B of Figure 5 including the transfer function Gv, and the controller C (s).

4.3

Task 3

Consider the block diagram given in Figure 6, where C (s) is a Proportional+Derivative (PD) controller, with the following transfer function: C (s) = K,p 1 + T,d s 1 s+1 N = K,p + K,d s 1 s+1 N (16)

where K,p , is the proportional gain, T,d is the derivative time constant and K,d = K,p T,d is the derivative gain. Compute the open loop transfer function seen by the -controller by using the product (*) operator: GA, = GA,B (s)G, (s) (17) Notice that this transfer function exhibits pole-zero cancellations. To see this, use the zpk command3 to convert the transfer function to pole-zero form. To eliminate the common poles and zeros you must use the minreal command4 (it is important to do this). Now assume for the moment that K,p = 1 and T,p = 0 and use the product operator (OL) (*) to compute the open loop transfer function GR, as follows: GR, (s) = C (s)GA, (s)
Type >> help feedback for help on this command type >> help zpk for help on this command 4 type >> help minreal for help on this command
3 2

(OL)

(18)

R(s) +

C ( s)

A +

v(s)

(s )

Gv , ( s )

(s)

G , ( s )

C ( s)

Figure 6: Block diagram of the control scheme including the inner control loop on and the outer control loop on Use the rlocus command5 to compute the root locus based on the above values of K,p and T,d . Write your observations on your log book. Now let K,p = 1 and T,p = 0 and (OL) recalculate GR, and the root locus. Write your observations on your log book. Repeat this procedure leaving K,p = 1 but for dierent values of T,d = {0.1, 0.5, 1}. Write your observations on your log book, and indicate what value of T,d is best and why. Using the root locus for the best value of T,d compute the best value of the gain K,p to achieve a good damping ratio for the dominant complex poles ( 0.7 is reasonable; you can do this by placing the pointer and clicking the mouse on dierent points of the loci and reading the values from the screen.) and take a note of the value of the gain K,p and compute the corresponding derivative gain using K,d = K,p T,d . Using the same root locus, nd a value of the gain K,p for which the system is unstable. Take a note of this other value of K,p and nd the corresponding value of the derivative gain.

4.4

Task 4

Open the Simulink R le exp106.mdl and assign values to the following Matlab R variables from the command prompt: >> >> >> >> >> ktp = 1.0; ktd = 1.4207; kap = (K,p found in Task 3 for 0.7) kad = (K,d found in Task 3 for 0.7) N = 50;

Switch on the Universal Power Module (See Figure 7; the switch is located at the back of the module), hold the pendulum steady at the upright position, from the Simulink R window called exp106 choose the menu option WinCon/Build. Then, from the small window
5

Type >> help rlocus for help on this command

Figure 7: The Universal Power Module and associated connections entitled WinCon Server press the start button, release the pendulum and observe the results. Apply a slight tap to perturb the pendulum using your hand and see if it recovers. After a while, press the Stop button in the WinCon server window.

4.5

Task 5
>> kap = (K,p found in Task 3 for unstable behaviour) >> kad = (K,d found in Task 3 for unstable behaviour)

Assign values to the following Matlab R variables from the command prompt:

Again, hold the pendulum steady at the upright position, from the Simulink R window called exp106 choose the menu option WinCon/Build. Then, from the small window entitled WinCon Server press the start button, release the pendulum and observe the results.

Conclusions
1. How robust is this control scheme to large perturbations on the pendulum and why? 9

Your conclusions must address the following points.

Figure 8: The terminal board and associated connections 2. How accurate was the root locus approach based on the linearised model in predicting the stability/unstability of the system?

Appendix
Set up and connections
The required setup and connections will be made by the demonstrator. This experiment is performed with the SRV-02 in the high gear ratio conguration. Attach the pendulum arm to the central gear of the SRV-02 using the two brass thumb screws. The connections are indicated in Figures 2, 7 and 8. The required connections are listed below: 1. Encoder output of SRV-02 to encoder input No. 0 of terminal board (white cable). 2. Encoder output of pendulum arm to encoder input No. 1 of terminal board (white cable). 3. Analog ouput No. 0 of terminal board to connector labelled From D/A on Universal Power Module (black cable). 4. Output labelled To Load on Universal Power Module to left connector (as seen from the back) of SRV-02 (black cable).

10

Written by Dr. V. M. Becerra, October 2002.

11

S-ar putea să vă placă și