Your
processor must be able to talk to the outside world. In particular, you
will need to be able to control the motors, listen to any odometry sensors,
drive the sensor emitters and read the sensor results.

When you choose your processor, you might be constrained by the amount
of I/O that your micromouse needs. If, however, you are dead set on using
a particular controller, you might have to exercise a bit of care in getting
enough functionality out of the available pins.

There are a number of tricks for saving precious I/O pins. you can multiplex
functions to pins. For example, the same pins can be used for reading
a keyboard and driving an LCD display. Some other ideas are shown below.

Motors
For convenience, you might want three or four bits to control the motors.
For analogue motors, each will need a bit for direction and each will
probably need at least one bit for power. More sophisticated designs might
use an entire byte to specify speed and direction for each wheel – perhaps
using a (weighted) 2’s complement value. With latches for the driver circuits,
you could use the same port for two such channels.

Steppers can be driven with four bits. One for each motor for direction
and one each for stepping direction. Alternatively you could use four
bits each to generate the phase drive signals directly from the processor.
Since stepper drivers wth all the clever bits are not more expensive or
complicated to use than direct drive, I don’t think there is much to be
gained here.

With either drive option, it is probably a good idea to be able to isolate
the motors from the battery. Not only will this save a lot of power in
stepper designs, it could stop all that smoke from escaping after a crash.
You really should put a fuse in the power line to the motor by the way.
Resettable polyswitches are just fine.

Overall, reckon on at least four bits and possibly eight or sixteen if
you are keen. Five is, perhaps, best.

Odometry
With DC motors, you will need some kind of counter or counters to see
how far you have gone. Tricycle mice can get away with just one on the
steering wheel if they don’t want to have closed loop control for the
motor speeds.. Wheelchair mice need one on each that can do both odometry
and closed-loop speed control. Those clever four-wheel mice tend to need
lots of sensors – perhaps six for many designs.

Counters are best if they are directional and that will need two lines
per counter. Ideally, your mouse will have built-in counters and you canconcentrate
on signal conditioning with the sensor lines going straight to the counter
inputs. Without that, you will have to poll the sensors. This can be time-consuming
as you will have to check the encoder often enough to be sure of not missing
a count. Yet another task for an interrupt service routine.

If you want to show off with multi-proccessor mice, how about using a
PIC (or whatever) to look after odometry. It could present the controller
with a distance travelled as a serial or parallel loaded value on demand.

Steering
Tricycle mice and those four-wheel micromouse designs need some way to
know where the wheels are pointing. Encoders can work here but they represent
yet more time-critical work for the processor. If you have analogue sensors,
you can use a feedback pot and build a software controlled servo loop
for the steering. Among other odd advantages, you could create software
controlled Ackerman steering geometry. If you wanted.

Wall sensors
The emitters for you IR sensors will need to be flashed on and off. Leaving
them on permanently will drain the battery and deprive you of the benefits
of AC coupled sensors.

If you have look-down arrays, join them in banks. Eight emitters can
be driven using a single pin and a couple of transistors or part of a
driver chip. Bear in mind that LEDs may have a forward voltage drop of
1.2 to 2.2 volts so you will need a high supply voltage to drive many
in series. They may also need a considerable current for reliable reflective
detection.

The receivers can all be connected in parallel to a single port so eight
pins will probably be plenty. Parallel-in-serial-out shift registers can
be used where there are a lot of sensors and not many input pins. there
are lots of ways to arrange this. Sixty four inputs can be read in eight
operations using an eight pin input port and a single output pin to clock
the registers. AC coupling the pins means the results are very time sensitive.
You might use latches or careful interleaving of sensor banks.

Analogue wall distance sensors pretty well demand analogue inputs but
you could achieve a similar result with an analogue comparator. You could
build an A/D convertor in hardware or software. Analogue results can be
obtained by timimg the length of a pulse – simple enough but time critical
so watch what your interrupt service routines are doing.

Summary
There are plenty of pins on just about any processor if you are careful
enough. However, you might want to pick a processor with all the necessary
I/O on board and save a lot of design effort. Your choice.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.