John Hallam, 25 Feb 1994.
In this supplement to paper 1 I discuss some design decisions for our putative robotic cat project. These design decisions reflect my thinking since our last meeting and suggest some ways to proceed and some implications for the sensory systems of the cat -- the latter hopefully go some way toward amplifying the bare descriptions of sensors that people have been signing up against for electronics practice. The main problems in designing mobile robots concern weight and power supply. Using the Lego technology will allow us to keep weight down, since the plastic components are both light and strong. However, the complete machine is going to weigh around 3Kg once all its sensors etc. are in place, and this is too heavy for the Lego motor to move easily. Lego gears have a tendency to reduce themselves to powder in the course of normal operation and so are unsuitable for long-term autonomy experiments. We therefore need a more resilient motor system and, to carry the vehicle and motors, a strong light chassis. For the former, I suggest we use 12V motors with integral gear boxes, from RS. These motors, according to the catalogue, come in a range of speeds and torques. To choose one, suppose the wheels of the vehicle are 8cm in diameter and thus about 25cm in circumference. If we want the cat to be able to move at a top speed of about 50cm per second, the wheels must spin twice per second; fortunately there is a motor with a 130rpm normal speed (gearing of 30:1). This motor generates a maximum continuous torque of 300mNm which corresponds to a force of 7.5N at the wheel rim. If the wheels do not slip, the two motors (assuming a tricycle topology) generate 15N between them and can accelerate the cat at 5ms^-2 or 0.5g, which is reasonable. So let's go for this motor. Its electrical resistance is ? ohm, which means relatively little power is wasted as heat (so the motor will run cool and the cat will not need an unreasonably large power supply system). Its only disadvantage is that it costs about 40 pounds + VAT, but then you get what you pay for... For the latter, a good structural material is perspex. Light and strong, a 6 or 7mm sheet of perspex would carry the motors without distorting and Lego superstructure could be built on top of it. The motors are such that their axles could carry the weight of the cat (so David Wyse assures me from looking at their picture in the catalogue) so mounting them can be quite straightforward. This gives us a plausible sketch design for the basic hardware. We need to provide 12V power for the motors and store a reasonable amount of energy so that the cat's waking life is a fair proportion of its total. The power supply technology we'll consider is lead-acid secondary cells. This is the same as that used on the Lego vehicles and has a number of advantages: it gives a fair power-to-weight ratio (equal to nickel cadmium cells for example); the cells can be recharged from any state and exhibit no memory effect (the effect where a cell recharged after a partial discharge is only capable of partial discharge thereafter); and the cells are convenient shapes and sizes able to be mounted in any orientation. How much energy do we wish to store? As much as possible, of course. But how much will the cat need? We can calculate as follows. A Lego vehicle brain brick, which we'll assume as the basic processor for the cat at the moment, uses about 400mA in its fully active state, and this is drawn at 5 Volts. Thus it requires 2 Watts. The motors might draw 300mA each on full load (according to their data sheet) which amounts to 4W each. Allowing another 5 Watts, say, for sensory and other peripheral equipment on the cat, we have a power drain of 15 Watts total of which 8 Watts is needed at 12 Volt and 7 Watts at 5 Volts. Power conversion technology allows us to generate 5 Volt from 12 Volt with about 80% efficiency, so the 7 Watts at 5 Volts becomes 8.75 Watts at 12 Volt. We are now in a position to calculate the current drain on a 12 Volt battery. The total power used by the cat is 16.75 Watts which at 12 Volt amounts to about 1.4 Amps. The battery must be able to supply this for a reasonable period of time. 12 Volt dryfit batteries come in a variety of sizes, and a 2.1 Ampere-hour one would be able to supply 2.1 Amps for 1 hour, or 1.4 Amps for 1.5 hours. With such a battery the cat would have a waking lifetime of about 90 minutes. Lead-acid batteries can be recharged in cyclic applciations (where they are alternately charged and discharged) in around 4 hours, giving about 27% of the time awake, which sounds about right. A 2.1 Ampere-hour 12 Volt battery weighs around 0.8 Kg, and accounts for around one quarter of our mass budget: still reasonable. So, we are now considering a 12 Volt lead-acid cell for main power. The power controller will therefore need to contain a charging controller for such a cell and an efficient power convertor to generate the 5 Volt supply for the bulk of the cat's circuitry. Neither of these presents any serious electronic problem. It would also be nice if the cat were equipped with a means of recharging by basking in the sun -- a solar cell. This makes things more interesting since it gives the cat a reason for basking in the sun (if it can find any) but also provides alternative sources of `food' which is ethologically more interesting. Solar cells in the RS catalogue suitable for the cat generate around 8 Volts on load, so a second power conversion system will be needed to raise this voltage to around 14 Volts to charge the lead-acid battery. This also presents no serious problem. (Lead-acid cells have a nominal voltage of 2 Volts. This is a function of the chemistry of the battery. The typical charged cell actually achieves 2.3 Volts and can be held at this voltage forever without damage by the application of a small current (trickle charging, this is called). A cell undergoing cyclic charge and discharge could be charged to 2.5 Volts without damage. The 12 Volt lead-acid battery consists of six cells in series, so its trickle charge voltage is 13.8 Volts and its peak voltage for cyclic charge is around 15 Volts.) Motor control for the cat will be similar to that for the Lego vehicle, but it would be nice if the cat could use full proportional speed control of its motors rather than the five speed scheme the Lego vehicles use. The motor drivers for the Lego vehicle should be capable of handling the 12 Volt motors planned for the cat, being able to drive about 10 Amps peak through the motor, with a little adjustment to the current limiting protection in the drivers. We can provide full proportional control by constructing an extra motor processor board to supplement the basic drivers. This would generate a switching waveform (a `square wave') with a varying mark to space ratio -- i.e. it would generate a pulse of variable length at a regular rate. Varying the pulse length would vary the effective speed of the motor being driven by that pulse train. What sensor systems should the cat possess? Really, we should design the sensor systems on the basis of the competences the cat ought to have. With that in mind, basic competences include getting about on D/E floor without falling downstairs, getting trodden on or trapped. Next, it need to be able to dock with rechargers and recognise when there is one near enough to be useful. Then it must be able to communicate with humans and with others like itself. Playing with objects requires manipulative skill and an ability to recognise potential objects to play with. And the cat needs to be able to detect when someone is being attentive to it. Finally, it would be an advantage to detect and track patches of sunlight for recharging. These competences suggest a variety of sensor systems. First, it needs whiskers. Whiskers allow the detection of obstacles, measurement of clearances and detection of intrusions into the cat's personal space. If we include non-contact proximity sensors such as active infra-red sensors to take part in the whisker system we can implement a sophisticated proximity detection system. For whiskers we can use the new bumper design which will allow direct contact switches, whiskers like those on Alder and Cairngorm, and short-range binary active infra-red sensors to be integrated in an efficient uniform bus structure. This system is already under investigation and construction in the workshop. Recognising rechargers is easiest if they emit some particular signal which the cat is able to detect. This might be an infra-red signal or a sound signal, or even a magnetic field. It's probably easiest if it is a magnetic field, since that requires no energy to establish, is fairly long range, and is easy to detect. (Magnetic flux patterns are used by many species for long-range navigation, migration and other spatial sensing tasks.) There are two ways to detect magnetic fields worth considering, since the use of superconducting quantum interferometric methods requires liquid helium and we won't be moving fast enough to see any appreciable effects from electromagnetic induction. These are the hall effect and the flux-gate compass idea. The hall effect generates a voltage across a semiconductor sensor proportional to the external magnetic field (because the field pushes the moving charges in the semiconductor to one side rather than the other, causing a voltage difference) and it's possible to buy integrated circuit sensors from RS that allow one to measure magnetci field in this way. The flux-gate compass works on a different principle. When a magnetic field is generated in a material using an electric current, eventually the material becomes `full' and can accommodate no more magnetic flux. Imagine a toroidal magnetic core. On one side of the ring, the external magnetic field lines up with the internal field while on the other side of the ring it lines up in reverse with respect to the internal field. Thus one side of the ring becomes `full' of flux before the other as the internal field is increased and this difference can be sensed. Furthermore it's possible to determine which part of the ring the effect takes place in, so the direction of the external field as well as its size can be measured. Clearly the circuitry required to do this is rather more complex than the linear hall-effect sensor. Provided the linear hall-effect sensor were sufficiently sensitive (a matter for experiment or a consultation of the reference books) it would be possible to measure the earth's magnetic field as well as that of recharging points and give some sense of direction to the cat. Precise recognition and docking with a recharging point might be handled with another sensory system or, indeed, the magnetic one might be used for that purpose and an alternative used for long-range detection of recharging points. For communication, the most plausible medium is sound (motion the cat can already use, tactile stimuli it can detect). This opens up the field for sound detection and communication systems. These two share a common front-end, in that the cat will use a microphone (or more than one) to listen with, and the signal from the microphone must be amplified to be usable by the auditory processing built into the machine. The amplifier is not quite as simple as it might appear, though, because it needs to incorporate AGC -- automatic gain control -- to allow the cat to cope with load as well as quiet sounds. the peripheral auditory system, then, will comprise one or more microphones together with some controllable amplification and perhaps filtering to restrict the range of sounds the cat attends to. All of these peices are standard building blocks in electronic circuitry. After the amplification, systems diverge according to purpose. For example, i reckon the easiest way to implement communication is to use the Dual Tone Multiple Frequency (DTMF) technology that makes touch-tone telephones possible. There are a variety of receiver and transmitter chips for this; Gillian has been considering them. the nicest of the transmitters is physically small (an 8 pin package), interfaces with the same communications bus the Lego vehicles use (the I-squared C bus), and also generates a range of musical tones. She has designed an output system for DTMF communications. The input system remains to be designed, and would consist of a receiver chip together with an interface to the cat's brain. this is a mixed software and hardware project, probably involving programming one of the PIC microcontrollers (simple 18 pin computers with lots of I/O pins and a small amount of program and data memory). Gillian is in charge of this one... A second possibility is to use sound to detect interesting events in the environment, for example by responding to loud or sharp sounds or by localising sounds in space. The former is easy: one simply looks at the average volume of sound received and reacts on sudden increases -- the peripheral processing will compensate for a sudden loud sound that continues (e.g. a vacuum cleaner). The latter is harder, since localising sounds with a sensory system the size of the cat must rely on phase discrimination rather than amplitude, unless we design pinnae for the cat. To do phase discrimination we'd need to delay the sound signals from each microphone (there must be at least two) and cross-correlate the with the undeleayed signals from the other microphone(s). This will work only for a restricted range of frequencies determined by the physical separation of the microphones but will give an indication of the direction to the sound source if it is localised in space. in terms of electronics this is rather more complex, but the basic machinery can be built out of the same kind of technology as is used to provide reverberation effects in PA systems. A really neat idea would be to make ears like a real cat's: steerable pinnae that turn to focus attention on interesting noises. The main difficlty here, aside from building the steering reflexes, would be to make ears that moved fast and quietly -- no point trying to attend to sounds if moving your ears induces so much vibration that you can't hear them any more! Finally, a related sonic system is ultrasonic ranging. Here, the sensor emits pulses or a continuous tone in the ultrasonic range, normally at 40kHz, and listens for echoes. The time between emitting the sound and hearing the echo tells you how far away the reflector is. Complications include the fact that most objects that reflect at all behave like silvered mirrors at 40kHz (since sound goes at 330m/s in air at room temperature, the wavelength at 40kHz is large compared to most surface structure). Measuring time of flight to first echo is easy, as is generating pulses or continuous tones. Doing more sophisticated things is proportionately harder. For instance, if you emit a continuous tone, a good trick is to modulate it with a long-period pseudorandom stream of bits; you can then use correlation to disambiguate echoes you receive. None of the circuitry for doing this is unduly complex, thought here are a few tricky bits. The transducers for 40kHz ultrasonic systems are small and inexpensive. To interact with humans the cat must be able to detect them and one easy way to do this is using heat. Pyroelectric materials generate electric fields when heated and can be used to detect radiant heat: the principle is used in burglar alarms and the sensors for that can be obtained readily. They detect moving heat sources and need only simple interface circuitry to connect them to the brain brick. Detecting and tracking sunlight can also be managed using off-the-shelf sensors. Light dependent resistors, used in the Lego vehicles, change their electrical resistance depending on the intensity of light falling on them. They are rather slow to respond to changes in illumination, but that would be fine for tracking the sun. An alternative is to use a light intensity to frequency convertor, which can handle five decades range of light intensity values; again, such items are easily available and straightforward to interface. For sunlight tracking, the cat should have light intensity detectors at various places on its body so that it can see the motion of patches of light over its surface. Perhaps the most complex sense is vision, and it's unlikely we could build into our cat anything approaching the sophistication of the visual sense of the real animal (especially since it isn't really understood how vision works). however, apart from simple light level sensors we can get 64 element strip cameras which need a little timing and conversion circuitry to allow a linear array of 4 bit pixels to be collected and processed. Simple reflexes in the sensor could be implemented to compensate for changes in light level by varying the sensor integration time; the strip camera could be used to detect vertical or horizontal lines in the environment, to measure colour, or to look for bright and dark regions. Together with optical fibre they could be used to implement a touch pad of some kind, like a pattern sensitive fingertip. Problems that remain are how to detect stroking (a warm, rhythmically moving, nearby object), how to identify and manipulate objects, and of course how to control all of this!