You are on page 1of 4

6

th
International Advanced Technologies Symposium (IATS11), 16-18 May 2011, Elaz, Turkey
6


AbstractThis paper presents a new pendulum experiment
setup for educational purposes. The pendulum is actuated by the
thrusts of two motorized propellers mounted back-to-back at its
free end. It can be positioned at any desired position including the
unstable upright. Setups hardware, control system and
mathematical model are described. Performance of the system in
single-thrust and differential-thrust modes is evaluated by
hardware-in-the-loop simulation experiments featuring feedback
linearization and discrete PD control.

Keywordspendulum, propeller, brushless motor, hardware-
in-the-loop simulation

I. INTRODUCTION
he inverted pendulum is a classic benchmark system for
control design and its various implementations have been
studied excessively in the literature [1-3]. The traditional
inverted pendulum systems are actuated by moving the axis of
rotation and the aim is to balance the system in its unstable,
upright balanced position. Due to its fairly simple dynamics,
the inverted pendulum is especially suited to the dynamics and
control systems laboratories of academic institutions.
This paper describes the development and testing of a new
pendulum experiment setup, designed to aid mechanical
engineering students in system dynamics and control related
courses. Unlike traditional systems, the axis of rotation is fixed
and the pendulum is actuated by the thrust of a motorized
propeller mounted at the free end. Similar propeller actuated
pendulums for educational purposes have been reported.
References [4-6] describe experiment kits utilizing a single
brushed dc-motor powered propeller. The pendulum is
balanced against gravity in a single direction and upright
balancing is not possible. In [7], a single motorized propeller
is rotated by a positioning servo around an axis parallel to the
pendulums axis of rotation. This way, the direction as well as
the magnitude of the thrust is varied to hold the pendulum at
any desired position. Our setup features two brushless dc-
motor powered propellers mounted back-to-back at the tip of
the pendulum. This provides two point forces of variable
magnitude and opposite direction that can be used to drive and
hold the pendulum at any position including the unstable
upright. The dual motor arrangement enables differential thrust
actuation which improves the responsiveness and stability of
the system.

Figure 1: Pendulum Setup
II. SETUP DESCRIPTION
The overall design of the setup is shown in Fig.1. Two
motorized propellers are attached back-to-back to the end of
an aluminum pendulum arm. Each of them is able to provide
thrust in a single direction, therefore they are referred to as
clockwise (CW) motor and counter-clockwise (CCW) motor
regarding the moment of their thrusts with respect to the
pendulums pivot point. The pendulum arm is suspended by a
free-to-rotate overhung axle which is coupled to a 2000
counts/revolution optical incremental encoder. The housing of
the axle bearings are clamped to a laboratory desk.


Figure 2: Circuit Board
Pendulum Positioning System Actuated by Dual
Motorized Propellers
Y. Gltekin
1
and Y.Tacolu
2
1
TOBB University of Economics and Technology, Ankara, Turkey, ygultekin@etu.edu.tr
2
TOBB University of Economics and Technology, Ankara, Turkey, ytascioglu@etu.edu.tr
T
Y. Gltekin, Y. Tacolu

7


Figure 3: Control Hardware Schematic

Figure 4: Thrust vs Control Input (a) CCW motor (b) CW motor

The control algorithm has been implemented on a PC by
using MATLAB/Simulink Real Time Windows Target
(RTWT) [8]. RTWT compiles Simulink models into C or C++
code and enables the execution of hardware-in-the-loop
simulations in real-time. A custom designed circuit board
(Fig.2) interfaces the control PC to the physical system via
standard RS-232 serial protocol. It includes a Microchip
PIC16F877A microcontroller for serial communications and
PWM (Pulse Width Modulation) signal generation for the
motors, a HCTL2022 integrated circuit for decoding and
counting incremental encoder pulses, and a serial level
converter circuit [9] for translating RS-232 signals from the
control PC to TTL signals suited to the boards
microcontroller. The data exchange between the control PC
and the microcontroller takes place at every 5 ms with 2-byte
packets. The PC receives 16-bit encoder position and sends
two 8-bit motor control signals (Fig.3).
The chosen brushless dc-motors are commonly used in
model aircrafts due to their small size and high speed (~20000
rpm) and they can deliver up to 5 N thrust with 8x4
propellers. The standard drive circuit for these types of motors
is called an ESC (Electronic Speed Controller). An ESC
adjusts the speed of the motor according to a special PWM
signal where the duty cycle period has to be between 1 ms to
2ms. As in this case; when the PWM frequency is 200 Hz, the
ESCs accept duty cycles from 20% to 40%. This range of duty
cycles is expressed with 8-bit resolution. That means the
motors stop at %20 duty cycle (0) and runs at full speed at
40% duty cycle (255). Even though both motors have identical
hardware, a small difference is expected between their
performances. Thrust measurements were performed for the
entire range of duty cycles and curves are fitted to the results
by using MATLABs Basic Fitting tool (Fig.4). The curve
equations are used for analytical approximation of control
inputs corresponding to the required thrusts.
III. MATHEMATICAL MODELING AND SIMULATION
The system is a simple pendulum with a point force at its
free end (see Fig.5). By using Newtons 2nd law and
D`Alembert principle, it can be modeled as follows:

TL c gL m m L m m
B A B A

sin
2
1
3
1
2
(1)

where:
m
A
= mass of the arm (kg)
m
B
= total mass of the motor-propeller assembly attached at
point B (kg)
L = distance from the pivot O to point B (m)
m
A
= mass of the rod (kg)
= angle of the pendulum arm measured counter-
clockwise from rest (rad)
g = gravitational acceleration (m/s
2
)
c = total viscous damping coefficient (Nms/rad)
T = net thrust produced by the motorized propellers (N)

The first term of this equation is the moment of inertia of
the system. The second term is the moment due to the weight
of the pendulum assembly. The parameters m
A
, m
B
, and L are
0.21 kg, 0.16 kg and 0.6 m respectively. The third term is the
moment due to the viscous friction of the bearings and also the
aerodynamic drag caused by the propellers. An average value
for c is found to be 0.0074 Nms/rad by performing a simple
drop test while both motors are running at the same speed. The
last term of the equation is the moment about the pendulum
axle due to the net thrust of the motorized propellers.

ENCODER
DECODER
PC
ESC ESC
CCW
MOTOR
CW
MOTOR
ANGULAR POSITION
PIC16F877A
0 1 2 3 4 5
0
50
100
150
200
250
Thrust Force (N)
C
o
n
t
r
o
l

I
n
p
u
t


CCW Motor
Approximation
0 1 2 3 4 5
0
50
100
150
200
250
Thrust Force (N)
C
o
n
t
r
o
l

I
n
p
u
t


CW Motor
Approximation
(a)
(b)
Pendulum Positioning System Actuated by Dual Motorized Propellers
8

Figure 5: Pendulum Schematic

In order to cancel the non-linear term from the equation,
feedback linearization is applied in the form:

u g m m T
B A
sin
2
1
(2)

The resulting system is linear and has a fairly simple
transfer function with two real poles:

s
mL
c
s
mL
s U
s
2
2
1
(3)

where:

B A
m m m
3
1
(4)


Figure 6: Simulink Model

The Simulink model of the system is given in Fig. 6. Since
the system is already Type 1 (linearized system has 1 pole at
zero), a proportional-derivative (PD) controller is preferred. It
is known through thrust measurements (see Fig.4) that the
propellers are limited to apply just above 4.5 N of thrust.
Therefore a saturation block is also added to the model. The
system is simulated with a multiple step input from 0 to 150
in 30 increments. The proportional and derivative gains are
tuned with structured trial-and-error and selected to be 2 and
0.8 respectively. Fig.7 shows the results of the simulation.
0 10 20 30 40 50 60
0
20
40
60
80
100
120
140
160
time (s)
t
h
e
t
a

(
d
e
g
)


reference
simulation

Figure 7: Simulation Result
IV. EXPERIMENTS AND RESULTS
The Simulink model shown in Fig.6 is also used for the
experiments but the mathematical model of the system is
replaced with the physical system thanks to RTWTs
hardware-in-the-loop capabilities. The blocks shown in Fig.8
are connected to the rest of the Simulink model instead of the
blocks inside the gray Plant box of Fig.6. Using RTWT, the
sampling time of 5 ms is also achieved on the PC side and RS-
232 communications are performed with the built in Packet-
Input, Packet-Output blocks. The Thrust to Control Input
Conversion block contains a MATLAB function which
calculates control inputs to the motors corresponding to the
required thrust based on the approximate curves of the Fig.4.
The Count to Radian Conversion block converts the
instantaneous encoder count to angle in radians.


Figure 8: RTWT Model

The first experiment is performed with the same multiple
step input and controller gains as in the simulation. Only the
CCW motor is used as a thrust source. Fig.9 shows the result
of this experiment in comparison to the simulation. The system
generally performs as expected; however, two shortcomings
can be identified. Firstly, a dead-band is present when the
motor starts from rest. This is the reason for the lag at the
initial response (t=13 s) to the first step reference. Secondly,
the lack of breaking mechanism causes system to overshoot
when the motor needs to slow down rapidly. This is apparent
in the transient at the last step (t=4855 s).
-K-
c
si n
Thrust
Saturati on
pi
Target
-K-
L
1
s
1
s
PID(z)
Di screte
PID Control l er
-K-
1/
((mA/3+mB)*L^2)
-K-
(mA/2+mB)*g*L
-K-
(mA/2+mB)*g


Plant


ref

L
O
A
B
T
1
theta
T
theta
CW Motor
CCW Motor
Thrust to Control Input
Conversi on
1
2
Output to
Seri al Port
1
Input from
Seri al Port
encoder theta
Count to Radi an
Conversi on
1
T
Packet
Output
Packet
Input
Y. Gltekin, Y. Tacolu

9
0 10 20 30 40 50 60
0
50
100
150
200
time (s)
t
h
e
t
a

(
d
e
g
)


0 10 20 30 40 50 60
-20
-10
0
10
20
time (s)
s
i
m
u
l
a
t
i
o
n

-

e
x
p
e
r
i
m
e
n
t
(
d
e
g
)


simulation
experiment

Figure 9: Experiment Result - Single Thrust, Multiple Step

In the second set of experiments, the aim is to stabilize the
pendulum at the upright position ( = 180). Again a single
thrust source is active at any given time. That means, only the
CCW motor is active when the pendulum is at the right-hand-
side semi-circle (0 < < 180), and only the CW motor is
active when the pendulum is at the left-hand-side semi-circle
(180 < < 360). When the previously tuned gains are used,
the system oscillates around the reference with 18 amplitude.
The proportional gain is reduced until no further significant
reduction occurs in the oscillation amplitude. The best
performance is achieved with K
P
= 0.5, K
D
= 0.8, and it has
10 amplitude as shown in Fig.10.
0 5 10 15 20 25 30
0
20
40
60
80
100
120
140
160
180
200
time (s)
t
h
e
t
a

(
d
e
g
)


Kp=2, Kd=0.8
Kp=0.5, Kd=0.8

Figure 10: Experiment Result - Single Thrust, Upright Balance

The last set of experiments also aims upright stabilization.
This time, both motors run at all times and actuation is
achieved by differential thrust. The idea is to shorten the time
required for the motors to achieve the desired speed in order to
minimize oscillations. Fig.11 shows the results of this
experiment. Using the same controller gains as in the previous
experiment, oscillation amplitude is reduced by 50% in
differential thrust mode. The proportional gain is further
reduced until the system becomes over damped. Finally, the
pendulum is stabilized at 179 with no oscillations.
0 5 10 15 20 25 30
0
20
40
60
80
100
120
140
160
180
200
time (s)
t
h
e
t
a

(
d
e
g
)


Kp=0.5, Kd=0.8
Kp=0.2, Kd=0.8

Figure 11: Experiment Result - Differential Thrust, Upright Balance
V. CONCLUSION AND FURTHER WORK
Development and testing of a new pendulum experiment
setup for educational purposes is described. The setup features
two brushless dc-motor powered propellers mounted back-to-
back at the tip of the pendulum. Systems performance is
evaluated via hardware-in-the loop simulation experiments by
using Simulink RTWT with custom designed interface circuit.
The designed system is an ideal aid for teaching mathematical
modeling, parameter identification and control system design
at various levels. The further work will concentrate on
development of a compact, modular and portable setup based
on the prototype presented here. Such a system can be given to
students as a take-home hands-on project.
ACKNOWLEDGMENT
Authors thank to former undergraduate students smet Fatih
ekerolu and Elgin Oktay for their efforts in building the
system hardware.
REFERENCES
[1] J. Yi, N. Yubazaki, Stabilization fuzzy control of inverted pendulum
systems, Artificial Intelligence in Engineering, vol. 14, pp. 153-163,
2000.
[2] A. Siuka, M. Schberl, Applications of energy based control methods
for the inverted pendulum, Robotics and Autonomous Systems, vol. 57,
pp. 1012-1017, 2009.
[3] J. -J. Wang, Simulation studies of inverted pendulum based on PID
controllers, Simulation Modelling Practice and Theory, vol. 19, pp.
440-449, 2011.
[4] E. T. Enikov, V. Polyzoev, J. Gill, Low-cost take-home experiment on
classical control using Matlab/Simulink Real-Time Windows Target,
in Proc. of the ASEE/PSW-2010 Conf., Reno, NV, 2010.
[5] S.-F. Yang, J.-H. Chou, A mechatronic positioning system actuated
using a micro DC-motor-driven propellerthruster, Mechatronics, vol.
19, pp. 912-926, 2009.
[6] http://prism2.mem.drexel.edu/~paul/thrustTester/thrustTester.html (last
accessed 17.02.2011)
[7] K. Craig, M. Kleinigger, Mechatronics case study: Thrust vectoring
and control of an unstable system, Dept. Mech. Eng., Rensselaer
Polytechnic Institute, Troy, NY.
[8] http://www.mathworks.com/products/rtwt/ (last accessed 17.02.2011)
[9] http://picprojects.org.uk/projects/simpleSIO/ssio.htm (last accessed
17.02.2011)

You might also like