Professional Documents
Culture Documents
By
So today, we are going to make a fully functional VOR/LOC/Glideslope Indicator
What do we need?
An IN-386A instrument or similar
A Teensy Arduino board (compatible with xPlane) https://www.pjrc.com/teensy/td_flightsim.html
The Teensy software and plugin for xPlane, the Arduino software
Four 5K trim potentiomenters (10 turn or more)
One 5K potentionmeter (linear)
Four 5K resistors, a 470 Ohm resistor and 3 to-be-determined resistors
Some gears
In the above example we filled up the buckets with Blue de Curacao, some good tasting liqueur ...
at a 100% duty cycle we have plain 5vdc or 5 Liter per time-frame
at a 25% duty cycle we have simulated 1.25vdc or 1.25 Liter per time-frame
at a 50% duty cycle we have simulated 2.5vdc or 2.5 Liter per time-frame
So although, the pulses are 5v high, the width will determine our output voltage
Now that solves one issue but how are we going to create a NEGATIVE voltage?
Thus by using 2 voltage sources, we can create a positive or negative signal !
If we hook up our instrument in-between 2 PWM pins, we can vary from negative to positive voltages
Thus if the PWM signal on C4 > C5 we have a negative voltage
Thus if the PWM signal on C5 > C4 we have a negative voltage
The pot has to be geared so that we can (at least) turn the OBS dial from 0 degrees to 360 degrees without hitting the
potentiometer's limit
I mounted the pot on a piece of scarp PCB and made the mounting holes slightly oblong so I can perfectly align the
gears
If you want to save money, you could mount the voltage dividers (trim pots) on a test board, calibrate the
NAV and GS needles, write down the resistor values and use regular resistors
The Code:
void setup() {
BackCourse = XPlaneRef("sim/cockpit2/autopilot/backcourse_on"); //set Backcourse dataref
BackCourse.onChange(updateBackCourse); //only do things when BackCourse changes
pinMode(5, OUTPUT); // set the BackCourse LED pin
// change only if more then one and send OBS data to XPlane
if (OBSanalog < OBSprevious - 1 || OBSanalog > OBSprevious + 1) {
OBS = OBSmap;
OBSprevious = OBSanalog;
}
}
if (NAVmap > 0) {
analogWrite(Pin_NAVLow,NAVmap);
analogWrite(Pin_NAVHigh,0);
} else {
NAVmap = NAVmap * -1;
analogWrite(Pin_NAVLow,0);
analogWrite(Pin_NAVHigh, NAVmap);
}
}
if (GSmap > 0) {
analogWrite(Pin_GSLow,0);
analogWrite(Pin_GSHigh, GSmap);
} else {
GSmap = GSmap * -1; //convert negative number to positive
analogWrite(Pin_GSLow,GSmap);
analogWrite(Pin_GSHigh,0);
}
}
I rarely endorse a seller but whatever I purchased from swift46 was in pristine condition and dirt cheap!!!
Snap Lemon (aka swift46) is a pleasant and knowledgeable person to deal with
And by the way, most of his gear comes with the certificates!
http://stores.ebay.com/swift46/