This website portrays the development of a LIDAR altimeter based voice
assistant for LSA/Microlight plane use (my own "Barking Bob").
Note: This is currently a work in progress, so stay tuned.
DISCLAIMER: This is a hobbyist project that is not meant for use as a safety instrument. This is a purely informational assistant system that does not guarantee for accuracy. I cannot claim any liability for its use, if you choose to replicate this build, you are doing so at your own risk!!
In hobby aviation sometimes you think about your own landing technique, especially when you're flying different classes of aircraft (like gliders and microlight/LSA) which have operational differences when landing. When considering the technical implementation of landing aid available, like the spoilers mostly used in gliders are working completely different from the (Fowler) flaps used in microlight/LSA that influence the planes behavior in lading significantly.
Therefore you come to envy commercial aviators that have this automated computer voice calling ou the altitude during final descent. My goals was to bring this convenience to hobby pilots.
Using a commercially available LIDAR module by Garmin it is nearly trivial to integrate a laser distance sensor into micro controller applications.
Back in the day, the only laser based distance measurement device available to the common public was the "Disto" made by Leica. Today you can buy a rather small module that has a claimed range of up to 130ft. Both of these technological marvels use a laser impulses travel time and give you the distance to a target. In this case hopefully it is the ground.
LIDAR Altimeter schematic
The PWM signal from the μC is smoothed out by R1/C8 to create an audio waveform for use with the op-amps.
The only really interesting part is the option of a fully differential
sound output here if C10/C11 are not populated, and Tr1 is a simple 600
Ω audio transformer, which could even be salvaged from an old telephone.
The one used in this model has been bought from a major german
Alternatively you could also populate C10/C11 and leave Tr1 out to get single ended audio output, which might be more susceptible to electrical noise pickup.
In order to not have two power rails (one positive and one negative), the PWM output of the μC is idling at 50%. Therefore about 2.5V are to be seen at the output of U3/A, the opposite side of the transformer is held at about 2.5V by the other part of the op-amp that simply uses a voltage divider as a reference.
The menchanical design of this device has some more constraints compared to my other projects, namly:
- Simple mounting: Minimize amount of holes in the fuselage
- Water protection: Ingress of potential rain water should be avoided
- Low drag: Mounting the device to our LSA should not create too much drag which would lead to decreased fuel efficency.
Therefore a droplet shaped case was designed using OpenSCAD, which should help with the aerodynamic drag. The lenses of the LIDAR module go through the flattended bottom of the device, as shown above. This will propably be covered with a disc of acrylic glass (depends on how well the LIDARs wavelength can propagate through it).
On the inside, there are eight cylinders to mount both the LIDAR unit and my own PCB.
The whole device will be installed on the aircraft using four small M3 type holes.
Code for the microcontroller
The micro controllers job is to translate data aquired from the LIDAR module using I2C- to voice output.
In order to quickly build a simple prototype, an Arduino Nano was used. Especially implementing the I2C communication was quite simple, as Garmin supplied open source libraries to communicate with their units.
More challenging is making such an 8 bit micro controller speak. Sure, I could have used an SPI flash to store samples, but this would increase the BOM and I tried to keep the circuit as simple as possible..
The current code iteration uses quite a long established scheme of encoding speech data: LPC (Linear Predictive Coding), which was e.g. the basis of the classical Speak’n’Spell toy. The "Talkie" library for Arduino implements a TMS 5220 compatible LPC bitstream decoder that plays the audio back through the AVR's PWM facility.
In order to encode audio into a TMS 5220 compatible bitstream one can either use the mac programBlueWizard (https://github.com/patrick99e99/BlueWizard) or my cross platform python port PythonWizard (https://github.com/ptwz/python_wizard). The speech samples them selves where created using the very powerful "say" command in macOS.
Also, it is not trivial to create a nice and smooth height value out of the quite noisy LIDAR information. The module returns its height in centimeters, which makes for a nice resolution and some headroom to work with when averaging. Currently the height processing works as follows: A burst of maximum 15 height measurements is triggered within 1/3rd of a second. All values under 10cm and over 5000cm are currently discarded immediately. The resulting values are sorted in descending order, if at least five values are valid, the calculation proceeds. As it seems the LIDAR makes most mistakes towards the lower end of measurements, guessing the hight too low, the third biggest altitude is taken for further calculation. The resulting height in centimeters is converted to feet and passed to the speech routines. During its maiden flight, all raw values where sent to my laptop on board of the plane. These have been used to fine-tune the algorithm described above.
The plot above shows the results of the post processed raw data of the first flight. The profile looks a bit strange, because the terrain before the runway consists of quite a high forrest, a small valley and quite a steep slope up towards the airfield. All of which has been quite well detected here.
All sources are available from https://github.com/ptwz/lidar_altimeter.