Maneuvering of a Robotic Pike

Maneuvering of a Robotic Pike
by
John Muir Kumph
Submitted to the Department of Ocean Engineering
and
Department of Mechanical Engineering
in partial fulfillment of the requirements for the degrees of
Master of Science in Ocean Engineering
and
Master of Science in Mechanical Engineering
at the
MASSACHUSETTS INSTITUTE OF TECHNOLOGY
February 2000
@
Massachusetts Institute of Technology 2000. All rights reserved.
..........................
Department of Ocean Engineering
Author'
and
Department of Mechanical Engineering
February 3, 2000
.......................
Michael Triantafyllou
Professor of Ocean Engineering
Thesis Supervisor
Certified by...
...................
Read by ......
IHarry Asada
Professor of Mechanical Engineering
Thesis Reader
A ccepted by ............
....
..............
Chairman, Department Commit
..............
Nicholas Patrikalakis
ts
OF TECHNOLOGY
NOV 2 9 2000
LIBRARIES
ENG
Maneuvering of a Robotic Pike
by
John Muir Kumph
Submitted to the Department of Ocean Engineering
and
Department of Mechanical Engineering
on February 3, 2000, in partial fulfillment of the
requirements for the degrees of
Master of Science in Ocean Engineering
and
Master of Science in Mechanical Engineering
Abstract
A robotic mechanism is described, called Robopike. The robot has fork length equal to 82cm, and
contains 5 motors, a computer and a wireless modem for communication during testing. Details of
the construction and testing methods are provided. The testing covered only a small part of the
extensive parametric range, and resulted in speeds up to 0.11 body lengths per second and turns of
350 in two seconds. The kinematics of the robot are quantified and analyzed. A non-dimensional
number, the Maneuvering Strouhal Number (Stm) is defined based on observations from live fish and
previous theoretical developments. Recommendations for further improvements in the maneuvering
performance of flexible hull vehicles are derived based on the Maneuvering Strouhal Number (Stm).
Thesis Supervisor: Michael Triantafyllou
Title: Professor of Ocean Engineering
2
Acknowledgments
I owe many thanks to all the people who have helped me build this robot, helped me test it, and put
up with all the messes, smells, and space it took. The last 5 years have been a very exciting time for
me. Thanks to David Barrett, Jamie Anderson, Elise Martin Fermier, Gillian Lee, Pehr Anderson,
Franz Hover, Alex Techet, Sam Tolkoff, Jim Czarnowski, Bill Kreamer, Ryan Cleary, Mike Jakuba,
Rocky Bryant, David Beal, Cocksucker the Black Shark Catfish, Michael Sachinis, Jen Tam, Keith
Breinlinger, Doug Read, Albert Wu and all my other cohorts at the Ocean Engineering Towing
Tank.
Special thanks to my UROPs, Marc dos Santos, Alex Chu, Pavlo A Valdivia Y Alvarado, Ann
Marie Polsenberg, Carlos Tapias, Sadiki Mwanyoha, and Anuj Mohan for their enthusiasm and help
in making pieces of the fish.
I can't believe how many friends were kind enough to drag me away from technology and remind
me of the other parts of life when I needed time to relax. Especially Slava, Joey, Kakul, Tanya,
Suzy, Janet, Siobahon, Xenia, Ken, Saul, Jason, Sarah, Jade, Bruce, Mike, Adrian and Shandra,
and Kristin.
Especially Lori for making thesis time full of good times.
And my advisor Michael Triantafyllou for thinking that the never been done could be done, as
well as all the folks at DARPA, Sea Grant, and ONR that funded this extremely fun project.
3
4
Contents
1 Introduction
2
3
4
5
11
1.1
M otivation
1.2
Previous Work
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . .
11
13
Theory of Fish Maneuvering
15
2.1
Mass and Energy .....................
15
2.2
Vortex Formation Number and Strouhal Frequency . .
16
2.3
Hydrodynamic Resistance . . . . . . . . . . . . . . . .
17
19
Experimental Apparatus
3.1
M echanical
. . . . . . . . . . . . . . . . . . . . . . . .
19
3.2
Electronics
. . . . . . . . . . . . . . . . . . . . . . . .
22
3.3
Software . . . . . . . . . . . . . . . . . . . . . . . . . .
23
3.4
Experimental Setup
. . . . . . . . . . . . . . . . . . .
25
3.5
Data Collection . . . . . . . . . . . . . . . . . . . . . .
25
Data Processing and Results
29
4.1
Optical Correction
. . . . . . . . . . . . . . . . . . . .
29
4.2
Kinematic Measurement . . . . . . . . . . . . . . . . .
30
4.3
Kinematic Results
. . . . . . . . . . . . . . . . . . . .
30
4.4
Sensitive Parameters . . . . . . . . . . . . . . . . . . .
30
Summary of Research
41
5.1
Mechanical attributes of robot
. . . . . . . . . . . . . . . . . . . . . . . . .
41
5.2
Maneuvering Strouhal Number (FFSN)
. . . . . . . . . . . . . . . . . . . . . . . . .
41
5.3
Speed and Turning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
43
5.4
Estimate of Power
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
43
5.5
Future Work
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
44
5
A Mechanics
45
B Electronics
51
C Software Control of Robot
55
D Kinematics
65
D.1 Joint 1 ...........
............................................
65
D.2 Joint 2 ...........
............................................
66
D.3 Joint 3 ...........
............................................
69
6
List of Figures
1-1
Robot Pike making a left turn in the MIT Towing Tank. The 82cm long vehicle is
modeled after a chain pickerel. It has an onboard computer, 5 motors, and bends like
a fish to move through the water. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-2
12
Above is a diagram showing a fish and the location of its fins. The Robopike is similar
in shape to this fish, and has a caudal fin and pectoral fins. The ventral fins were
not made for the Robopike. The dorsal and anal fins were made but not used for all
experim ents.
2-1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12
Above is a sequence of a fish turning. It illustrates the desired formation of vortices
during the turn. At the end of the turn a dipole, or pair of vortices is formed, which
contains the necessary momentum for the turn. . . . . . . . . . . . . . . . . . . . . .
3-1
Above is the layout of Robopike. This drawing generated in Autocad was used to
determine the size and geometry of most of the internal mechanical parts of the robot.
3-2
17
20
Above is a series of figures to demonstrate the overlay and blending of the maneuvering. The top figure shows the base sine wave. The next figure shows the trapezoid,
and the last figure shows the superposition of these two waves. The trapezoid is
synced with the sine wave so that jerk is minimized. . . . . . . . . . . . . . . . . . .
24
3-3
Above is a drawing of the experimental setup. . . . . . . . . . . . . . . . . . . . . . .
25
3-4
Closeup of video frame during experimental run. The marks used for following the
body's motion are visible in this image.
4-1
. . . . . . . . . . . . . . . . . . . . . . . . .
27
Effect of postprocessing on the data. Above is the trace of body position 1, during
a 1.0hz swimming run. Some shift is evident in the data due to a shadow in the
picture and the postprocessing software trying to find the center of mass of the spot.
However, it removes most of the dither which comes from hand selecting the spot on
the robot. The effect of the low pass filter is also shown. It does not significantly
alter the data visually. But since it is a 10th order non-causal 4Hz butterworth filter,
it significantly reduces the amount of dither in the velocity signal.
7
. . . . . . . . . .
31
. .
4-2
Locations of the marks on the body of the robot as it performs a turn at 1.0hz.
4-3
The velocity of position 3 on the fish's body during a 1.0Hz turn. The velocity is
32
decomposed into the relative side and forward velocities as referenced from position
3. The filtered and processed position data was used to obtain x and y velocities. The
velocities were then tranformed into the local co-ordinate system of the body position. 33
4-4
Above is the angle of the body positions of the robot as it makes a turn at 1.0 Hz.
This gives a good indication of the turning rate achieved during these runs. . . . . .
4-5
Above is a sequence of images of the robot pike (89cm long) performing a turn with
a tail beat frequency of
0.5Hz. The images are star shaped because of the warping of
the image during the elimination of barrel distortion. . . . . . . . . . . . . . . . . . .
4-6
. . . . . . . . . . . . . . . . . . . . . . . .
36
. . . .
37
4-7 Angle of body at each of the 8 measured positions on the body of the robot.
The velocity components of the body positions in their local co-ordinate frames, 0.5hz
run. ...........
4-9
35
Above the traces from three experimental runs. They show the body positions tracing
through space as the robot makes a turn.
4-8
34
.............................................
38
The velocity components of the body positions in their local co-ordinate frames, 0.8hz
run. ...........
.............................................
39
4-10 The velocity components of the body positions in their local co-ordinate frames, 1.0hz
run. ..........
.............................................
40
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
47
A-2 The final design for the collar part . . . . . . . . . . . . . . . . . . . . . . . . . . . .
48
. . . . . . . . . . . . . . . . . . . . .
49
A-1 The drawing for the skinmold.
A-3 The final design for the motor wiring feedthru.
B-1 Above is a schematic of the important connections between the computer and other
components in the head. Not shown are the power conditioning electronics. . . . . .
52
B-2 Bracket mounted to face seal bulkhead in nose cone. The electronics are mounted off
of this. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
53
B-3 Layout of electronics inside nosecone. . . . . . . . . . . . . . . . . . . . . . . . . . . .
54
8
D-1 Above is the schematic which helps understand the model for the first and third
actuators. This actuator, which drives the middle of the robot's body, is composed
of a hobby servo and a scotch yoke mechanism. The distance the scotch yoke pin is
located from the center of the servo's rotation is p. The way the mechanism works is,
first the servo disk turns because of the motor. Then the pin, located on the dotted
line at a distance p, slides in the scotch yoke. The horizontal bar attached to the yoke
then slides side to side. Since the pin goes around in a circle, but only the side-to-side
motion is translated to the horizontal bar, the bar has a linear motion equal to p sin(9)
where 0 is the angle of the motor. The term "linear motion" should not be confused
with linearity in the algebraic sense, since the relationship is highly non-linear.
. . .
66
D-2 Above is the schematic for the first body section's mechanism. The symbols used in
the mathematical model are shown in the drawing. . . . . . . . . . . . . . . . . . . .
67
D-3 Solution to the motor-joint kinematics for joint 1. The non-linearity is only strong at
the ends of the motors motion. An unexpected effect is the lopsided-ness of the joint.
68
D-4 Above is the schematic for the tail section of the robot. It is composed of a series of
links which move together to form an arc. . . . . . . . . . . . . . . . . . . . . . . . .
69
D-5 Above is the schematic for the caudal fin section of the robot. It is composed of a
dual scotch yoke mechanism, a housed pull-pull cable and a pinion attached to the fin. 70
D-6 The solution of the relationship of motor angle 3 to joint angle 3 for p = 1cm. The
non-linearities are only strong at the extremes of motion, where the fin isn't positioned
during normal motion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
70
D-7 Above is a schematic showing the symbols for the local curvilinear co-ordinate system. This co-ordinate system is used as an intermediate co-ordinate system when
determining body shape as a function of joint or motor positions. The body reference
frame co-ordinates, not shown, are referenced from the nose cone with y pointing aft
and x pointing port. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9
71
10
Chapter 1
Introduction
In order to study the maneuverability of fish-like bodies, a free-swimming flexible hulled underwater
machine was built, see figure 1-1. It was modelled after a Chain Pickerel (Esox Niger). Controlled
by an internal computer, this robot swam in the MIT Towing Tank. The swimming motions were
parametrized so that different swimming, turning, and starting motions could be tested. The swimming motions were recorded and analyzed so that the kinematics of the robot could be shown.
This chapter explains the motivation behind this research as well as some of the previous work
on this machine and other machines like it.
Chapter 2 describes the theory behind the maneuverability of fish-like underwater vehicles.
Chapter 3 details some of the mechanical design for this experimental apparatus, and also describes the experimental setup.
Chapter 4 shows the results of experiments and test-runs of the Robot Pike. It also explains how
the data was processed.
Chapter 5 discusses the results in comparison to theory, and it suggests possible future work
with this machine.
Appendix A has drawings and pictures of different parts of the robot
Appendix B has a description of the computer and control system of the robot.
Appendix C details the software that runs on the robot
Appendix D has the kinematic equations for the robot
1.1
Motivation
Underwater vehicles currently in use today fall into two general categories: those that are used to
go a long distance, and those used to explore an underwater site. The latter need to be agile and
have the capability to maneuver around an often cluttered underwater environment, whereas the
former need to be streamlined and fast for long range cruising. There currently is a lack of vehicles
11
Figure 1-1: Robot Pike making a left turn in the MIT Towing Tank. The 82cm long vehicle is
modeled after a chain pickerel. It has an onboard computer, 5 motors, and bends like a fish to move
through the water.
Pike Fin Locations
Caal Ta Fn
Dorsal Mn
Ventral
Pectoral Fins
Figure 1-2: Above is a diagram showing a fish and the location of its fins. The Robopike is similar
in shape to this fish, and has a caudal fin and pectoral fins. The ventral fins were not made for the
Robopike. The dorsal and anal fins were made but not used for all experiments.
12
that can perform both tasks well. This severely limits the range of tasks that underwater vehicles
can perform successfully.
By building a streamlined flexible-hull underwater vehicle and successfully controlling it, many
tasks that require the use of people, ships, and robots, may only require a single machine in the
future. Since the ocean is an extremely dangerous place, this could also save lives.
1.2
Previous Work
Many scientists and engineers have studied fish over the years and marvelled at the ease with which
they swim through the water. There have been many attempts at making fish like propulsive systems
for water-bourne craft. Recently there has been the Robotuna [5], The Penguin-Boat [8], and Draper
Lab's VCUUV [3].
Robopike has been built specifically to experiment with the maneuverability of fish like propulsion. By using a large part of the body as a control surface to maneuver, the vehicle has exceptional
maneuvering abilities when compared to a rigid hull vehicle with control surfaces. Of course one can
outfit an underwater vehicle with many thrusters which make it extremely agile, such as Jason [4].
However, the addition of so many thrusters makes the vehicle a poor choice for long range cruising.
The streamlined shape of a fish, along with its articulating hull allow it to swim with low drag but
still retain very good maneuverability. This increased ability comes with the engineering cost of
increased complexity. It was the aim of the Robopike project to determine how to build such a
machine and make it work.
Because the body is articulated there are a large number of degrees of freedom and it's not
obvious how to co-ordinate all the different actuators to perform navigation. Nature gives us a very
good starting point for emulating the motion of a fish. But subtle differences between the robot and
real fish make simply copying the motions ineffective. The general problem of articulated underwater
craft control is difficult at this point and this thesis does not offer a solution. Rather it points towards
a good method to solve it and shows some results of swimming tests. The experiments also show a
proof of concept. A fully articulated underwater vehicle is shown here and a similar design may very
well be a good solution for certain kinds of underwater missions. Robopike demonstrates a small
(82cm long) free swimming robot fish.
13
14
Chapter 2
Theory of Fish Maneuvering
Fish have pushed themselves through the water for ages, and people have often marvelled at their
abilities [10]. But how much of their capability is rooted in hydrodynamics and how much in the
complex mechanisms and control of their strong muscles. Many researchers have worked on this
question [11] [5] [1]. Compared to a traditional streamlined underwater craft, fish use a much larger
area to actively manipulate the water, which in turn propels them. It is this larger area which
allows fish, real and artificial to perform with such agility underwater. However, the robot pike does
not have the power density that real animals have. This detracts from the ability of the artificial
fish to accelerate rapidly and swim at high speeds. These capabilities increase directly with better
actuators. But it is our hypothesis that an articulated streamlined hull is a very good solution for
both agility and long range cruising. Below we will show how a streamlined articulated hull has
both agility and low drag.
2.1
Mass and Energy
For maneuvering, the more water one can use to manipulate oneself, the lower the energy required
to do the maneuver. For a turn, one can in theory use almost no energy to turn. For a start, it
would be the energy required to obtain the final forward speed. The amount of momentum required
to do a maneuver is fixed at,
p= my
(2.1)
where # is the momentum, m is the mass of the object doing the maneuver, and v is the velocity
vector representing the change in velocity due to the maneuver. The momentum imparted to the
external environment due to the maneuver is -J. If the absolute velocity doesn't change, as in a
15
turn, then momentum is required, but energy may not be. The energy to perform a maneuver is,
1
-mV 2
2
E
(2.2)
where m is the mass of the object one is using to push-on or pull-on to perform the maneuver and
v is the final velocity of the object being used to perform the maneuver. We don't need to take into
account the object performing the maneuver because its speed and mass aren't changing. For an
underwater vehicle, it's using many particles of water and so the above equation is an integral of
all the velocities and masses of the water being used to perform the turn. Because the momentum
imparted on the fluid is fixed at -,
but the way we divide it between the velocity and mass isn't, we
can increase the mass. This decreases the velocity, and this reduces the required energy dramatically.
ie. If we can double the mass used to perform the maneuver, then the velocity imparted on the mass
is halved. And the energy is also halved. If one can involve a larger amount of the surrounding fluid
in a constructive way (not just stirring it up), then the required energy to maneuver is reduced. The
tail of the fish forms vortices with every flap. The size of these vortices is indicative of their mass.
By creating large vortices in the correct direction and position, one can maneuver with less energy.
2.2
Vortex Formation Number and Strouhal Frequency
The unsteady hydrodynamics of maneuvering and starting means that the predominant characteristic of the flow, from a Navier-Stokes perspective, is given by the Strouhal number, Df/U. Several
researchers studying propulsive jets and vortex rings have found that to optimally form vortices, the
timing and motion are related.
In working with vortex rings, Gharib et al. [9] found that the most important parameter for
forming vortex rings with a piston pump was the so called 'vortex formation number'. In their paper,
they form vortex rings by using a tube inserted into a bath of water with a piston in it. The piston
in the tube is made to move, which pushes a slug of water into the water bath. Much like blowing
smoke rings, they form vortex rings in the water bath. They varied the diameter of the tube, and
the motion of the piston and found that the strongest vortices with the least work were formed with
vortex formation numbers between 3.6 and 4.5. The vortex formation number is defined as LID or
Ut/D. L is the length of the slug of water the piston pushes, D is the diameter of the piston, U is
the average speed of the piston, and t is the time of the piston's stroke.
Other researchers have found that many different fluid-mechanical systems which generate propulsive jets operate with similar strouhal numbers [18]. Systems as diverse as a large range of aquatic
animals and the human heart operate with similar strouhal numbers.
Df/U. Where D is a characteristic diameter,
f
The Strouhal number is
is a characteristic frequency but one can substitute
1/t where t is a characteristic time, and U is a characteristic speed. The amazing thing here is that
16
(a)
(b)
(c)
(d)
(f)
(e)
Figure 2-1: Above is a sequence of a fish turning. It illustrates the desired formation of vortices
during the turn. At the end of the turn a dipole, or pair of vortices is formed, which contains the
necessary momentum for the turn.
many different fluid mechanical systems seem to have an optimal operating range. Our robot will
need to operate in that range if it is to work optimally.
Our robot produces a propulsive jet with a series of vortex rings. Instead of a piston, like in
Gharib's experiments, it has a caudal fin. We seek to non-dimensionalize the motion of the tail to
see if we can find a similar pattern in the formation of propulsive vortices as described above.
2.3
Hydrodynamic Resistance
By having a streamlined body, the coefficient of drag is very low.
Maneuvering forces are still
substantial, but as shown in the analysis above, the actual energy used can be minimized. For straight
line swimming the energy required can be estimated at the drag times the speed forward. The energy
used by the vehicle can be substantially higher than that though because of lost energy at the motors,
gear boxes, and propulsive inefficiencies. A fairly thorough measurement of characteristics of flapping
foils was done by Read [16]. The highest measured efficiencies were about 60%.
17
18
Chapter 3
Experimental Apparatus
Most of the design for the Robot Pike is detailed in the bachelors thesis by this author [12]. However,
this chapter details some mechanical modifications and additions.
The design of Robopike was
heavily influenced by the design of the Robotuna [6]. This chapter also details the electronics in the
head of the robot and explains how the software works.
3.1
Mechanical
The robotic mechanism was built for this thesis. Below are descriptions of various parts of the
machine.
Layout:
In figure 3-1 is a drawing of the layout used to build Robopike.
Little is changed from the
original drawings [12]. However this layout shows the electronics in the nose cone and shows some
of the small modifications. The basic design of the robot is shown. There are 4 main sections of the
machine: the nose cone, the body, the tail, and the caudal fin.
Actuators:
Originally all the servos were Tower Hobbies TS-51's, but later the main body servo and the tail
servo were switched to Futaba 9303 high torque model airplane servos.
Transmission:
Originally the tail transmission had some glue joints in it, but since the parts were made out of
delrin, even a shear joint would not hold. So holes were drilled and shear pins pressed in. The wire
rope which is used in the tail transmission slipped on the pulleys, so brass was crimped onto the
wire and pockets were milled into the pulleys to prevent slipping.
Skin:
The skin was finally composed of cast silicone rubber. It was cast in the shape of a bellows so that
it was extremely compliant in the longitudinal direction of the fish. No flat homogeneous material
19
Linear Servo Drive.
Secod Body Section uDouble
~lode
~
spring
Control
Bar
Linkage
~
\~~
~
~
~
----
ooen1lyup
Srvg&
~pln
~Gervo
o
Control Ba 1.4,1r a
ukea
~
oo
box
0,
04
Holds Spin toBukhadmon
Cluep
BClamprcable
toryo
Figure 3-1: Above is the layout of Robopike. This drawing generated in Autocad was used to
determine the size and geometry of most of the internal mechanical parts of the robot.
20
uble acting linear
rvo drives Tel
Pike Assembly
te to
4-40 Eolt hocldface
ied to oe o
flange
Digital Cameras for gyia
Onse Model
Computer
8
none cone flange
.....
Cutouts .850" Deep to
make room for top of em0al
r
honsings
Power Management Unit
rieE
#29 a-ring
Electric Cable
Face
pla bolted
boZdltet
noee cone flange
FMgdthroughs
Mounting
Aembly holes are used by rods
Blocks
in place during a.embiy of
John Muir Kumph
M.I.T. 1995-1996
J20 O-ring
4 inches
21
I
could be found which was compliant enough. In fact real fish skin was inspected to determine what
properties it had. It too was extremely compliant. The real fish skin examined had the same elastic
properties as that of a bellows. The real skin was very compliant up to a certain strain and then
became very stiff. The bumps of the skin are oriented vertically and so they are in such a direction
so as to add to the skin drag of the robot. However, since we are interested in maneuverability of
this robot, added skin drag should not adversely affect its ability to maneuver.
Fins:
The caudal fin is a wood laminate structure, but the pectoral fins are cast epoxy with hollow
glass spheres in the mixture to lighten the structure. The anal and dorsal fin, because they needed
to be flexible, were cast from silicon rubber.
Flotation:
The flotation is made of PCV foam (Klegecell). This kind of foam has a very high stiffness so
that it does not compress very much under water pressure. This keeps the fish which is only slightly
positively bouyant from sinking should it go a foot or so beneath the surface. Originally styrofoam
was used and the fish would sink if it went below a foot from the surface.
Hull:
The hull of the robot is made from a helical wound fiberglass spring. The spring is constrained
to only bend in a plain by two splines attached to the top and bottom of the hull. For the main
body section of the fish, this hull also is the main structural element of the robot. But for the tail,
the robot mechanism on the inside provides the main structural component.
3.2
Electronics
The electronics in the head of the robot are there to control the motors and make the robot swim.
There are no sensors installed for the testing in this thesis. Below are the major components.
Power:
On board power is conditioned from three DC-DC converters and a low voltage drop-out regulator. External power is supplied by two thin wires. The voltage needs to be 10-18 volts. At 17 volts,
the current is about 500mA while swimming at 1 Hz.
Computer:
The computer on board the robot is a Motorola 68332 based computer from Onset Computers
Inc. (Onset Tattletale Model 8).
22
3.3
Software
The software which runs on the fish sets up the onboard computer, communicates with the host
computer, and makes the robots motors move. Below are the main components of the software.
Interrupts:
The 68332 computer outputs the commands to the motors at 70 hertz, driven by an interrupt
from the onboard clock. The wave forms come from a sine wave lookup table superimposed on top
of a time varying bias. This bias is what controls the turning of the vehicle.
Sine wave lookup table:
Each joint moves in a sinusoidal motion and so there is a lookup table for the sine wave. The
amplitude of the swimming motion is controlled by divisors and the phase by an offset into the
lookup table. Each joint has the sinusoidal motion but during a maneuver a time varying bias is
added to the sinusoidal motion.
Blending and Overlay:
By superimposing a turning motion on top of the sinusoidal motion one can turn. But the turning
motion needs to be co-ordinated with the swimming motion. The turning motion also needs to be
smooth so that it is blended into the smooth swimming motion. The strategy to parametrize the
motion is in [13], but will be repeated briefly here.
A trapezoidal time varying offset is added to the sinusoidal motion. See figure 3-2 for a visualization of the method. This method works well for maneuvering, provided that the proper parameters
are chosen for the motion and that the turn is synchronized with the normal sinusoidal motion.
Parameters and simplification:
The number of parameters which one can tune starts to become very large quickly, even with
this simple method of turning and forward swimming. So certain simplifications were made so that
the parameter space could be explored a bit.
The parameter space is composed of swimming parameters, turning, and starting. The swimming
parameter space is composed of the tail beat frequency, the amplitude of the motion of each of the
three joints, the offsets of the second and third joints from the first. This makes 6 parameters for
swimming. For turning, each joint has a trapezoidal overlay for the turn. Each trapezoid has a
starting slope, a trailing slope, an amplitude and a duration. This makes 5 times 3 joints, or 15
parameters, plus the trapezoids for the second and third joint have time offsets from the first. This
makes 17 parameters to define a turn for a particular way of swimming. A start is parametrized the
same as a turn. By making some simple simplifications we can reduce the complexity of the system.
And each parameter we can eliminate reduces the complexity exponentially, so it's a very desirable
thing from an experimental point of view.
First all the trapezoids have the same length, but varying amplitudes, and different slopes. The
rise slope and fall slope are the same for each trapezoid. The phase offsets for the trapezoids are
23
1
0.5
0 WMI
I
IM
I
-0.51
-1
0
20
40
60
80
100
120
140
1E 0
20
40
60
80
100
120
140
1 30
1
0.5
0
0
2
-AA
1
0
-1
0
20
IAAAAAAAAA-
40
60
80
100
120
140
-
1 30
Figure 3-2: Above is a series of figures to demonstrate the overlay and blending of the maneuvering.
The top figure shows the base sine wave. The next figure shows the trapezoid, and the last figure
shows the superposition of these two waves. The trapezoid is synced with the sine wave so that jerk
is minimized.
24
I
hi-res camerc
~3ft
power cale
free surface
Figure 3-3: Above is a drawing of the experimental setup.
found from the phase of normal swimming. This makes for 7 parameters for a turn (3 amplitudes,
1 length, and 3 slopes).
3.4
Experimental Setup
The robot was operated in the MIT Towing Tank near the surface of the water. Different operating
parameters were chosen to make the robot swim in different ways. The main interest for this thesis
was to investigate turning behaviors. An overhead video camera was used to collect data during the
run. Calibration of the video image was done by floating a yard stick in the field of view and taking
snap shots of the image. Power was provided by a thin pair of wires to the robot. And the dorsal
and anal fin were not present on the robot during these tests. See figure 3-3 for a drawing of the
experimental setup.
3.5
Data Collection
The primary source of data for testing came from analysis of digital video images of the robot
swimming around in the water. A high resolution black and white camera (Texas Instruments MC1134P) camera was used. The output of the camera was directly fed into a video digitizing card
25
(ATI TV Wonder). The resolution sampled was 640x480 pixels for each frame. And the video was
sampled at between 15 and 30 hertz. The camera's output was interlaced, but the image's pixels
were sampled in 1/60 of a second all at the same time. The resolution of the camera's pixels is 1134
x 486 so the digitized video is of lower qualiy than the camera's.
Unfortunately, digital video takes an enormous amount of data storage at the time of this testing.
But by using current data compression techniques, the digital video becomes manageable. These
data compression standards are meant for consumer video content so they are lossy and do not
replicate the images perfectly. However, by inspection, these compression standards do not seem
to modify shapes so much as they reduce the color depth. The information in the digital video is
the kinematics of the robot as it swims through the water. By following certain high contrast spots
(see figure 3-4), we can obtain the kinematics of the robot. The lossy compression we used did not
corrupt the 640 x 480 resolution of the image.
For our testing, we had to use a wide angle lense. This is because the images had to be taken
overhead, and the ceiling was only 6 feet from the surface of the testing tank. The wide angle lense
introduced spatial distortion which we eliminated during the data processing of the images (see
section 4.1).
26
Figure 3-4: Closeup of video frame during experimental run. The marks used for following the
body's motion are visible in this image.
27
28
Chapter 4
Data Processing and Results
The fish was operated with different swimming parameters (see section 3.3) in the MIT Towing
Tank, see section 3.4 for the experimental setup. Digital video was taken of these experimental runs.
The video was then broken up into individual frames and imported into Matlab where the images
could be analyzed with software. A modified Xanim was used to break up the movies into individual
frames. Inside Matlab the optical distortion of the wide angle lense was corrected with the help of
calibration images taken before each sequence of runs. By going through each image and selecting
the marked points on the body of the robot, these points could be followed in two dimensions from
the fixed reference frame of the camera. The points on the body were initially selected by hand,
but then a post processing algorithm described below was used to refine the location measurements.
The marked points on the body gave the kinematics of the body so that the performance of the
robot could be analyzed.
4.1
Optical Correction
By imaging rulers or a grid, one can determine the distortion of the image. The distortion introduced
by a wide angle lense is called barrel distorion and can be eliminated by performing a transformation
on the image [7]. To eliminate the distortion we apply the transformation,
r2 = ar + br3 + cr5
(4.1)
where rp is the new distance of the pixel from the center of distortion, r is the measured distance
from the center of distortion. There are two more parameters for the warp not explicit in the
above equation. They are the co-ordinates x and y of the center of distortion. Since the camera is
directly overhead the robot and the image plane is parallel to the plane of the robot's movement,
the co-ordinates of the center of distortion can be taken to be the center of the image.
29
4.2
Kinematic Measurement
After calibrating the digitized video, each frame was analyzed and the locations of marks on the
body recorded. Due to the difficulty of hand digitizing the locations of the marks on the robot,
a significant amount of dither is present in the hand recorded data. But by reanalyzing the data
one can eliminate most of this dither. The method used involved drawing a box around the hand
selected point and then averaging all the pixel values in that box. If the mark on the body was
white, then the center of brightness of all pixels brighter than the average brightness of that box
was the measured location of the mark. If the mark being searched for was black, then the center
of darkness darker than the average value was the measured location of the mark. The results were
checked visually and this method recorded the center of the marks on the robot much better than
just selecting them by hand, see figure 4-1. All of this processing was done with the aid of Matlab.
4.3
Kinematic Results
Below in figure 4-2 are the pathlines of the marks on the robot during a turn. During this run,
the robot was operated at 1.0hz. And it swam at 9cm/sec forward. In figure 4-3 is the velocity of
position 3, which is close to the center of mass. In figure 4-4 is a plot of the angles of the various
joints through time. One can see that the turning rate is about 15 degrees/second. One can see that
during the turn, the forward velocity component of joint 3 slows down a bit, see figure 4-3. During
the turn, position 3 also picks up some sideways slip.
4.4
Sensitive Parameters
In order to get the fish to turn the most important parameters were timing of the turn so that it
started and stopped in sync with the swimming motion. Turning was tuned by hand and eye and
then variations were made to the parameters.
One of the most sensitive parameters was the phase between the joints for normal forward
swimming. As we changed the frequency of the swimming motion, the tail had a tendency to lag.
This was corrected by raising the commanded phase until it appeared to match earlier tests. Still,
the forward speed was very dependent on the phase of the tail motion, so a small change results in
a large change in the forward speed. Because the motion of the turn is superimposed on top of the
normal forward swimming motion, the turning performance is also effected by the phase as well.
The amplitude of the caudal fin's pitch oscillation also has a large effect on the forward speed of
the robot. This is probably due to the apparent local velocity of the water at the foil. If the pitch
oscillation amplitude is too high then the foil can't produce thrust at a higher speed, but if it is too
low then it will stall the foil at lower speeds.
30
raw data to processed data, 1.0hz, position 1
---*-
-0.98
filtered and processed
post processed
raw
-1
-.-.-.-.-
-1 .02
C-1
-
-.-.-
-
-.-
-....
--....
-....
-----. -................
-..- - ---- .04 -.........
-
-
----
-. -
--
0
.06
-.
.--.
. . .. .----.
.. .--.
..----.
. ..
-.-.
-.- -.
. .. -.
. ..
.. ..-.-.-.-.-.--.-.
.-.-- .
1
.08
- . . . ... . .--.
. ...------.
.. . . - . -.
.. .
. ..
.-.-.-.-.-.-
...
-1.1
-1.12
1.24
1.26
1.28
1.3
1.32
1.34
x co-ordinate [m]
1.36
1.38
1.4
Figure 4-1: Effect of postprocessing on the data. Above is the trace of body position 1, during
a 1.0hz swimming run. Some shift is evident in the data due to a shadow in the picture and the
postprocessing software trying to find the center of mass of the spot. However, it removes most of
the dither which comes from hand selecting the spot on the robot. The effect of the low pass filter is
also shown. It does not significantly alter the data visually. But since it is a 10th order non-causal
4Hz butterworth filter, it significantly reduces the amount of dither in the velocity signal.
31
composite of body positions 1.0hz
I
I
I
I
1.2
1.4
-0.4 k
-0.6 k
-0.8 H
E
0
-1
-1.2 -
-1.4
0.2
I
I
I
I
0.4
0.6
0.8
1
x co-ordinate [m]
1.6
Figure 4-2: Locations of the marks on the body of the robot as it performs a turn at 1.0hz.
32
velocity components of body referenced to local body position pos 3, 1.0hz
0.2
-
.-.-.-.-.-.-.-..-.-.-.-.-.-.-.-.
0 .15 - . .-.. . . .. . . . . . .. . .. . . . . . . . . .. . . . . .
-
-..-
- -
0 .1
-
..
forward velocity
side velocity
-..
E
0 .0 5
-0.1
.-.-.-.-.-.-.-.-.-.
-..
.. . . .. . . . . . . . . ....-...
0
1
2
3
4
5
6
7
8
time [sec]
Figure 4-3: The velocity of position 3 on the fish's body during a 1.0Hz turn. The velocity is decomposed into the relative side and forward velocities as referenced from position 3. The filtered and
processed position data was used to obtain x and y velocities. The velocities were then tranformed
into the local co-ordinate system of the body position.
33
angle of joints during turn 1.0hz
20
-nose
-0-+-*-
0
- - - - - - - --
- 2 0 - - - - - -.- - -
cone
body position 4
body position 5
body position 6
- - - - - - - - - --. -x--
caudal peduncle
-
caudal fin angle
- - - - - --..
. - - - .. .. . .. .. . - -.... . . .- - - -..--- - - - -.-- - - - - - - - - - - - -..-- - - - --..--
CO
-R - 4 0
. .. -..- -.. .-.. .. -.- - -.-.-.-.-- -.-.-- - - - - -
-.
- -.
C
- 8 0 - -- - ..-- ..-
-100
0
1
2
.-.-.
- - - - - --..
--.-
-..- - --..-
3
4
time [secs]
5
.-.-.
..-.-.- - - --..
6
7
--.-
8
Figure 4-4: Above is the angle of the body positions of the robot as it makes a turn at 1.0 Hz. This
gives a good indication of the turning rate achieved during these runs.
34
K)0
:-4
:-4
Figure 4-5: Above is a sequence of images of the robot pike (89cm long) performing a turn with a
tail beat frequency of 0.5Hz. The images are star shaped because of the warping of the image during
the elimination of barrel distortion.
35
composite of body positions during 0.8hz
composite of body positions during 0.5hz
1.3
-0.2
1.2
-0.3
1.1
-0.4
1
-0.5
-0.6
0.8
o0.7
0.7
-0.8
0.6
-0.9
0.5
-1
0.4
0.3
-1.1
0.6
0
0.8
1
1.2
1.4
xco-ordinate [in)
composite of body positions 1.0hz
1.6
1.8
0.6
0.8
1
1.2
x co-ordinate
1.4
1.6
1.8
[m]
-0.4
-0.6
--0.8
- 1.2
-1.4
0.2
0.4
0.6
0.8
x
1
co-ordinate [m]
1.2
1.4
1.6
Figure 4-6: Above the traces from three experimental runs. They show the body positions tracing
through space as the robot makes a turn.
36
angle of joints during turn. 0.5hz
80.
angle of joints during turn
nos
0.8hz
cone
body position 5
6
-M-caudal peduncle
caudal fin angle
--- nose
con
-- body position 4
... ....
...
.. .......
..
-4- body position 4
-+ body pooltion B
+..body position
caudal pedurenle
caudal fin angle
+-4
6
.. ....
......
60 . ........ ... . . .
........ . .. .
........
.....
.
.
... -4 - body position
40
20
*m
20
0
*
. .. ..
-20
..........
... ....... ......
....
. . . .....
.....
0
..... ....
-20
-Q0
-40
2
0
4
6
10
a
timne [sees]
during
angle of odntB
12
-no.. con.
-e_ body position
+body position
-- . -..
-.
-.
.
-...-.-..
. . . . . .. . . . -. -
0
14
1
2
3
4
5
tine [seca]
6
7
B
tumn 1.Ohz
4
5
6
caudal
caudalfn ange
-a-- body position
..peduncle -
..
-40
-80
0
1
2
3
4
time [ses]
6
6
7
8
Figure 4-7: Angle of body at each of the 8 measured positions on the body of the robot.
37
9
10
velocity
-~
0.1
of
components
body
relerenced
~ ~ ~ ~ ~ ~ ~~o:,
~~
~ -ve-l------~
~
i
-ve-----loc-----it--
--
local
to
--
--
y
body
pos 1,
position
velocity
6.5hz
0
components
body
2
referenced to local
body
position
pos
.
O.Shz
-
0-08
it-y
0.08
O-OE
O-.D
I
0.04
0.02
0.02
-~ ~- - - -
(I
~- - ~
- -~
--r - - -
-0.02
-0.02
o
2
4
6
velocity comnponents
10
a
of
body
to local
--- ;:wrd Velocity
referenced
posilion
2
pos
3,
0-5hz
4
100
body ,64000ooed
velocity cornpona0610of
velocit
-side
0.05
12 1
body
.
.-..
1261
I
to60601
body
positio
pos 4,
0.51,
-.
0.042
0.04
0.03
1-012
0 0.02
-0.01
-0.024
-0.04
-0.02
0
2
velocity
4
6
to loca
10
a
fimne 1s-c]
conponents 6l body referenced
body position
p6s 5,
12
1
2
0
00,
4
velocity
.
O.1hz
A1.
6
timne
1-1c
of body referenced
components
..
b
10
to local
body position pos
12
6,
0.5hz
[ . r veo ]
sid velocit-
0-.0
-k
----
0.08
0.04
0.02
0.02
I0
i
-~~~
-........
-0.02
-0.02
-0.04
-0.04
-0.06
0.08'
2
4
tinto
velocity comrponents
-o0
0.1
-
6
0
b]
a
10
0
of body referenced to local body position pos 7,0.5hz
~~
~
--.rd -l
2
12
1
46
timb
10
[1
velocity comtponentse of
-
----------
0.3
-ve--lo--ci--ty~ - ~ sd
1
~~f=I
~ ~ ~ -~ - ~ ~ --~
-
-
- -
1
12
bd
body relerenced to
-
-
local
body posidion pos
-
-~
~~
sd v---e---locity------
0.2
-q
0.05
0.1
J!
0
0
-0.1
--O-D5i
-0.2
-0.1
-0.3
-0 0
2
4
6
8
10
12
0
2
6
time
a
10
4
[sec]
Figure 4-8: The velocity components of the body positions in their local co-ordinate frames, 0.5hz
run.
38
12
8. 0.5
velo0ty componenls of
body
reerenced
to local
body position
velocity components of body referenced to local body position pos 2, O.-hz
O.Bhz
Poe 1,
forward -elcity
forwrd voity
--
side Velocity
1
0.15
0.1
OOS
0
-
-0.1
0
-0.15
lo.ioty ooopo
ol.dbody referenced to loca body posdo p6- 3,O
0
1
2
3
4
5
timie [secl
6
7
8
9
1
9
1
velocity components of body referenced to local
iy
0.1
0.1
1
body position pos 4, o.8hz
1
1
1
1
0.08
0.08
0.06
.-
0.04
0.02
C,
-
-q
0.02
-0.02
1
2
3
4
d
6
It-m [-]c}
7
8
a
9
1
0
---
3
2
ve ocity components of body referenced to local body position pos 5,O.Bhz
4
5
6
7
a
velocity comrponants of body referenced to local body position Pos 6,08hz
orward velocity
velocity
side
0.1
-
~~ ~ ~
-
-
f-
--
+
-0.15
-0.1
-0.2
'
0
1
b015
2
3
4
6d 7
81
velocity corrponents of body referenced to local body position poe 7.O.8hz
0
9
velocty comriponents of body eferenced to local
body position ps
80.
O8hz
=ewrd veloiy
0.2
0.2
0.1
-0.2
-0.1
-0.2
0
1
2
3
4
0"m
5
[sect
6
7
a
9
1
1
1
2
6
time 1-1c
6
7
a
9
1
Figure 4-9: The velocity components of the body positions in their local co-ordinate frames, 0.8hz
run.
39
velocity omrponents of body relerenced to local body position pos 1. 1.Ohz
velocity
components
o(body referenced to local body position pos
2, 1.Ohz
OA5
0.08 - --0.06
E
-005
0.02
0.02
-
--
--
-
-
-
-
---
-
-
-
**)4
0 ,( 6
2
1
velocity
(A
components
3
body
relerenced
02
-
0.1 I--
--
- -
-
--
-
body
5
6
position
pos
7
3,
0
1
velocity
1.Ghz
2
components
3
of body
4impoo14o
6
5
rdwarnoed to local
7
body position pos 4,
1.Ohz
locd
s.,
0.16
4
IoCa
to
-
-
-
--
-- --
- ---
0.1
-
l -od-
-
-00
0.08
--- -
- - -
-
-
0.06
0.06
0.04
0
0.02
-0.0
0
-2
0
1
2
3
4
0
velocity components of body reter,00604to
6
0201 body
7
-
-
p60
5,
-
1
00 -
velocity
1.000
lo ft
cit
--
0.15
2
positio
4
3
of
o
5
Nine [sac]
comnponents
body
to loca
referenced
body
posiion
pos
6,
0.2
0.15
.1s
0.1
0.0
-0o
-
.......-0.1
-0.15
0
0.26.
0.2
1
2
elocity components of
-----
3
body
S
4
te1rmed to local
-v---o-ci-ty
id
0
body position
1
2
3
4
b
6
7
velocity comtponents of body ersncd IG PooW body positon pms 8,1.Ohz
t-rw wocity
..
...
------ --
0.3
0.15
-
---
-
~ ~~--
y.
-----
sd ve--lo--ci---y
0.2
0.1
01
o
E
0
7
pos 7,101hz
-0.2
--. 1:
--. 3
-0.2
0--
40100
35
6
7
a
0
1
2
3
4
6
Figure 4-10: The velocity components of the body positions in their local co-ordinate frames, 1.0hz
run.
40
0
7
1.Ohz
Chapter 5
Summary of Research
In this thesis we have investigated building, running, and analyzing a robotic pike. Kinematic analysis shows that the speeds it can swim at are around 6cm/sec - 9cm/sec, and that the maneuverability
is not significantly effected by the speed. This is likely because the articulated hull acts like an adjustable angle propulsor. It remains to be shown what the upper limit on the performance of this
robot is. Because of the large parameter space for both turning and swimming it is desirable to
perform many more tests. This thesis has laid out that the robot pike built does work and it is a
promissing possibility for underwater propulsion. But much work does remains to be done.
5.1
Mechanical attributes of robot
The robot works underwater and flexes its body to move. The skin used, while bumpy, was compliant
enough so that the motors were not limited by it in their motions. The motor design worked well,
except for the two pectoral fins which would sometimes spring a leak. The weight distribution of
the robot worked but made it very difficult to add sensors and batteries.
5.2
Maneuvering Strouhal Number (Stm)
It may be interesting to measure the motion of the robot during a turn or a start by some metric
which is akin to the vortex formation number or strouhal number. This would allow us to compare
future results with similar experimental apparatus. The Maneuvering Strouhal Number, Stm, is
define as
Stm = D/Ut
(5.1)
where t is the time it takes to make the turn, D is the distance between the vortices produced by
the tail during the turn, and U is the forward speed of the body during the turn.
41
Table 5.1: Below is the measured data from the different runs used to obtain the measurements of
Stm.
run freq. [Hz]
robopike 0.5
robopike 0.8
robopike 1.0
danio unk.
tail sweep dist. [m]
0.3
0.3
0.3
0.41
speed [m/s]
0.06
0.07
0.09
1.5
time to turn [sec]
3
1.5
1.5
0.5
Stm
1.7
2.9
2.2
0.55
Because we have not measured the distance between the vortices directly, we must estimate it.
One method is to assume that the vortical pair made for the momemtum necessary for the turn has
similar geomemtry to a real fish, for which there is already flow visualization for. This is not an
unreasonable estimate because the motion of the body is very close to that of a real fish. Another
estimate can be made by assuming that the distance between the vortices is close to the swept
distance made by the tail during the turn. This is also a good estimate because the vortices are
made by the tail.
Using kinematic measurements of the tail from the video shots we get a Stm of 1.7, 2.9, and 2.2
for the 0.5, 0.8, and 1.0 hertz runs respectiveley. The sweep distance of the caudal fin was the same
for all runs and was measured by looking at the video data. It was measured to be 0.30 meters, and
can be seen in figure 4-5. The speed of the robot is taken from the processed data for the run. It is
the speed of the robot as it enters the turn. The time it takes to turn is determined from the plots
of the angle of the joints vs. time (figure 4-7).
We can compare these results to that of a real fish.
Anderson [1] measured Giant Danio's
swimming and making turns with digital partical image velocimetry (DPIV). Her results show the
fish making a turn of 750 in 0.5 seconds. The flow visualization of DPIV makes directly measuring
the spacing between the vortex cores, which form the momentum jet, possible. Using the above
definition of Stm the Danio has a Stm = 0.45. By measuring the kinematics of the danio and not
using the knowledge of the actual jet width, the tail sweep length is 41% of the body length. And
using this number the Stm = 0.55. Thus it appears that for turning motions of both our robot
and Anderson's danio a smaller Stm makes for a better turn. Anderson also measured the core
size of the vortices and found them to be much larger than for regular swimming. The core size is
a good indication of how much mass is involved in the vortex. And involving more mass reduces
the required mechanical energy for the turn. Gharib's work [9] suggests that there is a limit to the
strength of the vortex that can be made before pinch off. But the tests done with the Robopike so
far are unlikely to be near that limit.
42
Table 5.2: Below are the estimates of power use at a swimming frequency of 1.0Hz. The electrical
power required to operate the robot while idle was subtracted from the power used while swimming
to determine the electrical power required to swim. The electrical power required to swim was then
multiplied by the total system efficiency to arrive at the required mechanical power.
swim mode
idle
straight
turning
5.3
current [amps]
0.300
0.5
0.7
voltage [V]
17
17
17
power [W]
5.1
8.5
11.9
rq
13.5%
13.5%
13.5%
mech. power [W]
n/a
0.5
0.9
Speed and Turning
The fish swam at speeds of 6cm/sec (0.5 Hz), 7cm/sec (0.8 Hz), and 9 cm/sec (1.0 Hz), and made
turns of about 30 degrees for each run. The swimming parameters for the 0.8 Hz and 1.0 Hz were
adjusted to account for lag of the servo system, so that it still would swim well. It is likely that
the power cable slowed down the robot as it swam through the water by a small amount. For the
0.5hz run, the robot turned 400. For the 0.8hz run, the robot turned 25'. And for the 1.0hz run,
the robot turned 35'. The different amounts of turn between the 0.8hz run and the other two are
probably because the duration of the turn was smaller. This made the Stm higher and the strenth
of the maneuvering vortices weaker. The difference between the 0.5hz run and the 1.0hz run is also
shown by analyzing the Stm for each of these runs. Because the robot's speed didn't scale with
the frequency of tail beat, the Stm was higher in the case of the 1.0Hz run and so the maneuvering
vortex pair is weaker.
5.4
Estimate of Power
We can estimate the power used to perform the above maneuvers and the power required to swim in
a straight line by measuring the current being used by the robot during the runs. The power supply
for the robot ran at 17V. At rest, the system took 300mA. Forward swimming at 1.0hz took 500mA
and turning at 1.0hz took 700mA peak.
The DC-DC converters in the robot are 90% efficient and servoed DC motors are typically 30%
efficient [2] at turning electrical energy to mechanical. The motors have many stages of gearing to
produce the forces necessary to move the robot. The transmission and gears are estimated to be
less than 50% efficient. So normal swimming takes about 0.5 watts of mechanical power and turning
takes about 0.9 watts.
43
5.5
Future Work
The data collection system, as well as navigation are two systems which are limiting current testing.
By installing a sensor to read the heading of the fish, one could have the fish swim in a straight line.
With the addition of a speed sensor, the speed could be recorded and its performance increased. The
actual kinematics of the robot should be recorded, perhaps by reading the position of the motors on
the robot, or by using the video method shown here in this thesis. If the video method is used, a
way of automating it should be done so that the processing doesn't take so long.
44
Appendix A
Mechanics
Below are the drawings of parts that needed to be revised from the original design in [12]. Also here,
is a more detailed description of how the non-machined parts were made.
Nose cone:
The nose cone is made from fiberglass and West System epoxy. The mold for the fiberglass
was cut from polystyrene foam with a hot wire cutter. The shape of the nose cone was determined
from the digitized hull of a 22 inch long Chain Pickerel model. The model of the chain pickerel
was obtained from New England Taxidermy, Weymouth MA. The nose cone was made by vacuum
bagging the fiberglass on the mold. Body filler and sand paper were used to smooth out the shape.
Fins:
The dorsal and anal fins, though not used for experiments in this thesis, were cast from RTV
silicone rubber in a delrin mold. The mold was machined on a 6 axis CNC milling machine at MIT.
The RTV was de-aired in a glass bell jar before pouring into the delrin mold. Spines of stainless
steel were placed into the mold so that the fins could be held in place should they be used at some
point. The shape of the dorsal and anal fins comes from taking a NACA 0012 section and scaling
it to fit the profile of the fin. The profile of the fin was determined from an illustration in [17]. The
g-code for making the fins on the CNC milling machinewas generated in Pro Engineer.
The pectoral fins were made by making an RTV silicone mold of a model and then casting epoxy
parts in the mold. The model was made by having Craft Pattern and Mold (Maple Plain, MN)
make a stereo lithography part. The epoxy used to cast the fins was filled with micro glass spheres
to lighten the fins so that they are barely positively bouyant.
Flotation:
The flotation was cut and fitted by hand so that the robot was slightly positively bouyant. Extra
flotation was put near highly dense object so that the robot would be close to uniformally neutrally
bouyant.
45
Machining:
The parts were sent out and machined at Ramco Inc., Beverly MA. Some of the parts were later
filed to allow for interference problems when the robot flexed. The modification of the main body
servo and the tail servo also required additional filing of parts to avoid interference. The hand filing
did not significantly weaken the structure. In figures A-2 and A-3 are the parts which needed to be
revised from the original design [12].
Skin:
The skin was cast from RTV silicone rubber (TEKCAST RTV HS II). Its durometer is shore A
10. The mold used to cast it had a corrogated shape (see figure A-1.) A user fillable caulking gun
was used to inject the RTV into the mold.
Hull:
The hull was made by wrapping fiberglass around a wooden hull and then constraining the helical
spring at the top and bottom with a fiberglass spline. The design is analyzed and detailed in the
bachelor's thesis [14].
46
Notes:
1.718
1.-31
1.344
1.128
1) Make 1 piece
2) Use supplied delrin block
3) use supplied cutters to
route inside and outside radii
4) Questions? Call John at
x3-4348
0.969
Right side view
0.781
-0.594
0.40,
0f..094
90.031 typ.
14 place4
.4020.063 typ.
14 plaes.
-6
1.825
1.437
Innft
1.250 _0.38
I
1.062
.872
0.031
0
0.870.500-
-4
10.500
4.1C
0.188 typ.
10.063
bD
thru 00.1240
four places
0.158
3.219-
20.375
Cut here in half with band
saw
Mold
Part:
*ad'
ale: 1:1
a
John Muir Kumpf
MI
Sept 16.
Ship Model Tovtank
98
v A
1
I
TI
Key to features:
\4
i
H1
H2
H3
H4
H5
H6
TO
T1
T2
T3
y-
\
T.4.1
t
drill 0 1/4" through
drill no.28 x 1.0' deep
drill 09/16" through
drill 03/4" through
drill 01/2" through
drill 03/8" through
1"-28 UN-2B though
8-32 UNC though
4-40 UNC though
2-56 UNC though
54
$.4
-e
00
bO
0
FinHolto
Pectorl
L.
co
a~s
0)
co4
_j
""
2
as
U
L1
J. .I
Notes:
1. Material: Delrin
2. Quantity: 1
3. Questions?
Call John (617)253-4348
4. Break and Debur
all Sharp Edges
Collar
Block
x.xX
xX.X
t0.005
*0.01" Front Bulkhead
*0.1'
7I
iii
Scale:1:1
IT Towtank
Oct. 10, 1996 Rev: B
SDate:
]
-45' 0.05"
chamfer
drill through 01/4"
5 places
drill through no. 30
01/4" x 0.089"
'I planes
roounterbire
.4-D
--
7
S
1
0,548
0
--
5'. '3
-0--0.000
typ.
A
/11
countersink
45*
0.10"
-
/-.0.271
40
"N0.296
0.473 typ.
0
-0.558
Not.es:
1.) Make 1 piece
2) break and debur all sharp
edges
0.448
3) Questions? Call John at
(617)253-4348
4) MATL: 113 Iack Delrin
Tolerance Block
x.xxx ±0.005"
Xxx
:10.01"
large elect rical
feedthrough
w aterproof nosecone
J. M. Kumpf
Scale: 1:1 MIT Towtank
x.x
±0.5
Date: Oct 10, 1996
Rev:B
Ci
C.)
50
Appendix B
Electronics
The electronics in the nose cone of the robot consist of the Motorola 68332 based Onset model 8
computer see [15], DC-DC converters, a low dropout regulator, I/O buffer chips for the motors, a
915Mhz digital modem for serial communication and the support components such as capacitors and
resistors. Below is a layout for the nosecone electronics (see figure B-3) and a simplified schematic
(see figure B-1.)
The construction technique for the electronics is soldered 32AWG stranded wire with components
mounted to a solder covered square pad prototyping board. This allows for a small circuit board
with possibility for customization. There are no sensors onboard the robot at the time of this thesis
but the 68332 has 8 analog inputs and many free digital inputs for use.
The I/O buffers provide some protection for the computer should the inputs and outputs be
shorted or experience high voltage. The DC-DC converters, by Power Trends Corp., allow for a
wide input voltage and convert the power efficiently. Below is a list of the components and who
makes them.
* 3 DC-DC converters, PT6302G, Power Trends
* 1 Low Dropout Voltage Regulator, LM2941CT, National Semiconductor
* 1 68332 Computer, Model 8, Onset Computers
* 2 I/O buffers, 74HC245
* 1 Wireless modem, WIT915, Digital Wireless
* 1 15 pin D shell, 1 9 pin D shell connector
* 2 RCA connectors for power
* various caps, resistors, and LED's
51
I
Onset
Mod~el 8
68332
-
-LE
50514567891011S12-
Rx
Tx
-MCLR
TPU 12
TPU 11
TPU 10
TPU 9
TPU 8
TPU 7
TPU-P6
TPU 5
1
IRQ 3 -61
-62
-63
-64
E7
-65
E6
-66
E5
-67
EO
TPU 15-20
TPU 14-19
TPU 13-18TPU 0-17
TPU 1-16TPU 2-15TPU 3-14TPU 4-13-
2
3
4
5
6
20
19
18
17
3 16
U 15
7
14
8
11
1-10
1
-2
3
4
-
5
-
6
7
8
9
10
2-
Tx
6-
DTR
13
Ln
'
0
20
19 18 ----17
16
15
14
13
12
I
motor
motor
motor
motor
motor
starboard pectoral (A)
1st body segment (B)
2nd body segment (C)
3rd body segment (D)
port pectoral fin (E)
11
T 91 5
LI 3- Rx
Figure B-1: Above is a schematic of the important connections between the computer and other
components in the head. Not shown are the power conditioning electronics.
The software operates intimately with the hardware by controlling the I/O buffers. The servos
are commanded to go to a position based on the length of a pulse which must be sent at least every
1/20 of a second. The middle position of these servos is a 1420psec length pulse. The swing of the
servos is about
±900.
The pulse changes from about 500psec - 2500psec. This is roughly 11 psec per
degree. The servo loop gain on these servos is tuned very low so the commanded position is often
fairly far away from the actual. The servos are geared so low that the effective inertia is very large
and quick motions introduce substantial lag. The output of the tail isn't noticeably attenuated until
frequencies go above 1.0Hz.
52
Figure B-2: Bracket mounted to face seal bulkhead in nose cone. The electronics are mounted off
of this.
53
crq.
C
0
0
0+
0
eD
C..
Appendix C
Software Control of Robot
This appendix contains a description of the software running on the robot. The software sends out
synchronized commands to the motors. The computer upon command via the wireless serial link,
sends position commands to the servo motors at a rate of 70 Hz. The sinusoidal motion of forward
swimming is modified by the superposition of a trapezoidal profile. The parameters for the turning
and swimming can be changed while the machine is in operation, thus allowing tuning of the motion
interactively.
The computer on the Pike runs a version of ARC C by Newton Laboratories. This is a kernel
which allows for shared memory, messaging, and multi-tasking of several processes. The overhead
of the kernel is minimal and it still allows for user programs to directly access the hardware. See
the ARC C manual for more information [19].
Setup of the hardware is done by making the I/O buffers on the robot work as outputs, setting
the serial port speed to 19.2kbps, setting up the sine wave lookup table so other programs can use
it, and finally running an endless loop to blink one of the onboard LED's. This lets us know that
the computer is up and running.
The sine wave lookup table is used so that we don't need to compute trigonometric functions
while swimming. By keeping the motion of the robot in a parametrized form, a trade-off is made
between speed and flexibility. Since floating-point code would be very computationally expensive
on the 68332, we use fixed-point math and a lookup table to make the robot swim in a sinusoidal
motion. The solution to the kinematics of the robot (see appendix D) shows that there are some nonlinearities in the commanded position to the joint angle. But these non-linearities are not corrected
by software for the series of tests shown in this thesis.
Interrupts are used to output the motion to the servos. This ensures that there won't be higherorder jitter due to the wave forms not being output properly. Synchronization of the turns is done
by monitoring the position of the tail; when it swings through the middle of its motion (maximum
55
Table C.1: Below are the values and descriptions for the variables used in the swimming code for
each experimental run described in this thesis. The frequencies correspond the frequency of the
experimental run described in chapter 4
var. name I description
turn-post
turn
phase
offset
0.5Hz
0.8Hz
1.0Hz
[0,278,600]
[0,111,240]
[0,140,300]
[3000,3278,3600]
[1200,1311,1440]
[1500,1640,1800]
[500,500,500]
[1250,1250,1250]
[1000,1000,1000]
[500,600,400]
[500,600,400]
[500,600,400]
[500,500,500]
[1250,1250,1250]
[1000,1000,1000]
[50,0,270]
[50,0,285]
[50,0,200]
[16,32,8]
[16,32,8]
[16,32,8]
start of the trapezoidal overlay, time in
milliseconds
turn-posp
turn
phase
offset
stop of the trapezoidal overlay, time in
milliseconds
turnru
turn
ramp
up
of
the trapezoidal overlay, rate in motor
counts/second
turn-mo
turn maximum offset
of
the
trapezoidal
overlay, amplitude in
motor counts
turn-rd
turn ramp
down of
the trapezoidal overlay, rate in motor
counts/second
count
initial count, it defines
the phase between the
joints for swimming,
given in degrees
divscale
divides the value in
the sine wave lookup
table to give amplitude of the sine wave
speed), the trapezoidal overlay is started. This minimizes low speed jerk which makes the motion
look unnatural.
Persistents are a term used by ARC C to mean variables which don't get erased between reboots.
Because the computer on the Pike doesn't have a battery backup, a loss of power does erase the
"persistents". But persistents can be modified on the command line of the ARC C enviroment. Since
the command line runs on the host computer, this allows interaction between the running process on
the robot and the host computer. The persistent variables are used to tune the turning parameters
while the fish is operating. This allows one to change the performance with direct feedback without
the write-compile-run-debug cycle. The swimming and turning variables are listed and described
along with the values used for the different experimental runs in table C.1.
The sine wave lookup table is ommited from the source code listing because it not needed. It is
2520 elements with an amplitude of -2048 to 2048 motor counts. The motor counts are approximately
11 counts per degree. The number 2520 has a great many close factors, so that it is possible to run
through the sine wave table at many different speeds without interpolating the table.
56
Below is the source code listing for two programs which run on the robot's computer. The first,
baud19200, is stored in the onboard EEPROM and is loaded and run everytime the system starts.
The second, swimint, is loaded via the serial modem and performs the swimming motions. The
programs can run at the same time since ARC C is multi-tasking, but when one downloads new
code to the onboard computer other processes are stopped and have to be restarted manually.
57
baud19200.c: contains code to initialize the onboard computer
/* Program to set baud rate to 19.2Kbps
John Muir Kumph
MIT Rm 48-015
Ocean Engineering Towing Tank
1998
/*
standard arc c include files for 68332 processor */
#include "332.h"
#include "TPU_332.h"
*include "tpu/pwm.h"
*include "crt0.h"
10
/* include an integer form of the sine wave */
#include "sine.h"
swavelookup swavIkup;
maino{
int swap-period;
20
setup tpu speeds *7
initialize-tpu.speeds(psck-div32, div2, divi);
set tcr2_source(pin-is-gate-oLdiv8-clock);
/*
set-baud-rate(19200);
printf("Wanda the Pike, running Arc C v1.4\n");
printf("Onset Model 8 computer, Motorola 68332 at 16Mhz\n");
printf(". .Baud rate set to 19.2kbps\n");
swap-period = get-swap-tick-period();
printf(". .Swap Period is %d\n", swap-period);
printf(". TCRI is running at %dhertz\n", tcrl-rate();
/* first initialize the structure we'll pass to other programs */
swavIkup.wave=sinewave;
swavlkup.waveperiod=(sizeof sinewave / sizeof (*swavlkup.wave));
swavlkup.divz=sinedivz;
swavlkup.divzsize=(sizeof sinedivz / sizeof (*swavlkup.divz));
/* now initialize the persistent so other programs
can get to the sine lookup table wave kept in eeprom
30
40
*/
set persistent(" swavetable", (int)&swavlkup);
/* set porte bit 5 to output
this is to blink the red led light
set-porte.output( (1 << 5) );
*/
/* and turn off light before we start to blink
write.porte( read.porte() & Oxdf );
*/
50
/* now blink the led light forever *7
while (1){
write-porte( read.porte()
(1 << 5));
sleep(l00000000/swap-period);
write.porte( read.porte()
(1 << 5));
sleep(300000000/swap-period);
}
}
58
swimint.c: contains code to make turns and swim straight
/* Program to undulate the fish's body by
Sending out PWM signal's to the fish's
3 motors
John Muir Kumph
Ocean Engineering Towing Tank
1999
*/
/* Hardware used
TPU Ports 0-4 used
Port E pins 0 and 6 used
10
*/
/* E6-Direction of 74HC245 buffer chip
EO-Isolation enable of 74HC245 buffer chip
so to enable output make E6 high and EO low
*/
#include "332 .h"
#include "TPU_332.h"
#include "tpu/pwm.h"
#include "tpu/dio.h"
#include "crt0.h"
*include "swimint .h"
20
#define RATE 70
#define MIDDLE 1500
/* globals for arcc environment */
/* don't run this process on reset
int run-on-reset=0;
/* place to store error value for arcc functions */
int error;
*/
30
/* define TPU channels for body parts */
enum tpu-channels {STBDPECT=0, BODY, TAIL, FIN, PORTPECT};
/* public variables for controlling motors */
/* pwm structures for the 5 motors *7
pwm pptr[5];
/* setup software order of motors */
int period, motor[] = {BODY, TAIL, FIN, STBDPECT, PORT-PECT};
40
7* var's
7* as of
int
int
int
int
int
int
int
especially for ISR routine */
6713799 the sine wave lookup table have a max value of +7-2048 *7
count[3];
/* counters for each body servo for wave form */
divscale[3];
/* divisor for amplitude of each body waveform *7
/* let's one modify the center position of the sine wave *7
offset[3];
/* overall scale for starting and stopping motion *7
ramp;
div;
/* increment each step for timer, sets frequency */
ctr-position[5]; /* center position of all the motors */
width[3]={0,0,0}; /* position of servos */
/* lookup table for sine waves, is kept in EEPROM
swavelookup *plookuptbl;
int *swave;
int step;
int waveperiod;
50
*/
/* now for turning and starting variables*/
/* define public variables corresponding to persistents */
int turn-post[3]={0, 111, 240};
int turn-posp[3]={1200, 1311, 1440};
int turn-ru[3]={1250, 1250, 1250};
int turn-mo[3]={500, 600, 400};
int turn-rd[3]={1250, 1250, 1250};
60
int start-post[3], start-posp[3], start-ru[3], start...mo[3], start-rd[3];
/* define word list for variables */
/* assign these words to persistents (plus a trailing no. *7
char *wordlist[]={ "turn-post-", "turn-posp-", "turn-ru_", "turnmo_",
"turn-rd_", "start_post_", "startposp..", "start-ru_",
"start-mo_", "start-rd_", "ctr.position-", ""};
7*
variable list must correspond 1 to 1 with varlist*/
int *varist[]={turn-post, turn-posp, turnru, turn-mo,
turn-rd, start-post, start-posp, start-ru,
59
70
start-mo, start-rd, ctr-position, NULL};
80
int maino{
char a;
int j;
channel-control
7*
character buffer */
/* integer counter */
ctl; /* TPU channel control structure */
printf("\n\nSwimming program for Wanda the Pike\n");
printf("motor period = %d ticks\n", period);
printf("middle = %d ticks\n", period-to-tcrl-counts(MIDDLE*1000, &error));
/* dereference sine wave lookup table */
if((plookuptbl= (swavelookup *)(*lookup-persistent("swavetable")))==NULL){
printf("Error finding table address in persistents,
return(');
10
exiting\n");
I
/* derefence far shared global variables for interrupt routine */
swave=plookuptbl ->wave;
waveperiod=(plookuptbl->waveperiod)-l;
/* setup scale factors and phase offsets for motors */
count[O]=50 * DEGTOINDEX; /* phase offset for body *7
count[l]=O * DEGTOINDEX; /* phase offset for tail */
count[2]=285 * DEGTOINDEX; /* phase offset for caudal fin
ctr-position[O]=0;
20
*/
/* physical center position of motor in usec's from middle
*7
ctr-position[1]=150;
ctr- position[2]=0;
ctr-position[3]=O;
ctr-position[4]=0;
offset[0]=ctr.position[0];
offset[l]=ctr-position[l];
offset[21=ctr-position[2];
divscale[O]=16;
divscale[l]=32;
divscale[2]=8;
div=28;
/* 28 is
/* 30 is
/* 35 is
/* 36 is
/* 18 is
/* set default offset for all motors
/* dividers for each motor
30
*/
*7
0.77 Hz */
0.83 Hz *7
0.97 Hz
1.00 Hz
0.50 Hz
40
*/
*7
*/
/* (plookuptbl->divz[ONEHERTZDIVOFF])/2;/* setup a 0.5 Hz wave
ramp=0;
*/
/* overall scale is zero */
/* initialize tpu interrupts */
/* initialize-tpu-interrupts();*7
/* wait for console key press
printf("Press space to start
while(getchar() !=
' );
50
*7
motion:\n");
/* set tpu outputs to low first */
for(j=O;j<5;j++)
dio-output-init(motorj], 0);
60
7*
now setup buffer chip to send out TPU signals */
set-porte-output( 1 1 (1<<6) );
/* porte(0,6) activate
write-porte( (readporte() 1 (1<<6)) & xfe); /* copy A->B */
/* and disable output of TPU ports to idle servos */
/* write-porte( read-porte() | 1 );
/* set EO high
*/
*/
/* start pwm at middle position *7
ctl = channel-control-output(force-low, no-change, odclml);
period=rate-to-tcr1..counts(RATE, &error);
/* this will actually start the motors and set them to position zero */
for(j=O;j<5;j++){
pptrD]=pwminit(motor[j],
60
70
period-to-tcrl-counts(MIDDLE*1000, &error),
period, 3, ctl);
/* startup motors one at a time, to avoid electrical problems */
sleep(100);
printf("Motor %d started\n", j);
}
80
/*
now start the interrupts to update waveform */
install-tpu-exception-handler( motor[O], swim-isr);
set-timer-interrupt-enable( motor[O], 1);
* now ramp up motion */
for(j=0;j<=256;j++){
/* default is about ims for each tick
sleep(10);
/* this in 1/256 */
ramp=j;
/
*/
90
printf("Program may respond to a change in persistents\n");
printf("spawning child process 'swim-trajectory'\n");
start-process( "swimtrajectory", swim-trajectory, 1024, 5);
/* printf("spawning child process 'monitor-pos'\n"); */
/* start-process("monitor-pos",monitor-pos, 1024, 5);
/* press any key to leave program
a='
*7
*7
100
';
printf("Press return to quit program\n");
while(a!='\n'){
defero;
/* make sure we don't stop other programs from running
if(serial-data-received()!=0)
a=getchar(;
/* get character *7
/* dereference variables which may be getting updated
dereLvarso;
/* exit loop if someone presses the right key
if(serial-data-received()!=0)
a=getcharo;
/* get character */
*/
*/
*/
110
}
7*
ramp down the position command */
for(j=256;j>=O;j--){
/* default is about ims for each tick
sleep(10);
/* this is 17256 of the position */
ramp=j;
*/
}
/* disable interrupt before exiting */
set-timer-interrupt enable(motor[O], 0);
120
/* set final position as zero *7
for(j=0;j<5;j++)
pwm-set-times(pptr[j],
period-to-tcrl-counts(MIDDLE*1000, &error),
period);
/* and disable output of TPU ports to idle servos */
/* porte(0,6) deactivate
set-porte-input( (1<<0) (1<<6) );
return with no error *7
return(0);
main()
/*
}
7*
routine to monitor position of servos */
/* a heads up display */
void monitor-poso{
while(1){
printf("%d %d %d%d\n", timeo, width[0], width[1], width[2]);
sleep(100);
}
}
monitor-pos()
/* interupt service routine to make robot swim (hopefully) *7
/* runs off of TPU interrupt */
7* most hobby servos can handle a 70 hertz update rate */
/* The TCR1 clock has to be setup right on initialization */
void swim-isr({
61
*/
130
int i;
/* index counter */
/* do this for each of the body joints */
for(i=0;i<3;i++){
/* loop if at end of data buffer *7
if(count[i] > waveperiod)
count [i] - =waveperiod;
10
if(i==1)
/* now get width[i] of pulse in TCRI ticks */
/* kinematics for joint 1 are backwards but linear */
width[i]=period-to-tcrI-counts((MIDDLE - ramp *
offset[il +
swave[count[i]]/divscale[i]
) / 256
* 1024,
&error);
else
/* now get width[i] of pulse in TCR1 ticks *7
/* kinematics for joints 0 and 2 are non-linear and should be fixed in the future
width[i]=period-to-tcrlIcounts((MIDDLE + ramp * (
offset[i +
swave[count[i]]/divscale[i]
) / 256
* 1024,
&error);
20
*/
30
/* set motor position of body, tail and fin *7
if((width[i] < period/2) && (width[i] > 0))
pwm.set.times(pptr[i], width[i], period);
7*
update counters for body, tail, and fin motor joints
count[i]+=div;
}
}
*/
40
swim-isr()
/* subroutine to go through all the possible persistents
and update the values
void deref.varso{
int i,k;
char varbuf [401;
*/
/* check every word in the worklist */
for(i=0;*wordlist[i]!=' \0';i++){
/* only check upto the third value in the array */
for(k=0;k<3;k++){
sprintf(varbuf, "%sd", wordlist[i], k);
if(lookup-persistent(varbuf)!=NULL)
varlist[i][k]=*(int *)(lookup-persistent(varbuf));
defero;
}
}
10
}
dereLvars()
/* a routine which runs as a process
and needs to be started as one
*/
void swim-trajectory(void) {
printf("\n\nTrajectory process running\n");
while(1){
printf("swimming straight for 6 secs\n");
swim-straight(6000);
10
printf("turning right\n");
turn(RIGHT);
printf("swimming straight for 6 secs\n");
swim-straight(6000);
printf("turning left\n");
turn(LEFT);
i
} swim..trajectory()
20
62
/* just swims straight
and doesn't do anything else
the argument is the number of
seconds
*7
void swim-straight(int dur-msec){
int start,i;
start=timeo;
10
while((timeo-start)<dur-msec){
/* swim straight *7
for(i=Q;i<3;i++)
offset[i]=ctr-position[i];
sleep(100);
}
}
swim-straight()
/* this routine makes a turn
by overlaying offsets on the regular
motion. It will wait for the
right moment to make the turn
*/
void
int
int
int
int
turn(int direction){
starttime;
end-time;
i;
turn-segment;
10
/* sync up turn with swimming straight *7
/* absolute time isn't important here, rather the direction of body motion is *7
printf(" sync up turn\n");
if(direction==LEFT)
while((count[l] < (177*DEGTOINDEX)) II ( count[O] > (183*DEGTOINDEX))){
printf(" tail angle=Xd \r", count[1]/DEGTOINDEX);
I
/* defer(); *7
else if(direction==RIGHT)
while((count[l] < (357*DEGTOINDEX)) && (count[O] > (3*DEGTOINDEX))
printf(" tail angle=%d \r", count[1]/DEGTOINDEX);
){
20
/* defero; */
else
return;
/* get start time of turn */
start-time=timeo;
/* figure out length of turn */
/* assume turn ends with caudal fin
end-time=start-time+turn-posp[2];
30
*
printf("\n making turn time=/d starttime=%d endtime=%d\n", timeo, start-time, end-time);
/* make turn */
while(time() < end.time){
for(i=O;i<3;i++){
/* determine what part of the turn we're in */
if( (timeo - start-time) < turn-post[i])
turn-segment=NOTYET;
else if( ((timeo-start-time) >= turn.post[i]) &&
((timeo-start-time) < (turnpost[i] + (turn-mo[i]*1000/turn-ru[i]))))
turn-segment=RAMPUP;
else if( ((timeo-start -time) >= (turn.post[i] + (turn-mo[i]*1000/turn-ru[i]))) &&
((timeo-start-time) < (turn.posp[i] - (turn.mo[i]*1000/turn-rd[i]) )) )
turn-segment=FLAT;
else if( ((timeo-start-time) >= (turnposp[i] - (turnmo[i]*1000/turnrd[i]))) &&
((timeo-start-time) < turn.posp[i] ))
turn-segment=RAMPDOWN;
else if( (timeo-start-time) > turnposp[i]
turn-segment=NOTYET;
else
turn-segment=NOTYET;
63
40
50
/* now compute the proper offset for the joint */
switch(turn-segment) {
case RAMPUP: /* we're in the ramp up *7
if(direction==LEFT){
offset[i]=ctr-position[i] + (turn-ru[i] *
(timeo - start-time - turn-post[i])) / 1000;
/* if(i==) printf("offset[]=%d count=%d\n", offset[], count[]); *7
60
}
else
offset[i]=ctr-position[i] - (turn-ru[i] *
(time() - start-time - turn-post[i])) / 1000;
break;
case FLAT: /* we're in the flat part */
if(direction==LEFT){
offsetfi] = ctr-position[i] + turn-mo[i];
/* if(i==) printf("offset[]=%d count=%d\n", offset[], count[]); */
70
}
else
offset[i] = ctrposition[i] - turn-mo[i];
break;
case RAMPDOWN: /* we're in the ramp down */
if(direction == LEFT){
offset[i]=ctrposition[i] +
((turn.rd[i] * (turn-posp[i] - (timeo-start-time))) / 1000);
/* if(i==C) printf("offset[]=%d count=%d\n", offset[], count1]); */
80
}
else
offset[i]=ctrposition[i] ((turn-rd[i] * (turn-posp[i] - (time()-start-time)))
break;
case NOTYET:
default:
break;
}
/
1000);
90
/* let other processes run for a sec */
/* defer(); */
/* printf("\r"); */
}
7*
reset offsets back to center positions
for(i=0;i<3;i++)
offset [i] =ctr-position [i];
} turn()
*7
100
64
Appendix D
Kinematics
The functions which map the shape of the robot to the position of the actuators are detailed below.
This should help facilitate control of the robot. It also shows where the nonlinearities are in the
motion and how severe they are. The robot is composed of a robotic mechanism surrounded by a
helical coiled spring. The spring is constrained on the top and bottom so that it can only flex in the
plane of swimming motion. The first motor control the flex of the main body which isn't meant to
flex very much. The second motor control the motion of the tail, and it flexes up to +1200.
The
third motor controls the caudal fin and allows the pitch of the fin to be set independently. There are
two more motors which control the angle of the pectoral fins but they are one-to-one transmissions.
IE. the angle of the pectoral fin servos sets the angle of the pectoral fins directly.
D.1
Joint 1
The first body segment is bent into an arc by the moment of the first servo on a linkage offset
from the centerline of the robot. See figure D-2 for a graphic of the mechanism. For the first body
segment, the mapping between motor angle,
9j(lo + pi sin(#1)) 2
#1
=
and joint angle, 01 is:
2(lo
65
-
d91 )2 (1
-
cos(6 1 ))
(D.1)
servo bRsk
P
Figure D-1: Above is the schematic which helps understand the model for the first and third actuators. This actuator, which drives the middle of the robot's body, is composed of a hobby servo and
a scotch yoke mechanism. The distance the scotch yoke pin is located from the center of the servo's
rotation is p. The way the mechanism works is, first the servo disk turns because of the motor.
Then the pin, located on the dotted line at a distance p, slides in the scotch yoke. The horizontal
bar attached to the yoke then slides side to side. Since the pin goes around in a circle, but only the
side-to-side motion is translated to the horizontal bar, the bar has a linear motion equal to p sin(O)
where 9 is the angle of the motor. The term "linear motion" should not be confused with linearity
in the algebraic sense, since the relationship is highly non-linear.
where the quantities above are defined in figures D-1 and D-2. For this joint, where it is not simple
to solve the equation and to determine the extent of the non-linearity, the solution is given with
pi = 1cm, see figure D-3.
D.2
Joint 2
For the second body segment, the mapping between motor angle,
02 =
6D
q2,
and joint angle,
2
D2
02
is:
(D.2)
where D 1 is the diameter of the first tail pinion and D 2 is the diameter of the motor pinion. This
transmission is a series of cables which make a sequence of links form and arc, see figure D-4 for a
schematic of this transmission. The ratio D 1 /D
2
let's the trasmission has a bit more reduction before
the the links all amplify the motion. This joint is the only one which shows significant compliance,
and considerable effort was made to reduce the compliance of this joint.
66
IDi
lei
Figure D-2: Above is the schematic for the first body section's mechanism. The symbols used in the
mathematical model are shown in the drawing.
67
Solution to motor angle-joint angle kinematics for
joint 1
30
20
10
-.
.. . . . . ..
-. . . . . --.-.-.-.-.. . . .. . . ... . . . .. . . . . ..
-.
.. . . . . ...
..
..
.....
-.
.. . .-.. . ..-.. .. .- . ...-. . ...-. .. ..-.
- ..-..-.
.0
-...................
--..-.--..-.---.--..-.-.-..-.-.-..............
CD
C-
.5
-10
........--...... .......
----.--.---.-.-.--.-.-.--.--.-.---.-.-20
...- -.-.-
-.-
.--.
---.-
-
-- -- - -- ---..
--
-30
-40
-80
-60
-40
-20
0
motor angle 01 [deg]
20
40
60
80
Figure D-3: Solution to the motor-joint kinematics for joint 1. The non-linearity is only strong at
the ends of the motors motion. An unexpected effect is the lopsided-ness of the joint.
68
".aWil louAkheaci
;-aik segments
Figure D-4: Above is the schematic for the tail section of the robot. It is composed of a series of
links which move together to form an arc.
D.3
Joint 3
For the caudal fin, the mapping between motor angle,
03,
and joint angle,
03,
is
0 2P3 sin(0 3 )
(D.3)
r
where the quantities above are defined in figure D-5. This joint, like the first body segment, has a
scotch yoke mechanism, which has a radius p. Because of the non-linearity of this joint a solution
is plotted for p = 1cm (see figure D-6. The non-linearity is only strong at the ends of the motion.
The caudal fin never obtains such large angles during normal forward swimming.
To determine the shape of the body from the joint positions, a curvilinear co-ordinate, s is
introduced. This corresponds to the position along the length of the body. The body reference
frame co-ordinates, (x, y), can be found using s and the joint co-ordinates. The body reference
frame co-ordinates are referenced from the nose cone with y pointing aft and x pointing port. See
69
r
housed cable
caudal fin pinion
servo disk/scotch
yoke mechanism
Figure D-5: Above is the schematic for the caudal fin section of the robot. It is composed of a dual
scotch yoke mechanism, a housed pull-pull cable and a pinion attached to the fin.
Solution to motor angle-joint angle kinematics for joint 3
100
60.
. . . . . . .. .. . . . ..........
.. . . .. .. . .. . .
- -...-. .-- -..-.-. .- -.
-..-.-.
6 0 - - - -.
...
. ......
. .. . . . .
. - - ....- ..- .-.-..-..-. - - - -..
- ..-..- .-..-
-80
- - -.
..60-- - - - -- - - 8- -.-...
- 0 -. .-..-..-.
-20
-1 0
-.-..
- -
-. -..
- -. -. - - - - -
- - - -.------
..- - - - - -.-60 . ..- .-80
-40--. . .- .-....
80
4.-2..2.4..0
10
motor angle 63 [deg]
Figure D-6: The solution of the relationship of motor angle 3 to joint angle 3 for p = 1cm. The nonlinearities are only strong at the extremes of motion, where the fin isn't positioned during normal
motion.
70
LI
/
h
S3
S
Figure D-7: Above is a schematic showing the symbols for the local curvilinear co-ordinate system.
This co-ordinate system is used as an intermediate co-ordinate system when determining body shape
as a function of joint or motor positions. The body reference frame co-ordinates, not shown, are
referenced from the nose cone with y pointing aft and x pointing port.
figure D-7 for a drawing of the co-ordinate system as well as definitions for the mapping from joint
space to body shape.
The co-ordinates x, y are given as a function of s, 01,
0 <= s < Sh
-- +
sh <= s < s1
-
y(Sh)
+ Ypl
(D.4)
+ j-rotation(xp2, Yp2, 01)
-+
y(s2)
+ j -rotation(xp 3 ,yp3 ,01
< sh
-*
0
Sh <= S < S1
--
Si <= S < 82
-+
82 <= S < 83
0 <=
s
S2 <= S < 83
j
s
-+y(si)
si <= s < 82
where i and
62,63
+
+ 02)
xpi
(D.5)
x(si) + i - rotation(Xp2,yp2,
->X(s2)
+ i - rotation(xp3, Yp3,
1)
01 + 02)
are the unit vectors in the x and y direction and the rotation function is given by the
two dimensional rotation of the local co-ordinate frame of the base of the joint in question to the
71
co-ordinate system of the head of the robot. It is defined as,
x
cos(O)
y
sin(9)
P
-sin(O)
(D.6)
y
cos(9)
where x,, y, are the co-ordinates of the body in the local reference frame of the base of the joint in
question.
The local co-ordinates xp, y, are given below for each joint. The local co-ordinate system for a
joint is one where the y axis is tangent to the body position at that joint.
XP
(s - Sh)1
L,
1
Ypi
L
-
Li
Sh)1
-(S
L
o(ss1)02
)2
sin(
L2
02
s=
(D.7)
(s - s)62)
cos(
(1-
L2
L
(s- sD)71
L2
o2=
yp2
sin(
cos(
(D8)
- s2 )sin(0 3 )
Yp3 = (s- 82) cos(0 3 )
(D.9)
where 0 is the angle of the joint, L is the length of the body segment, and s is the curvilinear
co-ordinate along the length of the body.
The constants for the above equation can are,
pi = 0 -+ 0.583in (adjustable)
p3 = 0 -+ 0.583in (adjustable)
L, = lo = 28.7cm
L2=
21.0cm
sh= 25.0cm
Si = 53.7cm
72
S2 =
Di
=
74.7cm
0.313in
D2 = 0.626in
r= 0.5in
d = 0.983in
73
74
Bibliography
[1] Jamie Marie Anderson.
Vorticity Control for Efficient Propulsion. PhD dissertation, Mas-
sachusetts Institute of Technology, Department of Ocean Engineering, February 1996.
[2] Jamie Marie Anderson. Draper laboratories study on the efficiency of various servoable actuators. Personal communication, 1998.
[3] Jamie Marie Anderson. Vortex controlled unmanned underwater vehicle. In Proc. 11th Annual
InternationalSymposium on Unmanned Underwater Technology, 1999.
[4] Anonymous. Undersea Vehicles Directory 1990-1991, page 169. Busby Associates, Inc., Arlington, VA, 1991.
[5] David Scott Barrett. Propulsive efficiency of Robotuna. PhD thesis, Massachusetts Institute of
Technology, 1988.
[6] David Scott Barrett. The design of a flexible hull undersea vehicle propelled by an oscillating
foil. Master of science, Massachusetts Institute of Technology, Ocean Engineering Department,
May 1994.
[7] Lee Campbell. Code to correct barrel distortion. Sent code via e-mail elwincQmedia.mit.edu,
December 1999.
[8] James Czarnowski. Flapping foil boat. Master's thesis, Massachusetts Institute of Technology,
1997.
75
[9] M. Gharib, E. Rambod, and K. Shariff. A universal time scale for vortex ring formation. Journal
of Experimental Fluid Dynamics, 360:121-140, 1998.
[10] D. Harper and R. Blake. Fast start performance of rainbow trout salmo gairdneriand northern
pike esox lucius during escapes. Journal of Experimental Biology, 150:321-343, 1990.
[11] Meldon John Wolfgang IV. Hydrodynamics of Flexible-Body swimming Motions. PhD thesis,
Massachusetts Institute of Technology, June 1999.
[12] John Muir Kumph. The design of a free swimming robot pike. Mechanical Engineering Bachelor's Thesis, Massachusetts Institute of Technology, May 1996.
[13] John Muir Kumph, Michael Triantafyllou, David Nugent, and Marc dos Santos. Fast starting and maneuvering vehicles - robopike and robomuski. In Proc. 11th Annual International
Symposium on Unmanned Underwater Technology, 1999.
[14] Elise Anne Martin. The mechanical design of a flexible outer hull for and underwater vehicle with
oscillating-foil propulsion. Mechanical Engineering Bachelor's Thesis, Massachusetts Institute
of Technology, May 1995.
[15] Onset Computer, Pocasset, MA. Tattletale Model 8 User's Guide, June 1994.
[16] Douglas Andrew Read. Oscillating foils for propulsion and maneuvering of ships and underwater vehices. Master of science, Massachusetts Institute of Technology, Ocean Engineering
Department, February 2000.
[17] National Geographic Society.
Wondrous World of Fishes, chapter 4.
National Geographic
Society, 1965.
[18] Michael Triantafyllou and George Triantafyllou. An efficient swimming machine. Scientific
American, 272:64-70, March 1995.
[19] Anne Wright, Randy Sargeant, and Carl Witty. ARC Development System User's Guide.
Newton Research Labs., Redmond, WA, 1.0.1 edition, May 1996.
76