Reader small image

You're reading from  Mastering Beaglebone Robotics

Product typeBook
Published inDec 2014
Reading LevelBeginner
Publisher
ISBN-139781783988907
Edition1st Edition
Languages
Concepts
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 2. Building a Basic Tracked Vehicle

Now you will add the capability to move the entire project using wheels. Perhaps the easiest way to make your project mobile is to use a vehicle with two tank tracks. In this chapter, you will be introduced to the basics of controlling DC motors and use the BeagleBone Black to control the speed and direction of your tracked platform.

In this chapter, you will be doing the following:

  • Using a motor controller to control the speed of your tracked vehicle

  • Controlling your mobile platform programmatically using the BeagleBone Black

  • Using voice commands to control your tracked vehicle

Choosing the tracked platform


The first step in building your mobile robot is to pick your tracked vehicle platform. There are several manufacturers that make preassembled, tracked units. Here's an image of a preassembled, inexpensive tracked platform, made by Dagu. It's called the Dagu Rover 5 Tracked Chassis.

Once you have chosen your mobile platform, you'll need to hook up a motor controller, a battery, and the BeagleBone Black.

Connecting a motor controller to control the speed of your tracked 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. Before you get started, let's spend some time understanding the basics of motor control. The unit moves by engaging the motors. If the desired direction is straight, the motors are run at the same speed. If you want to turn the unit, the motors are 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 this motor are 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 in which the motor is turning.

The magnitude and polarity of the voltage are not the only important factors when you think about...

Controlling your mobile platform programmatically using the BeagleBone Black and Python


Now that you have your motor running, your next step is to programmatically control the motor controller using the BeagleBone Black. If you are going to do this remotely, log in through PuTTY. If you are doing this directly on a monitor, simply log in.

I suggest you use Python in your initial attempts to control the motor. It is very straightforward to write, run, and debug your code in Python. I am going to include the directions here for Python; you can also go to the Pololu.com website at www.pololu.com/ and find instructions for how to access the capabilities in the C programming language.

The first Python program you are going to create is shown here:

To create this program, create a directory called track in your home directory by typing mkdir track, and then type cd track. You should now be in the track directory. Now open the file by typing emacs dcmotor.py. If you are using the nano editor, open...

Summary


Now you have a basic tracked, mobile platform. You can control the unit remotely or give it voice commands. In the next chapter, you'll add some sonar and IR sensors so that you can avoid or track objects. This will allow your tracked vehicle to move around without hitting barriers.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Mastering Beaglebone Robotics
Published in: Dec 2014Publisher: 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.
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