jump to navigation

NexGen, Understanding Synchros April 29, 2013

Posted by phoenixcomm in DIY Aircraft Cockpit, Hardware, Software, Synchro.
Tags: , , , , , , , , , , , ,
add a comment

There are many types of synchros, Rx, Tx, and Resolvers  But what you have to remember that they are all just motors.
Synchro Diagram As you can see this is really just a 3 phase motor, that is the three (3) Stators, are 120 degrees apart. But you ask what is the Rotor winding for? Well if you look at the picture of your cars Alternator Diagramalternator with out the diodes it kind of does the same thing as the Drive winding on the alternator. So if you took the diodes out of the alternator, and you put a 400 Hz sine wave on the Drive winding, remember you have to spin it, you will get 400 Hz 3 phase power, just what I need for my plane.
Duh Now What?? ūüėē
So now I have you all thoroughly confused. Right?
In a perfect synchro world you will have a Tx (like on a flap), and the Rx (in the cockpit) which is inside a indicator, both Rotors are driven in parallel  So when the flap is moved the changes on the 3 Stator, windings are impressed from the Tx, to the Rx and if by magic the needle in the indicator moves with the flap.
I will not bore you with the math behind this, but this is a question?

What would happen if you put on the 3 Stators, a 400 Hz  3 phase, that is each one of the phase are 120 degrees apart, sine wave???

But wait, what about the rotor?? Ok that’s the key. Remember what we did with that alternator? We do the same thing here. But we don’t have to spin the synchro, we spin it, or move it electrically!

Digital Resolution of Angular Displacement
Bits n2 Degrees BAM
1 2 180 32768
2 4 90 16384
3 8 45 08192
4 16 22.5 04096
5 32 11.25 02048
6 64 5.625 01024
7 128 2.8125 00512
8 256 1.40625 00256
9 512 0.703125 00128
10 1024 0.3515625 00064
11 2048 0.17578125 00032
12 4096 0.087890625 00016
13 8192 0.043945312 00008
14 16348 0.021972656 00004
15 32768 0.010986328 00002
16 65536 00001

Remember those 3 phases that you put on the Stators well if we call the unshifted signal the reference and you apply it also to the Rotor winding. Your indicator should point to 0. Ok so far?
Now if you phase shift the signal 90 degrees on the Rotor winding your indicator should move to 90 degrees.
Wow this is simple shit, right?
Lets get down to business. You can see a with your eyes about a ¬Ĺ degree movement. Don’t believe me look at your analog watch’s second hand. 1 second is 1/60 of a circle. So you need about 1/10 of a degree so the indicator will float. So by checking the table you will see you only need 12 bits of resolution. I have also indicated a column for 16 bit BAM, as they are much easier to deal with, than degrees. And I don’t have to use the Trig functions. To understand how to calculate the BAM please look at the link below. One more thing about a BAM it only represents part of a circle. I know I hear the question but we only need 12 bits so why use 16 and through away 4 bits? Well remember the is a computer and it likes things in 8 bit chunks, so getting a 16 bits on a 32 bit embedded CPU is no problem.
Here are two 16 bit functions, I wrote them as that is all you will need:

#define TO_BAMS16(x) (((x)/360.0) * 65536)
#define TO_DEGS16(b) (((b)/65536.0) * 360)

**You will notice that I wrote them as a #define as I let the preprocessor take care of it, rather than making them a formal functions, in that way I can avoid the call and return time. You will also notice the 16 at the end of the name, as I also have 32 bit versions of the functions. The 16 bit version is fine for the instruments  but with the 32 bit version, I can resolve down to a postage stamp size any where in the world!

Advertisements

Stellaris LM4F120 LaunchPad Evaluation Board or the best 13 bucks you ever spent! December 2, 2012

Posted by phoenixcomm in Arduino, DIY Aircraft Cockpit, Flight Simulation, Linux, ps2 keybaord, Software, TI Cortex‚ĄĘ-A8 CPU, TI EK-LM4F120XL LaunchPad, TI Stellaris.
Tags: , , , , , ,
1 comment so far

What in the world do you get for $12.99?? LM4F120_LaunchpadYou get this cool 80Mhz 32 bit ARM Cortex M4F Launchpad Board!

So lets take a look at this thing. Well for openers we get both 16/32 bit instruction, and the F stands for Floating Point. It comes with its own on-board USB In-Circuit Debugger. On-board I/O is USB,  CAN, SPI, PWM,  ADC. 16 MHz main xtal oscillator, 33MHz Real-Time Clock xtal. And plenty of memory: 256KB of 40Mhz Flash, 2KB of EEPROM, 24KB SSRAM, an MPU.

TI has provided a great Student Guide and Lab Manual. I went to TI training it cost me $25.00 and I got my kit plus the Ken Tec QVGA TFT display with a¬†resistive¬†touch overlay. 350px-Kentec¬†With this I can model my CDU with out any of my hardware. I also found a nice App Note on using this board as a I/O processor (shows you how to hook up a PS2 keyboard). I looks like I can put my code¬†that’s¬†in my Linux box into the Stellaris board, but at this time im not shure of my code size as yet. ¬†I have only been messing about with this for a month. But I have been busy moving ūüė¶

Now for what do you use for the IDE? Nope we can use Code Composer 5 (Eclipse) and the licence is forever as long as you have the board plugged in. No you can remove it and put in a different one.

Arduino Trials and Tribulations, Part 4 (The Linux Platform) July 15, 2012

Posted by phoenixcomm in Arduino, DIY Aircraft Cockpit, Flight Simulation, Linux, Mint 12, Software.
Tags: , , , , , ,
add a comment

Well now that I am using Linux Mint 12 with a¬†Cinnamon¬†Desktop for my development with Eclipse (Juno) for my C¬†programming¬†environment. I wanted to make my work¬†easier, so first thing I did was to put my lpr icon on my Desktop… ¬†unfortunately there was nothing in the menu tools. So with a little digging, I found a cool solution so from a terminal, you might want to sudo into shell (sh): ¬†¬†gnome-desktop-item-edit ~/Desktop/¬†–create-new
Which brings up the Create Launcher tool.  Now edit the tool to as shown, press ok, and you get a new icon on your desktop, that looks like a spring. So right click on it and bring up the property dialog and change you icon.  Now you can drag any file from you desktop filer and drop it on you printer and presto it prints!!

Ok now on to more fun… Well¬†I’m going to move my arduino tools to this box now..
First thing when you try to configure your arduino’s serial port my box only gave me /dev/ttyS0¬†but we need a serial usb port…. so you need to make sure your that you arduino is unpluged, and run lsusb from your terminal, and you get this:
$lsusb
Bus 005 Device 006: ID 413c:2010 Dell Computer Corp. Keyboard
Bus 005 Device 007: ID 413c:3200 Dell Computer Corp. Mouse
now plug in the arduino and run it again.
$lsusb
Bus 005 Device 006: ID 413c:2010 Dell Computer Corp. Keyboard
Bus 005 Device 007: ID 413c:3200 Dell Computer Corp. Mouse
Bus 003 Device 004: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
$sudo modprobe usbserial vendor=0x403 product=0x6001
now when you go to the arduino console you can now select /dev/ttyUSB0

enjoy
One note: That is only for that jack. If you want to map the other USB jacks just repeat the steps.

Getting Windows XP Pro SP3 running under Windows 7 with VirtualBox May 6, 2012

Posted by phoenixcomm in Ventura Publisher, Virtual Box, Windows 7 Ultimate, XP-pro.
add a comment

Well as this project get bigger my need for documentation grows bigger as well. It seems that all I have been doing lately is writing and writing.. Well my first choice for my editor was Open Office or Libre Office.  But I was having problems with paragraph numbering and indention. It is not consistent.  So in my search for a better editor I found Scribus, but that does not support paragraph numbering at all. And more over neither dealt with the concept of frames. As a long time user of Ventura Publisher, first published by Xerox and them by Correl. Correl never upgraded Ventura for Vista  or the Windows 7 environments, and stopped with Version 10. I tried to get it to run in Compatibility Mode, but it would not run consistently.

So I had Virtual Box loaded on my Windows 7 box, so we are off to the races.  First I need to mount a XP image in my CD-Rom.  Then I had to tell Virtual Box that I wanted a new OS, pick my memory size, make the new drive in Virtual Box, Power on the virtual machine, and watch the system load just like on a new machine. The whole install took less than 15 minutes from start to finish. So here, what follows,  is a step by step guide:

  1. Open the VM VirtualBox manager and select NEW.
  2. Type in the name of your OS: XP Pro SP3 
  3. Change your Base Memory Size: for XP I like 512 Mb.
  4. With the Start-up Disk checked and the Create new hard disk selected click next.
  5. Leave VDI selected and click next.
  6. Pick Dynamic or Fixed Size and click next.
  7. Pick the location and size I need about 30GB and click next.
  8. Review your choices and click Create.
  9. Ok get a cup of coffee or a coke.
  10. Mount your copy of Windows.
  11. Click the power button on the Manager.
  12. And let it install just like you where doing it on a new machine…

FINS! ENJOY!

AFTER THOUGHT:  Install Ventura Publisher and get back to work..

FILE SHARING: 

  1. Open the VM VirtualBox manager and select Shared Folders.
  2. On the right hand box right click on Machine Folders and then click on Add Shared Folder.
  3. Enter the complete Folder Path and Folder Name.
  4. click on Auto-mount and Make Permanent, and then ok.
  • Your Windows 7 files now show up in Windows XP under your network places.

Radio Subsystem – Putting Together the Linux Pc. April 6, 2012

Posted by phoenixcomm in Arduino, ARINC 410, Audio, DIY Aircraft Cockpit, Ethernet, Flight Simulation, Linux, Software.
add a comment

Well here I am again.. still talking about this radio system..
The Plan:   Well I have an older pc that will be the donor. It has a old ECS K7S5A pro motherboard. Yes its only 32 bits, but it has 5 PCI slots, more than enough to hold a video card, a ethernet adapter, and a few Sound Blaster PCI-16 cards. ALSA or Advanced Linux Sound Architecture should handle the multiple audio cards.  The motherboard has a built-in ethernet adapter which will connect to the Internet, and other ethernet adapter will connect to the private simulator network, so the radio subsystem can get messages from the navigation subsystem (latitude, longitude, and altitude), so I can get the slant range information of the radio that the pilot has selected. This calculation gives us: From/To, DME and is the Nav radio valid. One of the other programs running on this box is a Morse Code signal simulator, as all Nav radios use a Morse Code identifier.  This Pc is also hooked up to the Arduino which talks to the radio heads. This is accomplished by using a virtual comm port,  over a USB cable.   I plan on using Linux Mint on this box, as it is light weight.

¬†I will use a tool, UNetbootin,¬†to download an image onto a USB stick for booting, it was so simple to use ‘even a cave man could have done it‘. Later when every thing is installed and running properly, I will use the Yacto Project to generate a custom distro.

Update:¬†¬†ECS¬†K7S5A pro¬†motherboard’s BIOS could not be reset. . So I installed an ECS P4M800pro-m. It has a built in¬†Ethernet¬†port, VGA adapter, ¬†and only 3 pci expansion ports, so in this box there are 2x Soundblaster PCI16 cards and a¬†3C905-TX Fast EtherLink 10/100 NIC.

ARINC-410 Radio Subsystem – Putting it all together March 6, 2012

Posted by phoenixcomm in Arduino, ARINC 410, Audio, DIY Aircraft Cockpit, Ethernet, G-4390, Gables Engineering, Linux, Software.
3 comments

All right we got most of the design out of the way now. So now we just need a plan to bring all the pieces  together.

The Plan:  I figure every body needs a few radios and the guys with the heavy tin needs a lot more. So I need to be expandable, and flexible. So here are the parts of the system:

  • Linux Pc with ALSA, and multiple pci audio cards
  • arduino
  • Radio Heads that are ARINC-410 compliant
  • Master Interface Card – which holds the arduio, and does board decoding. With space for 2 74LS138 decoders
  • Radio Head interface cards one per card.
  • Audio Interface card. This card has 3mm jacks on it to hook to your pc’s sound card.
  • Your audio panel & audio sub-system mixer, etc.
  • Your cables from the Radio Head to the Interface card.
  • Your cables to chain the audio panels together.

Now what form factor are we going to use? I think that the STD Bus (28/56)¬†will fill the bill perfectly. Not only are they still making racks for them (Vector Electronics), but it has been around for almost 30 years and has not died off yet. So there are some surplus parts around. I’m going to keep the¬†mechanics simple. Each card will be plugged into a slot. So the board addressing will be a jumper on the board. KISS. At the other end of the card there will be a standard 40 pin idc right angle header, and a pin header for the audio.

Notes:  

  • The Master Interface Card and the Audio Interface Card have the same address. When you READ you are reading the switch¬†positions. And During a WRITE you are turning on or off ¬†the Digital Switches on the Audio Interface.
  • The Master Interface Card and the Audio Interface Card, may end up as simply the Control Card.

ARINC 410 Subsystem – Audio Routing March 4, 2012

Posted by phoenixcomm in Arduino, ARINC 410, Audio, DIY Aircraft Cockpit, Ethernet, G-4390, Gables Engineering, Linux, Radio Sub System, Semiconductors, Software.
add a comment

These are just some thoughts its not all here yet.

The Analysis: Well we need multiple audio sources, from things like VATSIM, NAV Morse code, co-pilot, weapons officer, and if you are flying formation a plane to plane chatter. For VATSIM, and for the inter-plane chatter we will need internet.

So, we need a computer that will have multiple audio cards, well that is going to eliminate a windows box. So I guess I need a Linux box, and we need a distribution that supports ALSA, the Advanced Linux Sound Architecture. So far so good. This box will also handle the radio ARINC-410 interface(s), the Morse Code generator, do the slant range (figures out if you are in range of the station), and drive my DME display. 

So here are all the components:

  • Radio Heads
  • ARINC-410 Interface Card
  • Audio subsystem
  • arduino
  • Linux pc with ALSA

. Since each ARINC-410 Interfaces have 3 bits for addressing the heads you can have 8 heads per interface. I could add a board select to each board so two boards gives you 16 radios..

Now you will notice that the lower arrow allows you to chain crew stations, so that means you need one audio adapter per crew station. Each of the Isolation Amplifiers use the radio heads volume control.  With all of this we still have not taken care of the mic.

Notes:

  • the audio wiring between the head and the interface has to shielded.
  • I have just use 3 audio sources for an example.
  • Remember that you have to dedicate one channel for an¬†intercom¬†(if you have multiple crew stations).

ARINC 410 Interface subsystem, Continued March 2, 2012

Posted by phoenixcomm in Arduino, ARINC 410, Audio, DIY Aircraft Cockpit, Ethernet, G-4390, Gables Engineering, Linux, Radio Sub System, Relay, Semiconductors, Software.
2 comments

More information and gotchas:  

Interface¬†Specification: ¬†Remember I said that that the ARINC-410 has 5 bits? ¬†That means our Bus_0 through Bus_4 is the ARINC-410 A throgh E. ¬†Now I can use Bus_5 for Read/Write (the write is Low Active). Ok that only leaves one more, ¬†Bus_6 and I’m going to use it for a strobe. I can do that with a Schmitt Trigger. ¬†Now I did say that was all, but hey what about a reset line?? I don’t know if I need one but we can use Bus_7, and that gives us all 8 bits in the interface.

Outputs:  Well what are our outputs?  The table below shows the standard outputs, that is what the interface has to drive.

Function Voltage Notes
Panel Lights 28v
Dial Lights 28v
DME Lamp 28v Only on NAV

We read the position of the power switch in the status register. But it would be nice to drive all those fault flags.  So how do you drive 28vdc from TTL? There are really 4 ways:

  1. High Voltage Inverter Buffer/Drivers; such as 5406, 5416, 7406, 7416. But have no voltage immunity.
  2. Relays; You still need to drive them, that is the coil.
  3. Optoisolator;  such as TIL111. My personal choice for driving HV loads, and there good for 70volts..
  4. Solid State Relays; SSR’s are robust, and can handle both large currents and high voltages.. You can find used ones on ebay.

Audio:¬† The Gables Radio’s have Volume IN-HI, IN-LOW, OUT-HI and OUT-LOW. This will be a headache ¬†that I don’t want to deal with in this post. But we still need to handle the audio some how. This leaves two choices:

  1. Do what Microsoft Flight Simulator and others do. Just ignore it.
  2. Lets build an audio sub-system.  The benefits really starts to shine when you have more that one position to fill.. ie. pilot, co-pilot, navigator, weapons officer
    • If you fly VATSIM¬†their audio is now on a channel, on the COMM head.
    • We now can simulate¬†Morse¬†Code signals & DME milage station on the NAV head. More later as this will dictate other changes, like outputs to drive from-to flags, etc.
    • You can chain the audio outputs.
    • You can have the same audio at the instructors console.
    • You can record the audio for play back.

Looks like we need a part 3 later..

ARINC 410 Interface subsystem February 21, 2012

Posted by phoenixcomm in Arduino, ARINC 410, Audio, DIY Aircraft Cockpit, Ethernet, Flight Simulation, G-4390, Gables Engineering, Linux, Radio Sub System, Semiconductors, Software.
Tags: , , , , , , , , ,
5 comments

Well it’s about time I posted this interface. I’m not going to show you the whole thing because it goes on for pages and pages. Instead I’m going walk you through one channel in and one channel out. ¬†I’m going to assume that you have a older radio head you know the ones with out the¬†fancy LED displays. ¬†Most (here I go assuming again) use the ARINC 410 interface which is a 2 of 5 code. I described it¬†here¬†in an older blog.

G-3717

Gables G-3717 Dual Nav Head

Nav Pinout

The Analysis:¬†Well the first thing we found out about ARINC 410 that the signals are low active which means they must be ‘pulled up’ ¬†if the radio head does not have pull up resistors installed. As you see from the NAV-1 table we need the following information:

Signal Name ARINC410
Whole MC TENS A, B, E
Whole MC UNITS A, B, C, D, E
FRAC. MC TENTHS A, B, C, D, E
FRAC. MC HUND. B, C
DME TENS A, E
DME UNITS A, B, C, D, E
DME TENTHS A, B, C, D, E
DME HUND C
FREQ SEL COM.
DME Indicator 2
ILS Energize
ILS TEST SW
POWER
PANEL LTS  28v
DIAL LTS  28v
VOLUME 3

The Plan and a little more Analysis: ¬†I need to get the 4 connectors for the Gables G-4390 (five heads in one panel). ¬† So the one connector is a PTO2A-22-55P so I need my connector guy to give me the mate to this number. It looks like I only have to worry about the fields labeled DME and that a max of 5 bits. So I’m just going to throw away the other 3 bits. There is no off the shelf¬† 2 0f 5 ¬†to ASCII decoder, so lets not worry well do that in the driver..

I picked a Arduino  Duemilanove to run the driver and talk to the flight simulator. It only has 14 digital I/O, so could use the Mega 2560 as it has a bunch of digital I/O.

The Plan:  Ok. So we have to talk to the different heads in the plane. And you could have a bunch. So we need a protocol to talk bi-directional to the heads.. here we go.

  1. Write to the interface the head & channel you want to talk to.
  2. Read the response from the head.

Bi-directional communication must use two ports one out and one in.. but its easy to combine them and use tri-state drivers. ¬†First I want to use the 74LS125 or 126. This is an quad package, with each of the buffers having¬†separate controls.¬†¬† So I can get away with 8 bits.. ¬†first since the max we need is to count 0 – 5 thats 3 bits. So lets use the first 3, that give us 5 more to select a max of 32 heads. So lets take a pair of 74LS138 3 to 8 decoder one of them has to be hooked up to the D0, D1, D3 to decode which of the words you want A to E. The second 138 is hooked up to the D4, D5, D6 this will give us 8 radios, really 7, because I’m going to use 0 for power status & LED controls.. ¬†Next you have to AND the Radio + Chanel to drive the 5 74LS125 Tri-State Control signals.. ¬† So if you use my signals you end up with this: EN_Chan1 + EN_Radio1 = EN_R1Ch1.

The Software:¬† Ok here goes I’m not going to write the code.. but here is what you need to do.

  1. Initialize the registers.. #int radio = 0; int channel = 0; odd = 0; max_radio = (you radio count + 1(status)); freq [radio][chan]; freq2[radio][chan];
  2. Start Odd / Even loop.. #for(odd = 0; odd < 2; odd++)
  3. Start Radio loop.. # for(radio = 0; channel < max_radio;  radio++)
  4. Start Channel loop.. # for(channel = 0; channel < 5; channel++)
  5. write to the control register with radio, channel.
  6. read the control register and store the results..
  7. if ( odd = 0){ freq[radio][chan] = result from reg}
  8.  if (odd = 1){ freq2[radio][chan] = result from reg}
  9. if (odd > 1) write ERROR.
  10. End of Channel Loop
  11. End of Radio Loop
  12. if(odd = 1){  now check for changes.. you want to do this with some loops..
  13. if( freq[radio][chan] != freq2[radio][chan])  its changed.. now send to the simulator..
  14. odd = 0;}
  15. End of Odd /Even loop

FINS & FYI: ¬†You will need a bunch of the 125’s and lots of pull up resistors. Just for doing my Gables G-4390 with out any more radios lets do some math.. 5 heads * 5 channels per * 5 bits = 5 cubed or 125 buffers (32 packages) ¬†& 125 resistors this is not including status or light drivers.. ¬†I wire wrap (power tools), but that a lot of buffers. I am working on putting the whole thing into a Xilinx part. This is a product that I am going sell at Flite-Tronics.com. This still leaves the problem with audio, or driving other indicators, like ILS flags, etc.¬† ¬†If you¬†attempt this I really¬†recommend¬†that you check out Avnet they have the best prices for semiconductors period.

I wish to thank Gables Engineering for the pin-outs and outline dimensions.

How You Get There From Here or Great Circle Navigation December 7, 2011

Posted by phoenixcomm in Flight Simulation, Great Circle Navigation, Physics, Software.
1 comment so far

Have you ever wondered how you navigate on a round world? Remember Columbus thought was flat. So if the world was flat you could stick two pins in the map, and follow the angle from North. But as we know today the world is round so, sadly that will not work… ¬†So we came up with Great Circle Navigation. Apparently, the first reference to great circle navigation was by John Davis in his book, The Seaman‚Äôs Secrets (1594). ¬†The theory was understood, but in practice it could hardly be applied without accurate computation of longitude. With Harrison‚Äôs chronometer, this was then possible. ¬† The theoretical proof was given by Bernhard Riemann around 1900. ¬† ¬†The following is Great Circle that outputs distance.. Hey this is good for the DME¬†calculation…
BTW I convert all angles into 32 bit BAMs, which means that we get about a size of a postage stamp on the surface of the earth.

Distance = acos(cos(Lat1-Lat2) Р(1-cos(Lon1-Lon2)) * cos(Lat1)*cos(Lat2)) 

So here is a program that I use to calculate my DME.

/*
L1 = Original Lat; L2 = Destination Lat;
Lon1 = Original Lon; Lon2 = Destination Lon
D = Distance in Nautical Miles
*/
Lon1 = -Lon1;
Lon2 = -Lon2;
if((L1 == L2)&&(Lon1 == Lon2)){
return(0);}
temp = (cos(L1)*cos(L2)*cos(Lon1 – Lon2))+(sin(L1)*sin(L2));
if (temp == 1){
temp = 0;}
elsif (temp == -1){
temp = pi/2;}
else {
temp = 0 – atan(temp / sqrt(1 – (temp * temp))) + pi / 2;}
temp = ((sin(L2) – sin(L1) * cos(temp)) / (sin(temp) * cos(L1)))
if (1 – temp < .00000001){
return(360);}
elsif (1 + temp < .000000001){
return(180);}
else {
temp = rad2d(-atan(temp / sqrt(1 – (temp * temp))) + pi / 2;)
if (sin(Lon2 – Lon1) > 0){
temp = 360 – temp;}
return(temp);}

Note: This was the test program demo.html/demo.pl was written in Perl. It did not use BAMs. The program has been re-written in C.
if you wish to see the complete program running  click here
if you wish to use the source please¬†click here¬†… Please be¬†sure¬†to email me first here.

%d bloggers like this: