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 6. Making the Unit Very Mobile – Controlling Legged Movement

In the previous chapter, we covered wheeled and tracked movement. Cool enough, but what if you want your robot to navigate uneven ground? Now you will add the capability to move the entire project using legs.

Mission briefing


We've covered creating robots using a wheeled/track base. In this chapter, you will be introduced to some of the basics of servo motors and using the BeagleBone Black to control the speed and direction of your legged platform. Here is an image of a finished project:

Why is it awesome?

Even though you've learned to make your robot mobile by adding wheels or tracks, this mobile platform will only work well on smooth, flat surfaces. Often, you'll want your robot to work in environments where it is not smooth or flat; perhaps, you'll even want your robot to go upstairs or over curbs. In this chapter, you'll learn how to attach your board, both mechanically and electrically, to a platform with legs, so your projects can be mobile in many more environments. Robots that can walk: what could be more amazing than that?

Your objectives

In this chapter, you will learn:

  • Connecting the BeagleBone Black to a mobile platform using a servo controller

  • Creating a program in Linux to control the...

Connecting the BeagleBone Black to the mobile platform using a servo controller


Now that you have a legged platform and a servo motor controller, you are ready to make your project walk!

Prepare for lift off

Before you begin, you'll need some background on servo motors. Servo motors are somewhat similar to DC motors; however, there is an important difference. While DC motors are generally designed to move in a continuous way—rotating 360 degrees at a given speed—servos are generally designed to move within a limited set of angles. In other words, in the DC motor world, you generally want your motors to spin with continuous rotation speed that you control. In the servo world, you want your motor to move to a specific position that you control.

Engage thrusters

To make your project walk, you first need to connect the servo motor controller to the servos. There are two connections you need to make: the first to the servo motors, the second to the battery holder. In this section, you'll connect...

Creating a program in Linux to control the mobile platform


Now that you can control your servos using basic commands, let's control them using a program.

Prepare for lift off

So, you know that you can talk to your servo motor controller and set your servos. In this section, you'll create a Python SW program that will let you talk to your servos a bit more intuitively. You'll issue commands that tell a servo to go to a specific angle, and it will go to that angle. You can then add a set of such commands to allow your legged mobile robot to lean left, lean right, or even take a step forward.

Engage thrusters

Let's start with a simple program that will make your legged mobile robot's servos go to 90 degrees. This should be somewhere close to the middle of the 180 degrees you can set. However, the center, maximum, and minimum values can vary from servo to servo, so you may need to calibrate these values. To keep things simple, we will not cover that here. The following is the code:

The explanation...

Making your mobile platform truly mobile by issuing voice commands


Now that your robot can move, wouldn't it be neat to have it obey your 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 section, you will use the principles from Chapter 3, Providing Speech Input and Output, 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 3, Providing Speech Input and Output. 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...

Mission accomplished


Congratulations! Your robot should now be able to move around in any way you'd like to program. You can even have the robot dance.

A challenge


You've now built a two-legged robot, and you can easily expand this to robots with even more legs. Here is an image of the mechanical structure of a four-legged robot that has eight DOF, which is fairly easy to create using many of the parts you have used to create your two-legged robot. This is my personal favorite because it doesn't fall over and break the electronics:

You'll need eight servos, and lots of battery. If you look on eBay, you can often find kits for sale for four-legged robots with twelve DOF, but again realize that the battery will need to be much bigger. For these kinds of applications, we often use remote control (RC) batteries. These are nice, as they are rechargeable, but make sure you either purchase one that is 5 to 6 volts, or include a way to regulate the voltage. Here is a picture of this kind of battery, available at most hobby stores:

If you use this type of battery, don't forget a charger. The hobby store can help with choosing an appropriate match...

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