One of the outstanding features of autoCut is the ultrasonic positioning system. Since no other (lawn mower) robot I heard of has this feature it's a tough one. I posted a sketch on how this could work and I set out to make a proof of concept.
After some tinkering it works very well, here's a demo:
This is how it works:
The signal on top is the one fed into the ultrasonic transmitter. It is 40KHz as long as data is transmitted, and on every 1 there is a phaseshift of half a period (waves get inverted). On the oscillating receiver this causes the amplitude to drop to 0 and then start rising again. So 1es are where the amplitude is zero (blue dots) and 0 are where the amplitude remains high (red dots).
In this case the data stream is 01100011, written in correct binary: 0b11000110 (least significant bit gets transferred first).
The signal of the receiver gets amplified, one-way rectified and buffered by a capacitor. This creates a signal the represents the amplitude of the received signal.
With the help of a small phaseshift (caused by resistor+capacitor) comparator creates a digital signal which indicates when a signal starts rising or falling. Now when the amplitude is ~0 and starts rising again, the digital signal switches from low to high. Under friendly conditions this is enough already to decode the data stream.
To make sure that the switches from low to high are valid 1es (amplitude must be near zero) another comparator is used to create a signal representing the level of the amplitude. To receive a valid 1 the flank from low to high must occur AND the level of the amplitude must be zero. As you can see I also introduced a small XOR-checksum, which will be extended to 4 bit due to occasional false data (2 bit: 25% chance that checksum of corrupted data stream happens to be right).
So far I'm pretty satisfied with the results. Improvements I'm working on:
- use MAX232 as amplifier for the transmitter
- use better receiver/transmitter capsules
- use a better operation amplifier for the received signal (CA3140 so far which can't do rail-to-rail -> 2-3V max output on 5V power supply)
- Get bidirectional data transmission and distance measurement working
- work out a way to spread the sound into all directions