Reader small image

You're reading from  BeagleBone Robotic Projects

Product typeBook
Published inDec 2013
PublisherPackt
ISBN-139781783559329
Edition1st Edition
Right arrow
Author (1)
Richard Grimmett
Richard Grimmett
author image
Richard Grimmett

Richard Grimmett has more fun that should be allowed working on robotics projects while teaching Computer Science and Electrical Engineering at Brigham Young University Idaho. He has a Bachelors and Masters degree in Electrical Engineering and a PhD in Leadership Studies. He also has 26 years of experience in the Radar and Telecommunications industries, and even has one of the original brick phones. He has written books on the basics of using the BeagleBone Black for robotics projects, and another for the Raspberry PI and yet another for the Arduino.
Read more about Richard Grimmett

Right arrow

Chapter 5. Making the Unit Mobile – Controlling Wheeled Movement

You can now talk to the board, and it can talk back. It can even see. Now, you will add the capability to move the entire project using wheels.

Mission briefing


Perhaps the easiest way to make your projects mobile is to add a wheeled platform. In this project, you will be introduced to some of the basics of controlling DC motors and using the BeagleBone Black to control the speed and direction of your wheeled platform.

Why is it awesome?

Even though you can talk to your board, and it can talk back and see, you need to make it mobile to really call it a robot. In this project, you'll learn how to attach your board, both mechanically and electrically, to a wheeled platform. Mobility—what could be more amazing than that?

Tip

Downloading the example code and colored images

You can download the example code files and colored images for this Packt book you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Your objectives

In this project you will:

  • Use a motor controller to control the speed of...

Using a motor controller to control the speed of your platform


The first step to make the platform mobile is adding a motor controller. This allows us to control the speed of each wheel (or track) independently.

Prepare for lift off

Before you get started, let's spend some time understanding the basics of the motor control. Whether you chose the two-wheeled mobile platform or the tracked platform, the basic movement control is the same. The unit moves by engaging the motors. If the desired direction is straight, the motors run at the same speed. If you want to turn the unit, the motors run at different speeds. The unit can turn in a circle if you run one motor forward and one backwards.

DC motors are fairly straightforward devices. The speed and direction of the motor is controlled by the magnitude and polarity of the voltage applied to its terminals. The higher the voltage, the faster the motor will turn. If you reverse the polarity of the voltage, you can reverse the direction the motor is...

Controlling your mobile platform programmatically using the BeagleBone Black


Now that you have your basic motor controller functionality up and running, you need to connect both motor controllers to the BeagleBone Black. This task will cover this, and then show you how to control your entire platform programmatically.

Prepare for lift off

Now you'll hook up both motor controllers to the battery power supply and motors. Let's start with the motor controllers. The screw-type connectors on your motor controllers make this easy and help you avoid any soldering.

First, run the battery connectors to the VIN and GND connections on one of the motor controllers. Then, take one of the two small lengths of the jumper wire and place that in the VIN connector, and then do the same with the second jumper wire and the GND connector, as shown in the following image:

Now screw the connection tight. Do this on both the VIN and GND connectors. Now, take the other end of these two jumper wires and place them...

Making your mobile platform truly mobile by issuing voice commands


Prepare for lift off

You should now have a mobile platform that you can program to move in any number of ways. Unfortunately, you still have your LAN cable connected, so the platform isn't completely mobile. And once you have begun the program, you can't alter the behavior of your program. In this task, you will use the principles from Chapter 2, Programming the BeagleBone Black, to issue voice commands to initiate movement.

Engage thrusters

You'll need to modify your voice recognition program, so it will run your Python program when it gets a voice command. If you feel rusty on how this works, review Chapter 2, Programming the BeagleBone Black. You are going to make a simple modification to the continuous.c program in /home/ubuntu/pocketsphinx-0.8/src/programs. To do this, type: cd /home/ubuntu/pocketsphinx-0.8/src/programs and then type emacs continuous.c. The changes will come in the same section as your other voice commands...

Mission accomplished


Now you have your mobile platform up and ready to move around. You can command it using your voice. In the next project, you'll introduce a different kind of mobile platform: one with legs.

A challenge


You have already covered how to add vision to your BeagleBone Black project. A great addition to your mobile robot is the ability to follow a colored object attached to a target.

Remember how you used OpenCV to find a colored object, and could then find out where in your field of view (left or right, or up or down) it existed? You can use this to decide whether to move your mobile platform right or left, or forward or backward. Try this, and then move the target to see if your mobile robot can follow it.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
BeagleBone Robotic Projects
Published in: Dec 2013Publisher: PacktISBN-13: 9781783559329
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.
undefined
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

Author (1)

author image
Richard Grimmett

Richard Grimmett has more fun that should be allowed working on robotics projects while teaching Computer Science and Electrical Engineering at Brigham Young University Idaho. He has a Bachelors and Masters degree in Electrical Engineering and a PhD in Leadership Studies. He also has 26 years of experience in the Radar and Telecommunications industries, and even has one of the original brick phones. He has written books on the basics of using the BeagleBone Black for robotics projects, and another for the Raspberry PI and yet another for the Arduino.
Read more about Richard Grimmett