Simple MGL Airtalk reader

Technical questions, advice, sharing information etc (aircraft, engines, instruments, weather and such)
justin.schoeman
Frequent Flyer
Frequent Flyer
Posts: 1234
Joined: Tue Aug 30, 2005 5:25 pm
Location: Pretoria

Simple MGL Airtalk reader

Postby justin.schoeman » Sun Sep 22, 2013 11:01 pm

DISCLAIMER: Works For Me (TM) use with caution. If you break anything, it is your own fault...

With the bad weather today, I spent the afternoon playing on the computer...

I have been thinking of making a simple flight data recorder to work on my MGL Ultra Horizon. Since it is a 19200 baud signal, I thought that a high speed digital audio recording of the bus signal should be usable. So I made a recording, and wrote a script to read it. The results look quite good so far.

You should be able to use any digital device with a microphone jack (Cell phone, tablet, netbook, notebook, etc) to make the recording. The sample rate must be high (only tested on 48ksps, but 44.1ksps should also work). The audio MUST be recorded raw - any compression will destroy the data. Only WAV files are currently supported.

A crude ASCII art diagram of the microphone cable is included below. Uses two resistors and two diodes to reduce and restrict the voltage, as well as protecting the recording device.

Right now, I have only implemented the basic MGL Ultra Horizon master panel comms - which is what I need, as it basically spits out all the instrument information. It may not be 100% accurate yet, as the information available on the MGL web site is not 100% accurate... The framework should be easy to understand, so it should be simple to add any other frame types you may need.

Reading will never be 100% perfect, as typical sound cards can only record at most 48ksps - which is just over twice the bit rate. So there is no time for averaging, or phase synching. I seem to read about 75% of the frames accurately, which is more than enough for most uses.

It is implemented as a simple perl script. Very much a first draft, but it has all the functionality that I need so far. Here is the comment block from the script, giving the basic details:

Code: Select all

# decode.pl
#
# (C) Justin Schoeman 2013
#
# Very crude attempt to read MGL airtalk messages from a digital audio recording of the message bus. 
# Should work on any recording 44100 samples per second, or higher (only tested at 48000 samples per 
# second so far.
#
# Currently the only message frames supported are Ultra Horizon type 1 subtypes 1-3. Others should
# be easy to add.
#
# The one MAJOR todo is autoscaling the edge threshold.  The current code will only work with
# saturated recordings.
#
# Connect to Airtlak bus through the microphone cable:
#
#   MIC o------------------------------WWWWW---------------o Airtalk
#              |    |    |              100k
#              |    |    |              R1
#              Z    _    _   
#       R2 10k Z    ^    V   
#              Z    _    _   
#              |    | D1 | D2
#              |    |    |
#  GND o----------------------------------------------------o GND
#
# R1 and R2 form a voltage divider and current limiter
# D1 and D2 form a clamp and protection circuit.
#
The decoder, and a sample decoded CSV file are attached.
Attachments
decode.zip
Perl reader/decoder.
(5.18 KiB) Downloaded 60 times
ultra.zip
Decoded CSV file
(483 Bytes) Downloaded 49 times
justin.schoeman
Frequent Flyer
Frequent Flyer
Posts: 1234
Joined: Tue Aug 30, 2005 5:25 pm
Location: Pretoria

Re: Simple MGL Airtalk reader

Postby justin.schoeman » Sun Oct 06, 2013 8:49 pm

A new version that includes live decoding for people running a decent OS (i.e. Linux).
Attachments
decode.zip
(5.95 KiB) Downloaded 39 times

Who is online

Users browsing this forum: No registered users and 98 guests