Professional Documents
Culture Documents
UC San Diego
Peer Reviewed
Title:
Dynamic Maneuvers with a Mobile Inverted Pendulum /
Author:
Pogue, Edward
Acceptance Date:
2014
Series:
UC San Diego Electronic Theses and Dissertations
Degree:
, Engineering sciences (Aerospace Engineering)UC San Diego
Permalink:
http://escholarship.org/uc/item/12043152
Local Identifier(s):
Abstract:
A mobile inverted pendulum (MIP) type robot was constructed to test the feasibility of performing
high speed, dynamic maneuvers. Techniques were developed for line following and to achieve
high speed motion with a MIP. The results indicate that the speeds necessary for the maneuver
can be achieved, and the groundwork is laid for further experimentation
Copyright Information:
All rights reserved unless otherwise indicated. Contact the author or original publisher for any
necessary permissions. eScholarship is not the copyright owner for deposited works. Learn more
at http://www.escholarship.org/help_copyright.html#reuse
in
by
Edward Pogue
Committee in charge:
2014
Copyright
Edward Pogue, 2014
All rights reserved.
The thesis of Edward Pogue is approved, and it is ac-
ceptable in quality and form for publication on microfilm
and electronically:
Chair
2014
iii
DEDICATION
iv
TABLE OF CONTENTS
Dedication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv
Table of Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Chapter 2 Simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1 Physics Simulation . . . . . . . . . . . . . . . . . . . . . 6
2.2 Controls Simulation . . . . . . . . . . . . . . . . . . . . . 8
Chapter 3 Construction . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.1 Challenges . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.2 Wheels . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.3 Line Following . . . . . . . . . . . . . . . . . . . . . . . . 14
v
Chapter 6 Results and Future Work . . . . . . . . . . . . . . . . . . . . . 30
6.1 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
6.2 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . 30
6.2.1 The Loop . . . . . . . . . . . . . . . . . . . . . . 30
6.2.2 Improving Line Following . . . . . . . . . . . . . . 31
Chapter 7 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
7.1 Line Following . . . . . . . . . . . . . . . . . . . . . . . . 33
7.2 High Speed Motion . . . . . . . . . . . . . . . . . . . . . 33
7.3 LDL Maneuver . . . . . . . . . . . . . . . . . . . . . . . 34
Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
vi
LIST OF FIGURES
vii
LIST OF TABLES
viii
ACKNOWLEDGEMENTS
ix
VITA
PUBLICATIONS
B. Lavraud, J.E. Borovsky, A.J. Ridley, E.W. Pogue, “Strong bulk plasma ac-
celeration in Earth’s magnetosheath: A magnetic slingshot effect?”, American
Geophysical Union Journal, 18 July 2007.
x
ABSTRACT OF THE THESIS
by
Edward Pogue
xi
Chapter 1
1.1 Objectives
The dynamics of mobile inverted pendulums on two wheels are well un-
derstood. However, there are ranges of dynamic maneuvers which have not been
explored in the literature. In the execution of such a dynamic maneuver (involving
high speed movement and inversion in the inertial reference frame) the direction
and magnitude of gravity relative to the robot will vary widely. In the simulations
and experiments described in the body of this paper we will explore the feasibility
and challenges of two wheeled segway-like movement up to and through a dynamic
maneuver such as a classic ’loop de loop’.
1.2 Theory
The physics of the dynamic loop de loop (hereafter abbreviated ’LDL’)
maneuver are well understood. Entering into a curved loop at a high rate of speed,
a vehicle can use its centripetal acceleration to maintain contact with the surface
of the track through the course of the loop. With sufficiently high speed, a wheeled
vehicle can even continue to accelerate while at the top of the loop without a loss
of traction.
The dynamics of an inverted pendulum are well known[2]. However, that
derivation assumes that robot operates on a flat surface. For our purposes, we
1
2
derived the equations of motion assuming that the ground is at a given angle β.
One commonly used interpretation of the inverted pendulum is to visualize a wheel
with a rod attached at its center. In this derivation, the angle of the rod of the
pendulum is represented by θ, and the rotation of the wheel is represented by φ.
Taking the Lagrangian derivation of the equations of motion, we start with the
kinetic energies of the rod and the wheel.
1 1
Tw = mw ẋ2 + Iw φ̇2 (1.1)
2 2
1 1 1
Tr = mr (ẋ − Lθ̇cosθ)2 + mr (Lθ̇sinθ)2 + Ir θ̇2 (1.2)
2 2 2
Then we move onto the potential energy of the rod. Since we are measuring
the potential energy relative to the track, the wheel’s potential energy remains
constant.
Vr = mr gLcos(θ − β) (1.3)
Using these definitions of the kinetic and potential energy of the system,
we construct the lagrangian.
3
L = Tw + Tr − V (1.4)
d ∂L ∂L d
− = (Iw φ̇) + 0
dt ∂ φ̇ ∂φ dt (1.9)
= Iw φ̈
d ∂L d
= (−mr Lẋcosθ + mr L2 θ̇ + Ir θ̇)
dt ∂ θ̇ dt (1.10)
2
= −mr L(ẍcosθ − ẋθ̇sinθ) + mr L θ̈ + Ir θ̈
∂L
= mr Lθ̇sinθ(ẋ − Lθ̇cosθ) + mr L2 θ̇2 cosθsinθ + mr gLsin(θ + β) (1.11)
∂θ
Gathering the second derivative terms, the Lagrangian equations come out
to:
Qx = (mw + mr )ẍ − (mr Lcosθ)θ̈ + mr Lθ̇2 sinθ (1.12)
4
Qφ = Iw φ̈ (1.13)
The force vector F contains all the terms that are not second derivative
terms or the motor input.
mr Lθ̇sinθ
F =
0
(1.16)
−mr gLsin(θ + β)
The control input vector B relates the input torque of the motor to the rest
of the equation.
0
B=
1
(1.17)
−1
To simplify this, we apply the no slip condition at the interface of the
wheel and the track, simply x = Rφ. This changes the above overall equation to
S T M S ν̇ + S T F = S T Bu where S is:
−R 0
S=
1 0
(1.18)
0 1
And ν̇ is: " #
φ̈
ν̇ = (1.19)
θ̈
5
ηkγV
s̄ = (1.22)
Ω
η(kγ)2
b= (1.23)
Ω
Where the terms there are defined as:
η = motor efficiency (mechanical power out / electrical power in)
k = motor constant (torque applied per ampere)
γ = gear reduction
V = voltage (volts)
Ω = resistance (ohms)
Linearizing by taking the Jacobian we get the equation into the form Ax +
B = u. This is then input to the standard LQR derivation to come up with an
appropriate set of control gains for the robot at a given incline β.
Chapter 2
Simulations
6
7
slowing the robot would be the force of gravity against its motion and the rolling
friction of the wheel.
FGN = mrobot gcosβ (2.1)
The force normal to the track was used to determine the rolling resistance,
and also the failure condition of the simulation. If at any point it dropped be-
low zero, the simulation terminated. For a small segway-type robot to make it
through an LDL with a minimum radius of 0.25 meters, it must maintain a speed
of 1.56 meters per second to maintain a positive contact with the loop all the way
through. According to the simulations, this is achievable using motors available
to the project with a wide safety margin. According to the simulation, a speed of
2.5 meters per second is achievable through the loop.
8
a forward acceleration was developed. To test the high speed movement over a
longer distance, the φ and φ̇ set points were input to a simulation to assess how
quickly the robot would be able to get up to the desired speed of 2.5 meters per
second. Integrating the φ̇ term to get the φ set point, the φ̇ was incremented
by a small amount each time step, linearly for the first three seconds, and then
falling off quadratically afterwards to ensure that the set point wouldn’t exceed
the maximum desired speed. The simulation results came out positively. Later
simulations introduced a time delay between the signal of the motor duty and the
application of torque, which replicated oscillatory results that had been seen in
the robot itself. In future, the author would note the importance of including at
least a small delay on the order of the motor’s mechanical time constant into a
simulation to help keep the simulation grounded in reality. The data found from
these simulations formed the baseline for further practical testing.
Chapter 3
Construction
3.1 Challenges
The StuntMIP bears a resemblance to previous MIP-type vehicles developed
in the lab previously, specifically Mini-MIP and myMIP. The primary difference
between this robot and its forebears is the high performance it must achieve. The
top speed of the previous robots topped out at approximately 1 meter per second,
while for this robot to achieve its objective of completing the LDL, it must achieve
a velocity of approximately 2.8 meters per second and not drop below 2.5 meters
per second during the execution of the maneuver. This requires substantially more
motor power, while keeping any increase in mass to a minimum. The same motors
were used as in a previous design, the Mini-MIP, given their high performance
and compact form factor. To achieve the higher performance required, the voltage
available was increased from 12 volts to 22 by putting two 11 volt lithium polymer
batteries in series. The higher power density of these batteries allow for a small
form factor and a relatively modest increase in weight while providing the necessary
power.
It became apparent that the complexity of the wiring the electronics of
StuntMIP would prove excessively complicated and difficult to test, so the elec-
tronics were mounted onto a single printed circuit board. Mounting the motor
driver, accelerometer, gyroscope, bluetooth, light sensors, two voltage regulators
and the Arduino microprocessor on the board via female header pins allowed for
10
11
The main body of the robot is relatively simple, essentially a box to hold
the electronics and a shaft to mount the motors into. The line following sensors
require a low ground clearance, approximately, and are positioned along the bottom
of the robot. The batteries are mounted higher in individual pods on either side
to bring up the center of mass of the robot while maintaining symmetry, and to
shorten the distance of the main power lines to the board. The main driving design
concerns was fitting the board and the motors inside the robot. The entire robot
was designed in CAD and then 3D printed using a Makerbot Replicator out of PLA
plastic. This allowed for a rapid prototyping, as the design matured to include the
printed board instead of the free components and a ’rats nest’ of wires. A previous
design had already been printed and was then superseded by the second after the
decision was made to mount electronics on a board. That design was itself replaced
by one included space for larger batteries, which was the primary robot used in
12
testing. A fourth version was printed to angle the light sensors forward so that
they were seeing the line ahead rather than behind. It also incorporated mounting
points for two arms to catch the robot when falling or colliding with something
during testing.
3.2 Wheels
Using the lab’s 3D printer to produce wheels resulted in several interesting
failures and workarounds which are worth exploring briefly. The original design
called for press fitting the driveshafts into the wheels. While this works if the
wheels are never removed, once that becomes necessary, the second time one press
fits a metal shaft into plastic, it further deforms the plastic resulting in an un-
satisfactory fit. The second option explored was using a set screw to hold it in
place. Rather than threading the screw into the plastic, which would have had a
similar effect to the press fit, a small space was included for a nut that could act
13
as the threading to hold the set screw in place. This worked satisfactorily at first,
creating a tight fit that could be removed and replaced as needed. However, an
unforeseen consequence of this particular design was the crushing of the plastic
making up the channel for the drive shaft. As the set screw was tightened, it
pressed the shaft into the plastic, deforming it. While the wheel was still firmly
attached to the shaft, it was no longer aligned with the direction of the motor shaft
and a noticeable wobble developed in the wheels.
A third design was developed to act as a clamp around the motor shaft.
Utilizing a similar nut and bolt arrangement, a space was left in the wheel hub
that it might flex open to admit the motor shaft. The bolt was then tightened,
closing the gap and firmly clamping the motor shaft into place. This solution has
proven satisfactory, and resolved several issues previously thought unrelated, but
then turned out to be the result of several degrees of play between the motor shaft
and the wheel.
Figure 3.3: Final Wheel Design with Clamping Nut and Bolt Configuration
14
3
X
ri = T (3.1)
i=0
3
X
iri = W (3.2)
i=0
W
c= (3.3)
T
For four sensors, with the pivot serving as a zero point, the line should
be found at a centroid of 1.5. This algorithm allows for precise control, and also
alleviates the concern over varying sensor output as the robot accelerates and the
sensors move vertically relative to the track. Early testing with this algorithm
resulted in a general failure to follow a line.
Examining the telemetry from the MIP established that when at rest and
standing upright, the analog reflectance sensors read very low off the line and very
15
high on the line. The analog sensor readings were remapped from 0 to 5 volts to
0 to 1024. The on-line readings were approximately 900 to 30-70 off of it. As the
angle increased, the on-line sensors maintained their high readings, while the off-
line sensors had increasingly high readings. As a result, the centroid calculations
would steadily move towards the center reading regardless of location along the
line, since all the sensor readings were trending towards the maximum possible
reading. We modified the algorithm to select the smallest reflectance reading and
subtract that from the rest of the readings.
3
X
(ri − rmin ) = tadjusted (3.4)
i=0
3
X
i(ri − rmin ) = wadjusted (3.5)
i=0
This allowed the algorithm to function between a zero point and some larger point,
which resulted in much better tracking of position along the line.
Implementing the new algorithm, straight line following was achieved at
a variety of speeds. A controller was developed by iterative testing. Since the
16
dynamics of the system act as an integrator (the further along the line the robot
goes in a given direction that’s not directly along the line, the further off the line it
gets) we opted to use a proportional-derivative controller. Looking at the problem
further, it became clear that high proportional gain wouldn’t serve particularly
well, as this robot’s main function is to go in a straight line. Higher proportional
gain would cause it to overreact and pass straight off the line. Correspondingly, a
high derivative gain was chosen to ensure that the errors in line position damped
out over time. With some trial and error along a small straight-line course, a set
of control gains were found that were very effective.
While the straight line following was effectively implemented, attempts at
line following over a more complicated course were unsuccessful. This is largely due
to the physical design of an early prototype robot, more specifically the location
and orientation of the reflectance sensors. Their position at the bottom of the robot
facing straight down prevented them from reading the line in front. As the robot
leans forward to accelerate forward, the sensors were constantly looking back. As
a result, it could only react to the path of the line behind it, which, along a varied
course, results in the robot eventually reacting to a turn in the line too late, and
17
going off course. A later version of this robot had forward facing sensors installed
along the base, which improved straight line following, but no testing has yet been
done with more complicated course following.
Chapter 4
18
19
still require significant input to maintain a high speed. From the earlier equation
τ = s̄u − bω, for a torque τ of zero and a speed ω of 70 radians per seconds, the
required motor output u∗ is approximately 0.8 out of a possible 1, translating to
a pulse width modulation output of 204, where 255 is the maximum output. An
additional control term to account for this motor damping was implemented in the
code.
u∗ = 0.1212φ̇ (4.1)
This didn’t have the desired effect of stabilizing performance, but rather resulted
in an immediate failure in which the robot accelerated into the ground.
positive results, instead reverting back to the oscillatory failures previously seen.
Assault MIP
5.1 History
The Assault Mobile Inverted Pendulum (or MIP) is a direct offshoot of
one of our lab’s previous robots, the iFling. The iFling was a remote controlled
segway-type robot designed to collect ping-pong balls and then launch them one
at a time using a jai alai type arm. It was hoped to develop something that could
shoot faster and more reliably than the previous model. This idea became Assault
MIP. Using the iFling’s lower geometry to run over balls and collect them into
the wheel wells and moving them into a loading position, a new loading and firing
mechanism was designed, driven by a single additional motor. Several teams have
worked on several iterations of this design, which is rapidly maturing. The author
was team lead for the second and third prototypes, oversaw the design and building
of both, and focused especially on the ball-loading problem.
5.2 Firing
The firing mechanism for the first version of Assault MIP was driven by a
single motor acting on a spring loaded firing hammer. A curved attachment at the
end of the motor arm pressed the hammer back, tensioning the torsional spring
until, at its maximum point, the hammer slipped off the curved attachment and
the tensioned spring spun it forward into a waiting ping-pong ball, shooting it 6-8
22
23
feet, with the hammer coming to rest on the back end of the firing chamber. We
had an issue with the initial design, namely that the interface between the hammer
and the motor took place at the end of a rod attached to the hammer, which served
as a moment arm that would jam the firing mechanism. A second iteration of the
design shortened this moment arm, putting the motor almost directly onto the
hammer. This design resulted in a reliably high rate of fire in several test set ups
which precisely replicated the internal geometry of the future robot.
While this design had the desired firing rate, range and reliability, the
internal geometry it required proved incompatible with the third generation robot’s
loading mechanism, requiring a change. In the first two iterations, the hammer
24
rested in the firing chamber, lifting up and back to cock and fire. This in turn lifted
the ball stack slightly, then when the hammer cleared the chamber, a ball would
fall into firing position, and the hammer would then slip off the firing motor’s
curved attachment, spinning forward into the waiting ball. There were several
issues with this, one being that the hammer had to lift the entire stack of balls
with each firing. While this had not yet posed any problems, it was an inefficiency
that could potentially present a problem further down the line. Another issue was
that this design required that any new balls being loaded in do so on top of a
ball resting on top of the hammer. This presented some issues with maintaining a
sufficiently vertical loading stack, as balls could very easily get off-center, making
loading subsequent balls impossible.
The current design is also a high fire-rate design utilizing a spring-loaded
hammer, but rather than being driven by a torsional spring, it’s attached to a
linear spring and completes a full revolution with each firing, rather than the
reciprocating action of previous designs. To save space on the smaller robot, the
motor in this design drives a worm and worm gear to cock the hammer. This
hammer rests just below the firing chamber. It’s mounted to a slip clutch on a
shaft, allowing it to only turn on way, into the firing chamber. As the worm gear
turns, the hammer comes around, tensioning the spring until the hammer has gone
approximately 180 degrees, at which point the spring pulls the hammer forward
into the waiting ball. In testing this has resulted in a satisfactory rate of fire and
range.
5.3 Loading
The loading problem proved to be the thorniest issue in the design and
construction of the robot. In short, after gathering the ball using the wheel-body
geometry, it then needed to be loaded into a hopper that fed directly into the firing
mechanism, without using another actuator. On the iFling, this was accomplished
by storing the balls in the main body, and then releasing them out onto the arm
to fire. In the case of the Assault MIP, since the firing mechanism is in the main
25
body, the balls must now be stored above it, and in greater quantity, since it is
meant to fire them rapidly. This requires a precisely tuned internal geometry to
ensure that the loading process is both smooth and has a high success rate.
One concept explored was using paddles geared to the movement of the
wheels. A fixed wheel with a variable radius at one level and a gear the level
above is fixed at a set distance from one of the drive wheels. The geared level
is meshed with another gear, this one attached to a paddle further below. The
variable radius of the first wheel creates a ’dead space’ in its interface with the
drive wheel, to prevent the paddle from turning constantly. When a ball is rolled
up into loading position, it impinges on the paddle, pushing the variable radius
wheel out of its dead space, engaging the drive wheel, which then completes a
full revolution, driving the paddle which in turn pushes the ball into the loading
stack. This strategy was implemented with some success in the first generation
of Assault MIP, and worked in a simulation performed using Solidworks, however
its requirement for fine-tuned meshing between the drive wheel and the first gear
resulted in an unacceptably low success rate for loading, and the concept was
abandoned.
The subsequent loading strategy again involved using the drive wheel, but
26
this time bumpers were mounted to the inside of the wheel. These bumpers would
be angled on one side, creating a ’wedge’ effect between the ball and the front wall of
the robot, forcing it up and into the loading stack. This concept was implemented
on both the second and third generation Assault MIPs. In the second generation,
it was found that the robot was in fact too wide to effectively use the bumpers to
load into the stack. It was capable of loading, but only if there was a second ball
transmitting the force from the bumper to load the first ball into the stack.
Figure 5.3: Second Prototype Ball Loading Mechanism with Wheel Mounted
Bumpers
5.4 Fabrication
The first generation of Assault MIP was built using an industrial 3D printer
available in the UCSD design studio. The large scale of the printer, in addition to
its ability to use soluble support material allowed us to print the robot in several
28
large pieces. The second and third versions were printed on the Coordinated
Robotics Lab’s own 3D printer, a Makerbot Replicator. The second version, with
similar sizing and geometry to the first, couldn’t be printed in whole parts on the
smaller printer. Instead, the design was modified to split the entire robot into
printable components. While this proved feasible for most of the robot, it was less
than optimal for the wheels on the second iteration of the robot, as they had to be
printed in halves and then epoxied together. This resulted in some issues with the
wheels being ’true’. The third generation robot had a much smaller wheel radius,
which resulted in a simpler print.
The ability to 3D print our parts resulted in low-weight, high fidelity parts
for very low cost. This in turn allowed us to iterate through the design much faster
than we wound have otherwise. The design of the paddles for the loading system,
the hammer for the firing mechanism, the spring-loaded doors for maintaining the
loading stack, in fact every element of the robot required multiple versions to get it
into working order. The in-house 3D printer is now capable of making parts with
the same fidelity as the industrial level printer we used previously, after several
software upgrades which use the solid plastic which is used to make up the rest of
the printed parts to create an easily removable support structure for overarching
shapes that previously would have been unprintable.
The first generation Assault MIP had its electronics wired together manu-
ally, with various chips held in place with hot glue and wires soldered directly to
boards. This proved difficult to assemble, troubleshoot, and also created an un-
sightly ’rats nest’ of wires. For the second generation design a printed circuit board
was attached to the back of the robot, and all the electronics were mounted in with
header pins. This cleaned up the design significantly, and made troubleshooting
significantly easier. In addition, when the third iteration of Assault MIP was built,
the board from the second generation was mounted directly onto its hopper, which
allowed us to get it up and running in a fraction of the time previous designs had.
The second generation robot had to be assembled by hand from eight sepa-
rate parts held together with bolts and nuts. Not all of these were ideally positioned
for access by hand or by tool. For the third generation the team settled on using
29
4-40 sized bolts and captive nuts to hold the robot together, and the design was
done with a special eye towards ease of assembly.
This contributed greatly towards the speed of iteration that’s taken place on
the third generation design. Being able to take the entire robot apart to replace a
single component and then reassemble and test with a minimum of trouble helped
the team zero in on optimal solutions in reasonably short periods of time.
Chapter 6
6.1 Results
While it wasn’t possible to construct and test a full LDL for the robot,
much of the groundwork has been laid. Achieving high speed motion with a small
MIP proved non-trivial and counter-intuitive, however it is eminently achievable.
Having established the top speed of the robot as 2.1 meters per second we can
begin looking to the construction of the loop. While previous simulations required
a speed of 2.5-2.8 meters per second, in future the loop will be redesigned to acco-
modate the lower speed. Furthermore, while line following has been accomplished
with inverted-pendulum type robots before, previous attempts have been at very
low speeds. Utilizing the centroid algorithm with the appropriate conditioning of
the sensor data, we can achieve line following at much higher speeds.
30
31
In the instance of the robot completely losing the line, some preliminary
32
work has been put into writing an algorithm to recognize when the robot has lost
the line and to turn in the direction that the line was last seen in. This is achievable
on the current hardware, but is left to the next team to implement.
With the forward facing sensors, there’s work to be done exploring how
well it can follow a path with twists and turns. This could help shorten the course
necessary for the start of the LDL run, but also serves as an interesting problem
unto itself.
Chapter 7
Conclusions
33
34
[1] Morozovsky, Nick, Robert Moroto and Tom Bewley. RAPID: an inexpensive
open source dynamometer for robotics and applications. IEEE/ASME Trans-
actions on Mechatronics, Volume 18, Number 6, Pages 1855-1860 2013.
[2] Bewley, Tom (2012). Numerical Renaissance: simulation, optimizaion, and con-
trol, Renaissance Press
35