0% found this document useful (0 votes)
156 views50 pages

Make and Program Your Own Robots For The Commodore 64 and VIC 20

„Make And Program Your Own Robots For the Commodore 64 And VIC 20” by William Clark

Uploaded by

turboc201
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
156 views50 pages

Make and Program Your Own Robots For The Commodore 64 and VIC 20

„Make And Program Your Own Robots For the Commodore 64 And VIC 20” by William Clark

Uploaded by

turboc201
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

MAKEANDPROGRAM

YOUR OWN
ROBOTS
FORTHECOMMODORE64
AND VIC20

WILLIAM CLARK

DEVISED BY LIONEL BENDER


DESIGNED BY BEN WHITE

BEAVER BOOKS
== CONTENTS
About this book ....... ... .... ..... ........ ..... .... ..... ............ ...... ... .. .... ...... ...... ....... ........ 3
Linking up robots to your computer .. ............. .. ... .... ........... .............. ...... ....... ... 4
Programming and robot control ..... ...... ... .. .... ..... .... ........ ..... .... ... ... .......... .. ..... . 5
Wiring and electrical circuits .. .. .. ... .. ....... ....... ... ..... ... ........ .. .. ... ..... .. ... ..... .. ..... .. 6
Using LEGO® ................ .. ... .......... ..... ... ........... .. .. .... ... ......... ... ...... .... ........ ..... . 7
Projects
1 Walking Android ..... ..... ........... .... ... .......... .. ... ...... .. .... .... .. ... ... .. ..... ....... .. ... 8
2 Whirly Turtle ............ ............ .... .. .... .. ... .. ......... ......... ...... ...... .. .. .. ......... ..... 11
3 Lift Operator .... .... ....... ...... ..... .......... ... .. ... .... ....... ..... .. ..... .. .... ... ..... .... .. .... 15
4 Card Reader ... ....... ..... .. ..... ...... ... .......... .. ..... ... ... ...... ..... ...... .... ........ ... .. ... 20
5 Mini-arm ... ... ..... ......... ... ...... ... .. .. .. .. .. ... .. .. ..... ... .. .................. ........ ....... ... .. 25
6 Plotter...... .......... ..... .... ....... ..... ..... ...... ... ..... .. ... ..... ....... ....... .... .... .. .. ..... ... . 32
7 Maxi-arm ......... .... ..... .. .. ...... ..... .. .. ... ............ .. ... ..... ..... .... ...... .. ..... ....... .... .. 40
Useful addresses and information ...... ........... .. ... .. .. .. .. .. .. .... ... .. .. .. .. ................. 48

A Beaver Book Make and Progra m Yo ur Own Robots


Published by Arrow Books Lim ited was conceived and produced by
17-21 Conway Street, London W1 P 6JD Lionheart Books
10 Chelmsford Square , London NW10 3AR
London Melbourne Sydney Auckland
Johannesburg and agencies throughout the world Editor Lionel Bender
Designer Ben White
Illustrators Hayward Art Group
An imprint of the Hutchinson Publishing Group Typesetting Facet Filmsetting Limited
17-21 Conway Street, London W1 P 6JD Robot photography Ian McKinnell

First published 1985

© Lionel Bender (Lion heart Books) 1985


Text and robot designs © William Clark 1985
Illustrations © Lionheart Books 1985

All rights reserved. No reproduction , copy or transmission of this publication in any form or by any means, may be made
without written permission from the publisher.
This book is sold subject to the condition that it shall not, by way of trade or otherwise, be lent, resold , hired out, or
otherwise circulated without the publisher's prior consent in any form of binding or cover other than that in which it is
published and without a similar condition including this condition being imposed on the subsequent purchaser.

Printed in Great Britain by


Philip Print Limited , London
Bound by Hunter & Foulis Limited, Edinburgh

ISBN 09 942660 9
2
ABOUT THIS BOOK
Many of you may think that typical robots are like All our robots are made from LEGOI! Technic
R2D2 of Star Wars fame, the Daleks of Dr Who or building sets and motors. Many of you will probably
like machines that walle and talk like a human already have a collection of LEGO pieces .
b eing. This is mostly untrue, as you will discover To program the robots, you will need, in addition
fro m the projects in this book. A robot is any to your home computer, an interface unit. We have
machine that can be programmed by a computer to used a readily available purpose-built interface unit
carry out a task automatically. Most robots do but if you are good with electronics or know
simple jobs that people find boring or too someone who is, you could make your own from the
dangerous to do. details we provide. To SAVE the robot control
There are seven robot projects in this book for programs, you will also need a cassette tape
ou to try. The projects are designed to give you an recorder or disc drive unit, and to display and
_-sight into the basics of how robots are built and check your programs, a tv or monitor.
ork. They are very simple and start with a walking Before starting the projects, read the following
:-obot and progress to a 'pick and place' robot arm. four pages to become familiar with the basic
=-or each project we provide full details of what the techniques and skills you will need to build and
:- bot can do, how it does it, what you will need to program the robots. Then, we recommend that you
::::ake it, how to build it, link it to your home try the projects one at a time in the sequence they
mputer, and program it. After completing the are presented in the book. None ofthe projects
:;::- jects, you should be able to build and program should take you more than two or three hours to
:- . ts of your own design. complete.

3
I LINKING UP ROBOTS TO YOUR COMPUTER
To control the robots in this book using your contains six electronically controlled switches
computer you will need an interface unit. This is a called relays. A relay is a switch in which the
device that links together the motors in the robots, contact - the part that does the connecting (closing)
the battery box power source and the computer. and disconnecting (opening) - is moved by the
Inside the interface unit is an electronic circuit that force of an electromagnet. When the magnet is on,
switches the power to the motors on and off when the contact moves to the conducting position.
instructed by the computer. We have used an When the magnet is off, the contact is pulled away
interface unit called a VicRellt can be obtained by a small spring and the relay stops conducting.
from any good computer dealer or from one of the The relays allow the computer to switch on and off
suppliers listed on page 48. devices such as motors, lamps and alarm bells.
The VicRel comes with an instruction leaflet.
Study this carefully before proceeding. The unit

USING THE INTERFACE SWITCH INPUTS

Turn off your computer (remembering first to SAVE Also on the VicRel there are two switch inputs.
any important programs) then plug the interface These allow you to connect ordinary switches to the
unit into the user port on the back of the machine. interface so that the computer can sense when the
Now turn the computer back on. First you must set switches are open (off) or closed (on). In some of
up the user port to transmit signals to the relays and our projects we use simple switches as sensors.
receive signals from the switch inputs. Type You could, though, use switches in, say, floor mats
COMMODORE 64 VIC 20 or door handles and use your computer to operate a
POKE56579,63 POKE37138,63 burglar alarm
The relays are numbered I to 6. Each relay has a
control value as follows Using the switch inputs
Re~y 1 2 3 4 5 6 To find if either of the switches is open or closed,
Control value I 2 4 6 16 32 you have to 'look into' the computer's memory,
To switch on any relay, type where an item of data is automatically changed by
POKE56577, control POKE37 136, control the switches turning on and off
value value To test if switch 1 is closed (on), type
For example, to switch on relay, 1 type PRINT PEEK(56577)ANDI28 (Commodore 64)
POKE56577,1 POKE37 136, 1 PRINT PEEK(37136)ANDI28 (Vic 20)
To switch on relay 5, type If it is closed, the computer will print O.
POKE56577,16 POKE37136,16 If it is open. the computer will print 128.
By adding together control values you can switch Testing for switch 2, instead type
on combinations of re~ys. For example, to switch PRINT POKE(56577)AND64 (Commodore 64)
on re~ys 2 and 6 (control values 2+32), type PRINT POKE(37136)AND64 (Vic 20)
POKE56577,34 POKE37136,34 and the computer will print 0 if it is closed and 64 if
To switch on relays 3 and 5 (control values 4+ 16), it is open.
type This happens whatever state the relays or the
POKE56577,20 POKE37136,20 other switch sensors are in
To turn off all the relays, type
POKE56577,0 POKE37136,0
To convert the programs in this book for
When you type these commands only the relays the Vic20 change line 20 in every program
you want to go on are operated, all the others are to:
turned off (if they are not already off). 20 PRT =37136:POKE37138,63
The following program will switch relay 1 on
and turn on the motor when you press any key:
10 POKE56579,63 10 POKE37138,63 (In case you cannot obtain a VicRel or should you
20 GETA$:IF A$=""THEN20 wish to build your own interface unit, we supply a
= 30 POKE56577, 1 30 POKE37136, 1 F= circuit diagram on page 48.) =
PROGRAMMING AND ROBOT CONTROL
When you have built a robot you
CHECKING CONTROL SYSTEMS
are going to control using your
computer, type in the program
printed with the project. If you To check a program, first carefully compare the lines you have typed in
have not typed in programs with those in the program printed in the book Ifyou thinkyour program
is correct but you are still having problems, refer to the table below.
b efore, look in your computer's Here we list some of the most common problems which occur with the
manual to see how it is done. robots together with the remedies.
The interface unit should be
plugged into the user port before Problem Remedies
you turn on the computer and None of the motors will run Check the batteries are fresh
start typing in the program. Take Check the wiring and connections
care to type in the lines correctly. are good
Do not try RUNning the program Check that the LEGO plugs are
until you have typed it all in. plugged in properly.
When you have entered all the Make sure you are switching the
program, SAVE it on tape or disc. correct relay.
Do not RUN the program, unplug All the motors run in the Change the position of the
the interface unit or turn off the wrong direction pole reverser on the
c omputer. battery box.
Having SAVEd the program, If you are not using a pole
VERIFY it to check it is stored reverser, turn the plugs over on
properly. Then try RUNning the the battery box.
program. If the program causes
the computer to crash, LOAD the One of the motors runs in the Turn the plug over on
copy on the tape or disc back into wrong direction that motor.
the computer and check it The motors run but will not Check the switches are send-
through on the screen. stop under computer control ing pulses to the computer by
watching the green lights flash on
the VicRel
Check that when one motor stops,
Writing your own control its switch remains in the on
p rograms position.
After you have done some of the
projects, you should start to
understand how we use the interface
unit to control robots. You should be
able to write your own simple 10 REM ••LIFT (ONTROLLER** 20 set user port address
20 PRT=56577:POKE56579,63 30 set variables to drive Up,
programs to switch motors on and off 30 UP=9:0W=6:SP=O:CL=1 Down , Stop. Set Current
We use some of the interface unit 40 INPUT"WHIGH LEVEL 1-7";NL Level to 1
relays to do the pole reversing S0 IFNL)70RNL(tORNL=CLTHEN4~ 40 ask Which Level. Set Next
60 TD=NL-CL
(changing the direction of rotation of 70 IFSGN(TO )=-lTHENPOKEPRT, DW
Level to this vatue
50 check level between 1 & 7
the motors) and some to switch the 8u IFSGN(TU)=ITHENPOKEPRT,UP
60 find Travel Distance
90 FORI=ITOABS(TD)*6
motors on and off To help you lB~ IF(PEEK(PRT)AND128>=BTHENl0f' 70 switch molar on. II travel
understand the structure of our I 1~ IF(PEEK(PI<'T)ANDI2B)=128THEN110 distance negalive:Down
programs and what each line does, 12(' NEXT! :CL =NL 80 switch motor on. If travel
130 POKEPRT,SP:GOT040 distance positive:Up
opposite is a copy of our Lift Operator READY. 90 set up program to count 6 x
project program fully labelled and travel distance pulses
annotated (see project on pages lrom the interface
100 wait for switch to open
15-19).
110
120
wait lor switch 10 close
finish counting pulses. Set
Current l evel to Next Level
F= 5
130 switch motor off. Go back
to.line40
I WIRING AND ELECTRICAL CIRCUITS
To connect up your robots to the interface unit you
will have to do some simple wiring. For each cable
battery box
project we have provided a simple wiring diagr.am
in which we have drawn the components life-like. plug
The illustration opposite shows thCJ components. @@@@@
The cable we use for most ofthe projects is ~ @©©@©
called ribbon cable. It is flat like a ribbon and has ~
several strands which run side-by-side. It is best to

-
buy about 2 metres of 20-way (20-strand) ribbon switch pole reverser
cable which will suffice for projects in the book.
In our wiring diagrams we have shown the
.-....... mmm
interface unit on the left, with the terminals JJmIL
numbered, and the motors, battery box and so on,
and the wires corning from them, on tlie right. interface unit
The ribbon cable and all other electrical
components are obtainable from any good
electrical or electronics store or supplier.

PREPARING THE RIBBON CABLE MAKING THE CONNECTIONS

In our larger projects we show you in the wiring To connect the wires from the motors, switches and
section how best to cut and separate the individual so on into the VicRel, undo the little terminal screws
strands of the ribbon cable to wire up the robot using a small screwdriver and into each hole ofthe
motors and switches. Separate the strands by unit poke the wire or wires as appropriate. Tighten
gently pulling them apart. Some of the projects use the screws down firmly but not too hard. It is
non-standard widths of ribbon cable, such as 4-way sometimes useful to bend each twisted wire back
or 12-way. In these cases, split the 20-way cable against its plastic sheath. This can stop the wire
along the entire length you wish to use then cut off breaking if accidentally tugged when fixed in the
the appropriate section. VicRel.
Once you have cut the cable to length, strip the Wherever you have to make an electrical
plastic sheathoffthe ends ofthe individual strands. connection, the wire should actually touch (make
It is best to use wire-strippers for this. Close the contact with) the metal of the terminal.
cutting blades gently onto the strands so you cut the Below are examples of some of the connections
plastic but not the metal wire. Then slide off the we use in our wiring diagrams.

~
plastic. Strip about 8mm of sheath off the end of
each strand. Finally, twist together the metal fibres

~~C:~~d
of each wire.

~ toonepinofa
motor/battery plug

Several wires connected


to various terminals
in a terminal block

6
USING LEGO
~ e robots in this book are all constructed from
:..EGO! Technic pieces. We chose LEGO because it
~~@~Yl

•I
.:S e most popular, most widely available and most
ersatile of all children's model construction Beam (8 units)
systems. It is of course possible to make robots with
- er types of building kits and you might like to try
:::is after making our designs.
~
Plate (2 x 6 units)
24-tooth cog

o help you follow our building plans, we have pin peg


:i:. pted the same type of step-by-step illustrations Axle (6 units long) -axle lengths are I!l wheel

e.':~~i ~h i, *
aid instructions and the same component names as
=sed in LEGO plans. The illustration opposite
-..., ws and labels the main components. Where
--ere may be confusion over the name used for a
sma!! pulley
ponent or the component is unusual we have
ted it in the parts chart we provide for each (SP) 0
ect large pulley (LP) crown (24C) 1/2 bush

LEGO YOU WILL NEED MOTORS AND GEARS

=-::.~ earlier projects in the book are designed so Most robots are simple to control if the moving parts
..r.c... <hey can be built with just the parts contained operate slowly. You will have noticed in your LEGO
~ i:. standard LEGO kit or combination of standard motor instructions that to make things move slowly
But if you do not already have the kit we you need to 'gear down' the power from the motor.
_::ccmmend you buy, you can try and follow our We found it best to take the initial power from the
GC.SlC design and modify the robot to suit the pieces motor using a belt driving a large pulley wheel
_...;. do have. You may even be able to improve on (LP). This causes the motor to do 10 revolutions
...::deslgns! while the pulley does only I -a gearing down of 10
:: you need to obtain one or two specific to 1. If one then mounts an 8-tooth cog wheelan the
:::::~ponents you can probably obtain them from the pulley's shaft and uses this to drive a 40-tooth cog
=00 Spares Service. To order from this service wheel, the pulley does 5 revolutions when the
need an order form printed at the back of a 40-tooth cog does only 1 (a gearing down of 40/8 or 5
"'-::00 catalogue. The catalogues are available from to 1). The overall effect is that the motor does 50
shops and department store toy departments. revolutions while the 40-tooth cog - the output from
=- e best kits for building robots are those which the motor - does only 1. This is a reduction in speed
:::::~ lots of pins, pegs, gears and toggles as well of 50 to 1. You can see that by using different
=- :JeaIIlS and plates. The motor starter set No. 8050 combinations of gear wheels you can get a series of
..5 ~ Ideal set to start with. Supplementary set No. different reductions.
=:=-:" is a very good extension of any LEGO (When using switch between the switch
_~ection if you are going to progress to building
sensors note that the closing mechanism and
=-;;;e robots. The motors used in the projects are output-wheel, robot the output. Drive belts
- - .oo.ttery powered 4.5V Technic motors but you arm etc. - must be will slip.)
:z: use the l2V Technic motors (as long as you driven by toothed 'gears
-=;e a power pack) or the large 4.5V motors
gh you may find it cl,ifficult to build these
--: ur designs.
bots at school
..:. ..:. plan to build robots at school, it is possible to
-x ·. . e Educational LEGO Spares Service, which is
--.:.:::per than the ordinary spares seryice. For
-- . see page 48.
7
5
WALKING ANDROID
With just one motor and a few parts, you can build a
robot that walks along on two legs. Our design is an
android, a robot that looks and acts like a human.
But as you will see if you try yourself, it is difficult to
make a machine that walks exactly as we do.
This robot walks well because it can balance
in any position. You can test this by connecting it
to the battery box and stopping it in different
positions. The android keeps upright and stable
because its legs are rigid, its feet overlap one
another, and its weight is always spread over an
entire foot.

Up, one two, up, one two


The android walks by slowly raising
one leg, movi ng it forwards , loweri ng
it, putting it down, then re peatin g
the process with the other leg and so
on. If you have a friend who has built
an android , you co uld have races!

<J The android wired up to the


computer. The robot wil l work best on
a flat, leve l surface.

WHAT YOU NEED


All these pieces can be obtained from
motor kit No. 8700 (or 880) and the
supplementary kit No. 8710.
1 motor

Beams

Plates
j1x2 j1X3 j1 x4 j 1x8 j2X 4 j 2x8
J
[6 J 3 J 2 J 2 J 4 J 3 J
Axles

I! I; I : I
Gears
8

I : I ~4 11:C I 2:C I P~L

I~ I ~I~I ~ I~I~I
8
CD

- Start by building the android 's


ack. Press the pieces together
:-''11ly.

t:, Add the waist section bearing


the axles and gears. Make sure
that the slots in the two 24C-gear
wheels are set at the same angle,
as shown .

~ t> Place an 8-tooth cog whee l onto


the motor then add the motor

{I assembly to the body. Make sure


all the gears mesh smoothly by
turning the ' neck' cog wheel by

a
hand.

Rotor
arm f!ife
/:). Assemble and fit the four leg
rotor arms onto the 6-length axles.
The arms should be at the same
angle on each sid e of the body but
opposite to one another on either
side, as shown .

9
[> The body unit is now complete .
Lift it into the upright position
ready to add the legs.

[> Build each leg from the parts structure with simple sensors and ,
shown and attach it to the body as a fini shing touch , have fitted a
using rotor arm pins. Th e pins fit 'nose' below.
into the th ird and seventh holes of Test th e android on a battery
the 16-unit beam of each leg. box. If it moves stiffly , loosen all
Add a head of your own the gears. Th en connect it to the
design - we 've just used a computer.

I PROGRAMMING Wi RING
Program 1 starts the android when a key is pressed and
stops it when another key is pressed. (Any key can be
used .) Program 2 starts the android in the same way but
stops it after about 7 seconds . You can lengthen or
shorten this period by increasing or decreasing the delay
value in line 50. Try to adjust this number so that your
android takes one slow step at a time . Both these
programs can be used to control a motor in any of your
own androids or indeed any robot.

10 REM RNDROID CONTROLLER l0 RE~l RNDROID CONTROLLER


20 PRT=56577:POKE56579,63 20 PRT=5657?:POKE56579,63
30 GETA$: I FA$= '.' THtN3(1
11 30 GETA$: I FA$=" "THEt·i3C1
4~ POKEPRT~l:REM TURN ON MOTOR 40 POKEPRT~l:REM TURN ON MOTOR
50 GETA$: IFA$='"'THEN50 50 FORTD=0T05000:NEXT
6121 POKEPRT,0:REM TURN OFF MOTOR 60 F'OKEPRT, 121: RHI TURN OFF t'10TOR
70 80T030 70 CiOT03()
READY. READY.

10
HIRLYTURTLE WHAT YOU NEED
All the constructional pieces can be obtained from the motor kit
No. 8700 (or 880) and the supplementary kit No. 8710.
_:--e walking android in Project 1 did not have a very
_ be:> 'c function except to show how to switch a
Ion and off using the computer. In this project,
-~ e computer controls the motor in either direction-
=hckwise or anticlockwise. As a result, the floor
_ bo or turtle, can perform two functions. It can Plates
=-'7"'e forwards and it can spin round. This is similar
- standard turtles except that they can turn to the
~efl or right and drive forwards or backwards.
Om turtle has a holder for a pen, which allows it to
=---aw lines on a sheet of paper as it moves forwards.
en the turtle spins, it pivots about the pen and so
Gears
:xl line is drawn. Lay a large sheet of paper flat on a
:aD e and try and operate the turtle to draw different
- ' pes and patterns. Draw a few lines with a blue
_ e n, the n change this for a red or green pen.
Fibre-tip pens are the best to use.

The turtle seen from


behind showing the
pen holder.

Whi rling round


- he motor drives th e sin gle front
, heel. When the motor turn s one
ay, the wheel unit rotates until the
" heel points forwards , then the turtle
moves off in a straight line. When the
motor turns the other way, the unit
rotates until it is poi nti ng sideways ,
hen the wheel turns causi ng the turtle
iO spin .
11
® . rt ofthe Mtie 00
{'; Build the main P: wheel unit axle
the wheel unit. Th 3 of the 2 x 8 plate.
okes through hole ers of plates and
PNote the various lay nd below them.
@){'; Add the uppe cmosld plale ood ,
gear wheel
00
h is above a I the axles, the cog an
the gear w ee h
. check that t e g ears run free y.
Again as shown.

12
Motor
I================~ assembly

. add the motor assembly of v Fit the rear wheels onto half-
:;:es and gears beneath the large shafts and slot these into short
_ vss -plate. (Note, this is the beams on plates either side of the
"ear of the turtle.) motor unit. Push two 8-unit axles
with bushes at the top through the
top and bottom cross-plates and fix
half-bushes onto the bottom ends.
The axles must not touch the ground.

V Build the pen holder from toggle


joints, bushes , 2- and 1O-unit axles
(see insets). Each arm of the holder
is attached by a pin to one end of a
short beam with a small plate below .

V Fix the pen holder onto the top cross-


plate and motor assembly. Push the
holder on firmly . Hold a pen in
place using rubber
bands.

13
1
Operating hints and tips
1 As the turtle whirls about, the wire from the motor can
sometimes get tangled in the wheels. Strap the wire to
one of the bushes on top of the vehicle using a rubber
band and ho ld the wire so that it hangs down to the turtle.
2 The pen tip should rest directly between the two rear
wheels or when the turtle spins it will draw a little circle .

I PROGRAMMING
The first program allows the whirly turtle to be
controlled directly from the keyboard using the S key
to spin and the F key to drive forwards . The Pattern I WIRING
Drawer program allows you to instruct the whirly turtle
to perform several moves which it then repeats. The The interface block
DATA program line contains pairs of command numbers. is being used as
The first number tells the turtle how many units to a pole reverser
spin, the second how far to drive forwards . The main to drive the
program draws cypentagon . The series of moves are motor in two
ended by putting 0, 0 at the end of the DATA line. We directions.
have provided some alternative DATA lines. Experiment
by inserting your own command numbers.

1(1 F.:Hl ~·lHIPL'r' TUPTLE CC/t·lTF.:OL.LEP


2(1 PPT=56577:POKE56579 , 63
3(1 NK=64=FK=21 =SK=13
40 R=PEEK(197)
50 IFA=NKTHENPOKEPPT , 0
60 IFR=FKTHENPOKEPPT,6
70 IFR=SKTHENPOKEPPT,9
PERD'r'.

1(1F.:Erl ~·lHIPLIT' TUF.:TLE PATTEPt·j DPmlEP


20 PPT=56577=POKE56579,63
:::(1
CT=:35~:1:. St·j=9: HJ=6
40 PERIIA . II: IFR=(1At·lDD=(HHENEt·lD
50 R=A*10:D=D*10:IFR=0THEN70
60 POKEPF.:T. : : ;t·j : FOPP~;= J. TOCT +A : t·jE;'::T
70 POKEPPT , FW :FOPPS=lTOCT+D:NEXT
~R POKEPPT.0:GOT040
100 DRTR100,100 , 100 , 100,100 . 100,100.100.100 . 100 . 0 . 0
PERII'r'.

100 DATA80 , 100 . 80.100.80 . 100.80.100.0 . 0


FERII'r'.
100 DATR80.10.240.10 , 80 . 10.240 . 10.80 . 10.240 . 10 . 80 , 10.240 .
. 10.80.10.240.10 . 0 . 0
14 PERII'r' ,.
ERATOR
!"!I::::I:lie:::E:::w d we control a lift without a human
::p!:!::::::? •• .3 fairly simple to use a computer to
either direction (see Whirly Turtle
does the computer know when to
,.. in a lift for each level or floor?
d find the time it takes the lift car to
ee floors and use that as a guide? But
....... ---.:. :ties depending on the load in the car-
~:.;:::;-:.:.:~ e load the faster it descends. A better
-=orr"'=~--- - e computer to 'know' how far the lift car
"""''-''':'''"::' ad In this project we program it to do that.
_ ~ve noticed that on your interface block
.. ::e connectors called switch inputs. If you
:::z=":c a switch to one of these the computer can
--e the switch is in the on position or is
e use a mechanism which closes a
- :.s the lift winch-axle rotates. The computer
ts how many times the switch is closed
_:::::n this it finds out how far the motor has
-- ." e lift car. The switch is made from foil, a
- paper clip and LEGO pieces.
- - design allows you to extend the lift shaft to
-e ht and the lift car can carry small vehicles
_.' • eople. So you could build this 'robot' as part
el skyscraper or multi-storey car park.

-.:or and building pieces can be obtained from


- sa set No. 8050. The switch is home· made.

-=--'---=-..L....:=.......J---'--'--'--'--'---' Plates

~ I8l24TLPl
CI2JAxles ~Gears Fourth floor-going up
The lift car is win ched up on a piece of string wound
round the axle at the top of the shaft. The motor, whi ch is
geared down , drives the axle back and forth. As the car
goes up or down , the switch mechanis m closes the
• moto r, 3 1 x 8 steering plates, 2 drive belts,
switch six times between each level. The switch sends
30cm length of string , 3 2.5cm·squares of cooking foil , pulses to th e computer, which is set up to stop the car
a paper clip , 50cm length of 4-way ribbon cable. after 6, 12, 18, 24 pulses and so on . So to go from the 4th
to the 6th floor the computer counts 2 x 6 = 12 pulses.

15
CD
\l The base is a simple assembly of plates and beams. \l Build separately the four main upright supports.
A steering plate is used at the back as a cross -link. Fit pegs top and bottom as shown.

® ~
~

': ~
~
~
~
ct
~
~ ~
~
"
~
~
~
~


~
~
~

~
~
~
\l Attach the supports to the base. (Only the bottom ~ ~
ends of supports are shown.) Push the pegs in firmly. ~ ~
~ ~
~ ~
~ ~
~
~
~
"
~
~
~
~
~ ~
(f)
~
~
~ ~
~~

16
®

d th e lift car from beams and plates . If you


s make the car taller by adding an extra layer
o of beams. Allow the car to drop into the
- 0 the lift shaft. The car should slide freely
~e een the supports. If it does not, check you
-" e foll owed the instructions correctly. Do not
~'ocee d until you have solved the problem.

f:::" Attach the piece of string to the


winching axle by poking it through a
bush and then sliding the bush onto
the axle. Working at the top of the
model , add the three axles as shown .

<l The gear wheels and pulley wheel


fit onto the ends of the axles. If
the wheels do not turn freely ,
ease them slightly .

17
MAKING THE SWITCH

Straighten out the paper clip with your


fingers or, better still , with pliers.

b
g::z c
=-=
2 Bend the loop into the shape shown then poke it
through a pin with a hole through it. The loop at
the end of the clip should be about 3mm across.

~ ]t

3 Bend back the ends of the clip outwards and

"{;;JJ
'-
back and through the slots in the pin .

/ '
.~
) b "'-.:. '\ "=
: ~ .~ ' ~)~~ ~
4 Wrap anoth er pin with a square of foil. Then
push the three pins into the holes indicated. 6. Add the switch beam , plain beam , cross-plate
and motor. (See left for details of how to

[~B~~fi~~i~~J
make the switch.) The paper clip on the switch
Foil pin Third pin sho uld be pulled over to be above the foil.
Fix the belt between motor and pulley wheel.

5 Hook the belt onto the third pin . Pass it be hind


the paper Clip, pull it down ro und the middle pin,
then pass the loop of the belt over the lower end Operating hints and tips
of the clip. (See step 8, right, for final view.) 1 Make sure that the four main supports are pushed
well together but not in such a way that the lift car
gets caught. Also make sure the string is not too long
and there are no loose ends which could get tangled
in the works .
2 Sometimes the lift car, when empty , does not descend
very smoothly. To help it down add some extra weight
6 Make the plugs . Strip one to it - a piece of plasticine or some LEGO bricks , say.
end of each of the two wires 3 We've used a pole reverser on the battery box. This
by 1cm. Wrap a square of a is not essential, but if the car starts travelling too
foil round the end of each far, you can override the computer and turn off the
wire so that 2mm of bare d) motor as necessary.
wire poke out. Fold the foil 4 The paper clip should flick up and down repeatedly
over and roll the end of as the drive axle rotates . The clip should , at one
each wire to form a short plug. moment, be in contact with the foil pin and , the next
moment, be positioned a few millimetres above it.
18 Attach the switch to the model
and fit the plugs.
\l Wire up the motor and switch, with
one fo il plug pus hed into the fo il -
covered pin and the other pl ug into®
the paper clip pin . The inset 9
shows the switch from the far side
- note the position of the paper clip .

1~~~m~~= Clip pin wire


_ _'=""iP~"11 Foil pin wire
-t:ll'i~- Switch beam

[> Th e loose end of th e string goes


thro ugh the toggle on top of th e
car and is secured with a pin.
Attach toggles (or small plates)
to the outside edge of one of the
front supports , at 2-hole
intervals , to ind icate each level.

PROGRAMMING WIRING
~ - program will move the lift car to The wiring is similar to that for
eve I. When you RUN it, the the Whirly Turtle project except
"'puter assumes the lift car is at there is also the home-made switch
_= el 1 (ground floor) . If it is not, and a pole reverser is fitted
~ "nect the motor to the battery box to the battery bo x.
d move the car to the bottom of the
aft. Then reconnect the motor to
"interface. The program will ask
~u 'WHICH LEVEL? ' Type in a
.. 'TIber from 1 to 7 and press 10 REM**LIFT CO NTROLLER**
::-::TURN . The car will move to that 20 PRT=56577 : POKE56579 63 J
= el and automatically stop . It does 30 UP=9:DW=6 : SP=0 :CL=1
- s by driving the motor in the correct 40 INPUT "WHIGH LE VEL 1-7";NL
:: 'ection and then counting the
:: Ises from the switch. (If you wish to
50 IFNL)70RNL(10RNL=CLTHEN40
~se a taller lift shaft you will have to
60 TD=NL-CL
: ange the value 7 in line 50 to the 70 IFSGN(TD ) =-ITHENPOKEPR~DW
-J mber of levels in your model.) The 80 IFSm~ ( TIl >= 1 THEtWm::EF'f<:T.I UP
:rogram will then again ask the 90 FORI=lTOABSCTD)*6
:uestion. Note that if you type in , say , 100 IF ( PEEK ': PRT::O mm 128.) =0THEN 10"(1
2 , the lift car will move to level 2 and 110 IF ( PEEK(PRT : O AND128)=128THEN110
-ot just go up or down two floors .
12 0 NEXT I : CL =t~L
13 0 POKEPRT,Sp:GOT040
READlrl.

19
CARD READER WHAT YOU NEED

This simple device allows the computer to identify The maiority of pieces can be obtained from
motor starter set No. 8050.
a cardholder by reading the number encoded on a
card. It could be used as the basis for a security
device on a safe or on a door so that only certain
people are allowed into the room. Or it could be I-I-!-+I-;-+I----':--+I-:-t1_!- t--:--i1
1 1
Beams
used as a card reader in a cash dispenser, and you
could have a bank account record in your
computer. Pla,tes
The identity cards are made from ordinary
cardboard. The number on each card is encoded in
binary as a row of punched holes. You may have
encountered binary numbers in your computer's
manual or learnt about them at school or computer
tHE
2 3 Axles
I
8
3 I
24 40 SP
Gears

I~I~I.:.I I
4
club. Binary numbers use only two figures, or digits,
oand 1, to represent numbers. So 1 in binary is 1, 2 IbII
is 10, 3 is 11,4 is 100 and so on. In our machine
1 motor, 4 small wheels, 1 10x20 base plate , 6 drive belts, 1 1 x 8
cards, a hole punched thro~gh the card represents steering plate , 2 1 x 2 smooth plates, 50cm length of 6-way ribbon
1 and an absence of hole (solid card) represents a O. cable , 6 2.5cm squares of cooking foil, 2 paper clips.
As a card feeds through the reader, its code number is
read by th e com puter.

20
= :a d IS put in the correct way round , the far the card has moved through the machine. Th e
"::; In the reader is opened and the right-hand row of holes contains the binary encoded
'"5 ""e motor on . The card is drawn in by the number. When the computer has finished reading the
- - : a d the holes pass under the switches. The code , the motor is left running for a short while and the
, noles allows the computer to sense how card is fed out of the reader. The motor is then turned off.

- of motor
ent to base plate

the two cross-beams on the


blate. Push the bushes on the
es, slide the axles into one of
e ong beams and place the belts
er the bushes. Add the other long
_earn and fix the assembly on top of
e cross-beams. Add the gear wheel,
- ey, motor and drive belt.

l>Add the steering plates and other


plates as shown.

21
C> Make up the next level of beams ,
axles, gears and small wheels, and
place it in position on the first
level.

\/ Add the two 12-unit beams and the


plates that at the front of the
machine make up the slot for
the card .

C> The second pair of small wheels


are supported in a frame which
hinges on two upright beams placed
at the back of the machine.

22
!:::. The switches are of a
different design to
switches used elsewhere in
the book. The arms of the
paper clips should be set
to the angle shown .

For details of how to make


the switches see page 18

!:::. Add the central top plate and the


switch assembly of beams and cross-
plate. To hold the top card-roller
wheels firmly against the bottom
ones , add the pins and tension
belt. Wire up the model.

Operating hints and tips


MAKING-THE CARDS 1 If the card reader motor does not
turn off after feeding a card through ,
You will need a sheet of stiff card , try changing the angle between the
a hole punch , scissors, ruler and paper clip arms in the left-hand
E switch. The switch should make
pencil. E
1 From the sheet of card, cut some C\J definite clicks as the card pa·sses.
C0
pieces the size of a LEGO 4 x 8 plate 64mm 2 If the machine does not read the
(some 64 x 32mm). card correctly, try changing the angle
2 Mark the back of the card as between the paper clip arms in the
sh own . Wh e re you have mad e crosses, 2 rr----r----r---r---r----r---r---, right-hand s\}'itch .
punch a hole in the card . The 3 If the motor does not start when
centre of the holes should be over f-+-+-+++-++---l 12 mm you poke a card into the slot,
the centre of the crosses. Cut out i-*4***-*-*---l12mm check that only the right-hand
the right-hand end hole to make a switch is opening . If the switch is
slot. opening , check you have wired up
5 8 8 8 8 8 8 11 mm
3 Number the other points on the the switches, motor, interface, and
card as indicated. To give the card so on, correctly.
its identity, punch holes at the 4 If your cards do not pass easily
correct points. The card's number through-the machine , trim them
is given by all the punched carefully with scissors or a Stanley
numbers added together. (In a knife so that they are a loose fit,
binary number, values double or experiment using card of a
from right to left, 1, 2, 4, 8 etc.) different thickness .
32 16 8 4 2 1
To make the card run more
3 ~"'-'--'--'-'--r-"'.
easily in the reader, snip off
the corners with scissors. 23
",,---,---,---,----,----,---1......./
32 +8 +4 +1 =45
Type in the program and SAVE it. When you RUN the
program , the screen sho uld clear and the computer print a
message asking you to insert a card. If a card is inserted
the COrTect way round , the motor will be turned on, the
card will travel through the machine, and its encoded
number be read by the computer. If the com puter knows a
password for the card owner, it will ask for it. Then type in
the password for the computer to tell you that yo u may
enter. If it does not know the password , it will ask you to
enter your name and password .

10 REN CAF.:D READEI': E;ECUR I T'r'


20 PRT=56577 : POKE56579 .63 Ifyou type the wrong
30 N=1:S=0 : Tl=12S : T2=64 password. the computerwill
40 DINNS(63).PS(63) tell you this and ask you to
50 [1$=" :,:m!!l~!!l~lfl:[~l!!l~!!m!il" try again. Passwords can ()e
100 REM WAIT FOR CARD any word. code or number
lItl pF.:nnDS.; " PL EASE W::;EF.:T 'T'OUF.: CAF::D" you like. Once you have
120 IFCPEEK(PRT)ANDTl)=0THEN120 entered your name and
1::::tl IF ( PEEK (PIn::. ANDT2) = T2THEt·j 120 password into the
14[1 POKEPRT ., t'l computerJ t will not forget
150 IF(PEEK(PRT)ANDT2)=0THENI50 them unless you stop the
16(1 F~Hl F:EAD CArt:!1 program or turn off the
170 )0;=0 : FOF.: I =~:n05 computer.
1:=:-f1 IF (PEEK (P~::r :~ t41rr~~-=T2THEt~ 18(1
19[1 IF (PEEK (PRT) At·mT 1 ) =1~HHEt·1:'·~~>~+2 -n 'GOT0210
200 IF(PEEK(PRT)ANDT2)=0TH~N190
21 ~:1 IF (PEEK':: pF::n ANDT2) =~)THEN21 (1
220 NE>,:TI : FORTD=1 T015(1(1 .:NE~nTD
2:;:0 POKEPRT. E;
300 RE~l TEST FOR PA::;::::;l·jORD::::;
310 IFP:tOD=" "THEtN0(1
:;:2[1 H :I tHD$.: ; I t·lPUT" l·jHAT IS 'T'OUR PAf;Sl~Of.m II .: Pl~S
3::::~) I FPl·jS<:>PS':: >~) THEt-j5(1(1
340 PF::IHTDS.;" 'T'OU t'lA'T' EtHEF:: ".; t-l:t(X )
:350 GO::::UB 1(1(10 : GOTO 1(11:1
4(1(1 RHl ADD t·jEl·j PER:::;Ot·j TO FILE
410 PRUHDS .; "'T'OU AF.:E t·lOT 014 FILE AS A CARD HOLDER"
42(1 PRINT" l,jE l·JOULD LIKE 'T'OUR t·lAt·lE At·m A PASSl·lORD"
430 I t·jPUT" YOUI': HAt'lE " .; t·1S (>':)
44[1 I t·jPUT" 'T'OUR PA:::;;::::;l.JOF.:D a.; P$ (:,.,:)
450 PRIHT" NAKE A HOTE OF YOUR PAS::::WORD"
460 PF:: I NT" DO t·lOT LET At·NOt·1E KHOl·J 'T'OUF: PAS:::;l·IORD"
4 70 G08UB 1000 : GOTO 1~:1(1
5(10 F:Et'l L·jl<:Ot·j(; PASSl·jOF.:D EHTEF.:ED
51(1 PRItnDS .;" THAT IS NOT THE CORRECT PAS::;l,JOFW"
52(1 PRUH" TF.:'T' AGAIW'
~~A GO::;UBI00(1 : GOT0100
1l1tW F.:EN l.fA IT FOF.: SPACE BAR
1010 PF.: I In" PRE::::::; :::;;PACE TO cOIn I tjUE"

24 W20 GETA$: I FA${}" II THEt-l102(1


10:;:0 RETUF.:t·j
F.:EAD'T' •
INI ARM WHAT YOU NEED

Here is a simplified industrial robot arm for you to All pieces can be obtained from motor starter
build. Industrial robots do simple jobs that people set No. 8050, supplementary set No. 8710 and
motor unit No. 1175 (from the spares service) .
find boring and repetitive, such as packing and
sorting. They can also perform dangerous tasks,
like mixing chemicals and handling radioactive
materials. Our robot arm can pick up small
objects, swivel round on its base, then place
them down anywhere within its reach.
Our design uses two motors to do the job that
in larger robots is normally performed by three
motors. One motor drives the arm round on the 1 : 12
. 4
4 12~C 1. ~O I. SP3 1LP1 I Gears
.
base, while the other motor raises and lowers the

~O
arm and operates the gripper. The base and arm-
often called the waist and shoulder - both have 1 ; 1 6 I : I I Axles
built-in switch sensors. These, together with the 2 motors , 3 small drive
program, allow you to 'teach' the arm a set of belts, 3 large drive
belts, 50cm length of
moves which it can then repeat completely 8-way ribbon cable.
under the control of the computer. For the switches - belts ,
cooking foil , paper
The robot arm, with a small cube held in its gripper, clips.
swivelling round on its base.

25
Up, round, down; up, round , down
As the arm turns at the 'waist'
it can stop at anyone of 36 set
positions, and as it moves up and
down at the 'shoulder' there are
7 or 8 stop positions from bottom
to top .
The gripper closes its fingers
on an object. When the fingers
cannot close any more, the arm raises
up to the chosen position . Then
the arm turns , lowers and , as the
object touches the tabletop , the
grippers open. This is a 'pick-
and-place ' action .

THE BASE

'V Construct the bottom part of the 'V Assemble and add the next level ,
base with beams and plates from the with gear wheels, axles and so on,
supplementary set. Add the upright making sure you have used the
axle and the gear wheel. correct pieces (see insets for
details). Place small drive belts
on the pulleys. Make sure the
gears mesh properly and move freely.

CD

26
> Another layer of plates is
added front and back . Th e motor
®
unit that tu rns the arm is fixed at
he back of the base with more
plates. Hook the loose drive belt
onto the motor spindle.

V As a support for the shoulder of


the arm , add two 1 x 8 plates and ,
fitting on the axle, a 2 x 4 plate and For details of how to make
bush . Thread the wires for the base the switch see page 18
switch senSOF under the motor fixing
plate and up, and fi x the switch beam
in place.

VThe co mplete base un it. Put the


plug into the motor and push the
foil plugs into the switch pins
as shown above.

27
THEARM

C> The arm is made from the motor


starter set. First build one half
of the arm and the gripper shown
here in exploded view.

'V The other half of the arm is


added to complete the structure.
Use the detail diagrams to check
the construction. The mechanism
should move freely.

View from
underside End-on view of
front of arm

C> Build the switch and the drive


shaft that sits behind the arm ,
then construct the shoulder unit.
For details of how to make
the switch see page 18

Front view of arm switch

28
I> Add the last layer of gears and
beams to the top of the model. The
gears should move freely and
smoothly .
®

View from front of arm


to show belt on pegs

View of motor-
pulley assembly

6. The shoulder motor fits onto a


2 x 8 plate set on two small beams
on the top of the model. Use one
large drive belt on the pulley
and one on the pegs to help the
arm move up and down .

Plug the wires into the arm switch.


Put the plug into the motor.

29
V Attach the arm to the 2 x 8 plate
on the base.

Operating hints and tips


WIRING 1 Use a pole reverser on the battery box so that you
can manually turn off the motors should the arm move
too far.
2 To allow the arm to grasp objects more easily , add
some small pieces of draught excluder tape to the
fingers of the gripper.
3 Once you have connected the arm to the interface ,
attach the main wire to the back of the base with
Blu -Tac or tape to keep it neat and out of the way.
©©© 4 Both switches must function properly at all times
since they are connected to the same switch input on
r--V::-=I"'" I © © ©
the interface block. Each must remain closed when
its driving motor has stopped.

V Suggested separation of the 8


wires in the ribbon cable : 2 wires to
each of the motor plugs and 2 to each
of the switches .

6-7cm

12-15cm
15 - 20 c m
I.. ~I
40cm
30
Ie REM MINI ~RM CONTROLLER
20 PRT=56577:POKE56579 J 63
30 DR(0)=6;DR(2)=9:Ml=16:M2=32:T=129
40 DIMRl(50))R2(50 ) I PROGRAMMING I
100 REf'i t1EtiU After typing in the program , SAVE it
110 PRItH":J'1ItH AR~l PROGRAt'lt'lER" on tape. When you RUN the program ,
12(1 F'RItH")lBELECT:-" the menu will appear on the screen.
13(1 F'RItH"1l1 - TERCH t10'\"E:?" Select an option by pressing either
14(1 PRItH lin? - REPEAT ~10¥'ES" the 1,2 or 3 key. To TEACH the arm a
150 PR I NT")Il3 - SET HOt'lE POS IT 1 ON" series of moves , use the 1 and Q
keys to make the arm turn to and fro,
17(1 GETRf:lFVAL(Rf)(10RVAL(Rf»3THENI70 and 2 and W to make it go up and
180 ON VALCRI)GOSUB200,30G:400 down . At the end of each move, press
190 GOT0110 S to set the position in memory. At
200 REM TEACH MOVES the end of a series of moves press
210 PRItH":JTEACHHW ~l(tDE":RP=l : A:i='''' RETURN to go back to the menu.
22(1 >~$=A$: GETAt Pressing 2 will repeat the moves
230 I FA:t=" "ANDPEEK( 197) <:> 64 THEHAt=XI that you have taught the mini arm.
HOMING the arm allows you to use
240 IFAS=CHRt(13)THENRETURN the programming keys to set the first
250 IFA:t="S"THENGOSUB270 position for the series of moves.
260 GOSUB500:GOT0220
270 REM SET R POSITION IN ROUTINE
280 RICRP)=C1 :R2 (RP)=C2
290 RP=RP- (RP<50)IRETURN
300 REM REPEAT MOVES
310 PRINT":-REPEATING t'lO'v'ES"
320 FORI=0TORP-l:Nl=Rl(I):N2=R2(I)
330 G05UB600:NEXTI :RETURN
4(10 REf'1 HOt1E ARM
410 PRItH":'}-lOt'lE ARt'1 t'10DE"
420 GETA$:IFRS=""THEN420
430 IFA$=CHR$(13)THENC1=0:C2=(1:RETURN
440 GOSUBS00:GOT0420
508 REM CALCULATE ' DRIVE VALUES
510 Nl=Cl+ (At="l" ) - ( A$="Q" )
520 ti2=C2+(A1= "2" ) -(A$="W' >
5313 GOSUB6012i: RETUf;:N
60~ REM DRIVE TO Nl,N2
610SP=Nl-Cl:JF5P=OTHEN630
620 POKEPRT M1+DRrSGNCSP ) +1) ~GOSUB?00
J

63~ SP=N2-C2:IFSP=QTHENG5C
640 POKEPRT~M2+DR(SGN(SP)+1);GOSUB7GB
650 (,1 =1-11 : C2=N2: RETLJR~j
700 REM COUNT PUlSES
710 FORQ=lTORB£(SP)
726 lFCPEEk(P~T)AND T )=0THEN720
730 IF(PEEK(PRT)RNDT)=TTHEN730
740 liEXTQ: POkEPRT / (3 : RETURN
READY.
31
PLOTTER f-'=--+---+-=-_+-:=---+-..:.~2=-+-.:. :1:86 . .-j1 Beams

You can program this drawing robot, or plotter, to


draw graphs, patterns, diagrams and even letters
on a sheet of paper. There are two main types of
plotter: X-Y and drum. On an X-Y plotter, the paper
is laid flat and the pen moved up and down and
8
7
24
6
40
2 Is: LP
3 I
Gears

side to side over it. On a drum plotter, the paper is

I;.I ~I~I ~
attached to a drum which is rotated, and the pen is 2 5 3 2
moved from side to side only. Our model is a drum ItII ~ ill:::5
plotter. It uses two motors, one to move the pen, the
other to move the drum. A home-made
electromagnet raises and lowers the pen.
2
11
4
10
8
2
INon-holed
beams

2 4 6 8
Doodle, doodle, doodle 2 1 2 Axles
The motor at the front drives the penholder to the left and
right across the paper to draw horizontal lines. When the
drum is rotated but the holder kept still, the pen draws 2 motors; 4 small belts, 3 medium; 2 large wheels; 4 plugs, 2 battery
vertical lines. Diagonal lines are drawn using a boxes; 50cm length of 1O-way ribbon cable, 1 paper fastener, paper
combination of small vertical and horizontal lines. To move cli ps, 1 steel metric-5 25mm -long bolt with nut; 34 s.w.g. enamelled
copper wire (obtainable from electronics shops); thin card,
the pen to another point on the paper without drawing a double-sided sticky tape, Blu-Tack, 2-way terminal block.
line, the holder is raised . This is done by turning on the
electromagnet, which attracts a small metal paper fastener
fixed on the holde r.

32
<l Build the frame forthe base.
Break a medium belt, tie one end
through a rim-hole on the pulley
and make a knot, and secure
the other end to the cross-
beam using a pin .

'V Build the gear assembly as


below (inset). Use a small belt
'V To the right-hand side of the on the pulley . Place the chain
robot , add the plates and non- round the 24-tooth cog which sits
holed beams (you can use holed beams). between the two 16-unit beams .

6 33
<J At the back of the assembly,
add the plates and switch for the
belt drive. Remember
to pull the paper clip arm over
above the foil pin before
securing the switch. The paper
clip should be slightly curved
on what will be the left-hand
side of the switch (see inset) . Rear of
drive
assembly

V The rear 4-unit-long beam is


not holed. Add the drum drive
switch , beam and plate as shown.
As in step 4 , pull the paper
V Build the rear gear assembly and clip arm over the foil pin and
fix it to the back of the model . note the left-hand part of the
The gears must run smoothly. clip must be curved.

® ®

34
!> Working again at the front
left-hand side , add the other
half of the chain drive assembly.
Allow the chain to pass under
the 24-tooth cog wheel.

o
®
!> Make up the slide that supports
the penholder. The half-bushes
sit on studs on the plate.

!> Place the holder-unit slide


on the model. Using a small belt,
link the ends of the chain
across the slide as shown.

0000
10000 1
~1~11~11~lrrll~§;~~~
~
O~~~~~
0000
0000
0000

35
8 8

t> Add the plates, small non-


t::. Build the penholder arm units holed beams and electromagnet
from toggles, pins , axles and to complete the holder. The
steering arms . axles should hinge freely.

~ Place the penholder on the


slide . On the left-hand side ,
make the support for the drum
from non-holed beams. The pulley
linked to the base by a belt is
fixed on the left side of the drum .

36
I> Fix the drum on the plotter
frame . Note the drum-supporting beam
units. Add the two motors and medium-
size belts. Wire up the model. Two
loose wires go to each of the switches,
a plug to each motor, and the last two
wires go to the electromagnet.

If you wire up the


electromagnet via a terminal
block, you will need an extra
25cm of 2-way ribbon cable.

E
It)
N
6

37
MAKING THE DRUM MAKING THE MAGNET

You will need 2 large LEGO wheels , a piece of You will need a 2 x 4 holed plate, 2 half-pins,
card 160x280mm and double-sided sticky tape. 1 steel M5 25mm bolt with nut, and some 34 s.w.g.
1 Wrap double-sided sticky tape round the enamelled wire.
outer edge of each wheel. 1 Poke the bolt through the central hole of
2 Peel off the tape backing and the plate and screw on the nut undern8ath. Do
roll the card round the wheels. not over-tighten.
The edges of the card must align
with the edges of the wheels.
3 When you have nearly finished
rolling the card round, place a
strip of sticky tape across the • ••
2
front end of the card. Peel off
the backing, then stick the
end down to complete the drum. 2 Push the half-pins
into the outer holes of
the plate then poke about
1Ocm of wire through
2 one of the half-pins.
3 Wind the wire round
the bolt about 800
turns . (Write down the
numbers 1 to 8 and each
time you reach 100,
cross off the next
number.) Cut the wire
from the spool. •

4 5
4 Into each wheel, push a 6-length axle bearing
a bush and a 40-tooth cog wheel. The axles fit 4 Poke the loose end of the wire through the
through the end beam-stacks on the plotter. other half-pin . Cut the ends to leave
Wrap a sheet of drawing paper round the drum long 'tails'. 5 Gently scratch the enamel
and stick down the ends using Blu -Tack . When off the ends of each tail, twist the bare ends
you have finished your drawing, simply remove with the bare wires of the ribbon cable and
the paper anq replace it with a new sheet. poke the 'plugs ' into the half-pins as shown .

Operating hints and tips small and very tight. You may find it best to use a
1 The pen should rest on the paper so that the paper medium-size belt doubled-up.
fastener is about 1mm from the electromagnet. Adjust the 4 To support the pen in the holder, wrap a belt round the
gap between fastener and magnet by sliding the pen in pen and holder arms (axles) . Slip the paper fastener
and out of the holder. between them. Use a fine-point felt tip pen .
2 To keep the electromagnet wiring neat, make ajunction 5 Do not leave the electromagnet on for too long . It wil l
on top of the front motor to connect the magnet to the get quite hot and will drain the batteries very quickly.
ribbon cable . Place two smal l smooth plates on the motor 6 You can use any kind of paper to draw on but for best
and, with double-sided sticky tape, attach a 2-way piece of results use a good quality cartridge paper such as
terminal block (obtainable from an electrical shop) . See typing paper.
main photo on page 32 .
3 The be lt used in the chain drive gears (step 3) should be
I PROGRAMMING
10 REM PLOTTER CONTROLLER The main program contains sub-
20 PRT=56577:POKE56579,63 routines to control the plotter.
30 MX=8=MY=16:D(O)=2:D(2)=4:PS=0 We have given 3 examples which
40 XC=0:YC=0:XN=O:YN=0 draw different pictures. The
50 ;:::::;= 12::: : 'T'::;=64 routines are fairly easy to use.
To raise the pen in a program ,
100 REM DEMO , CIRCLE type GOSUB 1100. To lower
1.1. (1 CiCl::;UE: 1500 the pen, type GOSUB 1000. To
120 FOR~=OT02*rr STEPrr!20 reset the machine back to its
130 XN=R*COSCA):YN=R*SINCA) starting point, type GOSU B
140 GOSUE:2000:GOSUE:1000:NEXTA 1500. To move the pen to the
position X, Y, where X is a
150 GOSUE:1100:END position on the horizontal
1000 REM PEN DOWN scale and Y on the vertical
1010 PS=0 :POKEPRT,PS:RETURN scale , type XN=x; YN=y:
1100 REr'1 PEI'-~ UP GOSUB 2000.
1110 PS=l:POKEPRT,PS:PETURN
1500 REM RESET FROM KEYBOARD
1510 PF.: HH F:E::;ET -- I..Y:;E CUF.::::OR ~::: E'T'::; TO"
11

1520 F'R I rH" r'1 0 ',,.'E .' THa~ F'I?E::::::; F.:ETURrl" 100 REM DEMO, SQURRE
1530 GO::::UB 11 (10 110 GOSUBI500:GOSUBI000
1540 GETA$: I FFI$= "THEt·~ 1530
11 1:::::0 HWUT"LEHGTH OF t;IDE "; L
1550 ;::J~=>::t-H (A:t:= n" ) - (I=i$=
11 11 • • " )
140 XH=L:GOSUB2000
150 'T't·j=L : GO::;UB2[l1:::10
1560 'T't·~='T't·H (A$=" J" ) - (Flt= "'l.'!l" ) 160 ~< H=O : GO::::;UB20(10
1570 IFAt=CHRt(13)THEN1590 171:1 'T't·j=(t : GOSUB20(1(1
180 GOSUBI100: EHD
1580 GOSUB2000:GOT01540 PERD'T',
1590 XC=0:YC=0:RETURN
2000 REM MOVE TO XN,YN 1(10 f;Hl DE~10, S I t·jE l·lA VE
2010 XN=INT(XN):YN=INT(YN) I11j GO::;IJE: 15[10
2020 DX=XN-XC:IFDX=OTHEN2100 13[1 FOF: )< t~ =OT080
2030 POKEPRT;MX+D(SGN(DX)+l) 140 'T't·j= 0:: (80- )·n-D 16:> *8 It-W<t·j,·... :3)
15(1 G08UB20[10: GOSUB 10(1(1
2040 FORI=lTOABS(DX) 160 NEXTXH:GOSUBI1 0 0
2050 IF(PEEK(PRT)ANDXS)=0THEN2050 170 E~m
PERD'T',
2860 IF(PEEK(PRT)ANDXS)=XSTHEN2060
2070 NEXTI:XC=XN:POKEPRT,PS
2100 DY=YN-YC:IFDY=OTHEN2160
2110 POKEPRT,MY+D(SGN(DY)+l)
2120 FORI =lTOABSCDY)
2130 IF(PEEK(PRT)ANDYS)=0THEN2130
2140 IF(PEEKCPRT)ANDYS)=YSTHEN2140
2150 NEXTI:YC=YN:POKEPRT,PS
2160 F.ETI...IRt·~
F.:EAD'r' ,

39
MAXI ARM
We'v·e called this robot a maxi-arm because it is Reaching out, picki ng up
both iarger and more versatile than our mini-arm Under control from the computer, the top plate of the base
machine. It can not only move in a circle, it can also unit that supports the arm can rotate and stop at anyone of
extend and shorten in length from the 'shoulder' to 36 positions . The arm can slide in and out at the shoulder,
pick and place objects anywhere within a large stopping at anyone of about 20 positions. The gripper at
the end of the arm closes its fingers on an object and then
area It uses three motors and is built from a fairly
raises the object off the ground . At the wrist, the gripper
larg.e assortrnent of LEGO Technic pieces. (If you has about 15 stop positions. The arm-support, shoulder
don't have enough LEGO pieces yourself, perhaps and gripper all have a switch sensor which allows the
you can build the robot with a friend who has some computer to 'sense' how far each has driven.
LEGO Technic kits.) The base unit is the same as In effect, the gripper can be moved to pick up an object
that used for the mini-arm (see pages 25-31), but to anywhere within a sphere-shaped area around the
make the robot more sturdy, the base must be shoulder. The technical name forthis type of robot arm is a
placed on two 10 x 20 plates. polar arm.

WHAT YOU NEED


With this arm , you could move the pieces in a game
of chess if pieces and board are quite small.

1-1~::--t---;:C:--11-:1""":-+I-l:-::~ --t-I-l-:-2--+---:1:::--11 Beams

1-1_~_+I_:_I-I_:_+I _:_+I_l_°---11 Axles

3 motors , 2 battery boxes, 6 small belts, 2 medium belts, 5 plugs, 2


1Ox20 base plates, short length of draught-excluder tape, 1DDcm
of 12-waYTibbon cable, 3 2.5cm squares of cooking foil, paper
clips, 30cm length of string.

40
THE ARM

o the arm from PI~;ower


Construct th
{ . ; \ [>
es andpart of
beams.

41
t> Add the racking pieces. The
gripper drive gears are mounted
on axles that lie within the
beams at the back of the arm .

t> Poke the string through a


bush and then slide the bush onto
®
a 6-unit- long axle. Push 4 pins
into the gear wheel then build
the gear and axle assembly , and
fix the assembly onto the back
of the arm.

I> Make up the switch as shown . f4\


Fix the motor onto the 4 x 6 plate ~
then use the switch beam , the
8 x 1 beam next to it, and the
plates to secure the motor to
the arm . Fix a small belt
between the motor and the pulley
wheel.

Motor/switch assembly
from far side

42
THE GRIPPER

VConstruct the main gripper axle


unit ensuring that the two
14-cog gears are facing opposite
directions as shown.

®
L.On the 4-length axles , mount
the 4-length steering plates ,
setting them in a V-shape.
4 Lock them onto the axles using
4
half-bushes. When the steering
L. Add the 6-length beam, short axles, plates are moved in and out , the
and two more 14-cog gears. Slide half-togg le on the top
half-bushes part of the way up should move back and forth.
each axle.

®
L. Push 2-length axles through
the ends of the short steering L.Add the 6 x 1 side beams bearing
plates then complete the pins and fit a short axle with a
'fingers' with 6-length steering toggle in the top , central,
plates and 4 x 1 plates . Use half- half-toggle .
bushes on the ends of the axles
to lock the steering plates to gether.

43
/':,. Fix the gripper onto the end /':,. The completed gripper. Pull
of the arm you have already built. the belt over the front beam ,
Add the bottom plate and the top underneath, then up onto the
plate bearing a half-pin. half-bush. The gripper should
At the front , add the 2 x 1 beam. spring open in a downward
Hook a medium-size belt over position .
the toggle unit.

THE SHOULDER

<J Make up the base of the


shoulder with plates and beams.

'V Place the arm in the shoulder.


It should slide easily back
and forth in the channel.

<J Add the next layers of beams


forming a channel for the arm.
@
Step 15
6. Insert four pins in the 40-
Detail of gear
tooth gear wheel then build the and axle assembly
axle and gear assembly. Mount
the assembly over the arm to
form a 'roof' on the shoulder
unit. By turning the main gear
wheel , the arm should be driven
smoothly in and out of the
shoulder.

For full details of making


the switch see page 18

6. View of the shoulder from the side.

6. Make up the 6 x 1 switch beam then mount it onto the


shoulder. The 6 x 1 beam next to it and the two vertical
beams, fixed on with pins at the base and secured on the
axles with bushes , complete the assembly.

'V Secure the string in the toggle


on the gripper using a pin. Take the string from the
drive unit at the rear of the
arm and pass it over the gear
assembly of the shoulder.
Then mount a motor on top
ofthe shoulder. Fix a small
belt between motor and
large pulley.
45
@

I> Place the completed arm on the base


unit supporting plate . Wire up the
robot to the computer.

Operating hints and tips then need only one battery unit.)
1 To allow the gripper to grasp objects more easily, use 3 If you use pole reversers on the two battery boxes to
draught-excluder tape on the fingers . avoid over-running the arm , you may find that the motors
2 If you interface the arm directly to your computer, you will only drive in one direction. Simply change the position
will need two battery boxes. However, if you are good with of the reverser on one battery box.
electronics, you could use the interface to switch a larger 4 With wires going to all parts of the model, be sure that
'double-pole change-over relay ' (obtainable from an you keep the wiring neat and tidy so as not to foul any of
electronics shop) which will act as a pole reverser, the mechanisms. (We discuss wiring up the base unit on
changing the direction of drive of the motors. (You will page 30.)

To wire up the motors and


switches, separate the
ribbon wires to the lengths
shown .

Shoulder
Gripper

w
o
o
3
3 Base

150mm

46
10 REM ARM CONTROLLER
1
2(:1 F'RT.=56577: F'OKE56579 63
30 MB=16:MS=8:MG=4:D(0 =1:D(2)=2:SW=128
40 DIMB(50),S(50),G(50
50 Ii:t= ::m~I~J!!l" : c:t=
II II nilllllil" PROGRAMMING 1
60 F'R I iH ::']='(1:::: t·IO.
II :E: A:~;E : =';HOULDER OF.: I PF'ER II

7[1 PF.: Hn ":f!I~l'lODE: II Thi s progra m allo ws you t6 teach


1[1(1 PRI iHD:t" :~:;ELECT ": :::::T=O: GCI:::;!...I};:90(1 the arm a series of moves which
11(; IFA:t="T"THEHi'1:t="~ITEACH :RT=:l I!
it can then repeat. It also
1;20 IFA:t="H"THEHt'l:t="r::-i-lot'lE ":F.:T::<~: allo ws you to alter the moves
13(1 I FA:t= F; THEt·Jto1$= ~<lF.:EF'EAT f<:T<:
II II II II :
by going through them one by
140 F'RINTDSMS:ONRTGOSUB200,580,600 one and changing th e position s
150 GOTOI00 that are w rong. You can also
200 F'N=1:00SUB800 insert and delete positions.
21. [1 GO!i:;UB9(10: I FA$=CHF.::t ( 1::::) THENF.:ETl..JPtl The program displays the
220 IFA:t=CHF.:$(29)THENGO~~B280 positions of the base , shou lder
2:~:O I FA:t=CHR$ ( 157) THEt·1CiO:::;UB2:::I O
and arm and the current
240 IFAS=CHRS(148)THENGOSUB300 operating mode . The modes
250 IFA:t=CHRS(20)THENGOSUB330 include Se lect, Teach, Home
260 IFR$=":=';"THEt-lCiO::::UB:::::60
270 GOSUB700:GO~jB800;GOT0210 and Repeat Type in the
2::;:0 Pt'l=F'tl- ':: F'N(50) : GO:;:;J.fE::::::8~-::1 : RETUF.:tl prog ram , SAVE itthen RUN it.
29(1 Pt·l=PtH (F't'f>0) : GCI::=.;ur:::::::=:0 : PETURt~ How to use the program
300 FORI=49TOPNSTEP-l When you run the program , the
310 B(I+l)=B(I):S(I+l)=S(I):G(I+l)=G(I) screen w ill clear and the
320 NE XTI:GOSUB3f~:GOSUB1000;RETURN following display appear :
3:::::0 FOF.: I =F'tH0 49 POS. NO. BAS E SHOULDER GRIPPER
340 BCI)=BCI+l):S(I)=S(I+l):G(I)=G(I+l)
350 NEXTI:GOSUB380:GOSUBI000:RETURN MODE
360 B(PN)=BC:S(PN)=SC:G(PN)=GC SELECT
370 PL=PN:PN=PN-(PN(50):F.:ETURN
380 BN=B(F~):SN=S(PN):GN=G(PN) : GOSUB100G This means the computer is
39Ci F.:ETUPtl waiting for you to select one
500 GOSUB900:IFRS=CHR:t(13)THEN520 of the modes by pressing:
5W GOSUB700:GOT0500 Teaching mode-
520 BC = 0:SC=0;GC=O:PN=0~GOSUB800 : RETl~N Use [jJ [Q]to drive the base
6[11:::1 FORI=0TOPL:BN=B(I):SN=S(I):GN=G(I) [J~to drive the shoulder
611:::1 GOSUB1000:GOSUB800:NEXTI @][[\todrive the gripper
620 GO!;:;UI:90f1 : FETURtl
7t1.~1 t:t·j=BC- (A$=" 3 ") +.:: R$= il E" ) IC~SR I to move to next position
7tO ::,r'l=:::;C --.:: AS= +- (f~$= ~'l/l )
Ii ;;: " ) II
«
ICRSR I to move to previous position
720 GH=GC-(A$=/ll")+(A$="Ct") ~ to insert a position
730 GOSUB1000:RETURN IQ:K::J to delete a position
::IX1 ~'R I tH" ::I~l" ; C$; PH, (:$.; Be, C$; :::;C ., C$:.: GC IRETURN I to go back to the Select mode
.=:10 r::E TURH Homing mode-
300 GETAt:IFR$=""THENqAA Use the keys used in the
310 RETURN - ---
teaching mode to drive the arm .
1000 SP=BN-BC:IFSP=0THEN1020 When you have set the home
1010 ~OKEPRT,MB+D(SGN(SP)+1):GOSUB1100 position , press Return.
11]2[1 :=; p:::~;r·j-SC: I F::::F'=OTHHj 1. 040 Repeat mode-
lJ30 POKEF'PT,~;+D(SGH(SP)+1):GOSUB11~A The arm wil l repeat the moves
1040 SP=GN- GC:IFSP=0THEN1060 -- automatically . When it has
J050 ~gKEF'RT,MG+D(SGN(SP)+1):GOSUB1100 finished , the computer will
1060 Hc=BN:SC=SN:GC=GN:RETURN
1100 FORCT=lTOABS(SP) wait for you ·to press a key to
1110 IF(PEEK(PRT)ANDSW)=OTHEN1110 get back to the Select mode .
1120 IF(PEEK(PRT)ANDSW)=SWTHEN1120
1130 NEXTCT:POKEF'RT,0:RETURN
4
[ USEFUL ADDRESSES & INFORMATION [
Major electronic component suppliers LEGO parts VicRel
Maplin Electronic Supplies Ltd , For spares: Write and mention this book to:
PO Box 3, Spares Service Handic Software,
Rayleigh , Essex, LEGO UK LTD, 5 Albert Road ,
SS68LR Ruthin Road, Crowthorne,
(you will need to apply first Wrexham , Berkshire,
for an order form) Clwyd, LL13 7T0 RG117TL
Maplin also have shops at: Tel : 0344 778800
Lynton Square, Perry Barr, If your school is
Birmingham applying for parts : or from major
8 Oxford Road , Manchester LEGO UK LTD, computer shops
159-161 King Street, Hammersmith , Educational Department,
London W6 Ruthin Road ,
282-284 London Road , Westcliff- Wrexham,
on-Sea, Essex Clwyd , LL 13 7TO
46-48 Bevois Valley Road ,
Southampton
The shops are open 0900 to
1730 Tuesdays to Saturdays.

Watford Electronics,
33 Cardiff Road , Watford.
Herts WD1 8ED
The author would like to thank the following for their help in
preparing this book: Ben Matthews, Malcolm Crocker, CSE
Also look at the adverts Computers (Pangbourne), John Grey, Helen Seymour-Jones ,
in major computer magazines. Robert Solly.

The Interface unit


+5\1 +5\1--,r-rrTT"1----;-----, REL~Y

\",,1
L--02
\",,3 2
L--04
\",,5 3
L--06
.... l§
~7
...~ >--+5\1
'--<>8
....
u
: z~
~'J
(I)

~
:::> 0
5 u
II< '--<>10
~ ~
:::> ~11 6
;!;

~
u
'--<>12 ~
....
+5\1~14 ~
lSI
u
........... 15 <II

17
18 J'J'
~ LIGHT EMITTING DIOOE

1'.1 -c:::::J- RESISTOR

20 .J.. CONNECT ION TO D1GfT~ GROUND

48
ISBN 0-09-942660-9
UK £2.95
Australia $8.95* 00295
Canada $5.95*

I
*recommended price

9 t0099 426608

You might also like