Since I was a child I dreamed of making a Robot, something that could
move by itself and obey my orders, well I found (as most engineers in
the field) that it is not as easy as I had imagined, but certainly
was more fun that I thought. Before we start to make anything, we need to check what resources are
available, usually its best to look at parts from cars, washing
machines and everything you can pull apart with your favourite
screwdriver I will divide the project in two parts: hardware and software.
I suppose if you want to make something that can move be itself, with
arms, and maybe something that resembles hands. This means we need
motors and a method to control them. Basically we can use three types of motors. Servomotors, DC motors
and step motors. Servomotors are easy to get, and easy to control. They are
essentially a DC (direct current) motor, with a set of gears that
reduce speed, coupled with a control. they need usually a DC current
of 6 v. and they have a extra wire that is used as control. They
can rotate to a fixed angle, although you can modify them to make
continuous rotations. To control them you send an electric pulse,
and the length of the pulse control to what angle they rotate. Usually servos are used for model and radio control, but they can be
controlled by a computer through some special circuits. My favourite
are manufactured by NCD. This circuit is connected to the serial
port of the computer, it can control up to 16 servos (and you can put
up to 16 cards to one serial port...) Servomotors are useful when you need fine control, but if you need
power, they can became very expensive. So we need to check some
other alternatives. You can get DC motors from a variety of sources, my favourite are
those from cars, they need about 12 volts, and you can control them
varying the voltage, you can even reverse their rotation, but
probably you will need to reduce their speed by 4 or more to get more
power. Again there is a DC variable controller by NCD. The third kind of motor are step motors, they are very precise, you
control how fast they turn, and what position they can get. Usually
they need a speed reduction of 10 to 50. They are used for
"professional" robots, an as you can figure, they are more expensive.
But if you have the resources, they will give the better control. For my robot I used DC motors for raising the arms and for walking
(taken from winshield wipers) and gears from a washing machine to get
a reduction of 1 to 5. Motors from electric seats are useful to. For traction I used two motors for the back tyres, and the two front
tyres turn free. I control them with a variable DC control, so I
could control speed and reverse them, turning is accomplished by
taking the two motors in opposing directions, so it can turn almost
on its own axis. Also, moving just one motor and keeping the other
fixed can give you another kind of turn. This can give you more
alternatives for fancy movements (as dancing...) One drawback of car CD motors is that usually due to the mass of the
car is the negative voltage, so probably you will need to take the
motor apart to disconnect the negative from ground, if you don't do
this you can have troubles trying to reverse the motor. For the arms I used a simple on/off switch. I did not try to get a
very precise control since this robot is made for exhibition only.
But there are some ways you can accomplish this. The robot controls
the position of the arms by turning the motor on, only at a certain
time. I just put two switches at the upper and lower position, that
are activated when the arm moves to the extreme positions, the
computer can detect when the arm is in that position. (When the
computer is turn on, the first thing it tries to do is move the arms
to this two extreme positions. The is another way to get better
control, you can put a potentiometer (a wire pot is better for this)
and measure the resistance. This is how some joysticks work. Even if these motors are not very heavy. Putting one of them in the
arms would need too much power, so it is best if you put it on the
chest, and use cables to send the power to move the arm. And for the hands I used servos, I used one servo to rotate the hand
and a second servo to open an close the "claw". If you want to make
a better hand, probably you will need to use cables as tendons. My greatest problem was the power, I used two car batteries, one
for the DC motors, and another for "everything else". Since I used an Amiga computer, it has an video out, so to make some
use of it, I used a portable TV as head. It can be used as
diagnostic, and you can put a simulated face or some fancy effects on
it. This led me to another problem. I needed a whole set of different DC
voltages. +6 for the servos, and +5 +12 -12 for the Amiga (or
another computer). I took the easiest way out. I got a power
convertor, that transform the 12 volts from the batteries to 120 AC
current, and then I put several battery eliminators to get the other
voltages. Not very elegant, but it works, but it`s an interesting
problem to try to simplify this. Another extra touch was an DC amplifier so I could put some "robotic
noises", I put a wireless microphone and a wireless receptor (so I
could hear and speak through the robot...) and finally some blinking
led. Now, another important consideration is how to control your creation.
So far, my robot is totally blind, so it can really only go on my
orders, but that is just the beginning, for the present use and IR
receptor in the top of the robot and a little infrared keyboard.
This keyboard can only send numbers from 1 to 16, but you can do many
things with this. This keyboard can be concealed in many ways (I put
it in a toy cellular phone from my daughter). I refer you to NCD to
see what else can be used.
As much fun as the hardware can be, the soul of your creation is the
software. Since I didn't know anything about programming robots I
decided to take some experience from game programming. Usually in a
game you set a main loop, each time the loop takes place, it checks
if there are events (joystick, collisions orders etc.) and then it
send and order to the sprites. For my robot I used AMOS as
programming language, its a variant of basic with many graphic
orders, but its also very buggy, so probably it was a bad Choice. I won't give you specific commands, instead I will try to give you
the general idea on how to make your own software. So the first part
is to get a subroutine where you feed a simple order (turn left turn
right, left arm up, etc.). For the servos this is easy, but it can
get a bit complicated for the DC motors. What I did was to activate
the DC motors in small pulses, simply you use a timer for each motor,
for example I set the time for the arm motors so I took 10 pulses to
raise the arms. This gives you a very rough way to position the arm.
since its very easy to lose the exact position, I put a couple of
switches that reports to me when the arm is fully up or fully down,
and it resets the count to the correct positions. To get a more accurate report of the position of the arm I am planing
to put a Potentiometer in the arm, so the ohm value will reflect the
position of the arm. It's very important that this subroutine takes care of all details
and possible problems, imagine that it has reflexes, if the arm tries
to moves to much it must be stopped, if the robot moves forward and
it does not received any order in .. 10 sec or something like this,
it should stop automatically, this will make it easier to send orders
to your robot. And ideally this subroutine should be a task by
itself. This was my main problem with AMOS. Another thing that you must take in account is that you must butt a
timer to all actions, so the robot will stop by itself if something
goes wrong. So, ideally you end with a routine where you feed a variable (an
order), this is an examples of the orders I send:
Although it seems that is very serial you won't notice it. If you want , you can include here some extra orders, like...
You can have lots of fun with this extra orders. But you must
remember to put in orders like this... "XX00" (STOP EVERYTHING!!!!) Just in case something fails.... And now... Now that you have your control routine its time to begin to think
what to feed to it. As I said, my control keyboard cans send only a
number from 1 to 16, so I reserve some numbers: 1 to 6 to control
where the robot moves. When the robot receives the order this is
translated to a set to orders to the main subroutine. like...
So just one order will results in many actions, this will help to
give some personality to your robot. And if 16 orders seems too
little, you can use double numbers or use some numbers as an escape
sequence. Other possibilities.... You can also include extra routines that can be control by time, for
example, if the robot does not receive an order in 50 sec, it can
start an idle routine, like turn left and right as if it were looking
for someone or as if its bored ...Another possibility is to make it
possible to get more complex movements, for example when my robot
goes forward, it moves the arms up and down, like people do when
walking. And you can make a routine that permits it to record movements, I
used this option to make "choreographies" with the built in music the
robot has. So if you get the idea, you can understand that the fun just
begins...