Using Arduino microcontrollers with the Sea Hawk/Sea Perch hybrid




Our PORPOISE program assumes the use of Arduino microcontrollers which we favor because of their power, ease of use, and open source nature, and two arduino motor shields. The Arduino's are run using 9.6 V hobby batteries and the Motor Shields are run off of 11.1 V LiPo hobby batteries.

 Now that Arduinos can be found not only through wonderful specialty outlets like Sparkfun (which also sell kits to make your own Arduino clones which we use with our students to really build understanding for soldering, electronic components and schematics)  but are sold, along with many of their shields, at Radio Shack, they are the easiest way to get into powerful robotics building and programming.

In PORPOISE we require a minimum of two Arduino boards, one to control the Sea Perch and one to control the Sea Hawk.  We use Arduino Unos because they are the least expensive (~30 dollars), but you are welcome to use Arduino Mega's (which Radio Shack also carries) which cost about twice as much but have twice the power.



Materials needed:

Two Arduino Uno Boards @$30 ea. = $60.00 (the brains of the Sea Perch and Sea Hawk robots)
 1 Adafruit Motor Shield Kit @$19.50  (the brawn of the Sea Perch)
1 DFRobot Motor 2A Shield @$16.00   (the brawn of the Sea Hawk)
 Subtotal: $96.00

2 Robotic Claws @9.95 ea  = $19.00  (A way to hold the Sea Perch in wet-dock, mated to the Sea Hawk)
2 Robotic Claw Pan/Tilt Brackets @$29.95 = $59.90 (a way to mount and position the claws)
2 Medium Servos @10.95 ea = $21.90 (A way to control the claws so they will open and close! Note: the one's from Sparkfun that I've linked to fit the robotic claws; I can't vouch for others; another pair I tried from another vendor that were listed as "medium" didn't fit so I would go for these).
2 Pan/Tilt Brackets @$5.95 ea = $11.90 (these aren't strictly necessary, but give you a lot more flexibility for configuring your servos for the robotic claws).
Subtotal: $113.00






1 Ultrasonic Ping Sensor $29.99  (a way for the Sea Hawk to "see" using SONAR to detect walls and objects and avoid collisions!)
1 PIR Sensor (Motion Detector) $10.99  (another way for the Sea Hawk to, using Passive InfraRed, to take evasive action when a real porpoise or sea hawk suddenly leaps in front of the craft!)
1 ColorPAL Color Sensor $19.99 (yet another way for the Sea Hawk to see; in this case it can hone in on coloured beacons strategically placed in the water -- bright orange coloured navigational or marker buoys are an example, indicating where the Sea Hawk should stop so the Sea Perch can dive to find the treasure or the spewing oil well beneath...)
1 Sharp Triangulating IR Range-Finder: $14.50 (Yet another way for the Sea Hawk to see, this being similar to the Ultrasonic Range Finder above, but half as expensive)
Subtotal: $75.50




1 Xbee transceiver kit:  $95.00
1 GPS module $60.00 (A way for the Sea Hawk to drive to a general location so it can search for the marker buoys).
1 Navigational Compass  $29.95 (A way for the Sea Hawk to start doing dead reckoning navigation)
1 3-Axis Accelerometer $24.95 (An entry into the world of maritime stabilization -- compensating for the pitch, roll and yaw of the high seas)
1 BlueSmirf Bluetooth receiver  $64.95  (A way to talk to and control the Sea Hawk from an Android phone or other bluetooth device!)
 Subtotal: $275.00



Breadboards: (These are needed to hook the Arduino to the sensors)
4 Mini Breadboards @$3.95 = $15.80
1 Basic Breadboard $11.95
1 Medium Breadboard: $5.95
Subtotal: $33.70

M/F Jumper Wires $34.95 (Kit of 100 to Wire the Breadboard and Arduinos; you won't need this many, but it is good to have the extras).


Total:  $627.15

You'll also need  miscellaneous hardware... and batteries.

Each Arduino will need a lightweight high amp 9.6 V battery back, and each motor shield will need a lightweight 11.1 V LiPo battery pack.





 

On each Arduino we have a motor shield.

A) Sea Pearch:




 For the Sea Perch, which has three motors, we use the Adafruit Motor Shield ($19.50). The Adafruit has outputs for 4 motors (2 per H-bridge) and can also control a couple of servos.  It uses two L293D H-bridge chips which can handle 0.6 amp continuous each with a peak of 1.2 amps; since the Sea Perch motors draw about 0.54 continuous with an inductive load startup of about 1.1 it works but you have to be careful not to overload it.

We like the Adafruit because it comes as a kit and the students assemble it in class, learning much more about motor shields than if they just bought one and popped it on.  Also, it has IC sockets for the H-bridge chips so if you do burn one out (as we did when Sea Perch motors got stuck and drew over 3 amps!) you can simply pop out the IC and replace it with another (they only cost a few dollars).  It also holds the promise that we can replace the L293Ds that come with it with the SN754410 available at Sparkfun for $2.35 each which fits in the same socket but can handle 1A continuous.

Here are the Adafruit specs:
  • 2 connections for 5V 'hobby' servos connected to the Arduino's high-resolution dedicated timer - no jitter!
  • 4 H-Bridges: L293D chipset provides 0.6A per bridge (1.2A peak) with thermal shutdown protection, internal kickback protection diodes. Can run motors on 4.5VDC to 25VDC.
  • Up to 4 bi-directional DC motors with individual 8-bit speed selection (so, about 0.5% resolution)
  • Up to 2 stepper motors (unipolar or bipolar) with single coil, double coil or interleaved stepping.
  • Pull down resistors keep motors disabled during power-up
  • Big terminal block connectors to easily hook up wires (18-26AWG) and power
  • Arduino reset button brought up top
  • 2-pin terminal block and jumper to connect external power, for separate logic/motor supplies
  • Tested compatible with Arduino Mega 1280 & 2560, Diecimila, Duemilanove, and UNO
  • Download the easy-to-use Arduino software library, check out the examples and you're ready to go

B) Sea Hawk

 For the Sea Hawk, which has 2 motors (actually  4 in its new amphibious configuration,  but two have propellers and two have wheels and they would never be used together!) we sometimes use a Sparkfun 2A motor shield ($30), which comes in a kit which is fun for the students to build, or the much less expensive DFRobot 2A motor shield ($16), which comes ready built. 


The DFRobot Shield Specs are:
  • 2 way 7-12V motor drive 
  • Up to  2A current each way
  • Pin 5,6,7,8 are used to drive two DC motor 
  • Support PWM speed control 
  • Support PLL advance speed control
 I'm not particularly happy with the Sparkfun Kit because it doesn't come with a connector to use 12 V external power; it draws 5V off the Arduino but we can't run our motors off of 5 Volts.  You can solder your own 2 pin terminal block on it for Vin up to 18 volts max, it does have a place for that, but its another thing a busy teacher has to think about. And since the IC chips are surface mounted (machine soldered) to the board there isn't that much for the students to do and nothing to replace if something burns out.


Make sure that in the case of all motor shields you have long female headers that let the board be plugged into the arduino and in turn let other shields be plugged into the motor shield.


The Sea Perch Arduino/Adafruit motor shield sandwich will have an Xbee Wireless transceiver shield ($94.95) plugged in on top of it.  In this way the Sea Perch can be steered remotely. It works like this:  the Arduino/Adafruit/Xbee sandwhich sits on the deck of the Sea Hawk. The motor controller is connected to  an 8 pin telephone junction box that we rewired that also sits on top of the Sea Hawk.  The Sea Perch CAT5 ethernet cable plugs into that junction box which connects to the Sea Perch motors in the normal way.  The Xbee on the "sandwhich" receives signals from an Xbee explorer connected to the student's laptop onshore. This enables the student to use the Serial Monitor from the Arduino IDE to control the motors of the Sea Perch underwater (the signals being received on board the Sea Hawk wirelessly and then transmitted down the Sea Perch cable). 

To keep costs down, there is no need to use an Xbee for the Sea Hawk -- the Sea Hawk is used to demonstrate autonomy to the students so it will run using sensors.  But when students desire to control the Sea Hawk, they can dock the Sea Perch into the Sea Hawk and secure it with the robotic claws. Once the Sea Perch is secured in the Sea Hawk it's starboard and port thrusters  can be used to drive the Sea Hawk forward and backward and steer the Sea Hawk left or right.  In this way the Sea Hawk doesn't need any motors at all if schools don't have the money; the Sea Perch can BE the motor driver for the surface craft.  But since the Sea Perch motors aren't all that strong (.6 amp each) better results can obviously be obtained by giving the Sea Hawk its own motors. Without motors the Sea Hawk can be driven by the docked Sea Perch, and when the Sea Perch is on a mission underwater, under remote control from signals received by the Xbee/Adafruit/Arduino sandwich on the boat, the boat will be passively towed about by the cable from the Sea Perch (make sure to secure it tightly for this purpose!)  To do this "Sea Perch piggybacking" the first thing we hook to the sandwich are the two robotic claws which will hold the Sea Perch in place when docked with the Sea Hawk, and which will open and release the Perch when it is deployed in an underwater mission. The Adafruit motor shield has pins to control only two servos however, and our claws have 4, so compromises have to be made.  One is to use two additional arduino pins to control the other two servos...  the least complex way is to position the claws so they can easily grasp the Sea Perch grasping poles we put in when we "pimp our perches" and only control the claw servos, leaving the wrist servos in place.  We could  control the wrist servos more reliably from another motor shield later, as more money and time become available, or we can do some creative wiring and write code that allows us to use two servos at a time, switching back and forth, for fine positioning of the wrists and the claws, step by step, until the Sea Perch is captured.

 When the Sea Hawk has its own motors and motor shield sandwich, however, the fun of introducing autonomous vehicle operation to the students (which is very difficult to do for an underwater robot)  becomes possible and easy!

The Sea Hawk Arduino/DFRobot motor shield sandwich is ready for sensors and servos.   With an additional Xbee they could also be controlled remotely, but since that adds anothe $100 to the project we will try to avoid it.  The Navy trains its people to achieve the highest quality possible but asks everyone to be judicious in spending, trying to come up with creative solutions that don't sacrifice capability but which can be implemented at the lowest cost.  Since the Sea Perch itself can do a lot of the piloting of the Sea Hawk when "man-in-the-loop" becomes necessary, we want to focus on the autonomous side.  


The basic Sea Hawk autonomy plan calls for the PING sensor, PIR sensor, Triangulating IR Range Finder and ColorPAL to be mounted on a waterproofed breadboard on the bow of the craft. Ultimately we will solder the sensors to a custom PCB board.  For testing purposes the Sea Hawk has been made as a hybrid craft with propellers and wheels that can be tested in the classroom before being placed in the water.


(You can learn more about the differences between IR sensors and Ultrasonic Sensors here: http://www.societyofrobots.com/member_tutorials/node/71,
and about IR triangulation sensors here: http://www.acroname.com/robotics/info/articles/sharp/sharp.html)

The GPS shield mounts on the Arduino/DF Robot Motor Shield sandwhich.

The Accelerometer and Navigational Compass and BlueTooth Smirf can be mounted on mini breadboards or on an Arduino Prototyping shield which can be mounted right on the sandwich stack.










1 comment: