Computer Controlled Robots
Computer Controlled Robots
Tony Potter
CONTENTS
2 How to use this book 26 Making robot sensors
3 About robots 28 How to make a light sensor
4 Building a robot 30 Making a switching circuit
6 Things you need 32 Connecting the robot, circuit
8 Robot construction tips and computer
10 Making the robot base 34 Test programs
12 How to make the shoulder 36 Robot control program
14 Making the arm 38 Instructing your robot
16 Making the gripper 39 Shopping list
20 Customizing your robot 42 Templates
22 Electronics and soldering 48 Indexand
24 Electronic components circuit diagram
Turtle
Using a computer
language called LOGO, the
Turtle can be programmed
to draw with a pen as it
moves around. LOGO uses Buggy
commands like "F 20" for The Buggy is made from a
forward 20 units, or "L45" construction kit, and you
o for left 45 degrees. can add extra parts, like
? an arm, on top. It has a
light sensor at the front
Topo which detects the
Topo is designed as a difference between
household help. With "light" and "dark". You
sensors that are being can program a computer
developed, it may to use this information to
eventually find its way make the Buggy follow a
around a house to do the line. The robot in this
cleaning. book has a similar sensor.
WF
Building a robot
This cut-away picture shows the finished Wires to computer.
robot. The instructions in the book show
how to make one part at a time, and these
are painted in different colours to make it Sensor to detect when Elastic bands to pull
jaws are closed. jaws open.
easier to see what they are. You need not
build all these parts if you want to make
either a robot vehicle or a stationary arm
robot.
Sensors
The robot has simple sensors which tell
the computer when the arm is fully up or
A robot's "hand" is called a gripper. This has down, whether the jaws are holding
two "fingers" or jaws which open and close to something and if the gripper is open or
pick things up and put them down. The jaws closed. There is also a light sensor you
open to about 70mm and can lift something can make to give the robot extremely
the weight of a small apple. simple "vision".
The robot has an arm which moves up and The base of the robot is a flat board with two
down. It is designed so that as the arm moves, wheels driven by electric motors. By
the gripper always stays parallel to the programming a computer to switch the motors
ground. The arm is able to travel about 200mm on and off, the robot can be made to go
up and down. forwards or backwards, left and right.
Electronic switching circuit
You need to build an electronic circuit,
called a switching circuit, to control the
robot with your computer. This is made of
Battery wires. electronic components which switch the
robot's motors on and off when signals are
sent by the computer.
Light sensor detects
Electronic switching difference between
circuit light and dark.
Shoulder
Light shows robot is The shoulder supports the
switched on. robot's arm. Fishing line
control cables, to move the
gripper and arm, pass
through the shoulder to
motors on the base.
On/off light \
circuit.
Wires to robot.
Thin foam
rubber
Electronic components Veroboard (used to build Computer
I ,^«^^ circuit on).
An electronic component is a BBC Model B
small device which controls
the flow of electricity. There
are many kinds, all controlling
electricity indifferent ways.
Components are connected
together to make a circuit. Those
shown here are used to make the
switching circuit for the robot.
You can find out more about
them on pages 22 and 24, and
in the shopping list.
Relay Potentiometer
(a kind of or variable Spectrum
switch). ight resistor
dependent
ight-emitting diode resistor
(LED for short).
V To control a robot you need a
(LDRfor home computer with a special
short). s socket, or port, called a
6 parallel input/output port.
Computers with this port
include the Commodore 64,
nnecting VIC 20 and BBC B. You can
block (for
connecting buy an extra part for the
wires together). Ribbon Spectrum called an I/O
cable | interface, which
enables it to control a robot.
The project robot is designed
to work with these computers,
using the program on page 36.
Fishing line
or strong
twine
Wheels (minimum
2 tension diameter 60mm).
springs
(sort that
goes
springy
when
stretched).
Robot construction tips
To be successful you need to Cutting balsa
cut and drill all the robot
parts very accurately and Be very careful
carefully. This page gives when using a
craft knife.
some construction hints and Always use a
tips. You can also find out sharp blade.
how to use the templates at
the back of the book.
Home-made clamp Balsa
Butterflynuts
Cut the balsa with a sharp craft on. Always hold the knife
knife, using a metal ruler as a firmly. Stand to one side
guide. Use a piece of and cut towards yourself but
hardboard or plywood to work away from your body.
Tube drill
Test bench reports
You can make a home-
made bit to drill accurate Motors
holes in balsa for tube to go
through. Shoulder
Plywood or
6mm coach ^|^ chipboard 100mm Arm
bolt 50mm long tube
Make a clamp like this to keep Gripper
materials steady while 1 Cutoff Control lines
drilling and cutting. Glue or a 100mm length
screw the clamp to your of metal tube. Cover D
workboard. Solder check
Cutting tUbe Metalrod Circuit
pushed in
up to
here.
Sensor test D
2 File one end flat.
File angle.
After building each part of the
robot, there are tests and
f Tube
Home-made clamp
checks to do to make sure it
3 Put the tube works. You could make a
Some parts of the robot are in a hand drill chuck. "Test bench report" like this
made from metal rod which While you turn the and tick the tests off as you go.
fits snugly inside thin tube. handle, get someone else If your robot fails any test,
Clamp the tube or rod in a vice to sharpen the end with a there are checks and
or home-made clamp and cut file. Use the sharpened tube adjustments to make. You
it with a hacksaw. Push a instead of a drill bit, as it is must make sure each part of
piece of metal rod inside the more accurate. It will need the robot works properly, or
clamped part of the tube to re-sharpening several times. the completed robot will not
8 avoid crushing it. work either.
World of robots
Templates Robots are generally deaf,
Templates are like patterns, dumb, blind, have no
and are used to make all the sense of touch, smell or
parts for the robot. Those on taste, and have no
pages 42-47 are for all the "intelligence" of their
parts made from sheets of balsa own. The computer acts as
wood. The one on page 41 is the robot's "brain", but the
for the electronic circuit. robot needs electronic
senses, called sensors, for
the computer to "know"
what the robot is doing.
These pictures show These robots work together
robots in use today. to weld a car body as it passes
on a conveyor belt. Other
Photocopy Robot vision robots paint the car later on.
machine
Position the motors and Drill through your pencil Screw each motor to the base
gearboxes as shown on the marks using a bit slightly with self-tapping or wood
template, then make a pencil smaller than the shafts of the screws. Make sure they are
mark through the fixing holes. screws for fixing the motors. firmly screwed down.
-—~* VSS^
6mm approx.
Back
Cut two balsa spars as shown. Glue the balsa under the base This is how your completed
Sand them down 1mm shorter to act as skids to prevent the base should look. Sand the
than the height found in step robot from tipping up. They skids down if the wheels do
7, and round the corners. work best on a smooth surface. not touch the ground.
Some electronic
component
shops have
.second-han
Reared motors
like this which
Gearbox you could use.
Start
with pencl
if using
drill bit.
Gently clamp the shoulder Mark a piece of 6mm spar Gently clamp a length of metal
top. Drill a 6mm hole where 38mm long. Cut it with a tenon tube as shown on page 8. Saw
printed on the template. This saw, or a craft knife by cutting four 12mm and three 50mm
hole is for the on/off light. half-way through each side. pieces with a junior hacksaw.
Go to step 8
before glue
sets.
Hold the pieces of tube and file Glue together the shoulder templates to help you line all
the ends flat. Twist a drill bit sides, front, top and 6mm spar the pieces up. Lightly sand the
in the ends to remove rough as shown above. The glueing shoulder with fine-grade
edges, or burrs. positions are printed on the sandpaper and a block.
Front
Back
view
Shoulder Push the pieces of tube into Glue the completed shoulder
Dush a length of tube through the holes in the shoulder
^_
to the base over the glueing
the bearing holes to check tha I sides. The tube lengths for positions on the template,
theyline up. If not, move the each hole are on the templates. using plenty of glue. 13
sides before the glue sets.
Making the arm
You can find out here how to make the
robot's arm (coloured dark blue on page 4).
Some parts made at this stage are for
attaching other parts of the robot later on, so
don't worry if you cannot see what
something is for just yet. Try to drill all the
holes accurately.
Vice or home
50mm 10mm made clamp
Glue the 40mm lengths of spar Measure and mark the centre Saw one piece of tube 135mm
to the 2 50mm pieces in the of each joint. Drill a hole the long and four pieces 38mm
positions shown above. Use same diameter as the tube, long. Also saw two pieces of
plenty of glue for strength. using a bit or tube-drill. metal rod 70mm long.
Push the 135mm tube and two held firmly in the holes. If not, Glue arm templates A, B and C
of the 38mm pieces through put a little glue in the holes to to 3mm balsa sheet. Cut round
the holes in the spars as shown stick them in place, without them, making sure you cut out
above. Make sure the tubes are getting glue in the tubes. the slot in piece A.
Use the corner of a piece of
paper to check right angles
3
Right angle P, Arm top
Carefully glue the parts made right angles to the long spars. lengths of spar on the template
so far to the positions marked Make adjustments by moving glueing positions, as shown
on the templates. Make sure the spars slightly before the by the arrows above,
the short lengths of tube are at glue sets. Then glue the 24mm
Grippers
Cut out and glue gripper Measure and cut these pieces
templates A to U to 3mm or of 6mm spar: 2 at 55mm, 4 at
6mm balsa sheet according to 15mm and 2 at 20mm. Use a
the thickness printed on each tenon saw or cut through the
template. Clamp matching balsa both sides with a craft
parts together. Drill holes with knife. Lightly sand the ends of
a home-made tube drill or each piece using fine
suitable bit, where printed on sandpaper and a block.
Glass
the templates. Also drill 2mm
holes through parts G, H, I, J, K 12mm long rod /70mm long rod
and N, where marked.
15mm long tube
Industrial robots have
V grippers designed for the
job they do. The pictures
3mm long tube above show magnetic and
vacuum grippers, often
Cut the lengths of tube, metal rod and stiff wire as shown above. used to handle metal or
Use a vice or home-made clamp as shown on page 8. sheets of glass.
16 File ends flat and remove burrs from
tube by holding each piece on a
length of metal rod.
Cut along here with
craft knife and lightly
sand afterwards.
Drill a 2mm hole through the Push the 3mm and 6mm tubes Glue a 55mm and 20mm spar
sides of parts S and T, 15mm through the holes. You could to part C where printed on the
from one end as shown. Clamp push a length of rod in first template. Trim the end of the
the parts to drill them. and slide the tube down. 20mm spar with a craft knife.
12mm
.,_ metal
/rods
Place parts S and R over the Glue part D to the top of the to part C and part H to part D,
holes in part C. Then slide two balsa spars so it fits over the so that the shapes of all the
12mm metal rods through the metal rods and lines up with parts line up. Avoid getting
bearings as shown above. part C below. Then glue part I glue in the bearings.
13
If knot pulls
through tie a
small washer
on the end of
the line.
Tubes
must
line up
Pull here.
Glue four 15mm lengths of Glue the completed wrist to
tube as shown, using plenty of the gripper as shown, using Pull on the line to close the
glue. Try not to get any glue the dotted lines printed on jaws. Check the threading and
inside the tube. part Q as a guide to line it up. knots if this does not work
18
properly.
3 Remove the arm top (reverse of test
procedure on page 15). Line up the tubes 70mm metal rod ,
at the ends of the arm bottom and wrist.
Then slide a 70mm metal rod through the
tubes to connect both parts.
Customizing ideas
These pictures show some
customizing ideas. You could
add stripes, numbers or
mudguards to your robot, or
even make it look like a bug-
eyed science fiction monster.
Give your robot a name or
number with rub-down
lettering or paint brushed
through a stencil.
Glue the pieces of spar to parts Glue the side pieces to the The robot below is covered
A,D,E,F,G,HandI,onthe back as shown. You may have with synthetic fur fabric. Use
glueing positions printed on to support the sides with a clear glue to stick it on, but
the templates. matchbox while the glue sets. make sure moving parts are
not obstructed.
Test benchreport
Synthetic fur fabric
/-*,w
100 gradef
sandpapfe
Glossjjir-'*
Paper to protect table enamel paint
tub-down 'Remove wheels
Bering and. before painting Lightly sandpaper the robot to give a smooth
pflfetape surface for painting. Gently rub the surfaces in
for'W
custon Test paint on scrap of, the direction of the balsa grain with fine
balsa before using. sandpaper wrapped round a block.
MMtt
Cut section out of Use aerosol'
washing-up liquid
Painting paints in a
bottle for mudguards. well-
ventilated
area,
preferably
outside.
,
/Y
..-.
Ping-pong
Use an oil-based undercoat to seal the balsa
and lightly sand again before painting atop
V ball eyes coat of "enamel paint. Avoid getting drips of
paint in the joints.
Cardboard box
A circuit is made by
connecting components
to a battery so electricity 1 How to solder
flows through them to get
a certain effect. The Component
picture above shows a
simple circuit. When the"
switch is on, current
flows from the battery,
through the lamp,
through the switch and
back to the battery.
Veroboard
Bend the component's legs Turn the Veroboard over and
and push them through the bend the legs out slightly
holes in the plainside of the using pliers. This stops the
Veroboard. component falling out.
6
Press leg so
it does not
fly up.
Touch one side of the leg, other side. Hold them there for Trim the legs with wire cutters
where it touches the track about a second, until a blob of close to the solder. Hold the
with the bit, and at the same solder flows round the leg. board away from your face and
time touch the solder on the Then let the joint cool. put your finger on the leg.
Stripping wire
Stranded
wire
Plastic
cover
15mm
Practise your
soldering Pieces of Solder check.
. paperclip I Jit/
Slide along |
groove
between
tracks.
^~^,
o lined tract
Solder!
; Workboar
Score a small piece of
Veroboard with a craft knife,, It is very important not to join the tracks with solder
and snap it to break a piece off. j accidentally. Inspect your practice soldering to see if
Try making lots of joints in this has happened. If so, remove any solder by carefully
adjacent holes using pieces running a hot bit between the tracks._______________
of straightened paperclip. 23
Always pull the plug out when you have finished soldering.
Variable resistor or
Electronic components potentiometer - adjust
resistance by turning shaft.
^
in larger
shape
inside
case, or in
a flat edge
on the ^
case. /
Positiveleg
Current flows in one direction LEDs glow like tiny bulbs Transistors act like switches
through diodes - like a one- when current passes through to turn current on or off, or to
way street for electricity. They them. Like ordinary diodes, control the strength of current.
have a stripe at one end which current only goes one way. They have three legs, called
identifies which way round They have a positive leg, "base", "collector" and
you connect a diode in a connected to the positive "emitter". The centre leg is
circuit. Current only flows terminal (+ve) of a battery, usually the base and the case
when a diode is correctly and a negative leg connected has a mark to identify the
connected. to the negative terminal ( ve) others.
Relays
A relay is a special kind of switch activated by
an electromagnet. The picture on the right
Relay shown actual size.
shows a cut-away of the type used in the
project. The coil in the centre becomes an
electromagnet when current is passed through
it. This attracts the springy arm above it,
switching it from one of the contacts at the end
to the other. The magnet works as long as
current flows, but as soon as it is turned off the These are called
arm flicks back to the other contact. This effect single-pole (or
is used to switch the robot's motors on and off. switch) changeover
There are many types of relays, some with relays. Only some
more than one switch inside. See page 40 to makes have a clear
24 find out which you need. plastic cover.
*It is a good idea to take this book with you to the shop. See the shopping list on
page 40 for the components you need.
Resistor codes
This shows how to read Resistance is measured Robots need electronic senses, or sensors,
resistor codes. in ohms (written ft or to give their computers information, or
,1st digit Kn for 1,000 ohms). feedback, about the outside world or the
,2nd digit One stripe shows how robot itself. This robot truck has a kind of
- Number of accurate the resistor is radar sensor to detect obstacles in its
noughts (don't worry about this path. The instant anything is detected it
one), and the others sends a message to an on-board
show its resistance. The computer, which is programmed to
first and second stripes control the robot to steer clear.
Ac give the first two digits
stri in the number of ohms.
(gol
silver, red The colour of the third
or brown) shows how many
noughts to add to this.
fS~
Run wire
Twist wires round to through
make it easier. shoulder or down
Measure and cut two 400mm Bend one of the stiff wires over Stick the other stiff wire under
long wires and strip and tin the front of the shoulder as the arm with tape. Position it
both ends. Solder one end of shown. Cut off apiece of tape so that the stiff wires touch
each to two 50mm long bits of and stick the wire to the front each other when the arm is
stiff wire.* of the shoulder. right down.
1 Arm up sensor
Bit of Bare metal
steel nail
Spring
Matchstick
Stick tin toil to the face of the Cut a piece of foam 55mm x Stick a thin strip of double-
right-hand jaw. Strip a 600mm 30mm and a strip of brass sided tape to either end of the
wire and tape one end to the shim 15mm x 40mm. Glue or jaw. Stretch the foam and stick
foil. Glue a piece of matchstick tape the shim to the foam. it to the end of the jaw and the
to the jaw as shown. Strip a 600mm wire and tape it matchstick.
to the shim.
Leave wire
4 Gently bend the wires loose here.
from the jaw and tape
them to the gripper.
See page 33
for sensor
tests.
600mm wire
"^Solder
Glue the part made
in step 2 to the back of the Let drawing pin cool.
shoulder, about 25mm up
from the base. Then glue
the part made in step 3 to Strip and tin a 600mm wire Make another spring part. -. '
the lower part of the arm so and solder one end to a drawing Glue it to the side of the wrist
the spring touches the nail pin. Push the pin in the gripper so it touches the drawing pin
when the arm is fully up. to line up with step 2. when the gripper is fully open.
27
How to make a light sensor
You can find out here how to make a light
sensor, as an added extra for any version of How light f- Resistance
sensor in ohms _
the robot.* This enables you to instruct the High when f\ Low when
robot to follow a line drawn on a big sheet
wo
of paper, or "look" for bright objects. There
is an example of how to instruct the robot
and light sensor on page 39. You can also
find out how to make an optional on/off
light on the opposite page. iilsor is made from alight
dependent resistor, connected to the
Materials you need computer via a circuit, where there is a knob
Sensor templates A to F, 1 Vzmm balsa sheet, Velcro, to adjust its sensitivity to light. The LDR
sticky tape, dark paper, 2m bell wire, LDR, LED, sends an "on" message to the computer
10 hole connector block, 330(1 resistor, 2 small self- when light shines on it and an "off"
tapping or wood screws, soldering and tool kits. message when it is dark.__________
Strip and tin each end of two Cut out a piece of dark Cut out light sensor templates
500mm wires. Then solder coloured paper or thin card A to F and glue them to 1 Vainm
one end of each wire to the and make a tube round the thick balsa sheet. Cut each
legs of an LDR. LDR. Stick the tube with tape. piece out with a craft knife.
Glue the front, back, top and Place the paper tube inside the Cut two bits of Velcro 70mm
sides together as shown. Hold box with the wires poking out long. Separate the Velcro, glue
each part while the glue sets. of the holes at the back. Then one bit under the sensor and
Don't glue the bottom on yet. glue the bottom on. two bits to the robot. * *
*If you don't make the light sensor, leave out the * *See opposite to find out how to
potentiometer in the circuit on page 32. connect wires up.
Connecting up the
On/off light
robot's wires
All the wires from the robot's 1 Strip and tin the ends of
sensors, motors and LED (if two 250mm long wires and
you add one) are connected LED
one 100mm wire. Carefully
into a connector block. This twist one end of each
makes the robot ready to 250mm wire round the legs
connect to the switching of an LED and solder them
circuit explained on page 30. in place. Then wrap sticky
tape round each join. Note
which wire is soldered to
100mm
the positive leg. wire
Screw wires in 1 Wire from LED positive leg via 330H resistor.
this side. Wire from LED negative leg and one from each
2
sensor (including light).
3 One wire from each arm sensor.
4 One wire from each gripper sensor.
5 One wire from light sensor.
6 One wire from arm motor.
7 One wire from gripper motor.
8 One wire from left drive motor.
Write numbers by the side of 9 One wire from right drive motor.
the connector block. Thread 10 One wire from each motor.
any loose wires through the Screw the wires into the this chart. There are 18 wires
hole in the shoulder. connector block as shown in with the LED, 16 without.
29
Use the same hole numbers as shown above for all versions of the robot. Do this
carefully, checking each wire as you go.
Making a switching circuit
These instructions show
how to make the switching Things you need
circuit which connects the Relays, transistors, diodes,
resistors, potentiometer (see
robot to the computer. It is page 40 for exact types), bell
important to follow them wire or ribbon cable,
very carefully, as one mistake Veroboard, soldering kit and
tool kit, including drill bit
could damage the circuit or (about 5mm).
your computer. The template
on page 41 helps identify
where components go.
Relay 1
Pin No. 1234
Hole a8 Z8 V8 a5 Z5 V5
Relay 2
Pin No. 123
Hole alB Z18 V18 a!5 Z15 V15
Relay 3
Pin No. 1 2_ 3_ 4_5
Hole a28 Z28 V28a25 Z25|V25
Relay 4
Pin No. 1
Hole a38 Z38 V38 a35 Z35 V35
Relay 5 alO a20 a30 a40 H40 G23
Pin No.
Hole H38G38C38 H35G35C35
Push the legs of five relays Push the legs of six transistors Push the legs of five diodes
through the holes shown in through the holes shown in through the holes shown in
the chart. Bend the legs out the chart. Solder transistors to the chart, with the striped end
slightly as you go, then solder the track quickly to avoid in the hole marked in yellow.
30 them carefully to the track. heating them. Then solder to the track.
Transistors: Ask your supplier which leg is
nearest spot or other mark on case (see page 40).
Put tape round
erminals after
t nt ometer soldering. Push wires
J through.
Brown/Black/Red
2K2H Red/Red/Red
E6/M6 E8/L8 143/148 O43/O48
6K8n Blue/Grey/Red
ell/ell c21/e21 c31/e31
T10/Z10
40/Z40
Push the legs of fourteen Strip and tin the ends of two G39/T38 R4/Z4
resistors through the holes 150mm wires. Solder them to P24/Z24 O34/Z34 O41/B44
shown in the chart, bend the the centre and outside tag of a P41/b32 Q41/b22 R41/bl2
legs out and solder them to the 100K potentiometer. Solder A3/S3 E4/X4 I24/K24
G25/N41 K42/e42 C34/V34
track. one wire in E16 and one in N16. D34/G34 E34/H34
Cut 500mm of 10-way ribbon Cut 2m of 10-way ribbon cable Strip and tin the ends of five
cable or ten lengths of bell or ten lengths of bell wire. 200mm wires. Tape labels to
wire. Strip and tin the ends. Strip and tin the ends. Tape them and solder one end of
Tape labels to them and solder labels to them and solder them each wire into the holes
them in the holes shown. in the holes shown. shown above. 31
IMPORTANT: Check no tracks are joined, or you could damage your computer.
Connecting the robot, circuit and computer
These pages explain how to 1 Connector block Computer
connect the switching 1 inside robot connector block
circuit to the robot, batteries
and computer. It is very
important to read the
instructions before
connecting up, and then Circuit
follow them carefully, or wires
GROUND
you may damage your
computer. Connect all the circuit Connect all the circuit
robot wires into the computer wires into
connector block fixed to another connector block
Relay power the robot as shown above. with ten pairs of holes as
Check that the wires are in shown above. Label the
the correct holes. block with tape as shown.
Feed wires Computer
through slot at connector
back. ock
Mark
terminals
with tape.
v.
You could use a 12 volt
power supplier from a slot
car set. Not all power Connect the motor battery
supplier terminals are wires to two batteries as
marked +ve (positive) and shown. Connect the wire
ve (negative). Test which labelled COMMON Connect the relay battery
is which with a IK resistor between the + ve and ve wires to the +ve and ve
and an LED as shown. The battery terminals, using an terminals of a 12 volt
LED only lights up when extra wire. Use two battery. Some alternative
its negative leg is batteries of the same power supplies are
connected to the negative voltage as your motors explained in the yellow
terminal. (e.g. 3 volt motors need panel on the left.
two 3 volt batteries).
k/n 10
* * Push plug in ••IT
i User port
•
• ;ii.;.U ,•. •.•-•• -..iirj
/ :>•.;:-..• ,. ••••••• ••'•")
.• i '.:':''''•'. I' '• * : :; , • . }
.-J4:
16
18
19 17 15 13 11 9 7 5 .') 1
marked "User port" on the
User port numbers Top f
BBC. Buy one with a length of
Test the circuit before 20 18 16 14 12 10 8 6 4 2 ribbon cable attached, and
connecting to your You need a special plug called connect to the computer
computer to see if it a 20-pin I.B.C. plug to connect connector block as shown in
switches the motors on and the circuit to the socket this chart.
off. Strip three wires and
connect them as shown to Commodore 64 and User I/O pin Label on computer
numbers connector block
the computer connector VIC 20 tJLYqlts
block and a 6 volt battery -N ___ __
(the other batteries must be _cT 0 (motor polarity)
connected too). Touch the D 1 Tright drive motor)
loose wire in holes 1,2,3 2 (left drive motor)
3 (gripper motor)
and 4, one at a time. You Push plug in H 4 (arm motor)
should hear a relay click I/O port 5 (Tightsensor)
and one motor start as you K 6 (gripper sensor)
try each one. Remove the 7 farm sensorl
loose wire.
4 5 6 7 9 10 11 12
of ribbon cable and strip and
m Sensor test 1/0 port numbers Top 4
tin the wires at both ends.
ABCDEFHJKLMN Connect the wires to the edge
Use a plug called an edge connector and computer
connector for these connector block as shown
fave the
computers. Cut a short length above.
battery above in ZX Spectrum Interface Label on computer
"place (not shown in pin number connector block
picture). Solder three wires See page 40 + 5V +5 Volts
-ov GROUND
and a 330ft resistor to an £± Q 0 (motor polarity)
Expansion
LED. Put the + ve wire in the port 1 (right drive motor)
5 volt hole. Touch the other 2 (left drive motor)
wire in these holes, while 3 (gripper motor)
4 (arm motor)
manually moving the robot
(remove wires and battery -rs- 5 (light sensor)
6 (gripper sensor)
afterwards): Interface 7 (arm sensor)
Hole What should happen You need a special interface instructions, connecting a
3 LED on when arm fully
up or down. circuit which plugs into the short length of ribbon cable
4 LED on when gripper expansion port. There are a between the interface and
fully open or closed number of types and they give computer connector block as
5 LED off when light sensor
pointed at bright light. eight input and eight output shown above.
lines. Following the interface
Do these
checks if the If everything
tests don't fails, see page 33
work: 48.
Test programs
Here are some tests to check the robot is "start-up" routine to do each time you use
working correctly before typing in the main the robot. This makes sure the motors do
program over the page. There is also a not start before you are ready.
Program changes
The main program works for the BBC Spectrum
computer. These are the changes you need to 10 LET OP=the number of your port
make to the main program over the page for the 100 BQSUB 330»(fl=l)t230*IA=2)+120i(A=3)
VIC 20, C64 and Spectrum computers. 170 60SUB 480*(Q<8)+500t(Q=B)*540*(Q=9)+620*(Q=10)+640*(Q=ll)
190 SOSUB 680ilQsl2)*690*(Q=13)+710*(Q=14>+730*(Q=15)+750*(Q=U)
270 PRINT " ";!;". ";:IF N(I»0 THEN PRINT V$(H(I»i
• C64 A VIC20 375 IF LENICIK6 THEN LET C$=C$+" ":BOTO 375
800 IF INKEY$<>"" THEN GOSUB 830:LET PF=1:RETURN
10 POKE 5i579,31:DP=56577 830 either POKE QP,0 or OUT QP,0:RETURN
A 10 POKE 37138,31:OP=37136 840 either POKE OP,G or OUT OP,G:RETURN
A 30,230,330,990 Replace CIS with PRINT CHRK1A7) 850 LET SF=1
A 800 BET I$:IF IIO" THEN GOSUB 830:PF=1:RETURN 860 LET D= either PEEK OP or IN DP
A 830 POKE OP,0:RETURN 862 FOR 1=7 TO 5 STEP -1:LET Z=2A I
864 IF D>=Z THEN LET D=D-2:IF 2=TN THEN LET SF=0
A 840 POKE OP,6:RETURN 866 NEXT I
A 8iO IF (PEEK(OP) AND TN)=0 THEN SF=1 900 FOR T=l TO 100:NEXT T
A 900 FOR T=l TO 200:NEKT T 920 DIN M(40):D!« D(40):DI(1 Ptll):DIH V$(17,6)
Robot control program
' 10 ?iFE62=31:OP=&FE60———————
tart-up" • Sets data direction register This program is written in
20 GOSUB 830:SOSUB 920:60SUB 990 — • Sets robot to starting BASIC. No changes
: 30 position and reads data.
CIS are needed for the BBC
40 PRINT "ROBOTROL !1ENU":PRINT computer. Changes for other
50 PRINT "DO YOU WANT TO " — Prints menu computers are on page 35.
60 PRINT "1. ENTER STEPS"
Menu 70 PRINT "2. DISPLAY":PRINT "3. SO'
80 PRINT "TYPE A NUMBER"
90 INPUT A:IF A<1 OR A>3 THEN GOTO 90- • Gets user's choice (A).
100 ON A GOSUB 330,230,120—————— • Branches to routine depending on choice.
.110 GOTO 30 Sets PC (step number) to 1. Sets PF
'120 LET PC=1:LET PF=0————————— • (panic button flag) to 0.
130 LET GNM(PC)————————————— . Sets Q to number of command stored in V$
140 IF Q=17 THEN GOSUB 830:RETURN—————————————— as recorded in M for this step.
150 IF Q=0 THEN GOTO 210 |_ Stops motors and returns to menu if
160 IF QM1 THEN GOTO 190 • command is HALT (command 17 in array V$).
Run 170 ON Q GOSUB 480,480,480,480,480,480,480,500,540,620,640
steps __ Branches to relevant section depending
180 GOTO 200 on command.
190 ON Q-ll GOSUB 680,690,710,730,750
200 IF PF=1 THEN RETURN ———————————————————'• • Returns to menu if PF (panic button flag) = 1
210 LET PC=PC+1:IF PO40 THEN GOSUB 830:RETURN- 1 Increases step number (PC) for next step
.220 60TO 130 and goes back.
: 230 CLS
240 PRINT "FROM WHICH STEP":INPUT S
250 LET EL=S+15:IF EL>40 THEN LET EL=40———— • Works out last step to list to (EL).
260 FOR I=S TO EL
List 270 PRINT " ";!;". ";V$(M(1)>;———————— • Prints step numbers and commands.
steps 280 IF D(I)>0 THEN PRINT TAB(15);D(I);———— • Prints duration (D) if any. Array D holds
290 PRINT the duration for the step.
300 NEXT I
310 PRINT "PRESS RETURN FOR MENU"
.320 INPUT Q$:RETURN
'330
CLS
340 PRINT:PRINT "STEP NUMBER":INPUT N————— Asks for step number (N).
350 IF N=0 OR N>40 THEN RETURN
360 PRINT "COMMAND":INPUT C$—————————— Asks for command (C $).
370 LET V=0 V = Number of position of the command
380 FOR 1=1 TO 17 in array V$. Sets V to 0 then compares
Enter 390 command (C$) to commands stored in V$.
steps
IF C*=V$(I) THEN LET V=I Sets V if match is found.
400 NEXT I
410 IF V=0 THEN PRINT "COMMAND NOT REC06NIZED":GOTO 360- Command not recognized.
420 LET M(N)=V ——————————————————————— Records command in array M.
430 IF V=10 OR V=ll OR V=16 OR V=17 THEN LET D(N)=0:60TO 470 Jumps to line 470 for commands which
440 IF y ^ 10 HR V—' ^ THFN PRINT "DURATION""RnTn 4 AO ™^^~^^^^^^^^^~i
450 PRINT "TO WHICH STEP" ——————————————————————— ISfwieToTa^chTo^3111 C°mmandS
460 INPUT DIN) ——————————————————————————————— D(N) = duration for this step.
.470 GOTO 340 Array P holds the binary numbers to send to the output lines in the
"480 LET G=P(Q):LET N=D(PC):LET TF=0 ——port, for each of the movement commands. G is the number actually n
Move
wheels 490
: 500
GOSUB 770'RETURN sent to the port. TF = 0 means no sensor test is needed as wheels have I?
36 IF A$="UP : THEN RETURN ——————— ^sTp, arm won't move.
Arm
up 510 GOSUB 580
II
0.0
.520 IF SF=1 THEN LET A$="UP" ——————SF = sensor flag. If arm sensor is on, this means arm is fully up.
*Because it takes a while for the
robot to begin moving after a
command, the computer waits for a
time after the sensors go off before
530 RETURN
"540 testing to see if they are on again.
IF A$="DO" THEN RETURN • Same as Both the gripper and arm sensors
Arm 550 GOSUB 580 lines work in the same way.
down 500-530.
560 IF SF=1 THEN LET ft$="DO
.570 RETURN
'580 LET TN=128——————
TN tells computer which input line to test.
Move 590 60SUB 880:LET N=D(PC):LET TF=1- Waits for the sensor to go off then checks to make
arm BOSUB 770:LET A$="" sure it has not come on again before moving arm.
oa
600
Open
gripper
.610
'620
RETURN
IF 6*="DP" THEN RETURN————
Moves arm and sets A$ to indicate mid-way position.
Returns if gripper is open. *
.630
'640
GOSUB 660:LET G$="OP":RETURN - Moves gripper and sets G$ to indicate gripper is open. 2,
Close IF G$="CL" THEN RETURN ———— Same as 620-630 8
gripper 650 GOSUB 660:LET G$="CL':RETURN Waits for sensor to go off then sets duration to large |
'660 number so gripper moves a long way. TN tells the g
Move LET TN=64:60SUB 880:LET N=1E5-
gripper computer which input line to test. 3
.670 LET TF=1:GOSUB 770:RETURN —— TF = 1 therefore sensors must be tested. Moves gripper. w
GOTO [ 680
'690
LET PC=D(PC)-1:RETURN———— Sets step counter to step before one asked for. When
LET TN=32:GOSUB 850: IF SF=0 THEN GOSUB 680—— 1 is added (line210) correct step is obtained.
IFOFF
.700 RETURN Tests light sensor input line. Calls GOTO routine
"710 LET TN=32:SOSUB 850: IF SF=1 THEN GOSUB 680-] if sensor flag is off.
IFON Same as line 690 but
calls GOTO routine if sensor
.720 RETURN flag is on.
'730
LET R=PC:LET E=D(PC) 1________ R is a record of step number of command.
REPEAT/ 740 LET C=0:RETURN J E = number of repeats wanted. C = count.
END 750 LET C=O1:IF C<E THEN LET PC=R——————— Adds to count. If not the final repeat (E) then sets
.760 RETURN step number back to repeat statement (R).
'770 GOSUB 840:LET T=0——————————————
Turns on motors.
780 IF TF=0 THEN GOTO 800 ———————————— Misses out sensor test if not needed.
Run 790 GOSUB 850: IF SF=1 THEN GOSUB 830:RETURN —— Does sensor test. Turns off motors and
motors
800 IF INKEY$(0)O"" THEN GOSUB 830:PF=1:RETURN-L;returns for next step if sensor (SF) is on.
Turns off motors if a key is pressed, sets panic
810 LET T=T+1:IF T<N THEN GOTO 780————— 1 flag (PF) and returns.
.820 RETURN '—— T counts up to duration (N) specified.
Turn off
motors 1830 ?&FE60=0:RETURN —————————————— —— Turns all motors off.
Turn on f840 •>8iFE60=G:RETURN —————————————— —— Turns selected motors (G) on.
selected I...
motors 850 LET SF=0 ————————————————— —— Sets sensor flag to 0.
Testa 860 IF (?OP AND TN)=0 THEN LET SF=1 ————— —— Sets sensor flag (SF) to 1 if low voltage on sensor
sensor input line.
.870
'880
RETURN
LET G=P(Q):GOSUB 840——————————— —— Selects motors and turns them on.
Wait for
a sensor 890 GOSUB 850:IF SF=1 THEN GOTO 890————— —— Tests again if sensor still on.*
to go off 900 FOR T=l TO 500:NEXT——————————— —— Pauses before returning to start move (sensor may come
.910 RETURN back on momentarily which will stop motors).
"920
DIM M(40):DIN D(40):DIN P(11):DII1 V*(17>- __ M stores number indicating command chosen for each
step.
Read 930 FOR 1=1 TO 17:READ V$(I):NEXT I D = duration for each step, P = numbers to send to port
data
940 FOR 1=1 TO 11:READ P(I):NEXT I ————— —— for each movement command. E.g. for command B
.950
'960
RETURN (Backwards) number 7 is sent to port. V$ holds the
Robotrol DATA "F","B","FR","FL","BR","BL","STOP"/'UP","DOWN","OPEN","CLOSE" known commands.
commands DATA "GOTO",'IFON","IFOFF","REPEAT","END","HALT"
and numbers 970
to send
to port .980
'990
DATA 6,7,4,2,5,3,0,16,17,9,8
CLS:PRINT:PRINT "IS GRIPPER OPEN FULLY (Y/NP:INPUT 1$
1000 IF I$="N" THEN LET Q=10:GOSUB 630 ——————————————— Opens the gripper fully if not
1010 PRINT:PRINT "IS ARM FULLY DOWN (Y/N)':INPUT 1$ already open.
"Start-up"
procedure 1020 IF I$="N" THEN LET Q=9:LET PC=1:LET D(1)=1E5:GOSUB 550——— Moves arm down fully if not 37
1030 LET G$="OP":LET A$="DO" already down.
1040 RETURN
Instructing your robot
The main program is written in BASIC and Robotrol commands
enables you to use a set of special Movement commands
instructions, called Robotrol, to instruct the ^"\^r
robot. You can give the robot up to forty
separate instructions. This page shows you
F Goes forwards
^&®r
rx. _^<:L\.
>
cement London, SE27 OHH, England. 39
Shopping list continued over page
Wood Electronic components
You can buy all the wood from You can buy the electronic powered batteries.
a timber yard or hardware components from a DO NOT USE CAR OR
shop. Ask if they have any components shop, or by mail- MOTORCYCLE BATTERIES
offcuts as these are cheaper order. An address is given OR MAINS ELECTRICITY.
than buying whole pieces. at the end of this list. Maplin Electronic Supplies Ltd.,
Ask in your local TV repair P.O. Box 3, Rayleigh, Essex, SS6
Robot base: 6-12mm thick 8LR, England.
plywood or chipboard shop or look in the telephone
200mm wide x 250mmlong. directory to find where the Computer connectors
Home-made clamp: 15mm nearest components shop is. These are available either
thick softwood, ply wood or Ask your supplier for from components shops or
chipboard 200mm wide x substitute components of an computer dealers.
350mm long. equivalent type if they don't BBC: 20-way I.D.C. (short for
Workboard: any thickness have the ones specified here. insulation displacement
plywood, chipboard or Relays: 5 sub-miniature single connector) connector and
hardboard about 500mm pole changeover relays, coil cable.
wide x 750mm long. voltage 12V d.c. (See very C64/VIC20:0.156inch
Sanding block: any small important notes on relays pitch female edge connector
scrap of wood. opposite.) with 24 pins (two rows of
Transistors: 6 x BCl08or twelve).
Odds and ends BC107.
You may find some of these Diodes: 5 x any diode in the Spectrum interface
things around the house. If series 1N4001-1N4007. You need to buy a parallel
not, you can buy most of them Resistors: Ask for l/4- l/2 watt input/output interface board
in a hardware shop. with 5%-10% tolerance. 2 x for the Spectrum. Look for
Sponge (for soldering - any 330ft(forLEDs),3 x IfOl, 7 advertisements in computer
kind will do) x 2.2KO (sometimes written magazines or write to one of
Tin foil about 75mm square 2K2fl),5 X6.8KO the companies listed below.
Thin foam rubber about 75mm (sometimes written 6K8ft). If you already have a
wide x 300mm long. Potentiometer: 1 x 100KH, Spectrum sound board you
Fishing line or strong twine LINorLOG. may be able to use it as an I/O
about l a/2m long Light dependent resistor: 1 x interface. Check the manual to
1 drawing pin ORP12. find out.
6 metal paperclips 18-20 SWG cored solder Read the instructions with
1 steel nail about 75mm long 0.1 inch size Veroboard 31 the interface you buy very
2 elastic bands about 80mm tracks wide x 60 holes long. carefully. Depending on the
long when unstretched. (This is enough for an extra type you buy, you will have to
2 compression springs about piece 10 holes long to use either IN and OUT
30mm long. practise your soldering.) commands, or PEEK and
2 tension springs, or short 10-way ribbon cable x 4m POKE commands, as shown in
strong elastic bands, about (about 7 x 0.2mm strands in the Spectrum program
25mm long when stretched. each wire), or "bell wire" x changes on page 3 5. Check the
1 matchstick 40m (about 7 x 0.2mm thick interface instructions to see
1 matchbox strands). Do not use mains which to use. Most interfaces
Roll of sticky tape cable. have 8 input and 8 output
Roll of insulating tape 2 connector (or terminal) lines. Use those numbered 0-4
Velcro about 150mm long. blocks with 10 pairs of holes. as output, and those from 5-7
Velcro is a trade name. It Batteries: 1 x 12V, 1 x 6V and as input.
consists of two pieces of stiff 2 of a suitable voltage for Glanmire Electronics, Meenane,
Watergrasshill, Co. Cork, Eire.
fabric, one with tiny hooks, your motors. See page 32 for William Stuart Systems Ltd,
the other with loops, which notes on using transformers Quarley Down, Cholderton, Salisbury,
40 stick together when pressed. and combinations of lower Wiltshire, SPQ ODZ, England.
Relay notes Relay pins
It is very important to use the 1 Place the pins of your relay
c=>
correct type of relays for the over this guide. It will not fit
circuit on page 30. There are the circuit unless they line up
several makers of the same with the dots.
type and they number the pins 2 Turn the relay on its back.
c=>
differently. Number your pins Use the numbers shown to
as shown on the right as these identify the pins.
are used in the circuit
instructions. Listed below are 3 You may get a circuit
manufacturers' type numbers diagram like this to identify
and some useful addresses if the relay pins. Use the
your components supplier numbers shown here. This
does not have the correct type. diagram is a "pin view",
which means you identify the
Fujitsu FBR2 1 1 series type B or E
pins with them facing you.
RS Components number 348-510 Coil must
Fujitsu Component Europe, B.V, Substitute relays be in this
Rijnkadel9B,1382GS Weesp.The position
This is what to do if you
Netherlands.
cannot get relays with the pins
Fujitsu America Inc. in the correct positions:
918 Sherwood Drive, Lake Buff, Short stripped wires soldered to legs.
Look carefully at the relay
Illinois 60044, USA.
Fujitsu Limited, 6-1, Marunouchi 2-
chome, Chiyoda-ku, Tokyo 100,
circuit diagram and substitute
the pin numbers with those
V
Japan. used above. Then solder short
Tempatron Ltd., 6 Portman Road,
lengths of wire to the pins.
Battle Farm Estate, Reading RG3 Solder the wires into the
1JQ England. Veroboard instead of the pins.
Front-
Tape the The templates for all the robot
Fix connector on/off LSD parts made from balsa are on
block anywhere resistor the next six pages. Do not cut
in this area anywhere in these pages. See page 9 to find
this area ' out how to use the templates.
BASE TEMPLATE
6-12 mm plywood
or chipboard
If your motors and
gearboxes won't ft't
in the positions
marked, makeyour
base template
larger
^Gearbox Gearbox/
shaft ^
shaft position
position
Glueing positions
for shoulder
42 Back
Shoulder and cover templates
SHOULDER
TEMPLATE C
(•front) 6mm balsa
sheer
SHOUlPERJEMPltJE
Glueing Glueing
position -for Glueing Glueing position -for
6mm spar position position 6mm spar
for parrD -far parr D
SHOULDER SHOULDER
TEMPLATE A TEMPLATE B
(Side) 6 mm balsa (side) 6 mm balsa
sheet Sheet
Cat hole
with craft
knife
LIGUT LIGHT LIGHT
SENSOR SENSOR SENSOR
/^ mm //LIGHTSENSOR A TEMPLATE TEMPLATE TEM
balsa
shee.t C D PLATE
SENSOR
(back) (side) (side) £
-f (top)
Push LOR
legs -through
here mm l~z mm
balsa balsa balsa
Sheet sheet sheet
44
Gripper templates
6mm fomm
Spar Spar
glueing glueing
positions positions
46
'////////////777m
•*- Guide, positions -»
•for gluei'ng
COVER r£MPU\7EE
y (top) lyzmm balsa sheet
COVER COVER
T£MPLAT£ D TEMPLATE F
(side) l^ Guide position (side) 1% mm
balsa sheet for balsa sheet
COVER
TEMPLATE
G (back}
A*z mm bafsa
sheet
Glueing position
-for 6mm spar
Glueing
positions -for Glueing positions
6mm spars •for 6mm spars
Guide, position
i -for glueing
47
Index and circuit diagrams
arm, 4,14 parallel input/output port, 7, 33, 35 Motor circuit
robot, 3,15, 25 pitch, 16 + 12 volts
Armdroid, 3 potentiometer, 24, 31,40 o——
axis, 12 program changes, 35
base,4,10,11 relays, 24, 30,40,41 Diode
BASIC, 38 resistors, 24, 25, 31,40
BBC computer, 2, 7, 33, 34, 35 codes, 25
bearings, 12 robotics., 3 Computer
binary code, 35 Robotrol,2,38,39 output Transistor
bits, 35 commands, 38 o-TZZP
robot vehicle, 2,4, 5,11 2.2KO
Buggy, 3 Resistor f"16.8Kfi
bytes, 35 roll, 16 Resistor
Commodore 64, 2, 7, 33, 34, 35 sensors, 4,9, 25, 26,27
computer, 2, 7 arm down, 5,26,33,34 o-
control, 35 arm up, 5,26, 27, 33, 34 -0 volts
connectors, 40 gripper closed, 5, 27, 33, 34
connecting up, 29 gripper open, 5, 27, 33,34 This is the motor control circuit. It is
control lines, 18,19 light, 5,33,35 repeated five times in the switching
cover, 20,21 test, 34 circuit - four times to switch each
customizing, 18,19 shoulder, 5,12,13 motor on and off, and once to control
soldering, 22,23 their polarity to make them go either
degrees of freedom, 12,15 Spectrum, 2, 7, 33, 34, 35 backwards or forwards.
diodes, 24, 30,40
interface, 40
electronic circuit, 5, 22 speech synthesizer, 9 Light sensor circuit
electronic components, 7, 22, 23, 24, "start-up" routine, 34
25,40,41 stationary arm robot, 2,4
expansion port, 33 stripping wire, 23
switching circuit, 5, 30, 31, 32
gearbox, 10,11,39
gripper,2,4,12,16,18,19 templates, 9
arm, 44
Hero 1,9 base, 42
home-made clamp, 8 cover, 43,46,47
input, 35 gripper, 45
interface, 2 light sensor, 44
input/output, 7 shoulder, 43
switching circuit, 41
joints, 12 tinning, 23
Light dependent resistor (LDR), 24, tools 6, 39 -0 volts
28,40 Topo, 3
Light emitting diode (LED), 24, 29,40 transistor, 24,30,40
LOGO, 3 tube drill, 8
This is the light sensor circuit, and is
Turtle, 3 included with the switching circuit
manipulative robot, 3
micro-robot, 3 user port, 33 on the same piece of Veroboard.
mobile robot, 3,10,25 Veroboard,22,23,40
modeller's materials, 39 VIC 20, 2, 7, 33, 34, 35
motor, 2,4,10,11, 39 vision, 4, 9 Test failure
test, 34
wrist 16 Ask someone else to check the circuit
on/off light, 13,29
output, 35 yaw 16 and connections if any test fails, as it
is easy to miss something. Use fresh
batteries. If the circuit still does not
First published in 1984 by Usborne Publishing Ltd, 20 Garrick Street, London WC2E work, pack it carefully with enough
9BJ, England. stamps for return postage and send it
Copyright© 1984 Usborne Publishing Ltd to:
The name Usborne and device f are Trade Marks of Usborne Publishing Ltd. All Electronics Advisor,
rights reserved. No part of this publication may be reproduced, stored in any form or by Usborne Publishing,
any means mechanical, electronic, photocopying, recording, or otherwise without the 20 Garrick Street,
48 prior permission of the publisher. London WC2 9BJ
ISBN O-flbQSD-fllS-X