PDA

View Full Version : Gables VHF NAV radio interfacing (howto guide)



Brodhaq
09-02-2013, 01:13 PM
This is my short description how I have interfaced our VHF NAV from DC-9. For full-res photos and our other project related things visit Czech DC-9 project (http://www.dc-9.eu)

Result:
http://www.youtube.com/watch?v=3POaSXyhPas

On the following picture you can see the inner structure of the NAV radio from Gabels. The radio consits of two identical halfs - left and right. Each half includes frequency drums (what you can see, the numbers), seven encoders and two rotary knobs - one for whole part and one for decimal part of frequency. When you turn the decimal knob you move the frequency drum and also the encoders. Using the frequency select switch you can determine which frequency will be active. Above the frequency drums are green light bulbs showing the active one - they are 5V.


https://lh3.googleusercontent.com/-yNA6aLnDuls/Uh3OAojb8JI/AAAAAAAAATw/5AUfHHgmv5Y/s400/P8281033.png


Gables encoders
Here you can see a photo of one of our encoders. There are four of them for fraction part of frequency and three for whole part. On this example you can see the whole frequency encoder. Connecting this thing to your joystick card is pretty easy, the GND pin leads to your common ground, and the other pins are the buttons signal pins. When connected to (for example) Leo Bodnar card you can see this encoder in Windows as 10 buttons - only one of them is pressed at each time which determines the tuned frequency. In the radio there are much more encoders then what you need so we have used only: this one for whole part, two of them for decimal part - first number, and one special for decimal part - last number (which is five or zero). The exact wiring depends on your joystick card - just keep it simple, you only need individual button press combinations for each possible frequency, the rest is the matter of software. When working with the encoders pay special attention to them, they are fragile! Do not apply great force on them. Good thing is that they are very well heat resistant so soldering the wires on contacts is easy, the material surrounding the contact doesn't melt.


https://lh5.googleusercontent.com/-tSkB1qWDpEw/UiSzmqCaj0I/AAAAAAAAAUo/9G7UYNLk9NM/s400/P9021038.JPG


Joystick cards
I have chosen the MJ16 joystick cards manufactured by my friend in "micro" version which are the smallest joystick cards I have ever seen. You can find many information about them on google, they are not commercial product, people make them at home. They are cheap, easy and reliable. You can also use the Leo Bodnar cards which are similar and I think that the BU0836A could fit into the Gables unit. The Bodnar's BBI32 is too big and you would have to mount it outside of the radio box which I don't like.


On the following picture you can see some versions of the MJ16. We have used the smaller one:


https://lh6.googleusercontent.com/-W5y5-7dZITs/UhoioZDuKII/AAAAAAAAASE/gSFLoJReSmg/s400/599256_3460162399700_1044456153_n.jpg


What to do if you connect multiple same units to your computer and you don't know which is which? Easy task for Windows register editing. I use the USBView utility (freeware, google it) which can display information about everything connected to your USB. Simply run the utility and then connect your joystick card - you will see which device has just appeared. Write down the manufacturer and products IDs - they are there every time, even if you made the card at home - part of USB protocol. Run your registry editor (Start -> Run -> regedit -> enter) and navigate to Joystics -> OEM. Here you can find the folder if your card (look for similar numbers as which you have seen in USBView. By editing the OEMName you can rename your joystick card to anything you wish. The name will stay there even when you connect the card to other USB port.


https://lh5.googleusercontent.com/-yfNFKSlXyWI/Uh9Qc6Xqe8I/AAAAAAAAAT8/Q7H8RiDqBpU/s400/joystick_rename.PNG


Wiring
When connecting the encoders to the joystick card don't forget to use the frequency selector switch. You can wire your GND signal to this switch and the switch will connect the signal to only one of two sides at the time - means that you only need half as much inputs on your joystick card! Of course you could connect both sides at the same time to the card and the selector could be connected as a single switch which would bring the need of more complicated scripting to determine which side is active (actually, it would be easy one-line command). I just want to make things simple and easy, so my PC can never see what is tuned on the inactive frequency - because I don't need the PC to know it. Only the active side is connected to the joystick card. Your radio, your decision.


https://lh3.googleusercontent.com/-r5tv_f1Gmyg/UhXRaRW4U4I/AAAAAAAAASw/m9SXqbADzxo/s400/P8221026.JPG (https://picasaweb.google.com/107807729347181009933/RekonstrukceKokpituDC9Pedestal?authkey=Gv1sRgCPbHjY6i7e-fnwE#5914863934887187330)


Software interfacing
Here comes the challenge. You have the card connected to your PC and the encoders and you can make a table like:


button 1: whole part of my frequency is 108
button 2: whole part of my frequency is 109
and so far...


button 11: decimal part of my frequency is 00 or 05
button 12: decimal part of my frequency is 10 or 15
and so far...


button 21: last number of my frequency is 0
button 22: last number of my frequency is 5
that is all


Now you need something to decode your buttons and send the frequency to Flight Sim. If you are using FSX and registered version of FSUIPC you can do a LUA script to do the task. Or you can (as I did) use other utility. I have chosen HIDMacros (http://www.hidmacros.eu/) which can recognise many joysticks with unlimited number of buttons on each of them (note that FSUIPC is limited to 32 buttons per joystick). In HIDMacros I have assigned a function to each of my buttons to call the procedure of NAV1 frequency set. The code of the procedure follows at the end of this article (VBScript).


Other ways how to interface
As the radio is designed to provide tuned frequency "as is", you don't have to follow my way of interfacing. You can design you own PCB to connect to the original diodes and decode the binary coded frequency from them and use your own software to set the FS frequency. Great example of this approach is on L1011 project website (http://l1011project.blogspot.cz/2010/01/avionics-bending-vhf-com-frequency.html). This access has its own advantages - you don't have to touch the encoders and you can use many of the original wires. The disadvantage is that you have to develop your own PCB (printed circuit board) and maybe even your own software. I found it easier and faster to do it as I did.


HIDMacros code
This is my code calculating the frequency from pushed buttons. Note that I have used the FSX event function (yep, Simconnect) so this thing is not FS2004 or X-Plane compatible. If you wanted to use X-Plane the only change to the code would be not to send it as FSX event but as X-Plane dataref - see HIDMacros documentation.




Textové pole

Sub NAV1set
Dim wsh
Set wsh = CreateObject("Wscript.Shell")




wholeeight = HIDMacros.IsButtonPressed("NAV1", 25)/(-128)
wholenine = HIDMacros.IsButtonPressed("NAV1", 26)/(-128)
wholeten = HIDMacros.IsButtonPressed("NAV1", 41)/(-128)
wholeeleven = HIDMacros.IsButtonPressed("NAV1", 42)/(-128)
wholetwelve = HIDMacros.IsButtonPressed("NAV1", 43)/(-128)
wholethirteen = HIDMacros.IsButtonPressed("NAV1", 44)/(-128)
wholefourteen = HIDMacros.IsButtonPressed("NAV1", 45)/(-128)
wholefifteen = HIDMacros.IsButtonPressed("NAV1", 46)/(-128)
wholesixteen = HIDMacros.IsButtonPressed("NAV1", 47)/(-128)
wholeseventeen = HIDMacros.IsButtonPressed("NAV1", 48)/(-128)




decimalzero = HIDMacros.IsButtonPressed("NAV1", 14)/(-128)
decimalone = HIDMacros.IsButtonPressed("NAV1", 13)/(-128)
decimaltwo = HIDMacros.IsButtonPressed("NAV1", 10)/(-128)
decimalthree = HIDMacros.IsButtonPressed("NAV1", 9)/(-128)
decimalfour = HIDMacros.IsButtonPressed("NAV1", 12)/(-128)
decimalfive = HIDMacros.IsButtonPressed("NAV1", 11)/(-128)
decimalsix = HIDMacros.IsButtonPressed("NAV1", 17)/(-128)
decimalseven = HIDMacros.IsButtonPressed("NAV1", 18)/(-128)
decimaleight = HIDMacros.IsButtonPressed("NAV1", 19)/(-128)
decimalnine = HIDMacros.IsButtonPressed("NAV1", 20)/(-128)


lastzero = HIDMacros.IsButtonPressed("NAV1", 2)/(-128)
lastfive = HIDMacros.IsButtonPressed("NAV1", 1)/(-128)


frequencywhole = wholeeight * 108 + wholenine * 109 + wholeten * 110 + wholeeleven * 111 + wholetwelve * 112 + wholethirteen * 113 + (wholefourteen * 114) + wholefifteen * 115 + wholesixteen * 116 + wholeseventeen * 117
frequencydecimal = decimalone * 0.1 + decimaltwo * 0.2 + decimalthree * 0.3 + decimalfour * 0.4 + decimalfive * 0.5 + decimalsix * 0.6 + decimalseven * 0.7 + decimaleight * 0.8 + decimalnine * 0.9 + lastfive * 0.05
frequency = (frequencywhole + frequencydecimal)*100


HIDMacros.FSXEvent "NAV1_RADIO_SET", "&h"&frequency
'HIDMacros.Debug(frequency)
end sub

Brodhaq
09-03-2013, 04:06 AM
Hi Nick,
feel free to ask me whatever you need (here or on e-mail brodhaq@seznam.cz). I have one more NAV and two more COM to do yet :)

Pavel

lasseh
09-04-2013, 12:03 PM
Excellent! I've managed to interface the Gables NAV/COMM using fsuipc and Leo Bodnars card for my 727. Adds a nice touch to the sim when actually using this old hardware in the cockpit! :)

How many volts are you using for the backlight?

Brodhaq
09-04-2013, 02:15 PM
Right now I have 4,5 Volts, but will be 5 when in cockpit, regulated by the original dimmer on pedestal

I love the sound and force of this mechanism, just something better than encoders and 7-seg LCD displays :-D Today I am working on VHF COM radio, which is quite different inside (only 4 encoders and the connection logic differs), I will post some info when done. Good thing is that Bodnar BBI32 will fit into the COM module which will make the things simpler.

Pavel

lasseh
09-09-2013, 01:01 PM
I've tried using 5 Volts on mine as well, but the light gets dimmed as i connect more of the bulbs to the power source. I'm definately not an electric engineer or anything like that, so i am pretty lost here. Could it be that the amps is not sufficiant? I'm using 0,4.

Lasse

Brodhaq
09-09-2013, 01:27 PM
I did a measurement now and on 4,5V the unit eats 0,7A - which could be similar for your 5V power supply. Just try using stronger PSU :) Now I am using some low end Hama 1,5A switched power supply only for development purposes but I will need some good source for final version...

Try to measure each unit or device individually, you can do it by standard multi-meter available for few euros in every electronics store, all of them have up to 10A DC measurement capability which will be more than enough for individual units... When you are done you can calculate the total amps required and buy a good PSU. Also make sure you connect all our units/bulbs to a PARALLEL connection, not to SERIAL! Parallel connection will increase demand on the amps provided but will ensure 5V voltage to all bulbs and mainly will ensure that if one of your bulbs fails other devices will continue working.

8105

I just wonder how much amps will need the whole cockpit... you know all the overhead and pedestal backlight, instrument backlights, panel lights, flood lights,... Bulbs, bulbs everywhere :D

Pavel

lasseh
09-10-2013, 06:15 PM
Oh yeah, it surdenly adds a nice atmosphere to the flight deck when more and more og these old bulbs comes to life again! :)
Thanks for the great advice. I'll give it a shot with the measuring of amps required.

Btw. Pavel. I have concidered adding an adf radio, and thought of the old Collins model, similar to the one in your dc9 cockpit. I just wondered if the inside-mechanism allows for any modifications and interfacing.
With our Gables radios with whole digits in the freq. displays, it was no problem to do so. They just worked as ordinary rotary switches, as you know. But what about the Collins adf? Does the freq. selecter have any detends? Any considerations of yours on this subject is very warm appreciated! :)

Brodhaq
09-11-2013, 02:39 AM
I havent opened the ADF yet, currently it is in my friends place but I will bring it home in about one month and try to interface it. I think there are no detents but I believe I will be able to connect it to multi-turn potentiometers (maybe by some bearings or pulleys) to joystick cards, and reading potentiometers via LUA or HIDMacros is pretty easy so we will be able to do our "virtual" detents to tune the ADF. The same for the ADF frequency range switching (right knob). The task will be the signal strength needle which used to work when tuning the analogue beacon - I think I will use it in two positions: nothing tuned, needle stays at zero, ADF tuned, needle moves to about 3/4 of its range (via arduino analogue output or whichever IO board you prefer)...

Currently I am working on the Gables audio panels, my aim is to make it possible to control nav morse-code identification individually for both crew members and possibility to individually control the volume of each of those channel, the same for COM radios, PA, intercom, and so. I am designing audio signal mixing units and intercom module, I will share my PCBs as soon as I am done. My plan is to read the navaids identification from FSX via FSUIPC and send it to arduino which will convert it to morse code and use arduino outputs to generate the sound signal waves according to tones required - arduino can make it, we will just need some amplifiers for those channels. But using this method we can make independent sound channels for all the idents even if FSX doesnt allow using various sound cards for them.

Pavel

Brodhaq
09-18-2013, 03:40 AM
Both my NAVs working... Got delayed due to USB cards manufacturer but ready to continue now


http://www.youtube.com/watch?v=yJnVfumAefg&feature=youtu.be

I will add COMMs shortly, just wiring the USB cards :)

Pavel