You are on page 1of 13

INDIAN INSTITUTE OF TECHNOLOGY

BOMBAY

DEPARTMENT OF AEROSPACE ENGINEERING

Control Systems Laboratory - AE 427

INVERTED PENDULUM

GROUP 5

Name Roll Number


Swarit Sood 180010056
Panshikar Anay Rajan 18D180020
P.Raghav Rajeev 170010056
Atharva Gurudatta Telange 180010014

Instructors :
Prof. Arnab Maity
Prof. Shashi Ranjan Kumar
Experiment 6 Inverted Pendulum

Contents
1 Objectives 2

2 Theory and Relevant Formulations 2

3 Experiment 1: System Identification 4


3.1 Hardware Gain (kx and ka ) . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.1.1 Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.1.2 Calculations and Results . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.2 Procedure to confirm J ∗ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.2.1 Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.2.2 Observations and Calculations . . . . . . . . . . . . . . . . . . . . . . 6
3.2.3 Result Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

4 Experiment 2: Rigid body PID Control 7


4.1 Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.2 Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.3 Result Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.3.1 Under Damped, ζ = 0.2 . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.3.2 Critically Damped, ζ = 1 . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.3.3 Over Damped, ζ = 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

5 Group Contribution 12

AE 427 1 Group 5
Experiment 6 Inverted Pendulum

1 Objectives
1. To measure the hardware gain and inertia of the system

2. To know the effects of proportional, derivative and integral control action on the sys-
tem.

2 Theory and Relevant Formulations


An inverted pendulum is unique mechanism consisting of a pendulum that has its center of
mass above its pivot point. It steers a horizontal sliding rod in the presence of gravity to
balance and control the position of the vertical rod(pendulum). The mechanism is open-loop
unstable (right half plane pole) and non-minimum phase (right half plane zero). Hence a
feedback control is essential for the stability and the structure of the controller must be
selected carefully because of the non-minimum phase characteristic.

Figure 1: Inverted pendulum apparatus

The design features a DC servo motor, high resolution encoder, a low friction sliding
balance rod, and a adjustable balance weights. It is connect with real time controller unit,
servo actuator interfaces, and auxiliary power supplies.

A linearized approximation of the system may be found via the first two terms of the Taylor’s
series expansion about the equilibrium points.This results in:

m1 ẍ + m1l0 θ̈ − m1 gθ = F (t) (1)

m1 l0 ẍ + J0 θ̈ − (m1 l0 + m2 lc )gθ − m1 gx = 0 (2)

AE 427 2 Group 5
Experiment 6 Inverted Pendulum

The input to the system is the force applied and the output is the angle turned by the pendu-
lum, denoted by F(s) and θ(s) respectively. Hence the transfer function of the rod-pendulum
system will be of the form,

By the Laplace transform of Equation 2 and assuming zero valued initial condition it is
straightforward to express:
θ(s) m! l0 −S 2 + (g/l0 )
= × 2 (3)
x(s) J0 s − (m1 l0 + m2 lc )(g/l0 )
This when substituted in Equation 1 gives,
θ(s) l0 −s2 + (g/l0 )
= ∗× 4 (4)
F (s) J s − (m1 l0 + m2 lc )(gs2 /J ∗ ) − (m1 g 2 /J ∗ )
Equation 3 relates the motion of the nominally vertical (pendulum) rod to the motion of the
sliding rod and 4 relates the motion of the pendulum to the force acting on the sliding rod
via the drive belt. It is the motion of the pendulum rod(i.e. θ) that is to be controlled in the
experiments that follow. The linearized relation between the applied force and the sliding
rod position follows from the product of 4 with the inverse of 3,

X(s) J0e s2 + (m1 l0J+m 2 lc )g

=− × 0e
(5)
F (s) m1 J ∗ s4 − (m1 l0 + m2 lc ) gs∗2 − m1 g 2
J J∗

Figure 2: Inverted pendulum parameters

It is necessary to identify pertinent dynamic and scaling parameters in order to design


and implement controllers which stabilizes the inverted pendulum plant and allows it to
track set points in angular displacement. It is recognized that not all parameters may be

AE 427 3 Group 5
Experiment 6 Inverted Pendulum

Figure 3: Calculation of lw2

measured with a fully assembled pendulum. Figure 1 shows the parameters which are fixed.
Their nominal values have been measured prior to assembly. lw2 is a signed distance from
the pivot to the cg of the balance mass mw2 . The various distances for the calculation of
lw2 is shown in figure 1. From the definitions given in figure 1, we have:

m1 = ml0 + mw1
m2 = m20 + mw2
t + lt + lb
lw2 = −
2
mw2 lw2 + m20 lc0
lc =
m2

j0e = J + m1 l02 + mw2 lw2
2

3 Experiment 1: System Identification


3.1 Hardware Gain (kx and ka )
3.1.1 Procedure
1. Remove power cord from the control box, but have all other cables connected.

2. Position the pendulum rod to the right and the sliding rod to the far right of the limit
travel.

AE 427 4 Group 5
Experiment 6 Inverted Pendulum

3. Select Zero Position from the Utility menu. Now the position of Encoder1 and Encoder2
will be zero in the display.

4. Hold on to the pendulum rod and push the sliding rod from one end until it hits the
opposite end of its travel. Note the count of the Encoder2 on the screen.

5. Calculate the distance traveled by the sliding rod in meters. The ratio of the two is
the value of kx .

6. Move pendulum rod in the anticlockwise direction all the way to left.

7. Record the number of counts on Encoder1. Measure the angle moved by the pendulum
in radians. The ratio of the two values gives ka .

3.1.2 Calculations and Results


Transfer Function Calculation: The so-called hardware gain, khw , of the system is comprised
of the product:
khw = kf ka kx ks
where: kf , Combined DAC-motor-amplifier-pulley gain = 0.0013 (N/DAC counts)
kx , encoder 2 scale factor, =50200 (increment/m)
ka , Pendulum angle encoder 1 scale factor = 2546 (increment/rad)
ks , DSP Controller firmware scale factor = 32 (controller counts / encoder or ref input counts)

The measurement are:

1. Number of counts on Encoder2 = 9505 counts

2. The distance traveled by the sliding rod = 20 cm

3. The angle moved by the pendulum = 40◦

4. Number of counts on Encoder1 = 1976 counts

From the above measurements, we get,


N umber of counts on Encoder 2
kx = = 47525 increment/m
Distance travelled by the sliding rod
N umber of counts on Encoder 1
ka = = 2830.412 increment/rad
Angle moved by the pendulum
Thus, The hardware gain of the system is given by

khw = kf ka kx ks = 5595836.768 N − counts/m − rad

AE 427 5 Group 5
Experiment 6 Inverted Pendulum

3.2 Procedure to confirm J ∗


3.2.1 Procedure
1. Remove the Brass balance weights from the apparatus and install both donut weights
on the sliding rod.
2. Use a rubber band to restrain the sliding rod in the center of travel
3. Disconnect power cord from the control box but leave the other cables connected
4. Very carefully position the entire pendulum mechanism upside down, so that the system
can be operated in a normal pendulum mode.Keep the assembly supported between
the edges of the table. Now pendulum is hanging freely
5. With controller powered up, from the interface click Set-Up menu → Control Algorithm
→ set Ts = 0.0044 s → OK
6. Go to Data → Setup Data Acquisition → select Encoder1 as data to be acquired and
Data Sampling 5 servo cycles → OK to exit
7. Go to Utility → Zero Position. This make the encoder position as zero.
8. Go to Command → Trajectory → Step dialog box → step-up → Open-loop Step, Step
size = 0, Duration= 10000 ms, repetition= 1 → OK The data will be acquired for 20
s by the controller but without driving the actuator.
9. Go to Command → Execute and then manually disturb the pendulum
10. Ones the data is collected, a dialog box will be opened. click OK 11. Then Setup Plot
for Encoder-1 position 12. From the oscillations of the normal pendulum, find the time
period T and use Eq. (1) and (2).
 2
T
Joe = mlcg g (6)

where, m is the total mass of the system without brass weights. m = 0.998 kg and lcg
= 0.126 For this system.
J ∗ = J0e − m1 l02 (7)

3.2.2 Observations and Calculations


From the observation, we get the following table:-

AE 427 6 Group 5
Experiment 6 Inverted Pendulum

Now, from here, we get,

ωn = 0.8503 Hz = 5.3428 rad/s and ζ = 0.0128

Also, we get,  2
T
Joe = mlcg g = 0.0432 kg − m2

J ∗ = J0e − m1 l02 = 0.02001 kg − m2

3.2.3 Result Plots

Figure 4: System Identification

3.2.4 Conclusion
1. Thus, after doing the process of system where we find the parameters of the sys-
tem indirectly by doing measurements, we get the hardware gain of the system as
595836.768 N − counts/m − rad.

4 Experiment 2: Rigid body PID Control


4.1 Procedure
1. By adjusting the knob above the rod, bring the pendulum to zero position. Please note
to turn off the control switch before touching the pendulum. After finding the values
for the controller gains, the following method may be followed to assign the values to
the same using the Executive Program.

AE 427 7 Group 5
Experiment 6 Inverted Pendulum

2. Go to Data → Setup Data Acquisition → Selected Item [Command Position, Encoder


- 2 Position and Sample Period = 2 s OK

3. Command → Trajectory → Setup → select Closed loop step, Step size = 1000 counts,
Dwell Time = 1000 ms, Repetition = 1 → OK

4. Setup → Setup Control Algorithm → Continuous Time Control, Ts = 0.00442 s → PID


→ Setup Algorithm → Enter kp , kd values, select Encoder2 → Implement Algorithm
→ OK

5. Utility → Zero Position

6. Turn on the control box 7. Command → Execute → Run

7. Plot the data i.e. Encoder-2 Output and the Commanded Position, from plot menu.

4.2 Calculations
To design the controller to the sliding rod, we consider rod assembly as a point mass m∗ .
J∗ 0.0198
m∗2 = 2
= = 0.182 kg
l0 0.332

m1 m∗2
m∗ = = 0.09815 kg
m1 + m∗2
khw = kx ks kf = 47525 × 32 × 0.0013 = 1977.04 N/m
Then, the transfer function of the rod assemble reduces to-

Xc (s) khw
= ∗ 2 (8)
Fc (s) ms

Also, r
kp khw kd khw
ωn = , ζ =
m∗
p
2 m∗ kp khw

Figure 5: PID Control block diagram

AE 427 8 Group 5
Experiment 6 Inverted Pendulum

Under Damped
ζ = 0.2, ωn = 10 Hz = 62.83 rad/s

ωn2 × m∗ 62.832 × 0.09815


kp = = = 0.19599
khw 1977.04
p p
2ζ m∗ kp khw 2 × 0.1 0.09815 × kp × 1977.04
kd = = = 0.0012477
khw 1977.04

Critically Damped
ζ = 1, ωn = 10 Hz = 62.83 rad/s

ωn2 × m∗ 62.832 × 0.09815


kp = = = 0.19599
khw 1977.04
p p
2ζ m∗ kp khw 2 × 0.09815 × kp × 1977.04
kd = = = 0.0062385
khw 1977.04

Over Damped
ζ = 2, ωn = 10 Hz = 62.83 rad/s

ωn2 × m∗ 62.832 × 0.09815


kp = = = 0.19599
khw 1977.04
p p
2ζ m∗ kp khw 2 × 2 0.09815 × kp × 1977.04
kd = = = 0.012477
khw 1977.04

AE 427 9 Group 5
Experiment 6 Inverted Pendulum

4.3 Result Plots


4.3.1 Under Damped, ζ = 0.2

Figure 6: Under damped case, Simulink

4.3.2 Critically Damped, ζ = 1

Figure 7: Critically damped case

AE 427 10 Group 5
Experiment 6 Inverted Pendulum

Figure 8: Critically damped case, Simulink

4.3.3 Over Damped, ζ = 2

Figure 9: Over damped case, Simulink

4.4 Conclusion
1. In the under-damped case, the position reaches quickly to the command position and
then it oscillates about it as seen in the plot.

AE 427 11 Group 5
Experiment 6 Inverted Pendulum

2. In the critically-damped case, there are no oscillation in accordance with the definition.
The simulink response also matches with the actual response obtained in terms of the
rise and settling time. There is some offset present for the actual case which is not
seen for the simulink response as we have used an approximate transfer function for
modelling, which is neglecting certain effects such as friction.

3. In the over-damped case, the rise time increases,i.e.,it takes comparatively little more
time than the critically damped response case to reach the step further and also, there
are no oscillations.

5 Group Contribution

AE 427 12 Group 5

You might also like