Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering Beaglebone Robotics

You're reading from  Mastering Beaglebone Robotics

Product type Book
Published in Dec 2014
Publisher
ISBN-13 9781783988907
Pages 234 pages
Edition 1st Edition
Languages
Concepts
Author (1):
Richard Grimmett Richard Grimmett
Profile icon Richard Grimmett

Table of Contents (18) Chapters

Mastering BeagleBone Robotics
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Preparing the BeagleBone Black Building a Basic Tracked Vehicle Adding Sensors to Your Tracked Vehicle Vision and Image Processing Building a Robot that Can Walk A Robot that Can Sail Using GPS for Navigation Measuring Wind Speed – Integrating Analog Sensors An Underwater Remotely Operated Vehicle A Quadcopter An Autonomous Quadcopter Index

Chapter 9. An Underwater Remotely Operated Vehicle

Now you know how to build a rolling robot, and a sailboat, but what about all the amazing discoveries under the surface of the water? In this chapter, you'll build an underwater Remotely Operated Vehicle (ROV). This will allow you to explore the depths without getting wet.

In this chapter, you'll learn the following:

  • Constructing the ROV mechanical system

  • Controlling DC motors that can go both ways to power your underwater vehicle

An underwater ROV offers an entirely different way of using the BeagleBone Black to explore a new world. This project is a bit different in two ways. Firstly, there is quite a bit of mechanical work to do, and secondly, it is almost impossible to send wireless signals through water, so you are going to use a tethered control line to give directions to your robot.

Building the hardware for the ROV


There are several possible approaches to build your ROV. The mechanical design at openrov.com/page/openrov-2-0 is quite elegant and available for purchase as a complete kit or as component parts. At openrov.com/page/open-rov-designs-1, there is a simpler yet similar design. At www.instructables.com/id/Underwater-ROV/, there is another design that is very different from the first. All of these designs could certainly use the BeagleBone Black as the embedded controller.

My physical design is based more on the latter design, using mostly plastic PVC piping as shown in the following image:

This hardware design was done using standard PVC for the main chamber and the two chambers that hold the ballast. The main chamber is 12 inches long and 6 inches in diameter. The two smaller chambers are made from two PVC pipes that are 20 inches long and 2 inches in diameter. These small chambers are capped at both ends and hold the weight required to make your ROV neutrally...

Controlling brushless DC motors using the BeagleBone Black


Whichever physical design you choose, you'll need to control the motors, and the BeagleBone Black can do this task. In this case, I chose fairly standard brushless DC motors, four Turnigy D2836 9 950KV Brushless Outrunner Motors available at hobbyking.com, and then fitted them with RC boat propellers, the Traxxas Propeller Left 4.0mm Villain EX TRA1584 available at rcplanet.com. These motors work just fine when underwater and are easy to control with radio-controlled Electronic Speed Controllers (ESC).

For this project, you'll need four brushless DC motors, and four ESC controllers. You'll need to make sure that the ESCs will be able to control the motors to go both forward and backwards. Here is an image of one such unit:

This particular unit is a Turnigy Trackstart 25A ESC, made normally for an RC car, and is available at many retail and online RC outlets. The connections on this unit are straightforward. The red and black wires...

Program to control DC motors using the BeagleBone Black


Now that you've connected your motor, here is a simple Python program to control one of the motors:

Let's look at the details. Here are the individual command statements:

  • #!/usr/bin/python: As noted earlier, this command sets up the program to be executed without invoking Python

  • import Adafruit_BBIO.PWM as PWM: This library is used to communicate with the GPIO pins

  • motor1 = "P8_13": This sets the motor to PWM control P8_13—the 13th pin on the 8th connector

  • duty_stop = 9: This sets the duty cycle of the PWM that is needed to stop the motor

  • duty_forward = 12 # 12 max: This sets the duty cycle of the PWM signal on the control pin that is needed to make the motor go in the forward direction at the maximum speed

  • duty_back = 6 # 6 min: This sets the duty cycle of the PWM signal on the control pin that is needed to make the motor go in the backward direction at the maximum speed

  • PWM.start(motor1, duty_stop, 60.0): This sets the PWM signal...

Connecting to the BeagleBone Black via a long LAN


The ROV will be controlled from a computer on the service through a very long LAN cable. Fortunately, long LAN cables are readily available at most online electronic stores. I used a 100-foot cable for my ROV. You'll also need to be careful how you pass the LAN cable through the main compartment. I used a 90° Snap Elbow Dome Connector to pass the LAN cable to the main compartment. Here is an image of this part:

I also found it useful to purchase a hose spool from the local hardware store to organize my LAN cable. The following is an image of a hose spool:

Now you'll need to connect your LAN cable to a computer on the surface so that you can control your ROV. Since the default setting for the BeagleBone Black is to DHCP—a dynamic IP address allocation process—if you want to talk without changing anything, then you'll need a wired router to connect your BeagleBone Black to your computer. This router will help in providing the BeagleBone Black...

Accessing a camera for your project


Now that you have established a connection via a long LAN cable, the second capability you'll need is to access a camera to see where you are going. You've already done this as a part of Chapter 4, Vision and Image Processing. You can create a simple display window for OpenCV using the camera.py demo program that comes with the open source code. Depending on the camera, you might want to change the resolution of the image. Here is the program that works with the Logitech C270 webcam:

Now that you have these two applications, you'll want to run both the GUI and the camera program so that you can see where you are going and control your ROV. Do this by again using the VNC server capability. In your VNC viewer window, you can run both the programs, and you should see something like this:

With the image on the left and the controls on the right, you can now control your ROV and explore the underwater world. Mount your camera to the front of the ROV. I used a...

Summary


In this chapter, you tackled a robot that can go under the water. You learned how to control a project via a LAN connection across a significant distance with the ROV project. In the next chapter, you will move to projects that can fly.

lock icon The rest of the chapter is locked
You have been reading a chapter from
Mastering Beaglebone Robotics
Published in: Dec 2014 Publisher: ISBN-13: 9781783988907
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}