Previous BARG Newsletter Issue 1, Autumn 1984
Next BARG Newsletter #2 pages 8 - 13
BARG Newsletter Issue 2, Winter 1984
BRITISH AMATEUR ROBOTICS GROUP
NEWSLETTER
ISSUE 2 Winter 1984
British Amateur Robotics Group
171 Worting Road
Basingstoke
HANTS RG22 6NR
President Dr John Bi11ingsley
Committee David Buckley
Alan Dibley
Colin Freestone
Peter Matthews
Richard Moyle
Editorial - Richard Moyle
MOTORS - David Buckley
ACES HIGH, a control programme for Hebot 2 - Colin Freestone
LETTERS
Newsletter pages 8 - 13
BOOK REVIEW - David Buckley
Microprocessor Based Robotics by Mark J Robillard
The Robotics Revolution by Peter B Scott
Advanced Robot Systems by Mark Robillard
Practical Robotics & Interfacing for the Spectrum by Dr A A Berk
Basic Robotic Concepts by John M Holland
All matarial in this Newsletter is subject to Copyright
Editorial Richard Moyle
At last, the second issue of the Newsletter, and two apologies. You should have
received this document two months ago. Unfortunately, without articles it would
have been about one page long: Things are looking brighter, as we are now
receiving a few contributions, and the next Newsletter is already under way. This
brings me to the next apology. The promised construction article on sound ranging
using the Polaroid system has to be held over, as the prototype doesn't quite work
yet.
In this issue we have an article about motors, a forth programme for Hebot, a
review of several books on Robotics, and a letters section, We hope this will
become a regular feature, and a main point of contact for members.
We are receiving enquiries from enthusiasts overseas, and feel that we should
encourage membership both inside and outside the UK, so that we can get the widest
possible distribution of ideas. If you have any friends abroad who are interested
in robots, please let them know about BARG.
We would like to make some arrangements for the first heats of the competitions
mentioned in our last Newsletter, We have not, so far, had much response, and a
competition without competitors would not be very interesting. The venue will
also need to be arranged to suit the Majority of entrants, so please let us know
if you would like to enter, and which category or categories interest you most.
If you are not confident about entering a solo effort, why not join forces with a
local group, and enter a joint project.
Several members have enquired about the Innovonics vouchers, and whether a new
catalogue is available. Colin tells me that his catalogue has been reprinted, and
copies are available from Innovonics, 147 Upland Road, East Dulwich, London SE22.
The vouchers can be used, either together or individually, against any purchase
exceeding £10. If any other retailers in the Group would like to make themselves
known, we would happily pass on the information, and if they are able to offer a
discount to members, even better. -:
MOTORS David Buckley
One of the most misunderstood items connected with robotics is the electric motor.
This is unfortunate because, in one form or another, the electric motor is going
to be at the heart of all robots for some time to come. Even if the final
actuators are hydraulic or pneumatic, something has got to introduce hydraulic or
pneumatic pressure for them to work, and most times an electric motor will be
driving a pump. There may in the future be robots which will use replaceable gas
cannisters for power, similar to the system used in some artificial limb, but that
is another matter.
One reason that electric motors are misundsr stood is possibly that most texts
dismiss the small Motors which one can buy in hobby shops as toys, and concentrate
on the pros and cons of shunt, series and compound types of industrial motor
designs. The cheap "tin can" d.c, motors from hobby shops are certainly the same
as are used in toys, but the better ones are also like those used in electrical
and electronic office equipment.
Page 2
The construction of most such motors is virtually identical, consisting of a
pressed steel cup which forms the outer shell (hence the name tin can), with a
moulded plastic end plate which carries the brushes, two ferrite ceramic magnets
to produce the stationary magnetic field, and a three pole rotor and commutator
assembly whose spindle runs in sintered bronze bushes held in end of the steel cup
and in the moulded plate carrying the brushes.
Just for the record, there are some motors with more than three rotor poles -
generally five poles - and some use magnets containing rare earth elements, More
poles make the action of the motor smoother and rare earth Magnets produce a
stronger magnetic field, making the motor more powerful.
It is not advisable to try to take apart a motor; the brushes are very delicate
and easily bent. If a motor has been abused and no longer works, the best course
of action is to buy another, since damage serious enough to prevent a motor
working is usually almost irreparable.
The motors are designed to work from 1.5 to about 12 volts direct current. The
correct working voltage will vary between different types of motor. Using too
high a voltage will damage it. If there are lots of blue flashes emanating from
inside where the brushes are bearing on the commutator, then the voltage is too
high and continued use will cause the brushes to burn away - irreparable damage.
Most of the small motors with two mil1imetre diameter output shafts should not be
run on more than 4.5 volts and preferably not more than 3 volts. The bigger
motors in general require higher voltages.
Under no circumstances should these motors be connected to the mains. The result
will be a bright flash, a loud bang, burning, a completely ruined motor and maybe
a couple of deaths, so don't do it.
The best way of powering the motors is from C cells in a plastic holder. One
thing you will notice on connecting a motor to an appropriate supply is that it
will turn very quickly. It can be anywhere between 6,000 and 18,000 revolutions
per minute (rpm), in other words, between 100 and 300 revolutions per second. The
most efficient speed to run motors like these is at about two thirds of the free-
running speed. This information almost certainly will not come with the motor and
without fancy equipment is difficult to measure.
For a small motor, two millimetre diameter shaft, 9,000 rpm free-running speed is
somewhere about right, giving a most efficient speed of about 6,000 rpm.
All this is very much rule of thumb because, as I said, motor data is virtually
unobtainable and it would be a good school science project to determine motor
curves for the various motors available. The information would also be very
useful to the rest of us.
So if we have to run a motor at 6,000 rpm, what does this imply? Well, this is
100 revolutions per second. If we wanted to drive a vehicle at a fast 300 mm per
second, using 5 cms diameter wheels, the wheels would have to turn round twice
each second, so we would have to use a gearing or belt reduction drive of fifty to
one. If we wanted to move a robot arm ninety degrees in four seconds, then we
should use a reduction drive of 1,600 to 1 (4 x 4 x 100 = 1600).
You could, of course, ignore all this and just try to put the wheel or robot limb
directly onto the motor shaft, but you'll find it won't work very well, if at all;
there are enough problems in building robots without inventing some of your own.
Page 3
It is possible to buy motors already fitted with reduction drives, some of which
are adjustable, so you can set just the ratio you want.
It is important to note that these gearboxes all have limited strength, so don't
expect to set up a large speed reduction or to be able to stop the output shaft
without damaging the gearbox. If you do succeed in stopping the output shaft, you
will invariably find that the motor keeps running and inside the gearbox is a
number of broken bits of plastic.
Earlier, I mentioned blue flashes from the brushes and commutator. These are
caused by the brushes moving from one commutator segment to another and briefly
breaking the electric circuit. The rotor of the motor is a set of inductors and
when the current through an inductor is broken, a large voltage is generated
across the inductor, and this is sufficient to cause the sparks. Even when
running on the correct voltage, there will still be some sparks, although small.
These sparks cause electromagnetic interference, which can affect any nearby
computer. Even when you can't see any sparks, because the voltages are not high
enough to generate them, interference will still occur. The continual breaking of
the circuit also sends voltage pulses back into the supply leads, causing further
interference. Fortunately, there are some easy ways of reducing the problem of
interference.
First, earth the motor case by connecting it to Ov. Note, there are some motors
which have one brush already connected to the motor case, so check first with an
ohmmeter.
Second, connect a 0.1 uF capacitor directly across the motor terminals.
Third, connect a high current inductor, a choke, in each motor lead. One end of
the choke should be connected directly to the motor terminal and the other end to
the motor supply wire.
Most of the chokes available from electronics suppliers are high impedence low
current types, totally unsuited for use with a motor. The smallest hobby motors
will draw about half an amp, while the bigger ones take maybe up to ten amps on
load. Maplin do three suitable chokes called RF Suppressor chokes. They come, in
1 amp, 2 amp and 3 amp rating and these are ideal for the smaller motors, For
those with Radiospares accounts, they also do them and cheaper.
Fourth, to limit the high voltage that appears across the motor terminals, wire
two diodes from each terminal, one to each of the power lines, reverse biased, of
course. This will ensure that the induced voltage cannot go higher than the
supply or lower than the zero volt line by more than 0.6 volt in each case. The
end result will be a circuit like that in figure 1 below.
You may find that with a particular motor you don't need all this suppression and
everything works all right. On the other hand, there are motors that are so
electrically noisy that no amount of suppression works and the only solution is to
try another motor. Often, only the first three actions are will suffice, though
if you are using transistors to switch the motor, you should arrange to have at
least one diode across the terminals, to protect the transistor from damage.
I hope this brief look at d,c. motors solves some of your problems, if not all of
them, and allows you to get on with business of building robots and not having to
struggle with the mysteries of a crashing computer, or a motor that refuses to
turn.
Page 4
ACES HIGH FOR HEBOT A control programme for Hebot 2 Colin Freestone
Here is a listing for the Jupiter Ace Forth micro to control Hebot 2, running in
just over 1.5K, As the unexpanded Ace provides less than 1K of Memory for user
code, a RAM pack will be required. The programme assumes a bi-directional I/O
port addressed as port 1, though this can be changed by altering the value of
variable "port". Hebot requires eight bits for its microswitch impact detectors.
The programme was written as the basis of a roam-mapping exercise. Hebot will run
forwards until an obstacle is encountered; its reaction is to back away from the
obstacle, turn approximately 30 degrees right and continue forward. After five
impacts/right turns, the next impact will cause Hebot to rotate 30 degrees to the
left four times. At that point pseudo-conversation between the host computer and
the mobile takes place and a summary of turns to date is displayed.
The routines can be interspersed with counting and memorising routines. The four
variables would be read from within the main loop and more intelligent decisions
based on their running totals.
Ace/Hebot control illustrates three elementary but easily overlooked points.
1 The data present on the output latch of the I/O port stays valid until it is
changed under programme control, thus the duration of a valid command must be
determined by a timing loop. For this, the Forth word DUR requires the loop
limit to be placed on the stack and it follows that a stop or new move instr-
uction must be sent to the port, even after the timing loop has completed.
2 The number of right turns to left turns must be uneven or the Machine will
bump fruitlessly into the same obstacle field indefinitely.
3 The uneven number of turns enables Hebot to roam at least once round a given
area without tangling its cable to the computer.
ACE/HEBOT CONTROL PROGRAM XXX
Code Comment
Variables
1 variable port Port number
0 variable ltns No of left turns between
reports
0 variable rtns No of right turns between
reports
0 variable ttns Total no of turns since
start
0 variable turn No of turns (left or right)
between reports
Output Control Codes
: fwd 5 port out ; Both wheels forward
: fd fwd dur s ; Forward till stop
: back 10 port out ; Both wheels reverse
: bk back dur s ; Backwards till stop
: rr 6 port out dur s ; Rotate right about centre
: rl 9 port out dur s ; Rotate left about centre
Page 5
: s 0 port out ; All robot devices off
: siren 80 port out 2 dur 208 port out 2 dur ; Horn high/Horn low
: dur 1000 * 0 do loop ; Timing loop (DURation)
Input Control Code
: sens 240 part in-negate ; Low nibble set all high
impact will take bit low
Screen output
: ms ." ACE calling HEBOT" ;
: bleep cls ."HEBOT TO ACE !" cr cr ."PROGRESS REPORT REQUESTED.. ,"
5 0 do 64 port out 2 dur 208 port out 2 dur s loop Siren effect
cls ms 478 478 478 478 426 379 358 319 358 379 426 478
12 0 do 200 beep loop ; ACE beep command parameters
: report bleep cr cr ."PROGRESS SO FAR :" ACE report ' to HEBOT '
cr cr cr cr ."NO OF RIGHT TURNS : "
rts @ . cr cr ."NO OF LEFT TURNS : "
ltns @ . cr cr ."TOTAL NO OF TURNS : "
ttrts @ . 15 dur cr cr cr ."OK HEBOT ?"
10 dur 208 port out HEBOT'S reply
1 dur s 1 dur 208 port out 1 dur s 5 dur ;
: h begrn inkey 32 = until cls ; Keypress ' wait '
Driver routines
: go cr cr cr cr ."SEEKING..." Drives robot forward until
impact
begins sens 0 = while fwd repeat ;
: avoid cls turn @ 1 + turn ! turn @ 5 < Avoiding action routine
if
cr cr ."RIGHT TURN NO " turn @ . cr cr "TOTAL RIGHT TURNS : "
Right turn no
rtns @ 1 + dup . rtns ! Increment right turns
5 bk 5 rr 5 units back 5 to the right
else turn @ dup 4 > 9 < or More than 4 turns so left
if
cr cr ."LEFT TURN NO " turn @ 4- . Readout of current left turn
cr cr ."TOTAL LEFT TURNS : "
ltns @ 1 + dup . ltns ! 5 bk 5 rl Increment left turns
then
rtns @ ltns @ + ttns ! Sum right & left turns
then
turn @ 8 > No of turns between reports
if 0 turn ! report then ; Set current turns to zero
: bp begin go siren avoid 0 until ; Main loop forever until BREAK
: pr cls 0 dup dup dup rtns ! ltns ! ttns ! turn ! intro h cls bp ;
Optional introduction
: intro cls invis ."HEBOT CONTROL"
cr cr cr ." In this routine HEBOT will take"
cr cr ," simple evasive action on"
cr cr ," collision with an object"
cr cr cr ." IN EMERGENCY; PRESS SHIFTED"
cr cr ." 'BREAK' AND ENTER 'S'"
cr cr cr ." OK, Master,"
cr cr ." Press SPACE to start me..."
h bp ;
Page 6
LETTERS
As two keen but naive robot builders, new to the world of electronics, we've come
across problem. We want to use a motorcycle battery to drive the motors of our
robot, controlled by relays triggered by a BBC micro's user port (via a Darlington
chip), we need one ON/OFF and one double-pole changeover relay for each motor.
Unfortunately, the relays we've tried either won't trip over when told to by the
Beeb, or arc and burn out from the 12V 0.5-1A power, Would diodes solve the
latter problem? If not, what can we do? We noticed the article on the Zylatron
mentioned opto-isolators - what are they and how do we use then? Also, how
would one go about building a regulated distribution panel to run from a motor-
cycle battery" These might be suitable themes for articles in the newsletter, if
anyone knows the answers.
Steve Mansfield & Doug Selway (Stellar Cybernetics Ink), London E9
Building moter control circuits is, as you have discovered, somewhat harder than
it would appear. Everyone has trouble - even if you can switch the motors, you
still have the problems of speed and directional control. From your description
of the relays. I assume you are using a circuit similar to that shown in figure 1,
where the changeover relay is used to change motor direction and the other for
stop/start. This is perfectly feasible and should work provided the relays have
the correct rating for the motor current, and with the addition of reverse diodes
to protect the transistors. The arcing is caused by the reverse voltage generated
when the motor current is switched off, and it is probably this which is burning
out the relays, as it is the making and breaking of the circuit which does the
damage. Diodes help to limit the reverse voltage to a safe level. The relay
coils themselves are also inductive, and you should fit diodes to protect any
driving transistors. Another difficulty is that the stall current of a motor is
much greater than the running current, so the choice of relays must take account
of the motor jamming for any reason. Fortunately, most relays will happily carry
a much greater current than they can switch. One problem with using a darlington
(see note) array is that the BBC sets the user port lines as inputs when first
switched on, and the darlingtons may accept this condition as a high signal, and
switch on the motors,
Apart from these considerations, you are actually using too many relays, as you
can get the same effect by usinq the circuit of figure 2. Here, the two output
lines are used together to control the motor, both high or low stop the motor
(very quickly by the way) while one high and- one low will turn the motor in one
direction or the other. The relays should be rated for at least 1 amp, 3 for
preference, if you use the circuit as it is. Even so this is probably cheaper
than the two original relays with equivalent ratings. By placing a power tran-
sistor in one lead from the relay assembly, you can provide speed control by
pulsing the transistor, and protect the relays by ensuring they are switched only
when the transistor is off. 1 Amp relays would then be perfectly suitable.
Opto-isolators are devices containing a LED and a photodevice (usually a diode or
transistor, but triacs have also been implemented for mains control). The LED is
connected to the output from the computer, while the photodevice is part of the
circuit to be controlled. Switching the LED on or off therefore affects the
output circuit with no electrical connection between the two. These devices are
available, in single double and quad packages, frorn suppliers such as Maplin and
ElectroValue
Page 7
BARG Newsletter #2 pages 8 - 13