Showing posts with label VHF COMM. Show all posts
Showing posts with label VHF COMM. Show all posts

Saturday, July 12, 2014

L-1011 Trainer Installation: NAV and COM Radio Head Integration

L-1011 Trainer NAV and COM Radio Integration

Today we finished the VHF NAV and VHF COM Radio head integration with X-Plane. Ben Klang wrote the code for the VHF NAV radios. The VHF NAV radios use a 2 of 5 encoding method and we are reading them with National Instruments DIO cards. Ben wrote a program on a small Linux box that continuously reads the values and sends them on to X-Plane via a UDP DataRef.

We also completed the VHF COM Radio integration. Here, the radios use the ARINC 429 Labels 030 with different SDI numbers to differentiate the various COM channels. For now, we integrated COM1 and COM2 to directly interface with X-Plane. Just as with the VHF NAV tuning information, the VHF COM frequencies are passed to X-Plane via the network as UDP packets.

The video below shows the operation of the VHF COM and VHF NAV radios in our L-1011 cockpit.

Saturday, September 21, 2013

L-1011 Trainer Installation: COM Radio Power-Up

L-1011 COM Radio Power-Up

After almost a month away from the L-1011, due to work constraints and other museum projects, it is finally time to get back into it. Today we powered up the first few elements of the aft electronics panel on located just aft of the throttle quadrant. To be exact, we powered up the 3 VHF/HF COM radio combinations.

L-1011 COM Radio Without Backlight

The radio faces operate of 3 difference 24VDC sources. The VHF1 radio receives power from the BATTERY bus, the VHF 2 radio uses the GROUND SERVICE bus and the VHF3 radio receives power from the NO.2 RADIO BUS. I have extensively blogged about these Gables Engineering devices before and you can find more info on them when you search for Gables Radio Heads here on the blog.

Below is an image of the radio face under low light conditions with back plate and display illumination.

L-1011 COM Radio With Backlight

These radio faces are ARINC 429 devices and will be controlled by ARINC 429 interface. 

Wednesday, December 12, 2012

Avionics Bending: VHF/HF COM Radio Integration with X-Plane (Part 7)



The last two days I have been mostly working on the integration of the Gables radio head with x-plane. In particular the two VHF COM channels simulated on x-plane. Over the next few days this will then further control VATSIM and the respective VHF COM channels on VATSIM. The video above shows the integration between the original flight hardware and x-plane.

The integration architecture is pretty straight forward as you can see in the image below.

ARINC 429 to X-Plane Data Integration

The data flows from left to right in the diagram. The Gables multi function radio head outputs ARINC 429 data as described in the previous blog postings. The ARINC429 data is read by an ARINC 429 interface and then sent via UDP (Ethernet) to the computer running the simulator (in the video above that is my laptop). The system running the simulator (on the right hand side of the diagram above) also runs a device driver that receives the UDP packets, formats them for x-plane and sends them on to the TAP plugin running under X-Plane.

Next, the VATSIM integration and then we will get back to creating all the necessary audio channels for a radio experience that is close to the real thing as possible.

By the way, today I was asked by someone on the Internet if I modify the original flight hardware (such as the Gables radio heads) to work with my setup. The answer is no, all of the original flight hardware remains in its state as it was flown on the actual aircraft and is not modified at all.

Monday, December 10, 2012

Avionics Bending: VHF/HF COM Radio Integration with X-Plane (Part 6)

The Gables G6984 multi function radio head transmits 3 different ARINC 429 label. The labels are:
  • Label 030 - VHF Frequency
  • Label 205 - HF Frequency
  • Label 207 - Additional Software information
For the flight simulator integration, only Label 030 and 205 are of interest to me right now. There are three (3) VHF frequencies and two (2) HF frequencies on the radio. Here are the details on the labels:

Label 205 - HF Word - From ARINC 429 Specification
Label 030 - VHF Word - From ARINC 429 Specification
All three VHF and both HF frequencies that can be set on the radio head are transmitted on the ARINC 429 bus with the same label. Each radio is identified with a unique SDI in the ARINC 429 word. The SDI is a 2 bit field.

VHF SDIs

01 -- VHF Radio 1
10 -- VHF Radio 2
11 -- VHF Radio 3

HF SDIs

01 -- HF Radio 1
10 -- HF Radio 2

Below is a short video that shows the radio head transmitting ARINC 429 data to a test program. Currently the ARINC data is read by a debug code and output to the screen. Over the next two days I will connect the Radio head data to the x-plane flight simulator.

Thursday, December 6, 2012

Avionics Bending: VHF/HF COM Radio Integration with X-Plane (Part 3)

Now that I have decided on a basic architecture for the audio integration it is time to do a power up test of both the Gables radio head as well as the audio selector panel. Both components take 24-28VDC power input. I am driving them with 24VDC and that works just fine.

Gables Radio Head and Audio Selector Powered
At this point the radio head is powered but not yet connected to an ARINC 429 receiver or transmitter. The audio panel is powered and the built in amplifier and "Voice Only" selector are working. I also cabled a temporary L-1011 Headphone and Hand-Mike break-out panel ... this way I am able to connect the David Clark headset for testing. 

Original L-1011 Hand-Mike and Headset Connector Panel
Below is a short video that show the setup in action. I connected a scanner radio listening to Atlanta Center to the Gables Audio Selector's VHF-1 input. The audio is not yet coming from the simulator. 


Sunday, December 2, 2012

Avionics Bending: VHF/HF COM Radio Integration with X-Plane (Part 1)

Now that we have at least one primary flight instrument, the HSI, under our belt (see the previous 15 postings) I will now move on to something very interesting, which is radio integration into X-Plane. Here is the stack that I will be working with for the next few weeks:

Gables Multi Function Radio Head and Gables Audio Selector Panel
The two instruments in the picture above are a GABLES G6984 radio head and a GABLES G2930 audio selector panel. The G6984 uses the ARINC 429 protocol for radio data and is a perfect next step for the ARINC 429 work I have been doing lately. Unlike the the HSI, which only required sending ARINC 429 data to the device, the G6984 will require bi-directional traffic; radio frequencies from the radio and FMS data to the radio head.

In the L-1011 cockpit there are three identical audio selector and radio head combinations; one for the Pilot, one for the First Officer and One for the Second Officer. For the test setup I will also use a Hand Mike and a David Clark Headset (rather have a Telex, but I don't have access to one). Below is a picture of the input and output:

Gables VHF COM, Hand Mike and David Clark Headset
The L-1011 cockpit has two overhead speakers that can be used for monitoring audio without the need for a headset. For the test setup I will only use one of the two speakers. The speaker is powered and has an amplifier built in.

Original L-1011 Cockpit Overhead Speaker
Tomorrow, we will look at t detail analysis of the audio signals needed for a realistic integration of X-Plane and a simulated ATC system.

Wednesday, April 7, 2010

Avionics Bending - x-Plane Plugin: VHF COMM Raido


In this posting, we will connect the now modified VHF COMM Radio to the X-Plan software. This will close out this avionics bending project for my Lockheed L-1011 project. In the last posting we looked at the firmware code that we loaded on the AT90USB on on the backside of the original flight hardware.

A device driver that I wrote receives the USB data on the computer and puts it into a shared memory segment. I am not showing that code today, but if you are interested to see it, you can drop me a line and I e-mail it to you.

The image below is an output of the USB device driver (it does that in debug mode only).


My X-Plane plug-in does not directly interface with the USB software, it takes a good amount of processing and I don't want to slow down the simulator over time by loading it up with compute intensive attachments, hence, the X-Plane software simple reads the shared memory segment and inserts the code in the the simulator using an XREF. Below, you can see a screen shot that shows the frequency that we selected on the original flight hardware ... except for now it is shown on the COMM radio in X-Plane.



Here is the X-Plane plug-in code that does the magic:

/*
* RadioControl.c
* L1011_SimWare
*
* Created by Curd Zechmeister on 3/29/10.
* Copyright 2010 Area145 Corporation. All rights reserved.
*
*/

#include
#include
#include
#include
#include
#include
#include "XPLMUtilities.h"
#include "XPLMProcessing.h"
#include "XPLMDataAccess.h"

#define ECHOMAX 96

/*
* Simulator Dataword
*/
struct xplnDataWord {

int digit1;
int digit2;
int digit3;
int digit4;
int digit5;

} xplnDataInput, *xplnDataInputPtr;

/*
* X-Plane DataRefs for the L1011 Overhead Panel
*/
/* APU Control */
XPLMDataRef gCockpitRadios;


/* ********************************************************************************************
* * CALLBACK REGISTRATION
* ********************************************************************************************/

float MyFlightLoopCallback(
float inElapsedSinceLastCall,
float inElapsedTimeSinceLastFlightLoop,
int inCounter,
void * inRefcon);

/* ********************************************************************************************
* * PLUGIN STARTUP
* ********************************************************************************************/

PLUGIN_API int XPluginStart(
char * outName,
char * outSig,
char * outDesc)
{



strcpy(outName, "L1011 COM Radio Controller");
strcpy(outSig, "l1011.vhf.com1");
strcpy(outDesc, "Control the Lockheed L1011 Fight Engineer Panels");

/* Engine Start PanelData Refs */
gCockpitRadios = XPLMFindDataRef("sim/cockpit2/radios/actuators/com1_frequency_hz");

/* Register our callback for once a second. Positive intervals
* are in seconds, negative are the negative of sim frames. Zero
* registers but does not schedule a callback for time. */
XPLMRegisterFlightLoopCallback(
MyFlightLoopCallback, /* Callback */
0.3, /* Interval */
NULL); /* refcon not used. */


/* Connect to the shared memory segemtn */
/* Variables */
int iSegmentID;

// Create the shared memory segment
iSegmentID = shmget( 1234, sizeof(xplnDataInput), 0666 | IPC_CREAT );

// attach to the shared memory segment
xplnDataInputPtr = shmat( iSegmentID, 0, 0 );


return 1;
}

/* ********************************************************************************************
* * PLUGIN PAUSE/STOP
* ********************************************************************************************/

PLUGIN_API void XPluginStop(void)
{
/* Unregister the callback */
XPLMUnregisterFlightLoopCallback(MyFlightLoopCallback, NULL);

}

/* ********************************************************************************************
* * PLUGIN DISABLE
* ********************************************************************************************/

PLUGIN_API void XPluginDisable(void)
{

}

/* ********************************************************************************************
* * PLUGIN ENABLE
* ********************************************************************************************/

PLUGIN_API int XPluginEnable(void)
{
return 1;
}

/* ********************************************************************************************
* * PLUGIN RECEIVE MESSAGE
* ********************************************************************************************/

PLUGIN_API void XPluginReceiveMessage(
XPLMPluginID inFromWho,
long inMessage,
void * inParam)
{
}

/* ********************************************************************************************
* * CALLBACK LOOP
* ********************************************************************************************/

float MyFlightLoopCallback(
float inElapsedSinceLastCall,
float inElapsedTimeSinceLastFlightLoop,
int inCounter,
void * inRefcon)
{

int comFrequency;
comFrequency = 0;


/* ********************************************************
* * L1011 COM Panel -- Data Input
* ********************************************************/

comFrequency = ( xplnDataInputPtr->digit1 * 10000 +
xplnDataInputPtr->digit2 * 1000 +
xplnDataInputPtr->digit3 * 100 +
xplnDataInputPtr->digit4 * 10 +
xplnDataInputPtr->digit5 );

XPLMSetDatai( gCockpitRadios, comFrequency );


/* ********************************************************
* * L1011 COM Panel -- Data Output
* ********************************************************/




/* Return 1.0 to indicate that we want to be called again in 1 second. */
return 1.0;
}

Tuesday, April 6, 2010

Avionics Bending - Firmware: VHF COMM Radio

Now that we have completed the hardware modification, I will show you the firmware code that reads the analog radio head dials an translates them into digital information that will be sent to the X-Plane software on the computer. We are getting closer to integrating the radio head into my Lockheed L-1011 project.

Here is what the piece of code below does:

  1. it initializes the hardware
  2. it establishes a USB connection
  3. in an endless loop ... the code decodes the drums and sends the data via USB to the computer

The drums are encoded as follows:


#define digZero 0b00001011 // 0x0b
#define digOne 0b00000011 // 0x03
#define digTwo 0b00000101 // 0x05
#define digThree 0b00001001 // 0x09
#define digFour 0b00001010 // 0x0a
#define digFive 0b00001100 // 0x0c
#define digSix 0b00001101 // 0x0d
#define digSeven 0b00001110 // 0x0e
#define digEight 0b00000110 // 0x06
#define digNine 0b00000111 // 0x07


So below is the code. See the screen shots below for the test output. Tomorrow, we will connect the radio head to X-Plane.


/* *****************************************
*
* The L-1011 Project
*
* Radio Head Firmware
*
* Hardware: Teensy++ AT90USB1286
*
* Author: Curd Zechmeister
*
* Function : Read the radio head input and
* send it via USB to the
* computer.
*
* Revision History
*
* 2010-03-27 Initial Creation
* 2010
*
*******************************************/

#include

#include

#include

#include "usb_rawhid.h"
#include "print.h"
#include "VHFCOM.h"

/* ****************************************
* * Constant Definitons *
* ****************************************/
#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
#define BUSY_LED_ON (PORTD = _BV(PD6))
#define BUSY_LED_OFF (PORTD = !_BV(PD6));

/* ****************************************
* * Prototyping *
* ****************************************/
int teensyInit();
int USBlink();
uint8_t decodeNybbleFront(unsigned int region, unsigned char nybble);
uint8_t decodeNybbleBack(unsigned int region, unsigned char nybble);

/* ****************************************
* * Global Variable Definitons *
* ****************************************/
uint8_t usbBuffer[64];

/* ****************************************
* ****************************************
* * Main Program Logic *
* ****************************************
* ****************************************/
int main() {

// Variables
unsigned char val1; // Read input value 1
unsigned char val2; // Read input value 2
unsigned char saveVal1; // Save input value 1
unsigned char saveVal2; // Save input value 2
uint8_t i; // Loop counter

// Vaiable init
val1 = 0x00;
val2 = 0x00;
saveVal1 = 0xff;
saveVal2 = 0xff;
i = 0;

// Initialize the Device
teensyInit();

// Initizlize USB Connection
USBlink();

// This is a VHF COM Radio
usbBuffer[0] = COMRADIO; // Device is a VHF communications radio
usbBuffer[1] = COM1; // Device is COM Radio 1

// Input Loop
while( 1 ) {

// Read the 2 input bytes
val1 = PINA;
val2 = PINB;

// Determine if processing necessary
if ( val1 != saveVal1 || val2 != saveVal2 ) {

// Clear the buffer
for (i=2; i<64; saveval1 =" val1;" saveval2 =" val2;" porta =" 0x00;" ddra =" 0x00;" portb =" 0x00;" ddrb =" 0x00;" portc =" 0x00;" ddrc =" 0x00;" ddrd =" 0xFF;" region ="=" nybanalysis =" (nybble" nybanalysis =" (nybble">>4);
nybAnalysis &= 0b00001111;

}

switch( nybAnalysis ) {

case digOne:
return(0x01);
break;
case digTwo:
return(0x02);
break;
case digThree:
return(0x03);
break;
case digFour:
return(0x04);
break;
case digFive:
return(0x05);
break;
case digSix:
return(0x06);
break;
case digSeven:
return(0x07);
break;
case digEight:
return(0x08);
break;
case digNine:
return(0x09);
break;
default:
return(0x00);


}

}


/*
* Nybble Decoder for left hand side of decimal point
*/
uint8_t decodeNybbleFront(unsigned int region, unsigned char nybble) {

unsigned char nybAnalysis;

if ( region == 0 ) {

nybAnalysis = (nybble & 0b00001111);

} else {

nybAnalysis = (nybble>>4);
nybAnalysis &= 0b00001111;

}


switch( nybAnalysis ) {

case digOne:
return(0x01);
break;
case digTwo:
return(0x02);
break;
case digThree:
return(0x03);
break;
case digFour:
return(0x04);
break;
case digFive:
return(0x05);
break;
case digSix:
return(0x06);
break;
case digSeven:
return(0x07);
break;
case digEight:
return(0x08);
break;
case digNine:
return(0x09);
break;
default:
return(0x00);


}

}

// END

Monday, April 5, 2010

Avionics Bending - Flight Hardware Final Prep Part 3: VHF COMM Radio


This is the third and final posting as part of the preparation work of the original flight hardware. Today, we will attach the remaining cables needed for instrument illumination, drill holes in the back plate and attache the PCB to the backside of the instrument. This will complete the hardware modification for the VHF COMM radio head used in my Lockheed L-1011 project.

Step 1: The image on top of the page shows the final cables attached to the respective elements of the original flight hardware and the image directly below shows all the cables cleaned up and tied together inside the radio head.

Step 2: Next, I will remove the back plate (the one that held the original connector) and get it ready for drilling. The holes are needed for the nylon stand-offs with which i will mount the PCB securely to the instrument.


The image below shows the marking for the drilling in black.


Step 3: Now that the plate has been drilled, we can get ready to attach the nylon standoffs. I use nylon, because the mounting holes are not 100% exact and the nylon standoffs can bend a little.


Step 4: Mount the nylon standoffs to the back plate of the VHF COMM radio head.





Step 5: Finally we will attach the connectors to the PCB and mount the PCB to the backside of the radio head.


Below are a few images of the final instrument. Over the next few postings we will look at the C code that will attach the now modified VHF COMM radio head to the X-Plane software platform.


Sunday, April 4, 2010

Avionics Bending - Flight Hardware Prep Part 2: VHF COMM Radio


This posting, is the 2nd part of the preparation work of the original flight hardware for the VHF COMM radio of the Lockheed L-1011 project. In this posting, we will connect the the diode board to a set of connectors that will later interface with the board. The picture above, is where we left of the last time, except for that I have labeled the diodes according to a specific cabling scheme. Click on the image to see the numbers.

Step 1: In the image below you will see that I have prepared two 8 position connectors with roughly 4" cables. I assume you know how to crimp the connector, so I am not showing the steps here. Each of the connectors represents 8bits ... or one byte.


To connect the VHF COMM radio, I need 16bit ... or two bytes. Therefore, we will solder two 8bit connectors into place.


Step 2: Solder the two 8bit connectors into the correct sequence on the diode board.




Step 3: Once all the cables are in place, I will remove the excess leads.


Step 4: Cable Tie the two 8bit connectors and the original cables back together to clean up the cable mess.



Step 5: Mount the diode board back into it's original position in the enclosure.


The image below shows the finished prep work for today's posting. All the cables that will interface with the I/O board will be fed through the opening left behind from the original connector.

Saturday, April 3, 2010

Avionics Bending - Flight Hardware Prep Part 1: VHF COMM Radio


In this posting we will start the preparation work of the original flight hardware. The VHF COMM radio head that I picked for the Lockheed L-1011 project has two drum digits and a diode board that allows selection between the active and the passive frequency. The IO interface needs to connect to several elements in the original flight hardware:

  • frequency toggle switch
  • diode board for the drum encoded frequencies
  • Instrument illumination
  • light plate illumination



Step 1: We will remove the original connector from the housing. The IO board will sit right behind the connector and we will feed the necessary cables through the opening left behind by the connector.




Step 2: Open the cable ties and remove the diode plate so that we can remove the cables that originally ran between the board and the connector. These cables will be replaced with cables to the I/O board.





Step 3: Remove the original cables.




Step 4: Re-drill the connectors ... here is the finished cleanup work for today.

Friday, April 2, 2010

Avionics Bending - PCB Assembly: VHF COMM Radio


Today, we will assemble the PCB that we designed over the last few postings. I received a number of boards on my first run. The image above shows the top side of the board and the image blow the bottom side.



The next image shows all the components that will go onto the board. The majority of them are connectors which I will use the interface the micro-controller to the original flight hardware of the Lockheed L-1011 project.


Step 1: I will attach all the connectors. 8 bin connectors for the "byte" sized I/O registers, a 4 pin connector for the USB connection to the teensy++ and several 2 pin connectors for Analog I/O and for the Lightplate and Digit Drum illuminations.


Below is the the board with all the connects mounted. I arranged the connectors around the edges in order to keep enough space for the components that will go onto this relatively small board (well, small in sense of using DIL devices).



Step 2: Assemble the Multi Purpose Power Connector (MPPC). I feed +9V to the +5V Regulator, and a discrete power feed to the light plate and the digit drums. The idea is, that the digit drums and the light plate can be dimmed independently.


Step 3: Attach the USB connector.

Step 4: Assemble the voltage regulator. The regulator in the picture below, together with a number of capacitors and choke will make up the operational power supply for the micro-controller.

Step 4: ON/OFF Jumper and Power LED. The Green LED will illuminated if power is flowing to the device and the jumper to the right and below of the green LED has been close.


Step 5: Install the micro-controller. Since I chose the teensy++ for this project, I will install the teensy++ board as a mezzanine board.



Step 6: Install the nylon standoffs with the 3mm machined screws.


And here it he final product:



The teensy++ comes with an LED Blink test program pre-loaded. Here is the test program activating the small on-board LED as part of my power-up test.