Documente Academic
Documente Profesional
Documente Cultură
12
SERVO MAGAZINE
ROBOT BUILDING BASICS BLDC MOTOR ARTIFICIAL MUSCLES TANKBOT GAIT DETECTION
December 2008
Full Page.qxd
7/9/2008
9:57 AM
Page 2
Sharing Ingenuity
W W W. S P A R K F U N . C O M
Full Page.qxd
11/4/2008
9:54 AM
Page 3
Introducing Logic, the new Logic Analyzer with SPI, Serial, and I2C. Now shipping for $149.
logic
TM
TOC Dec08.qxd
11/5/2008
9:18 PM
Page 4
Departments
06
12
18
66
68
72
81
81
Mind/Iron
Events Calendar
New Products
Robotics Showcase
SERVO Webstore
Menagerie
Robo-Links
Advertisers Index
PAGE 20
Columns
08
Robytes
by Jeff Eckert
10
GeerHead
by David Geer
Artificial Muscles
14
by Dennis Clark
BasicBoard Robotics
22
27
BUILD REPORT:
Cloud of Suspicion
MANUFACTURING:
Laying Out Your Work Area
PARTS IS PARTS:
2.4 GHz Radio Fail-safes
Events
24
28
Event Report:
Robothon Robot Combat 2008
Results and Upcoming Competitions
Robotics Resources
by Gordon McComb
74
20
by William Smith
62
Features
58
Appetizer
by Shane Colton
Robot Profile
26
Micro Drive
77
Japanese Robotics
SERVO 12.2008
TOC Dec08.qxd
11/5/2008
9:19 PM
Page 5
12.2008
VOL. 6 NO. 12
PAGE 48
PAGE 74
Learning To Drive:
The BLDC Motor
44
by Fulvio Mastrogiovanni
AmI is a multidisciplinary approach
using intelligent systems around us
to help in daily activities. Or, you
could just call it a Smart Home, too.
by Fred Eady
Keep your robots runnin with this
latest addition to the motor arsenal.
34
48
Multi-Purpose,
Daisy-Chained Gait
Detection System
by Balakumar Balasubramaniam
and Wendi Dreesen
This inexpensive system lets you
monitor your (or your robots!)
rhythm and stride pattern.
by Chris Savage
Propeller Multi-Controller.
38
Ambient Intelligence
54
SERVO 12.2008
Mind-Iron Dec08.qxd
11/5/2008
4:33 PM
Page 6
Published Monthly By
T & L Publications, Inc.
430 Princeland Ct., Corona, CA 92879-1300
(951) 371-8497
FAX (951) 371-3052
Webstore Only 1-800-783-4624
www.servomagazine.com
Subscriptions
Toll Free 1-877-525-2539
Outside US 1-818-487-4545
P.O. Box 15277, N. Hollywood, CA 91615
Mind / Iron
by Bryan Bergeron, Editor
Mass Customization
Im convinced that the future of
robotics especially service robotics
is tied to the development and
acceptance of mass customization.
Consider the typical challenges faced
by an enthusiast in creating a
complete robot. First, theres the
hardware platform from the
supporting infrastructure to the drive
train to the effectors. Unless you
start from scratch a costly and
time-consuming affair you must
identify and purchase a crawler or
roamer or other platform suitable to
your needs. However, have you ever
tried mixing and matching an arm
from one manufacturer with the
body of another? Even if its possible
to readily bolt the effector securely to
the main body, there remain issues
from electrical connectivity to how to
best compensate for the extra weight
and shift in the center of gravity.
Then, theres the issue of sensor
selection from US range detectors
to IR radar. Again, this is a task- and
cost-dependent selection, assuming
what you need is even available offthe-shelf. Theres also the power
system, communications system, and
all-important computational
hardware and software to consider.
Typically, you must either cobble
together a unique assemblage of
components from a variety of
vendors or buy a pre-configured
robot from a single vendor thats (at
best) a compromise. On top of it all,
because your final robot is a unique
assemblage of components, sensors,
effectors, and software, the software
routines crafted by another developer
will probably require significant
SERVO 12.2008
PUBLISHER
Larry Lemieux
publisher@servomagazine.com
ASSOCIATE PUBLISHER/
VP OF SALES/MARKETING
Robin Lemieux
display@servomagazine.com
EDITOR
Bryan Bergeron
techedit-servo@yahoo.com
TECHNICAL EDITOR
Dan Danknick
dan@teamdelta.com
CONTRIBUTING EDITORS
Jeff Eckert
Tom Carroll
Gordon McComb David Geer
Dennis Clark
R. Steven Rainwater
Fred Eady
Kevin Berry
Michael Simpson
Chris Savage
Wendi Dreesen
Fulvio Mastrogiovanni
Shane Colton
Thomas Kenny
Blake Hooper
Rob Farrow
William Smith
Ron Hackett
Balakumar Balasubramaniam
CIRCULATION DIRECTOR
Tracy Kerley
subscribe@servomagazine.com
MARKETING COORDINATOR
WEBSTORE
Brian Kirkpatrick
sales@servomagazine.com
WEB CONTENT
Michael Kaudze
website@servomagazine.com
PRODUCTION/GRAPHICS
Shannon Lemieux
AJ Cohen
ADMINISTRATIVE ASSISTANT
Debbie Stauffacher
Copyright 2008 by
T & L Publications, Inc.
All Rights Reserved
All advertising is subject to publishers approval.
We are not responsible for mistakes, misprints,
or typographical errors. SERVO Magazine assumes
no responsibility for the availability or condition of
advertised items or for the honesty of the
advertiser. The publisher makes no claims for the
legality of any item advertised in SERVO.This is the
sole responsibility of the advertiser.Advertisers and
their agencies agree to indemnify and protect the
publisher from any and all claims, action, or expense
arising from advertising placed in SERVO. Please
send all editorial correspondence, UPS, overnight
mail, and artwork to: 430 Princeland Court,
Corona, CA 92879.
Mind-Iron Dec08.qxd
11/5/2008
4:06 PM
Page 7
Order at
(888) 929-5055
SERVO 12.2008
Robytes Dec.qxd
11/5/2008
6:46 PM
Page 8
Robytes
Stereo Vision System
Introduced
SERVO 12.2008
by Jeff Eckert
cut the number of accident fatalities
and serious injuries to Nissan drivers by
half by 2015, as compared with 1995.
Robytes Dec.qxd
11/5/2008
6:47 PM
Page 9
Robytes
the system and launched the UAS.
The team then executed the operational scenario (details not revealed)
and safely retrieved the UAS.
Specs are sketchy, but we did find
out that KillerBee is fully autonomous,
with no piloting skills needed by the
operator. Maximum takeoff gross
weight is 164 lb, and its powered by
an 8 hp engine fitted with a twoblade prop. The stall speed is 45 kt,
and loiter speed is 55 kt. Mission
endurance is 15 hr, and it has an
impressive range of 972 nautical miles.
SERVO 12.2008
Geerhead Dec-edited.qxd
11/4/2008
4:12 PM
Page 10
by David Geer
10
SERVO 12.2008
Harnessing EPAM
Properties
One of the most common
building blocks using the EPAM is
the universal muscle actuator (UMA)
configuration, which is a jumping-off
point for more complex applications.
This configuration attaches two EPAM
sheets/films at their centers, with a
lightweight spacer between them.
Each stack of film is attached to
a frameso it can be mounted. Each
stack is also attached to an output
disk which transmits the force and
stroke of the expanding film to some
load in order to perform work,
This larger solenoid coil at left is used
in commercial pneumatic valves.
The coil at right a 9.5 mm actuator
stack based on EPAM technology
is capable of the same workload
at a fraction of the commercial
solenoids mass and volume. The
commercial part weighs 70 grams
compared to the EPAMs 8.
Geerhead Dec-edited.qxd
11/4/2008
4:13 PM
Page 11
GEERHEAD
causing movement.
These actuators are made up of
only the EPAM membranes, a spring,
and end caps, which are cheaper,
simpler, and lighter than the several
parts and the electric motor otherwise
required to do the same job.
Further Applications
Like motors convert rotary
movement to linear today, EPAM
technology will be used to convert
repeated linear motion into rotary
motion, such as is seen with a crank
and pistons in an internal combustion
engine but much more cheaply
and efficiently in a more compact
size and space.
We can also perform accumulated
or step-by-step linear motion. One of
Conclusion
While there is a view to the future
of EPAM with robot muscles in mind,
there are some near-term obstacles.
One is that the range of motion
doesnt scale for EPAMs as easily as
the force emitted by them. Our
actuator stroke range is on the order
of 10 percent, says Polyakov. Robots
clearly require a much broader range
of motion. SV
Advantage: EPAM
EPAMs are a competitive technology
when compared with electric motors and
other actuators. Their benefits include:
SERVO 12.2008
11
Events.qxd
11/5/2008
8:58 PM
Page 12
Send updates, new listings, corrections, complaints, and suggestions to: steve@ncc.com or FAX 972-404-0269
Know of any robot competitions Ive missed? Is your
local school or robot group planning a contest? Send an
email to steve@ncc.com and tell me about it. Be sure to
include the date and location of your contest. If you have a
website with contest info, send along the URL as well, so we
can tell everyone else about it.
For last-minute updates and changes, you can always
find the most recent version of the Robot Competition FAQ
at Robots.net: http://robots.net/rcfaq.html
TBA
Januar y
20-22 Singapore Robotic Games
R. Steven Rainwater
December
4-31
ROBOEXOTICA
Museumsquartier, Vienna, Austria
In this event, robots are tested on serving
cocktails, mixing cocktails, bartending
conversation, lighting cigarettes/cigars, and
other achievements in electronic cocktail
culture.
www.roboexotica.org/en/acra.htm
24-26 Techfest
Robotex
Tallinn University of Technology, Tallinn, ESTONIA
Autonomous robot must clean a room by
gathering up socks, empty cans, and other stray
objects. The objects must be placed into a special
gathering area.
www.robotex.ee
29
Robotix
IIT Khargpur, West Bengal, India
Now at nine years old, this is supposed to be
the largest robot competition in India. Expect to
see over 1,000 teams competing and over 2,500
spectators this year.
www.robotix.in/
TBA
Kurukshetra
Guindy, Chennai, INDIA
This event includes Designers Quest, Solenopsis,
Freightocog, and Catch Me If You Can.
http://www.kurukshetra.org.in
12
SERVO 12.2008
F e b ru a r y
15-19 APEC Micromouse Contest
Washington, DC
Micromouse maze running. Cash prizes and
trophies.
http://www.apec-conf.org/
Full Page.qxd
11/4/2008
9:58 AM
Page 13
MrRoboto - Dec.qxd
11/5/2008
4:00 AM
Page 14
roboto@servomagazine.com
Tap into the sum of all human knowledge and get your questions answered here!
From software algorithms to material selection, Mr. Roboto strives to meet you
where you are and what more would you expect from a complex service droid?
by
Dennis Clark
. First off, thanks for the kudos! I dont know why you
need such exacting accuracy; it will definitely be a
challenge since I dont think there is anything that
can provide that level of accuracy that is built into a
roving vehicle. Youre going to need to instrument your
environment some how.
Even differential GPS can only get an accuracy of at
best one meter. One paper that I read www.gdgps.
net/system-desc/papers/ion_paper_2000.pdf suggests
a sophisticated Internet-based correction method for differential
GPS that can get an estimated accuracy of about 20 cm. So
clearly, GPS by itself cannot get you what you want. Regardless,
that will set you back way more than your $1000 limit. RF
systems are very uncertain for determining ranges well and
clearly IR rangers are of limited value outdoors. Okay, that
takes care of what WONT work for you. Now, lets step off
of the deep end and speculate on what might do what you
want in your limited area of a quarter mile.
My first thought would be to position two video cameras
at right angles to each other on tall towers aimed down on
the area within which you are tracking your robot. I realized,
however, that I was thinking a quarter acre, not quarter mile.
That wouldnt work because you couldnt get the whole space
in the frame at a useful resolution. So, strike that idea.
However, those sensors at right angles to each other
might work in another way. If youve ever seen a contractor
14
SERVO 12.2008
MrRoboto - Dec.qxd
11/5/2008
4:00 AM
Page 15
lots of things that will prevent this idea from working all of
the time, like light interference, the sensitivity of the camera,
or the expense of the light filters. Other tuning (like the angle
of the cameras to the ground) could also cause issues.
The problems in this type of system may be
insurmountable, so lets think even MORE inside the box.
Suppose we came up with small RF transmitters that were
carefully designed to have a limited range of about a meter
when used with a carefully tuned receiver. Then, suppose
we planted these transmitters in a grid at one meter
intervals. You could calculate your position by knowing your
range to each of these beacons by checking their field
strength. Since it would take thousands to do this at one
meter intervals, you could put them at longer intervals, but
then their resolution will suffer and your accuracy will not
be very good. Hmm, RF is just too unreliable.
Note that I dont even give odometry a nod here. Since
you are outside, there is just about no way you will get any
kind of positional accuracy when you consider ditches,
bumps, wheel slips, and the like. If you are going to use
some very sophisticated programming, you could use a full
IMU unit and calculate acceleration, deceleration, inclination, pitch, and yaw to create an inertial navigational unit.
But I still doubt that you could get a one inch in a quarter
mile accuracy. It would be fun to try it though! Google for
Inertial Navigation on the Internet. I have seen some
interesting papers on this topic; some by other well known
hobby robotics folks in the well known clubs.
Unless you can come up with something from my
rambling thoughts here, Im afraid that all Ive done is
15
MrRoboto - Dec.qxd
11/5/2008
4:01 AM
Page 16
16
SERVO 12.2008
Full Page.qxd
11/4/2008
10:18 AM
Page 17
SERVO 12.2008
17
DEC08NewProd.qxd
11/6/2008
1:04 AM
Page 18
New Products
N E W P RO D U C T S
RA-02
Robotic Arm
Kit
EDUCATIONAL KITS
Mechatronics
he CS220000 and
CS220001 are
new Mechatronics
kits from A-WIT
Technologies.
Choose the
CS220000 for US
power supplies or the
CS220001 for European power supplies. These kits
provide everything necessary to build a complete
Mechatronics Laboratory.
They include the 48-pin C Stamp, a C 101 BOL, PC
programming cables, power supply, instruments, and the
Mechatronics Parts Kit. Learn programmable mechanical
control, infrared speed and direction detection, and a
host of other Mechatronics concepts.
The Mechatronics Parts Kit includes sensors, display,
motor, etc. The electronic components required for the
Mechatronics activities are also included in the Parts Kit.
The activities introduce motor control and interfacing,
electronics, and transistor theory, just to name a few
concepts. All necessary software, documentation,
curriculum, and highly-illustrated instructions written
by college professors are included in the kit CD.
These Mechatronics kits are unique in the sense that
hobbyists, students, and autodidactic users alike work
with and develop embedded systems using professional
software development tools and a professional
programming language in a very user friendly
environment.
The power and versatility of the C Stamp guarantees
that learners can expand upon their Mechatronics
knowledge with their own ideas, projects, and
imagination. Well thought out and pedagogically sound
examples developed by college professors make sure that
learning Mechatronics with these kits is a powerful and
enjoyable experience.
All items are new, fully tested, factory direct, and all
software is included at no extra charge.
For further information, please contact:
A-WIT
Technologies, Inc.
18
SERVO 12.2008
he RA-02 Robotic
Arm from Images
Co. teaches basic
robotic principles. The
RA-02 kit includes all
components necessary
to build the robotic
arm shown here.
The robotic arm
kit also includes the SMC-05 five-position servomotor
controller kit. The servomotor kit includes the PCB and all
components necessary to build the servomotor controller
(soldering is required). Using the five-position servomotor
controller, one can control the robotic arm using the
onboard three position switches to manually grab, lift,
lower, wrist rotate, and pivot. In addition, the Windows
(98/XP) control software is available as a free download.
This allows PC control through one of the PCs serial
port. The Windows program has a script writing feature
that allows one to program the robotic arm with
thousands of movements with full, precise, and
repeatable control of each movement. Scripts may hold
a maximum of 10,000 movements (including pauses)
with a maximum repetition of 10,000.
Images Scientific
Instruments
Tel: 7189663694
Website: www.imagesco.com
TELEROBOTICS SOFTWARE
New AX-12
Smart Arm
Web Control
from
CrustCrawler
Interactive
he CrustCrawler
Interactive group
has released a simple
yet robust Telerobotics
application designed
DEC08NewProd.qxd
11/6/2008
1:05 AM
Page 19
CrustCrawler, Inc.
Website: www.CrustCrawler.com
Tel: 4805775557
MOTORS
HS-5485HB
Economy Digital
Servo
Hitec
Multiplex
SVI
SERVO 12.2008
19
CombatZone.qxd
11/5/2008
3:37 AM
Page 20
BUILD REP
by Thomas Kenney
Cloud of Suspicion
22 MANUFACTURING:
Laying Out Your Work
Area by Blake Hooper
27 PARTS IS PARTS:
2.4 GHz Radio Fail-safes
by Thomas Kenney
Events
24 EVENT REPORT:
Robothon Robot Combat
2008 by Rob Farrow
28 September 15 October 12
Results
by Thomas Kenney
20
SERVO 12.2008
RT
CombatZone.qxd
11/5/2008
3:38 AM
Page 21
SERVO 12.2008
21
CombatZone.qxd
11/5/2008
3:39 AM
Page 22
FIGURE 4. Cloud of
Suspicion is finished
and ready for battle.
components. I mounted
my two cell 1,320 mAh
Thunderpower battery
under my Spektrum BR6000
receiver and simply zip-tied
them to the base plate. I
then drilled through the
mounting holes of my
Scorpion XL speed controller
and used screws to secure
it. After this was done, the
robot was finished. Soon
after the robot was finished, I gave
it the name Cloud of Suspicion,
which I found in a list of Suggested
Names for Racehorses Expected to
MANUFACTURING:
Laying ut Your Work Area
by Blake Hooper
22
SERVO 12.2008
CombatZone.qxd
11/5/2008
3:41 AM
Page 23
SERVO 12.2008
23
CombatZone.qxd
11/5/2008
3:42 AM
Page 24
EVENT REPORT
Robothon Rob t Combat
2008
Event Results
by Rob Farrow
24
SERVO 12.2008
I3 lb BEETLEWEIGHT
1st Gutter Monkey, Team Death
by Monkeys, driven by Dan ODell
2nd T-Rex 2.0, Team DinoBots,
driven by Doug Brown
3rd Melty B(eetle),
SpamButcher, driven by
Rich Olson
12 lb HOBBYWEIGHT (12 lb)
1st Organ Grinder 12, Team
Death by Monkeys, driven by
Rob Farrow
2nd Shag, Team Gausswave,
driven by Rob Purdy
3rd Defiantly Daft, Team LNW,
driven by Travis Schwartz
CombatZone.qxd
11/5/2008
3:46 AM
Page 25
Driver-builder Dan
ODell holding the
3 lb Beetleweight
1st place winner
Gutter Monkey.
SERVO 12.2008
25
CombatZone.qxd
11/5/2008
3:47 AM
Page 26
The 12 lb robot
T-Bone built by
Dylan Feral-McWhirter.
ROBOT PR
FILE
Bot
150 grams
VD
1 pound
Dark Pounder
44/5
1 kg
Roadbug
27/10
3 pounds
3pd
6 pounds
G.I.R.
Bot
Win/Loss
10/3
1 pound
Dark Pounder
23/3
1 kg
Roadbug
11/4
48/21
3 pounds
Limblifter
12/1
17/2
6 pounds
G.I.R.
11/2
26/7
12 pounds
Solaris
42/12
12 pounds
Surgical Strike
19/7
15 pounds
Humdinger 2
29/2
15 pounds
Humdinger 2
29/2
30 pounds
Helios
31/6
30 pounds
Billy Bob
12/4
30 (sport)
Bounty Hunter
9/1
30 (sport)
Bounty Hunter
9/1
60 pounds
Wedge of
Doom
43/5
60 pounds
K2
14/2
53/15
120 pounds
Touro
14/2
46/13
220 pounds
Original Sin
12/5
39/15
340 pounds
Ziggy
6/0
28/9
390 pounds
MidEvil
3/0
Sewer Snake
MidEvil
26
Ranking
SERVO 12.2008
Historical Ranking: #2
Class: 150 gm Fleaweight
Team: Team Misfit
Builder(s): Zachary Lytle
Location: Santa Rosa, California
BotRank Data
Total Fights
Lifetime History
17
Current Record
13
Events
10
Wins
13
10
Losses
4
3
CombatZone.qxd
11/5/2008
3:48 AM
Page 27
PARTS IS PARTS:
2.4 GHz Radi Fail-safes
by Thomas Kenney
SERVO 12.2008
27
CombatZone.qxd
11/5/2008
3:50 AM
Page 28
be no unintentional frequency
conflicts.
The 2.4 GHz radio systems
operate on frequency hopping.
There are 80 channels in the range
of 2.4 GHz radios. The transmitters
will search for an open channel, and
once this is found, connect to the
receiver it has been bound to via
this channel.
The only problem with most
spread spectrum receivers is that
like many R/C receivers they
will only failsafe on the throttle.
There are no failsafes on any of
the other channels, and they will
simply continue in the positions
EVENTS
Results for September 15 October 12 Events
AR
presented
Robothon Robot
Combat 2008 in
Seattle, WA on
September 21st.
Twenty-two bots were registered.
28
SERVO 12.2008
Full Page.qxd
11/4/2008
11:02 AM
Page 29
email: sales@crustcrawler.com
11/5/2008
11:19 AM
Page 30
LEARNING TO DRIVE:
By Fred Eady
f you were to go back and survey past SERVO articles that I have written, you would probably conclude
that I have this thing about motors and motor drivers. For instance, we recently tackled Universal
Motors and constructed a Universal Motor controller. I also presented more than one SERVO stepper
motor controller project. In these pages, weve driven linear actuators, rotated hobby servo rotors, and
built circuitry to oversee the direction and speed of simple brushed DC motors.
30
SERVO 12.2008
BLDC 101
As you would imagine, the absence of brushes in a
BLDC motor does have physical and electrical advantages.
On the whole, BLDC motors last longer and run quieter
acoustically and electrically than comparable universal DC
motors. Pound for pound, a BLDC motor can deliver higher
torque than its brushed counterpart. In addition to being
more reliable, quieter, and stronger, BLDC motors have the
ability to run faster than universal brushed DC motors while
requiring less maintenance. BLDC motors are turning in
automobiles, kitchen appliances, medical equipment, and
aircraft. If you have one of those new front-loading washing
machines, its a good bet that a BLDC motor is spinning the
tub. These motors can also be found spinning diskettes and
hard drive platters. The power-to-weight ratio of BLDC
motors make them very popular for use in model aircraft. If
BLDC motor technology is soaring around in flying robots,
you can bet theres an application for them in land-roving
robotic manifestations.
I attempted to disassemble the BLDC motor you see
in Photo 1 with no joy. I suspect that its components are
sealed to preserve the integrity of the positioning of the
motors integral Hall sensors. I didnt have a second motor
on hand. So, I didnt work too hard at pulling it apart. The
model BLY171S-24V-4000 BLDC motor shown in Photo 1 is
manufactured by Anaheim Automation. This particular
motor has a permanent magnet rotor, a three-phase stator,
and a built-in trio of Hall sensors. Picking apart the model
number tells us that this motor is a NEMA size 17 type
BLDC motor. The 1S denotes a single shaft motor with 11
oz-in of continuous stall torque. The BLY171S-24V-4000s
motor windings are rated for 24 volts and are able to spin
the rotor shaft at 4,000 RPM.
The BLY (for short) connects to the outside world using
a standard eight-wire BLDC motor scheme. Three of the
11/5/2008
10:07 AM
Page 31
31
11/5/2008
10:08 AM
Page 32
32
SERVO 12.2008
11/5/2008
10:08 AM
Page 33
BEMF 101
When the BLDC motor shaft is spinning, BEMF is
generated by the movement of the rotor permanent
magnets past the stator coils. BEMF is just a fancy way of
saying opposing voltage. The BEMF varies according to the
speed of the motor. The faster the motor spins, the higher
the BEMF that is generated.
Recall that one of the three BLDC motor phases is
always electrically disconnected during commutation.
Consider Figure 7. Matching up the phase drive voltages
with the commutation chart in Figure 6 tells us that this
drive pattern is representing commutation sequence 4.
The floating phase in commutation sequence 4 happens to
be phase C. The floating phase provides a portal for the
measurement of the BEMF voltage for this commutation
period. Another look at Figure 6 shows that all three of the
phases are electrically disconnected at one time or another.
Thus, we are able to measure the BEMF during any of the
six commutation periods using the available floating phase.
Since the BEMF is directly proportional to the motor
speed, we can use the sensed BEMF levels to control the
commutation of a BLDC motor. The goal is to commutate the
BLDC at the required speed and torque while maintaining a
safe voltage and current level in the motors windings.
Next Time
SOURCES
Motor Anaheim Automation www.anaheimautomation.com
BLY171S-24V-4000 BLDC
SERVO 12.2008
33
11/5/2008
3:27 AM
Page 34
by CHRIS SAVAGE
GETTING CONTROL
WITH THE
Propeller
his month, we wrap up our four part series by
covering practical use of PWM on the Propeller using
our multi-controller board. In last months article,
Kevin McCullough covered stepper motor control and made
schematics available on the project web page. These
schematics use the L293D Quad Half-H Driver IC which
provides bi-directional drive currents of up to 600 mA from
4.5V to 36V. We will use the L293D in this article for both
motor control and light dimming. This IC is included on the
Propeller Professional Development Board as well, so those
who have the PPDB can follow along even if they havent
built a multi-controller board.
Control Methods
Controlling the speed of a motor or dimming a light
can be done by varying the voltage going to the device.
More voltage and the motor goes faster or the light gets
brighter. Less voltage and the motor slows down or the
light gets dimmer. Using analog control is inefficient for this
because power is typically wasted while the driver (usually a
34
SERVO 12.2008
PART 4:
Propeller
Multi-Controller
PWM Control
Using PWM, we will essentially modulate our signal at a
fixed period with a varying duty cycle. By varying the duty cycle,
we will be varying the ratio of on-time to off-time at a given
11/5/2008
3:28 AM
Page 35
rate or frequency (see Figure 1). This will allow us to control the
speed of a motor or the brightness of a lamp much more
efficiently. Our multi-controller board is Propeller-based so we
can take advantage of the counters to help generate our PWM
signal. The Propeller has eight cogs (processors) and each cog
has two counters for a total of 16. The counters operate
completely independently of each other and are advanced
modules having 32 modes of operation. For this article,
well be using the PWM mode which will be explained next.
Duty Cycle
Period
25%
50%
75%
FIGURE 1. PWM
example waveform.
SERVO 12.2008
35
11/5/2008
Page 36
FIGURE 3. L293D
motor drive circuit.
5V
VMOT
3:34 PM
P16
1
2
3
4
5
6
7
8
1,2EN
VCC1
1A
2A
1Y
2Y
GND
GND
GND
GND
2Y
3Y
2A
3A
VCC2
3,4EN
16
15
14
13
12
11
10
9
L293D
Dimming Lamps
time. The cnt value is a 32-bit counter incremented every
clock cycle. In line 24, we add our period to time. This
calculates the value of cnt one period from the time cnt
was read. To summarize, lines 20 through 24 set up all the
parameters we will need in our assembly routine before
running the loop. This includes setting up the direction
register for the output pin, setting up the configuration
register for counter A (which sets the mode and output
pin), and calculating the target cnt value for timing using
the system counter.
At this point, we enter the main assembly loop at line
25. This line reads the current value from the address
passed in the par register which as you may recall
points to the global variable parameter where our main
code can alter the duty cycle. Line 26 causes the cog to
wait for the target cnt value which was stored in time.
Once reached, period is added to time again to recalculate
the new target and the code proceeds to the next line. Line
27 takes the variable value and makes it negative before
loading it into PHSA.
The reason for this is that in order for the output to be
high, bit 31 must be set. By making value a negative number,
we set bit 31 and our output goes high. Because value is set
to our duty cycle and the counter will increment every clock
cycle, then once the counter reaches 0 the output will go low.
Line 28 loops back to line 25 where we fetch a new duty cycle
value and wait. So, as you can see the output stays high for
the duty cycle, which is a percentage of the period and then
goes low. The cycle restarts at exactly the number of cycles
in the period. This happens indefinitely or until the cog, is
reset. Since this routine runs in its own cog, the Main method
can change the duty cycle at any time and the PWM assembly
code will update at the end of the current period.
36
SERVO 12.2008
Other Options
So, now you have a good foundation to start
generating PWM on the Propeller and add functionality to
the multi-controller board weve been working with. While
this article covered the basics, more advanced code with
bi-directional motor control will be available on the project
website. We may even go so far as to integrate all three
types of control into one demo.
For now, experiment, build, and learn. Dont be afraid
to try new things. The chips are socketed and easily replaceable
if you should make a mistake that results in smoke. Remember
you can always visit the Parallax Object Exchange and the
Parallax Support/Discussion Forums if you need additional
code or have any questions. Feel free to email me at
csavage@parallax.com if you have any questions,
comments, or suggestions. Take care and have fun! SV
Resources
Project Page
www.parallax.com/go/GettingControl4
Parallax, Inc.
www.parallax.com
Propeller Object Exchange
obex.parallax.com
Propeller Support/Discussion Forums
forums.parallax.com/forums/default.aspx?f=25
Full Page.qxd
11/4/2008
11:04 AM
Page 37
1-800-728-6999 www.scienticsonline.com
11/5/2008
10:45 PM
Page 38
Ever wanted to monitor your rhythm and stride pattern while you run? How about the G-force on
your knees on the treadmill? Want to do simple motion tracking (inexpensively)?
This article describes a simple but powerful design for a gait detection system (of course,
along with all the software you would need!) using the highly configurable Cypress
CY29466 microcontroller for control and ADX330 accelerometers for the sensors.
Multi-Purpose, Daisy-Chained
THE BASICS
HARDWARE
DESIGN
The basic design of
this gait detection system
consists of one (or more)
slave nodes daisy-chained
to a single master node
by a fast I2C connection
operating at 400 kbps. The
38
SERVO 12.2008
11/5/2008
10:35 PM
Page 39
slave nodes are strapped onto the anatomy, and the accelerations imposed upon the slave nodes as they piggyback
during body movements are measured to calculate the gait.
The key sensor component residing in every slave node
of our current gait detection system is the humble triple
axis MEMS-based accelerometer ADX330. In lieu of the
stand-alone accelerometer chip, we chose to use the
DE-ACCM3D modules from Dimension Engineering
(www.dimensionengineering.com) as they carry
on-board regulators, power filters, reverse voltage
protection, and provide buffered outputs.
The three analog outputs (one for every axis) from the
DE-ACCM3D module in each slave is then fed into programmable gain amplifier modules within a Cypress C8YC29466
PSoC mixed signal array microcontroller. The amplified
signals are then digitized using an incremental ADC converter
(TRIADC8) capable of fast conversions. Note that the
TRIADC8 was chosen for this project solely for superior
speed. However, the PSoC provides a large variety of
incremental and delta-sigma converters that can be
FIGURE 3: PHOTOGRAPH OF THE COMPLETED SLAVE MODULE.
SERVO 12.2008
39
11/5/2008
7:16 PM
Page 40
MECHANICAL ASSEMBLY
After we got the hardware all set, we faced the
formidable challenge of mounting the boards firmly on the
appendages of the subject! After much trial and error, we
built a reliable and low cost mount for the slave board by
placing it in a plastic container (soap container from
Wal-Mart, $0.50) and screwing the board to the bottom of
it. Initially, we experimented by sticking a piece of wood
in between the board and the container using epoxy to
provide rigidity. However, the epoxy was not enough to
keep the board firmly positioned under vibratory motions.
Hence, four screws were used at the corners of the board,
each with three bolts (two on either side of the board to
hold it, and one to fasten the containers surface) to make
a firm mount. One could also use foam to fill the space
between the board and the container to damp out spurious
resonances between the board and the soap case. Once
the soap container was ready, we used an elastic neoprene
to fix the container in place.
SOFTWARE DESIGN
The code associated with this project contains two
components: the hardware configuration component for
the selection and correct configuration of the various
modules in the CY8C29466 chip; and the second
component that takes care of the inter-chip
communications, sends synchronization signals to control
data acquisition and transmissions.
We configured the master PSoC with one each of
I2CHW, LCD, and UART modules. The I2CHW module
communicated with the slaves while the UART interfaced
40
SERVO 12.2008
11/5/2008
7:17 PM
Page 41
PARTS LIST
Item#
PSoCEval1
CY8C29466-24PXI
DE-ACCM3D
Manuf
Cypress Semiconductors
Cypress Semiconductor
Dimension Engineering
Dist.
Dist. Part #
3M
SR205E104MAR
ECC-A3J120JGE
B37979N5101J000
2010/10 100SF
AVX Corporation
Panasonic ECG
EPCOS Inc
Digi-Key
Digi-Key
Digi-Key
Digi-Key
MB10R-100-ND
478-3192-ND
P12182-ND
P4925-ND
VT200F-6PF20PPM
276-150
28-6518-10
PPTC281LFBN-RC
Seiko Instruments
RadioShack
Aries Electronics
Sullins Electronics
Digi-Key
RadioShack
Digi-Key
Digi-Key
728-1000-ND
276-150
A409AE-ND
S7026-ND
ADIP10-G-LC-R
PPPC052LFBN-RC
Assmann electronics
Sullins Electronics
Digi-Key
Digi-Key
HDP10H-ND
S7108-ND
2-746610-1
P82B715
Tyco electronics/AMP
Phillips Semiconductor
Digi-Key
Digi-Key
ADM10S-ND
568-1006-5-ND
Description
PSoC evaluation board
PSoC mixed signal array
Buffered tri-axis accelerometer
9V battery
Cable 28AWG, 10 conductors, 100ft
Capacitor 0.1uF 50V 20% radial
Capacitor 12pF ceramic disk, 6kV 5%
Capacitor 100pF 50V ceramic mono pm
5% radial
Cystal 32.768kHz, 6pF
8-12 nos perf board
28 pin (2x14) solder tail dip socket
Connector header female 28pos,
0.1 pitch, tin
Connector DIP IDC 10Pos gold, gray
Connector header female 10pos,
1 pitch gold
Connector plug IDC 10pos .1x.1 pitch DIP
Bus extender
Quantity
1
4
4
1
1
20
20
20
10
10
4
5
5
5
5
5
SERVO 12.2008
41
11/5/2008
7:17 PM
Page 42
SAMPLE EXPERIMENTAL
DATA
Order your
web-enabled
catalog today!
42
SERVO 12.2008
Full Page.qxd
11/4/2008
10:21 AM
Page 43
SERVO 12.2008
43
Mastrogiovanni.qxd
11/5/2008
2:20 PM
Page 44
AmI
44
SERVO 12.2008
Mastrogiovanni.qxd
11/5/2008
2:21 PM
Page 45
Ambient
Intelligence
Using amBX
technology, multiple
peripherals in the
room around you
work in harmony with
the game to deliver
a new sensory
experience which
includes: surround
lighting, sound,
vibration, airflow,
and other effects.
Smart Homes
A classic example of AmI is the Smart Home a home
environment that is endowed with a network to provide its
inhabitants with many services. Smart Homes have been
the main focus of development during the early years
of AmI research. A good introduction to state-of-the-art
systems in AmI can be found in How Smart Are Our
Environments?2. Smart Home projects include Amigo3,
SERVO 12.2008
45
Mastrogiovanni.qxd
11/5/2008
2:27 PM
Page 46
Ambient Intelligence
Aware Home4, MavHome5, and Gator Tech
Smart Home6.
The levels of intelligence and proactivity a Smart
Home (and an AmI system in general) should exhibit is a
trade-off between provided services and user interaction.
Because the general behavior of a Smart Home is based on
rules that are encoded by human experts, the cognitive
capabilities offered by an AmI system largely depend on the
knowledge provided by these experts and on their ability to
encode it into reasoning systems.
Consider an automated system for turning on/off the
lights. Lets assume that a room is provided with sensors
that are read to decide if there are people inside. If sensors
and the corresponding logic are based exclusively on movement detection, someone relaxing on a couch could easily
trick the system, which would immediately turn off the
lights for absence of any movement. From the sensory
perspective, the system would misinterpret absence of
movement as absence of people. The fault lies in the logic
provided by system designers, not the actual system behavior.
One solution to the automatic lighting system dilemma
is to use different and heterogeneous sensors to obtain a
clearer picture of the situation. For instance, by adding a
number of sensors able to detect door crossings, it would
be possible to infer the current amount of people inside the
room, and to turn on/off the lights independently from
actual human behavior. On the other hand, a system
capable of detecting if someone is sleeping could purposely
decide to turn the lights off in the environment.
From a functional perspective, a typical Smart Home is
very similar to what is depicted in Figure 1. From a human
FIGURE 2. Basic information involved in Example 2.
46
SERVO 12.2008
Mastrogiovanni.qxd
11/5/2008
2:28 PM
Page 47
Ambient
Intelligence
From Here
There is still a lot of work to do before ubiquitous
intelligent systems surround us and help us in our daily
activities. Although AmI is particularly young and
unexplored for the most part, its benefits are more than
evident. What is needed to make AmI a reality is for intrepid,
motivated innovators to move the field forward. SV
All photos are courtesy of Philips.
Resources
1. K. Ducatel, M. Bogdanowicz, F. Scapolo, J. Leijten, J.C.
Burgelman. Scenarios for Ambient Intelligence in 2010. ISTAG
Report. IPTS-Seville, February 2001.
2. D.J. Cook and S.K. Das. How Smart Are Our Environments?
An Updated Look at the State-of-the-Art In Pervasive and
Mobile Computing, vol. 3(2), pp. 53-73, March 2007.
3. www.hitech-projects.com/euprojects/amigo/
4. http://awarehome.imtc.gatech.edu
5. http://ailab.eecs.wsu.edu/mavhome/
6. http://www.icta.ufl.edu
battery charger
connector
Item #975
$99.95
piezo buzzer
4 AAA
batteries
(not included)
30:1 micro
metal
gearmotors
optional
power LED
ISP
programming
connector
removable 8x2
character LCD
user pushbuttons
47
Simpson3.qxd
11/5/2008
12:56 PM
Page 48
Portable Drill
Tool Time
Someone once said to me, I dont want a woodworking
project, I just want to build robots. Im sorry, unless you
purchase a pre-fabricated kit, you have to dabble in
woodworking, metalworking, or both. Many of us utilize
woodworking as the materials and tools are readily
available and inexpensive. Woodworking tools also work
very well for many plastics.
Whether you prefer woodworking or metalworking,
FIGURE 1. The
two baseics.
48
SERVO 12.2008
FIGURE 2
Keyless chuck
Reversible motor
Variable speed
Adjustable clutch
High and low gear settings
If you get a drill with high and low gear settings, you can
use it to drill and grind, as well as drive nuts, bolts, and screws.
A quick change driver set like the one shown in Figure
3 is the most used accessory on my drill. It allows you to
drill and counter-sink in a single operation. You then flip the
bit and drive the screw.
If you cant afford a drill press or dont have the space,
then the $2 gadget shown in Figure 4 will help you get
great results. Its a simple, round bubble level that sits on
FIGURE 3
Simpson3.qxd
11/5/2008
12:57 PM
Page 49
FIGURE 4
FIGURE 6
Most of the features above are selfexplanatory, but I feel its important to point out
the value of the variable orbital setting. We all
FIGURE 5
know that the blade in the jig saw goes up and
down. The amount it moves up or down is called
the stroke. The more stroke, the more efficient the cut and
the less wear on the blade. In an orbital saw, the blade also
moves forward during the upstroke and back during the
down stroke. This allows the blade to make a more
aggressive cut. So, why would you want an adjustable
orbit? Because the more aggressive the cut, the rougher
the cut. With the orbit set to maximum, it makes for a very
splintered cut. When cutting finer materials, you will get a
better cut with the orbital option turned off. When cutting
metal, I use the minimum or non-orbital option.
If you plan on using your jig saw on metals and plastic,
its also important that you get a variable speed saw.
What Brands
Other Tools
FIGURE 7
SERVO 12.2008
49
Simpson3.qxd
11/5/2008
12:57 PM
Page 50
FIGURE 10
FIGURE 12
50
SERVO 12.2008
FIGURE 11
Simpson3.qxd
11/5/2008
12:58 PM
Page 51
FIGURE 14
FIGURE 15
Step 2
To mount the wheels on the base, well use a 4 x 14
x 3/4 piece of wood to create a wheel sub-assembly. You
need to cut a 1-3/4 x 4-3/4 notch out of two ends of the
board as shown in Figure 16. These notches are used to
make space for the tires in our wheel assemblies.
Next, take an extra OF-64S actuator mount and
mark four holes as shown in Figure 17. Then, drill a
11/64 hole all the way through the boards at each of
the marks. You will need to make two of these wheel
sub-assemblies.
Step 3
Lay the boards out so that the cutouts are oriented as
shown in Figure 17 and drill a 1/2 hole 3/8 deep into
each of the holes.
FIGURE 16
Step 4
Now, take a wheel assembly and insert the four bolts
into the four holes as shown in Figure 18.
Note that you are inserting into the side of the board
without the counter-sunk holes that you created in Step 3.
FIGURE 17
FIGURE 19
FIGURE 18
SERVO 12.2008
51
Simpson3.qxd
11/5/2008
12:59 PM
Page 52
FIGURE 20
Step 5
I recommend that you install some sort of bumper
around the robot. In my case, I purchased some 3/4 pipe
PARTS LIST
The following are the components needed to build this
portion of the project.
On the Megabot, you will need:
24, #6 hex nuts
24, #6 washers
1, 6 section of 3/4 pipe insulation
1, 2 x 2 x 1/2 birch plywood
2, 4 x 14 x 3/4 pine
6, 3/4 black phosphate screws
FIGURE 21
LINKS
CrustCrawler
RS-64 and components
www.crustcrawler.com/motors/RX64/index.php?
prod=67
FIGURE 23
52
SERVO 12.2008
Simpson3.qxd
11/5/2008
1:00 PM
Page 53
Step 7
Make a line across the center of the base that is
perpendicular to the three lines. The easiest way to do this
is to use a piece of paper lined up against the center line
with one corner at the center point on the base.
Place a mark on the center of the wheel assembly as
shown in Figure 21. Then, place the assembly on the base
with the center mark lined up with the new perpendicular
line.
Step 8
Use three wood screws to attach
the assembly to the base. Place them
at the positions shown in Figure 22.
Do the same with the other wheel
sub-assembly on the opposite side
of the base. Use screws that are
not long enough to protrude through
the opposite side. (I used 1 screws.)
I recommend a pilot hole and
slight counter-sink to prevent the
wood on the wheel sub-assembly
from splitting.
That completes the Megabot
base. Just flip the base over and it
should look like the one shown in
Figure 23. As you can see, there is
quite a bit of room for our power
system and controllers. You may have
noticed that I staggered the wheels
when I built the wheel sub-assembly.
This was done for a couple of
reasons. This allowed me to use less
space and pull the wheels in tighter.
Announcing
the Gears
Whats Next
Next month, we will look into our power system and
get those wheels moving. Im going to be looking at using
the Ryobi Li-Ion 18V battery, as well as a Li-Ion external
laptop battery for our power supply. I will also show you
how to use a PC to get those actuators turning.
Be sure to check out the Kronos Robotics website for
updates to this project at: www.kronosrobotics.com/
Projects/megabot.shtml. SV
Lb for Lb
the World's
Toughest Robot
Chassis
*VEX Robotics is a mark of Innovation First, Inc. and FIRST refers to US FIRST (Foundation for the Inspiration and Recognition of Science and Technology)
SERVO 12.2008
53
Centering Servo
Motors
11/5/2008
2:37 PM
Page 54
As we discussed in the
first Tankbot article back in
September, the PICAXE
servo command generates a
continuous pulse-train in
the background, suitable for
driving the TankBots servo
motors. The complete syntax
of the command is servo,
pin, pulse where pin
refers to the PICAXE I/O pin
to which the servo is
connected and pulse is a
value between 75 and 225
(in 10 s units). Theoretically, 150 (1,500 s or 1.5 ms) is
the center value that will cause the servo to stop rotating
altogether; values above 150 should cause the servo to
rotate in one direction (higher values produce faster
rotation) and values below 150 should produce servo
rotation in the opposite direction. This is in theory only
actually, every servos center point varies somewhat from
the theoretical value of 150.
In the TankBot manual, there is a section that details
the procedure, for disassembling your servos and adjusting
them so that their center values are each exactly 150. If you
feel comfortable carrying out that procedure, its certainly
worth doing. However, for the benefit of readers who
would rather not explore the inner physical mechanism of
their servos, were going to approach the problem entirely
in software. When you have completed the following
procedure, you will know the actual center value for each
of your servos and be able to compensate for their
differences from the theoretical values in your TankBot
54
SERVO 12.2008
11/5/2008
2:37 PM
Page 55
SERVO 12.2008
55
11/5/2008
2:38 PM
Page 56
56
SERVO 12.2008
volume down arranged in a convenient diamondpattern with an enter key in the center, then you
dont need the labels at all. In any case, jot down the
actual key names for the five keys you want to use and
the corresponding values from the chart of infra
values for each key-press presented in Figure 5. Ill be
using the appropriate values for the remote shown
earlier in Figure 4.
Finally, a word of caution may be in order. Most
Universal remotes have a row of buttons near the top
that allow you to switch between controlling a TV, a
VCR (how quaint!), a DVD player, or whatever. The
SIRC protocols involved are different for each device
and PICAXE processors are only capable of responding
to the TV protocol. So, if you are in the middle of
experimenting and you lose control (of the TankBot,
that is), you may have accidentally pressed the button
for one of the other remote functions; pressing TV
again should correct the problem.
11/5/2008
2:38 PM
Page 57
TV Remote Infra
Control Key Value
1
0
2
1
3
2
4
3
5
4
6
5
7
6
8
7
9
8
0
9
Channel +
16
Channel 17
Volume +
18
Volume 19
Mute
20
Power
21
Microsoft
Visual Studio
Dyynamixxel SDK
C/C++
Visual Basic
C#
EX-106
NEW
164
Encoder
EX-106
14.8
84
106
0.182
0.143
155
SERVO 12.2008
57
BasicBoardRobotics Dec.qxd
11/5/2008
3:34 AM
Page 58
This column started out building applications around the BasicBoard module sold
at www.beginnerelectronics.com. Ive since gotten several emails asking if the
BasicBoard was offered in a form that doesnt use the Basic Atom interpreter chip
from Basic Micro. In a word, no. But that doesnt make it a dead end.
he BasicBoard module (Figure 1) is built around the 40
pin Atom interpreter chip, which really is just a Microchip
PIC16F877A microcontroller with a custom bootloader
pre-installed. Therefore, the BasicBoard will accept any 40
pin PIC chip. You just have to program it off the board and
then plug the programmed part into the BasicBoard.
The advantage to the Basic Atom chip is the Atoms Basic
compiler can be downloaded for free. Basic Micro makes their
money on selling the interpreter or bootloader chip. This got
me thinking about what other free compiler options someone
could use to program a 40 pin PIC microcontroller. There
are several different versions of the 40 pin PICs and they all
share the same pinout. This presents several options to use
the BasicBoard with. It turns out the 40 pin PIC package
(shown in Figure 2) is a popular choice with many free
compilers. Let me cover some of the ones I found.
58
SERVO 12.2008
PICBASIC PRO
PICBASIC PRO
from microEngineering
Labs was the first
compiler I thought of
since Ive covered their
sample version in a
previous column.
The sample version
supports the 40 pin
PIC16F871, F874(A)
Figure 3. EZPIC programmer.
and F877(A) parts. The
compiler limits you to
31 commands so the F871 with only 2K bytes of program
memory is the cheapest of the three, and 2K is far more
memory than 31 commands will use up anyway. You simply
download the sample version from http://melabs.com/
pbpdemo.htm and then get to work writing your first
program. You can Flash the finished program into the
F871 using just about any PIC programmer. The
BeginnerElectronics.com EZPIC programmer shown in
Figure 3 is a low cost option.
You can get free samples of the F871 from sample.micro
chip.com or buy a few from Digi-Key or Mouser. The
command structure of PICBASIC PRO is similar to Atom
Basic so the sample programs that come with the
BasicBoard can be easily converted.
The PICBASIC PRO compiler (Figure 4) comes with its
own IDE for developing the program. You can add a
programmer to the automated setup, but that will take a
little reading. If you just load the .hex file it produces
into the programming software that comes with your PIC
programmer or the WINPIC software we recommend you
BasicBoardRobotics Dec.qxd
11/5/2008
3:35 AM
Page 59
PROTON
Swordfish
MikroBasic
CCS C Compiler
HITECH C PRO-Lite
PICAXE
SERVO 12.2008
59
BasicBoardRobotics Dec.qxd
11/5/2008
3:35 AM
Page 60
Microchip C18
Microchip offers a student version of their C18
compiler that you can download for free. The limit is
the optimization level similar to the one in HI-TECH Pro.
The C18 compiler works with the PIC18F parts, so the
18F4220 might be a good choice to use in the BasicBoard
with this one. The sample code is a little sparse but
theres documentation supporting this compiler including
a Getting Started manual you can download. This
compiler can be found at www.microchip.com/c18.
MikroC
This is another compiler from MikroElektronica (www.
mikroe.com) except this one uses the C language. I found
this compiler easy to work with and the sample programs
are good examples. The sample version is limited to 2K so
a PIC16F871 should work fine. One thing I didnt mention
Assembly
If you are willing to write your code in PIC assembly,
then download the Microchip MPLAB IDE (Figure 5) which
comes with the MPASM assembler already included. There
are no limitations in this one. You can write your code in
assembly, simulate it in the MPLAB simulator, and then
import the .hex file into your programmer to work with a
PIC16F87x part. There are no memory limitations so a
PIC16F876A or the new PIC16F886 would be a good
choice. MPLAB can be downloaded from www.microchip.
com/mplab. This IDE can also be used with the PICBASIC
PRO, CCS C, and HI-TECH C PRO compilers. I find it a little
difficult to use initially, but after some time found it to be
very good. It also supports all the Microchip programmers
so that gives you more options to program the 40 pin PIC.
Conclusion
There are more compiler options than what I listed
here, but as you can see the 40 pin package is popular
among sample versions. Any development board that
supports 40 pin PICs will work the same as the BasicBoard,
so shop for the features you want. The BasicBoard has key
features I like such as LEDs, switches, piezo speaker, and
LCD on board plus a few extras. Expansion pins allow you
to plug in servos or sensors so the board is handy, and
using it with a compiler makes it more versatile.
60
SERVO 12.2008
Full Page.qxd
11/4/2008
11:08 AM
Page 61
RoboResourcesDec.qxd
11/5/2008
12:13 PM
Page 62
So You Want to
Build a Robot
obotics is a wonderfully diverse
science. It mixes mechanics
with computers, mathematics,
electrical design, programming, and
a number of other sciences all
wrapped up in a package thats fun to
build and watch. If youre just starting
out, though, the vast breadth of
technologies that you need to master
can appear daunting. Fortunately,
robotics is a piecemeal type of
endeavor; you dont need to become
an expert in all aspects all at once.
In this installment of Robotics
Resources, well touch upon several
main points of interest youll need to
be familiar with if you want to plan,
construct, and operate your first robot.
Of course, space limitations mean we
cant provide in-depth coverage of
everything in this one column. To
further your study of the robotics arts,
you are advised to check out back
issues of this magazine and Nuts &
Volts, both of which are available in
convenient CD-ROM electronic format.
Robot Bodies
The simplest robot body is a printed
circuit board (PCB) or solderless
breadboard, and there are a number of
interesting amateur robots that use
this approach. Basically, a platform of
some type is used to build onto.This
platform is usually plastic, wood, or
metal. I have a particular fondness for
plastics, because plastic tends to be
cheap and easy to work with using
standard shop tools. Of all the
62
SERVO 12.2008
RoboResourcesDec.qxd
11/5/2008
9:27 PM
Motors to Make it Go
Motors make your robot move.
Among the variety of DC motors is a
wide array of sub-types; the most
common for robotics is one where the
motor turns continuously when electric
current is applied to its terminals.
A variation on this includes the
stepper motors; so called because the
internal construction allows it to
rotate a finite amount each time
current is applied. By alternating
current to a set of different wires
inside the motor, the motor shaft
turns by a specific amount each time.
As such, steppers are ideally suited for
when you need to control the position
of the motor shaft, rather than just
turn a shaft to rotate a wheel.
When a DC motor is connected to
a feedback circuit, its called a servo
motor. The feedback tells the motor how
far its gone and in what direction. This
feedback can be accomplished using a
simple potentiometer, a tachometer,
an optical encoder, or some other
means. The most common and
inexpensive servo motor is the R/C
servo; R/C stands for radio control, which
is the original application of these motors.
They are used in model and hobby
radio-controlled cars and planes.
R/C servos are in plentiful supply
and are reasonably priced (about $10
-$12 for basic units) Though R/C servos
are continuous DC motors at heart, they
arent controlled in the same way. In
addition to the power leads, you need
to provide a control signal to an R/C
servo. This signal varying from one
to two milliseconds controls the
direction and angle of the motor.
Page 63
Batteries to Give
Your Robot Life
There are literally hundreds of
battery compositions, but most of
these are special-purpose and not the
63
RoboResourcesDec.qxd
11/5/2008
12:25 PM
Page 64
Sources
All Electronics
www.allelectronics.com
Sells surplus motors, including
stepper, DC, and gear motors. Also
offers a printed catalog mailed to
current customers. Retail stores in the
Los Angeles area.
Atmel Corp.
www.atmel.com
Makers of several lines of
microcontrollers, including AVR a
very popular eight-bit controller used
extensively in amateur robotics.
BasicX
www.basicx.com
The BasicX is a general-purpose
microcontroller with a built-in programming language. You write programs on
the PC using a Basic-like syntax, then
download them via a cable to the
BasicX (including the BasicX 24 an
all-in-one module that is pin compati-
64
SERVO 12.2008
Batteries America
www.mrnicd-ehyostco.com
Batteries (including sealed lead
acid, ni-cad, Ni-Cd) and rechargers;
single-cell and packs.
Batteries Plus
www.batteriesplus.com
Battery City
www.batterycity.com
Consumer-packaged batteries:
Ni-Cds, camcorder, NiMH, and other
specialty types.
B.G. Micro
www.bgmicro.com
Source for surplus motors. Check
their site often so you are sure to
catch the best deals.
Beginner Electronics
www.beginnerelectronics.com
Resells the Basic Atom from Basic
Micro, as well as their own custom
boards. The BasicBoard is a generalpurpose microcontroller board with
LCD panel, speaker, LEDs, and other
built-in components.
Budget Robotics
www.budgetrobotics.com
Several variations of specialty
servos and wheels for small robotics.
(This is the company I operate.)
GoldenWest Manufacturing
www.goldenwestmfg.com
Kronos Robotics
www.kronosrobotics.com
Kronos has developed microcontrollers in various lines (Dios, Athena,
Perseus, and Nemesis) where speed and
low cost are key features. The chips
support code libraries of functions, which
allow you to readily program the chip
without having to re-invent the wheel.
Additional products include various coprocessor boards and adapter modules.
Lynxmotion
www.lynxmotion.com
Hitec servos, custom-made
mounts, and wheels just to highlight a
few of their products for sale.
Microchip Technology
www.microchip.com
House of Batteries
www.houseofbatteries.com
MicroMint, Inc.
www.micromint.com
RoboResourcesDec.qxd
11/5/2008
12:25 PM
Page 65
Plastruct, Inc.
www.plastruct.com
Rabbit Semiconductor
www.rabbitsemiconductor.com
Parallax, Inc.
www.parallax.com
The BASIC Stamp revolutionized
amateur robotics, yet the concept
is simple: Take an eight-bit
microcontroller, normally intended
to be programmed in assembly
language, but embed within it a
language interpreter so that it can be
programmed in a simpler language,
namely Basic. Also sells servo motors
and wheels.
SparkFun
www.sparkfun.com
Offers a wide assortment of
microcontroller development boards
and modules. Check out their line of
breakout boards which are small
circuit boards for attaching to the rest
of your robot electronics.
TAP Plastics
www.tapplastics.com
Pololu
www.pololu.com
Servo City
www.servocity.com
HE8EJIFH;<;H>?J;9)0'
.EW 2OBOT 3ERVOS
>_j[Y
Ej^[h8hWdZ
+656*
+656*
+657*
6SHHGVHF
7RUTXHR]LQ
6WHHO*HDUV
6SHHGVHF
7RUTXHR]LQ
6WHHO*HDUV
6SHHGVHF
7RUTXHR]LQ
7LWDQLXP
$//63(&,),&$7,216$792/76
7KHUHVXOWVRIDQLQIRUPDOSROOWDNHQUHFHQWO\DWWKH)LUVW
$QQXDO:RUOG'RPLQDWLRQ6\PSRVLXPDUHQRZLQ5RERWV
SUHIHU+LWHFVHUYRVRYHURWKHUVHUYREUDQGV7KH\NQRZWKHZLGH
VHOHFWLRQRI+LWHFDQDORJDQGGLJLWDOVHUYRVSURYLGHWKHPZLWKWKHSRZHUDQGGHSHQG
DELOLW\QHHGHGWRHYHQWXDOO\WDNHRYHUWKH:RUOG0DNH\RXUURERWKDSS\XVH+LWHFVHUYRV
3DLQH6WUHHW_3RZD\_&DOLIRUQLD___ZZZKLWHFUFGFRP
SERVO 12.2008
65
Showcase Dec08.qxd
11/5/2008
10:13 PM
Page 66
6
UH ROGH
TX UL
LUH QJ
G
7KH(VFDSH
5RERWVEXLOWLQ
PLFURSURFHVVRU
HQDEOHVLWWR
WKLQNRQLWVRZQ
.65
7KHURERWIURJPRYHVIRUZDUG
ZKHQLWGHWHFWVVRXQGDQG
UHSHDWVVWDUWPRYHIRUZDUG!
VWRS!OHIWWXUQ!VWRS!ULJKW
WXUQ!VWRS.65
PP:KLWH
ZDWHUFOHDU
/('9
PFG
$%
VHFRQGYRLFHUHFRUGHUSOD\EDFN
PRGXOH7KHHOHFWUHWPLFURSKRQHLVRQWKH
ERDUG2QHEXWWRQUHFRUGVWKHRWKHUEXWWRQLV
PRPHQWDULO\SUHVVHGWRUHSOD\WKHPHVVDJH
SUHDVVHPEOHG$
7KH9HOOHPDQ3HUVRQDO6FRSH
LVQRWDJUDSKLFDOPXOWLPHWHU
EXWDFRPSOHWHSRUWDEOH
RVFLOORVFRSHDWWKHVL]HDQG
FRVWRIDJRRGPXOWLPHWHU
+36 $146.
QGV
7KRXVD RQ
V
P
PRUHLWH LWH
V
E
H
Z
RXU
Robotics Showcase
THOUSANDS OF ELECTRONIC
PA R T S A N D S U P P L I E S
www.allelectronics.com
WALL TRANSFORMERS, ALARMS,
FUSES, CABLE TIES, RELAYS, OPTO
ELECTRONICS, KNOBS, VIDEO
ACCESSORIES, SIRENS, SOLDER
ACCESSORIES, MOTORS, DIODES,
HEAT SINKS, CAPACITORS, CHOKES,
TOOLS, FASTENERS, TERMINAL
STRIPS, CRIMP CONNECTORS,
L.E.D.S., DISPLAYS, FANS, BREADBOARDS, RESISTORS, SOLAR CELLS,
BUZZERS, BATTERIES, MAGNETS,
CAMERAS, DC-DC CONVERTERS,
HEADPHONES, LAMPS, PANEL
METERS, SWITCHES, SPEAKERS,
PELTIER DEVICES, and much more....
O R D E R TO L L F R E E
1-800-826-5432
Ask for our FREE 96 page catalog
66
SERVO 12.2008
SV-GiftSubAd2008.qxd
10/7/2008
4:07 PM
Page 67
Give the
gift that
lasts all
year!
Go to
www.servomagazine.com
to enter your gift order!
U.S. Prices
1 Yr $24.95
2 Yr $45.95
3 Yr $65.95
WebstoreDec08.qxd
11/5/2008
9:23 AM
Page 68
Lo
W h ao k
t
New s
EDITORS PICKS
Electronic
Troubleshooting
Kickin' Bot
by Grant Imahara
!
NEW
ROBOTICS
Discover what
robots can do and
how they work.
Find out how to
build your own
robot and program
it to perform tasks.
Ready to enter the
robot world? This
book is your passport! It walks you
through building your very own little
metal assistant from a kit, dressing it up,
giving it a brain, programming it to do
things, even making it talk. Along the way,
youll gather some tidbits about robot
history, enthusiasts groups, and more.
Forbidden LEGO
Forbidden LEGO
introduces you to
the type of freestyle building that
LEGOs master
builders do for fun in the back room.
Using LEGO bricks in combination with
common household materials (from rubber bands and glue to plastic spoons
and ping-pong balls) along with some
very unorthodox building techniques,
youll learn to create working models that
LEGO would never endorse. $24.95
68
SERVO 12.2008
$24.95
by Karl Williams
by
John Blankenship,
Samuel Mishal
$29.95
Robotics Demystified
by Edwin Wise
YOU DON'T NEED ARTIFICIAL INTELLIGENCE
TO LEARN ROBOTICS!
Now anyone with an
interest in robotics can
gain a deeper understanding without formal training, unlimited
time, or a genius IQ. In
Robotics Demystified,
expert robot builder
and author Edwin Wise
provides an effective and totally painless
way to learn about the technologies used to
build robots! $19.95
We accept VISA, MC, AMEX,
and DISCOVER
Prices do not include shipping and
may be subject to change.
WebstoreDec08.qxd
11/5/2008
9:25 AM
Page 69
Save $10
off the
normal
per bundle
price!!
Now you can get one years worth of all
your favorite articles from SERVO Magazine
in a convenient bundle of print copies.
Available for years 04, 05, 06, and 07.
$57
Fascinated by the
world of robotics but
dont know how to
tap into the incredible
amount of information available on the
subject? Clueless as
to locating specific
information on robotics? Want the names,
addresses, phone numbers, and websites of
companies that can supply the exact part,
plan, kit, building material, programming language, operating system, computer system,
or publication youve been searching for?
Turn to Robot Builders Sourcebook a
unique clearinghouse of information that will
open 2,500+ new doors and spark almost as
many new ideas. $27.95 Sale Price $24.95
Im still trying
to understand
the
bailout plan!
Do you?
Linux Robotics
by D. Jay Newman
CNC Robotics
by Geoff Williams
CNC Robotics gives you
step-by-step, illustrated
directions for designing,
constructing, and testing
a fully functional CNC
robot that saves you 80
percent of the price of an
off-the-shelf bot and
that can be customized
to suit your purposes exactly, because you
designed it. Written by an accomplished
workshop bot designer/builder, this book
gives you everything you need. $34.95
SERVO 12.2008
69
WebstoreDec08.qxd
11/5/2008
9:28 AM
Page 70
and
Programming Lego
Mindstorms NXT
save 10% off the list price. Plus get free shipping in the US!!
Call 800 783-4624 or order online @ www.servomagazine.com
List Price $29.95 Sale Price $26.95
List Price $40.95 Sale Price $35.95
FREE!
with any
e
purchas 0
over $10
by Owen Bishop
Phone-inly!
n
orders o
SERVO
Magazine
T-Shirts
Get your very own limited-edition SERVO Magazine T-shirt. Shirts come
in sizes S, M, L, and are available in either black or white.
All shirts are 100% preshrunk cotton.
Offer ends December 31, 2008. Call 1-800-783-4624.
PROJECTS
70
SERVO 12.2008
Full Page.qxd
11/4/2008
10:25 AM
Page 71
Menagerie - Dec08.qxd
11/5/2008
4:36 AM
Page 72
72
SERVO 12.2008
Menagerie - Dec08.qxd
11/5/2008
4:36 AM
Page 73
SERVO 12.2008
73
Appetizer.qxd
11/5/2008
8:42 PM
Page 74
Project Inspiration
74
SERVO 12.2008
Appetizer.qxd
11/5/2008
8:46 PM
Page 75
ultimately be used as an
educational tool at The Edgerton
Center, the team wanted to
make the scooters control strategy as simple as possible so that
one would not necessarily need
an MIT degree to understand it.
Making the
Physical
Components
With the projects size and
weight goals in mind, the team
designed a lightweight aluminum base plate, which was
cut with a CNC abrasive water
jet. (MIT has five such machines,
but they are also accessible from
relatively inexpensive online providers, such as www.bigbluesaw.com.) Rather than using the powerful but heavy
24 volt wheelchair motors found on similar projects, the
team chose the inexpensive and lightweight DC motors and
planetary gearboxes featured in the kit of parts provided to
2007 FIRST competitors.
The motors generate a maximum of 343 watts of
power each, giving the scooter a total of just under one
horsepower. The planetary gearboxes provide a 16:1 gear
reduction to increase the torque output to the wheels,
which are 12.5 inches in diameter with pneumatic tires and
composite hubs. A handlebar was cut
from aluminum extrusion and hinged
to the base plate to allow for
steering control. Figure 1 shows a
CAD illustration of the base plate and
motors, and Figure 2 shows students
assembling these components.
FIGURE 1. Base
plate and motors.
The sensors are small, inexpensive MEMS accelerometers and gyroscopes (angular rate sensors) made by Analog
Devices. One accelerometer senses the angle of gravitational
force, while a gyroscope estimates the angle (with respect
to horizontal) and the angular rate of the base platform. A
second accelerometer detects the angle of the handlebar
for steering. A problem that almost every self-balancing
project write-up mentions is the difficulty of obtaining an
estimate of angle from the noisy accelerometer signal and
the integrated gyroscope signal, which drifts over time.
The team overcame this problem with a very simple digital
FIGURE 2. Assembling the scooter.
75
Appetizer.qxd
11/5/2008
8:46 PM
Page 76
microprocessor installed on
a custom-designed circuit
board. The board was
designed using the PIC
microcontroller-based
educational prototyping kit
and online programming
environment developed
by Machine Science, a
Cambridge-based non-profit
organization that promotes
hands-on engineering
education. Machine
Sciences kit and online
development environment
are easy to use, but
powerful enough to execute
the projects floating-point
(decimal) filtering and
control calculations. The
main software loop which reads and filters the sensor
inputs, calculates the corrective action, and generates a
signal for the motor controllers runs at 100 Hz; fast
enough to stabilize the vehicles mechanical dynamics.
Development was also streamlined by a wireless serial
programming and debugging interface that allowed the
team to modify software and view sensor values in real
time with no physical connection to the vehicle. Data can
be viewed and collected remotely from up to 300 feet away
while a rider is cruising on the scooter a feature that
increases the educational value of the project and which
the team believes is unique to its version. Figure 3 shows
the projects control electronics.
Finished Product
The project was completed in the fall of 2007, just in
time for its creators to get back to their school work. Since
then, the scooter has made appearances at local high
schools, educational programs at MIT, and other robotics
competitions. It is a bit challenging to learn to ride. Because
the lower power motors require a stiff feedback loop to
provide enough stabilization, it has a tendency to oscillate.
(Wireless data collection reveals the natural oscillation
frequency of new riders to be about 1.3 Hz.) But with a
few minutes of practice, most can get the hang of it and
cruise around fairly well.
More importantly, it draws attention to the design
process, feedback control, and many concepts of
engineering in an inspirational way. All of the hardware is
left uncovered and whenever the designers are showing
off, they attempt to demystify the technology as much as
possible. The full project documentation, including design
notes and source code, is available online. SV
76
SERVO 12.2008
Then&Now Dec.qxd
11/5/2008
6:59 PM
Page 77
a n d
Then NOW
JAPANESE ROBOTICS
b
The Earliest
Japanese
Robots
Typical of the early
automatons of Europe and
America that were used to
amuse and entertain the
wealthy in the 17th century
and later, Japan also had
mechanical dolls called the
Karakuri ningyo. Figure 1
shows one of the more
ornate wooden wind-up
Karakuri dolls that could
FIGURE 3. A
modern
Karakuri robot.
SERVO 12.2008
77
Then&Now Dec.qxd
11/5/2008
6:59 PM
Page 78
78
SERVO 12.2008
Then&Now Dec.qxd
11/5/2008
7:00 PM
Page 79
FIGURE 9. HRP
robot from
Kawada
Industries.
SERVO 12.2008
79
Then&Now Dec.qxd
11/5/2008
7:01 PM
Page 80
Wrap-Up
FIGURE 12. Paro the robot harp seal.
80
SERVO 12.2008
RoboLinks-Index Dec08.qxd
11/5/2008
11:50 PM
Page 81
W
LO
!
ST
CO
Free
Expert
Technical
Support
1 (800) 985-AWIT
LOW COST
Easy to Connect
CO
ST
!
Professional SW Dev. Tools
www.c-stamp.com
Hitec ...........................................................65
Innovation First .........................................13
Jameco ......................................................42
Lorax Works ..............................................66
Lynxmotion, Inc. ........................................61
Net Media .................................................83
Parallax, Inc. ................................Back Cover
PCB Pool .......................................................7
Pololu Robotics & Electronics .................47
Robotis ......................................................57
RobotShop, Inc. ........................................43
Saleae LLC ....................................................3
Scientifics ..................................................37
Solarbotics/HVW .......................................9
SolderByNumbers.com ............................71
Sparkfun Electronics ..................................2
Vantec ..........................................................7
Weird Stuff Warehouse ............................66
SERVO 12.2008
81
Full Page.qxd
11/4/2008
9:05 AM
Page 82
Full Page.qxd
4/29/2008
4:05 PM
Page 83
backcvr.qxd
11/4/2008
9:44 AM
Page 84