![]() |
|
Doug Leppard (DLeppard@CCCI.Org )
This is the tenth in a series
of articles outlining the steps I have taken to build my robot. These articles are focused
on a robot, named HC12 after its MCU, that may compete in the Fire Fighting contest, be able to roam
around the house, but mostly be a fun learning tool. The robot uses a 68HC912B32
processor, so these articles will be about interfacing to the B32 various mechanical
devices and sensors using SBasic as the programming language.
I now have started on a second robot, right now named HC12F. HC12F is for fire fighting. This article will outline why I am building a second robot.
"Setting the Stage for
Building a Robot," we set goals for the robot and did research. From the goals
and research we will make fundamental decisions on what our robot will be like.
"Choosing the CPU, Language
and Basic Shape," using our goals we choose the microprocessor, language and
fundamental shape of the robot.
"Motorolas S-Record"
looking at the S-Record format that Motorola uses to load data and programs.
"Booting
up the 68HC912B32 for the first time" described in detail how to boot the B32 up
and run a program.
"State of the Union"
gives an overview of what state the robot was in August 1999.
"Multiplexing Five Sonar
Modules" tells why we wired five Polaroid sonar transducers and how to go about
doing so.
"Drivers for Sonar &
Mapping" shows the software to drive the sonar units, and how it can map a room
when tied to a PC.
"Using B32's Interrupts IRQ
and XIRQ" using the B32 interrupts to count the robots wheel encoders.
"Telemetry, using a
radio modem" using a radio modem to connect the robot to the PC.
"Sensing Objects with
Pyroelectric Detector" how to use the ever popular Eltec 442-3 Pyroelectric
Detector to locate people and candles.
Nobody likes to admit they have failed. But lets
be honest, all of us have blown it and made mistakes in building robots. The way I
figure it, if you don't make mistakes you are not extending yourself enough.
Sometimes we learn more from our errors then successes.
I remember well dreaming in grammar school about
building a robot. That must have been about 40 years ago. I stayed up almost
all night thinking about this robot that would walk across the house. In grammar
school I never had a chance to make this happen, so in a sense I failed to reach my dream,
but it put in my mind I wanted to build a robot. Built upon that failure was a dream
launched until today I now am building robots.
The first robot I actually built was quite a while ago,
even before the days of the Internet. It was based on an old PC (286 or
something). I had used the PC case as the frame for the robot and used screwdrivers
for the wheel motors. The thing weighed a ton and the PC ate power like mad. I
had two motorcycle batteries for power, designed my own PWM (pulse width modulation) and
drivers for it. I even had a special board I made that inserted into the PC bus that
I could control the motors and give input to the robot.
But it was a failure. It did move, had no sensors
but it could be controlled some. But it could not do much. The 286 ate the
battery power so bad it could only go a few minutes at a time. So my first real
attempt at robotics ended in the junk area (all of us in robotics have that area).
Then surfing on the net I came across guys doing
robotics. I discovered the SRS group and read Nuts
& Volts. Once again it was time to make a go of it. I searched the
net, bought all kinds of books, read all the Encoder articles. I practically
memorized articles by people like Karl Lunt
and Kevin Ross. It was
because of an article by Kevin that I bought my first MCU 68HC912B32 from Technological Arts.
That was when I started my series of articles on my
robot. I figured others could learn from what I learned doing my project. But
I wasn't through with failures by a long shot. Failing had only begun.
I set my goal for the Fire Fighting contest. Not
sure if I would really run in it but I needed a goal. It is a good contest and
forces you to a lot of things that just playing around wouldn't make you do.
About the only thing that I used from my first robot
was the screwdriver wheels. After all, that was about the only thing that worked and
I wanted to save money.
The screw drive motors worked pretty well. The robot could go fast and I could control the wheels with some accuracy. But I knew I needed to have wheel encoders to tell how fast the robot was going and be able to make turns etc. I spent many hours trying all kinds of techniques to get good wheel encoders. I tried to mount something on the screwdriver motors but there was no room. I finally mounted silver pin stripes on the wheels themselves (see picture). I got it to work but not very well. I could not place the pin stripes evenly and the wheels wobbled too much.
![]() |
My old wheels from my first unsuccessful robot which I did try to use on the HC12. I put the silver pin stripes on the wheel for a wheel encoder. They really didn't work well. The motors were from screw drivers, they worked but were real noisy. |
Ultimately I failed to make the wheel encoders work
dependently. At that point I searched the net for motors with built in encoders and
ended up with Pitmann motors with HP encoders, I love those things. The motors are
quiet and the encoders give clean signals and a lot more counts per wheel turn. That
failure led me to a great solution.
But even in that I had made a mistake. The motors
I had ordered I thought were a one channel encoder. One channel allows you to know
the speed but not the direction. A dual channel will give speed and direction.
It wasn't until I ordered a second set of motors that I realized that my first motors
where also dual channel, but just didn't have the leads for the other channel.
I ordered H-bridge controllers to control the power to
the wheels. Wired it up and nothing happened. All the right signals where
coming in, power was to the right place, but nothing worked. So we went back to the
specifications for the H-bridge and discovered it must work on a minimum of 12V and I was
trying to run it off a 7.2V nicad. Ultimately, I ended up ordering another set of
H-bridges. Luckily, I am able to use the 12V H-bridge on my newest robot.
I remember well trying to get the robot to go just in a
straight line. If I was going to be in the Fire contest I needed to go down an
18-inch wide hall and not run into the walls. But I couldn't even go in a straight
line. I had designed my own routines for controlling the speed etc. But they
were complex and just didn't work. I failed miserably.
So back to the Internet and I came across PID and some
past discussions by Larry Barello (Mr. PID). See his recent article "Small
Robot Motion Control: The Dilberts." Finally, using PID, I was able to
actually go in a straight line and accelerate and stop reasonably. Not perfect yet,
but close.
Anyone who has been into electronics long will tell you
what a smoke test is. Basically that is when you wire up electronic wrong and an IC
goes up in smoke. All of us have made those mistakes. I burned out some major
wires in my robot, burned up several ICs and burned up at least two MCUs. We all do
it.
I have had many other failures including my biggest,
the Fire Fighting contest failure.
I decided to go for the Trinity Fire Fighting
contest. SRS had a regional contest so I wanted to go to finally meet my SRS
friends. I got my buddy Steve Bissell, who lives in Portland, to go with me. I
managed to figure out a way to fly to Portland on business and to visit Seattle and SRS.
When it came time to go to SRS the robot was no where
near ready to go, but I had the plane tickets had my business excuse and was committed to
go. I did enter the contest and came in 5th of 7th in the contest (my buddy Steve
said I was 5th of 40, the others just didn't have a robot at the meeting). What I
learned was the robot would not be ready for Trinity no matter how hard I tried. So
I failed to reach my goal of the contest.
I learned a lot from my first robot. It actually works well and does neat things but I realized that it would never be successful at the Trinity contest. So I decided I needed to build a second robot designed specifically for the contest. For the first robot was a compromise to be a general learning tool and platform for robotics. But the compromises made it non-competitive.
![]() |
HC12 my first robot on the left. HC12F my second robot on the right. The one on the right still needs the top layer which will have the sensors candle sensors and fan. Even so it will be smaller and hopefully can move faster through the Fire arena. |
I am in the process now of making the new robot.
The following is what I am doing differently, at least to this point:
1.
My first robot was 12 inches round and about 12 inches high. Legal by Trinity
rules but still in my estimation was too large to get around quickly. My goal for
the new robot was 8 inches, but ended up at 9 inches. Winner last year in the senior
division was 10 inches.
2.
Years ago I fell in love with Polaroid sonar reading about in Popular
electronic. My first robot had to have these. I built a pod with five of then
mounted in its head. It worked great for moving around the house. Professional
robots use them. But when they are in a small area like the arena of the Trinity
contest the sound would bounce off the walls and come back for false signals. Plus
the signal could not be at too large of angle or the signal would not be returned and
failure to sense the wall would happen. I decided to go with the IR sensors GP2D12 from Acroname.
3.
My only sensor for the candle was the Pyroelectric Detector,
which worked great. But unfortunately, the Pyroelectric Detector had
to scan the room, which took way too long. The winning robots just had to
glance in the room to figure if there was a candle or not. That meant adding the Hamamatsu UVTron Flame
Detector Package to tell if it was in the room and then using the Pyroelectric Detector to
tell where it was. Also my scanning routine needed to be adjusted; see "Sensing Objects with
Pyroelectric Detector."
4. In my set up at home I didn't have the ramps to test the non-dead reckoning mode. When I got to SRS regional my line sensors hung up on the ramp. Problem the line sensors would be in front of the front wheel and were too low and would hit the ramp before the front wheel could raise them higher. My new design has the line sensors behind the front wheel.
The new robot with line sensors behind the front wheel so that when it comes to the ramp the line sensors will not hit the ramp first. | On the older robot the line sensors were in front of the wheel and hit the ramp and hung up. This didn't allow it to run with ramps and get bonus for non-dead reckoning. |
5.
The different lighting messed up the candle detection and gave it false
readings. So I have devised better shielding.
6.
Last, even though I started five months ahead of time, it was not enough time
considering it was my first robot and being a family man with wife and four kids, job and
church activities, there was not enough time to get it all done and still enjoy the
process. So now seven months ahead and a lot more experience the new robot is 80%
done.
Don't be afraid to take the big risk. Go and
dream and aim high. You will fail, but like me you can learn from those failures and
some day succeed with the robot of your dreams.
I have a saying, "Toss your hat over the fence,
then you will have to climb the fence." Go ahead and jump in and try it, you
may fail but you will learn a lot.