NetAvionics : A powerful but inexpensive B738 simulator

Hello !

I’ve been in the world of air simulation and home cockpits for a while. My last personal cockpit was based on opencockpit cards, run by several PCs, using my own instrument visualization programs.

I found the use of many PCs cumbersome and expensive and decided to look at today microcontrollers technology for a better way to do it. You can now find for a few bucks Arduino and RaspBerry Pi boards, which are fairly powerful, compact, and potentially offer all the elements to develop a full home cockpit system. I started to develop such system and I will report here my choices and results.

The system is based on hacked opencockpit cards (Mastercard and modified USB expansion card). It uses an Arduino DUE board to control all the hardware equipments (inputs, outputs, analog readings and servomotors), and several RaspBerry Pi 3 boards for openGL vizualisation of the instruments : PFDs, NDs, system and engines screens.

In the menu above, you will find some pages describing the main blocks of the system, like the hardware setup, the hardware configuration tools, the instruments displays …

In the course of developing my system, I am facing problems for which I had to find some solution. I will share these in articles named “Tech tips”, hope it can be useful to someone…

The system is under development, but once it is “reasonably” finished (it’s never really finished …), I imagine I could sell or share it, we’ll see …

Posted in Non classé | Leave a comment

Encoding a rotary switch to save inputs

Hi,

I imagine the following concepts are pretty straightforward for many builders, but probably not for all, so you will find here how to reduce drastically the number of inputs required to read a multi position rotary switch. The principle is to encode the position in binary. To illustrate the advantage of doing this, here are a few examples of the number of inputs required versus the number of positions used on the switch :

Number of positionsinputs required
21
42
83
12 (and up to 16)4
inputs versus switch positions with binary encoding

So, how to to this in practice ? well, using simple diodes. You can buy some for a few cents, any type will do, but the very common 1N4148 type is particularly suited, and inexpensive. A bit of wiring is required to link your switch pins to your inputs through the diodes. The following schematics illustrate the concept for a common 12 position switch :

If you need less than 12 positions, then just skip the portion corresponding to the excess positions. On the left, the rotary switch can connect the ground connection (0V) to any one single position selected, the on the right part, the connections labeled bit0 to bit4 have to be connected to your input card and they will represent the number of the activated switch position in binary. An activated input is set to 0, while a non activated input is set to 1. This requires that all input are set to 1 by the input card : for example, using an arduino board or similar, you have to configure the input with a PULL_UP activated, to set the input to 1 when not activated (on arduino : pinMode(pin, INPUT_PULLUP), where pin is the card input number). Then you read the different pins, invert their value (input = 1 – input) and read the position by : position = input0 + 2 * input1 + 4*input2 + 8*input3 …

Posted in Tech Tips | Leave a comment

April update

Hello,

I’m now working at home, due to Covid, and that spares me a lot of commuting. I have improved many aspects of the project, and in particular, while expanding the capabilities of the hardware control, I have come close to the limits of the arduino DUE. The reason is that I’m now reaching the memory and speed limits of the device. Although I could go on with the existing design, I have started to investigate a replacement of the DUE by a Raspberry, which is way more powerful. The drawback is that the Raspberry has a limited input/output port capacity, compared to the Arduino DUE. In a first step, I am experimenting with a Raspberry/DUE combination, where the DUE does a minimal work of handling the hardware input/output, digital and analogs, and the Raspberry does the “smart” job : communicating over the network with the simulator, mapping hardware values to real values (for example for servomotors and analogs, often in a non linear way…), handling a configuration file which hides the hardware structure and exposes increased functionalities …

It’s also possible to use a raspberry alone, without Arduino, but this implies a redesign of the expansion card which is used to connect to the opencockpit mastercards. This is my prefered approach but needs more work. My problem is that I have more ideas than free time to realize it, but this project is improving constantly.

Posted in Updates | Leave a comment

March update : windows version

Hi again,

Still working regularly on the project ! I’m on a prolific and durable mood … The FMC is still slowly progressing, and I’m working on a lua script to mimic all the B738 systems, as mentionned inthe last update. But this month, I decided to port the project to windows. I’m currently using X-plane on a linux (ubuntu 18) machine. I had decided at the beginning to make cross-platform development by using Qt, so this month it has been quite straightforward to compile the system for windows. It is now operationnal and I have made a bunch of flights with my cockpit under windows. It would be as easy to produce mac files, but I have no mac at hand.

Then I decided to start investigating a P3D version, so I got myself a developer license of P3D v4.5 and the P3D SDK. Let’s say 80% of the code can be ported as is, but the last 20% requires some work, so I’ll do it slowly and regularly.

Posted in Non classé | Leave a comment

February update

Continuing to work on the FMC; it’s a huge work so I’m progressing more slowly than I would like. Another aspect I have been developping is the implementation of the overhead. The overhead controls all the systems in the plane, so there’s a lot of interactions and complexity. I wanted to do something which can be easily reworked and improved, so I decided to use scripts. X-plane comes with a native implementation of LUA, which is a powerfull scripting language. I have made a script to define “datarefs” containing the state of every element of the overhead panel. These are variables that can be manipulated in the script to simulate the behaviour of the systems controled by the overhead. The overhead hardware state is fed into these datarefs (that’s a lot of switches and knobs !) , so they can be used to programmatically simulate all systems.

Using this approach, I have designed an “open” system which can be easily edited to modify, correct or improve the simulation of the overhead by the end user with a minimal knowledge of programming. This script is contained in a modified version of the Laminar B738, in the folder /X-Plane 11/Aircraft/NTAV B737-800/plugins/xlua.

I have also decided to write a manual for the system, as it is becoming larger and larger and has more and more functionalities and options. I will release it here as soon as possible.

Posted in Updates | Leave a comment

January 2020 update !

Happy New Year !

The project is in good progress, the FMC is on its way, and it’s a huge work, I must admit that I had underestimated it. Well, I want to obtain something very close to the real thing, and it requires a lot of efforts. I think I will need a few months more to obtain a first satisfying version.

Hardware : simpler, plug & play connection to the opencockpit master cards with a professionnal design !
I have designed dedicated electronic boards, all SMD component design, which just require to plug cables to obtain a working system :

The DSTACK card is the hardware processor, based on an Arduino DUE and handles easily 576 inputs and 360 outputs. This card has a wire connection to the network, to communicate with the X-plane dedicated plugin. I have also increased the number of servomotors to 15 and analog inputs to 14. On the bottom of the picture, notice the two connectors to connect two expansion cards, depicted below

DSTACK card = arduino DUE + connecting elements + Ethernet connection and Micro SD card
NTAV expansion board : connect to DSTACK and to 4 opencockpit mastercards

The NetAvionics (NTAV) expansion card is fully compatible with the opencockpit USB expansion card, and it allow similarly to connect 4 mastercards using the same connectors and cables (25 pins SUB-D). Two such cards can be connected to the DSTACK card, using the 26 pin connector at the center. A Servomotor card allow to connect 15 servomotors, using a serial connection which allows to use up to 20m (60 feet) long cables. This design is also necessary because Arduino DUE has 3.3V outputs while usual servomotors expect 5V control signals. The board both handles the voltage leveling and allow noise free control over long cable lengths.

NTAV servo card : drives 15 servomotors and connect to DSTACK card

Posted in Updates | Leave a comment

December update : working on FMC

Hello !

I’m working hard on the fmc. I have chosen to rely only on the X-Plane database, no data files will be specific to the FMC, in order to ensure a clean synchronization between X-Plane and the FMC. Any update of the X-Plane files (including using services like Navigraph or similar) is transmitted automatically to the FMC.

I didn’t imagine how complex the FMC route editor has to be. Just try on the FMCs you known to edit the legs list, containing airway segments, and look at how this is reflected on the route waypoint list, for example. I am really decided to reproduce the real thing as closely as possible, and I’m now taking the full measure of the amount of work needed !

Posted in Updates | Leave a comment

November Update (finally !)

Long time, no news !
But the project is still ongoing, and well !
I now have all the screens (PFD, ND, engines, …) working fine, except that weather radar and terrain radar are not yet implemented. All the cockpit hardware is supported.

I am currently working on a FMC independent of Xplane, which is based on a Raspberry pi Zero. The little Raspi has a composite video output, which is perfect for driving my recycled PS-one screen and the 69 keys FMC panel is handled using pushbutton matrix connected to the Raspi GPIO port.

Here are two pictures :

FMC, based on a Hispapanel panel and a PSOne 5″ LCD screen
Back side : notice the small raspberry pi zero (down right) which handle wifi communication with the XP11 plugin, drive the FMC keyboard and screen and run the FMC program
Posted in Updates | Leave a comment

March progress update

Hi !

Still workin’ hard ! I have finished all “basic” screens, i.e. PFD, ND, centered mode ND, Engine screen (upper DU) and MFD (both ENG and SYS). I am currently working on the TCAS implementation in ND and PFD, designed to work with AI planes and also online networks (IVAO, VATSIM). Next, I will work on the weather and terrain radar in ND, which are not implemented yet.

I have a test configuration running in my B737 NG 800 cockpit, which uses 4 raspberrys and one DSTACK, pretty cool … I will had a small video soon. I am also debugging the hardware part, but it’s pretty stable and easy to use.

I am also now thinking to add raspberry pi zero based FMCs. The power of the pi zero is enough for that, with a GPIO connector which hold enough pins to connect the FMC keyboard. But that’s for later 😉

Posted in Updates | Leave a comment

February Project Update

Hi,

I’ve been quite busy working on the system. I’m almost finished with the engines primary instrument screen (upper DU in the B737). Here are two rapid screen shots taken with my phone:

in-flight view. This is the “compact” display. The “TAI” symbol (Thermal Anti Ice) indicates that engine anti ice system is on.
Engines stopped

I have noticed that I have slightly different element placements depending upon the type of screen used and its resolution. I have decided to include a lot of user modifiable parameters so that “fine tuning” can be done for specific screen by a non-programmer, using a user friendly GUI. I am now doing the same for the other screens (PFD, ND) and I still have a lot to add to these. I am trying to follow as closely as possible the Boeing documentation to implement a maximum of realistic behavior.

Posted in Updates | Leave a comment

Tech tip #2 : Noisy servomotors

In many place in the simpit, I use servomotors : for the standby instruments, the flap and brake pressure indicators, and all the gauges in the overhead panel.

In the system I’m developing, the servomotors are driven by an Arduino DUE. The particularity of the DUE is that the outputs are 3.3V, instead of 5V. Anyway, even in the case of 5V driven servomotors, problems can occur when the cable between the command unit and the servomotor is more than a meter long … The command signal is altered, and the servomotor gets noisy, or even unresponsive.

This problem is very well known in the field of industrial systems, where command may be tens of meter away, in a noisy environment. In this case, a well know solution is to use a current signal, rather that a voltage signal, which is much more immune to noise. Of course, commercial converters exist, but I found their use to be too heavy and costly for my application. So, I gathered elements from the net and designed a very simple circuit to do the job. It makes use of two small transistors and four resistors, with a corresponding cost of the order of 1 euro …

Here is the schematics :

As you may note, the circuit is powered using 12 volts, which I use for panel lighting. Of course the servomotors must be driven by 5V TTL signals, but the circuit ensures that 5V command signal is delivered for supply from 7.5V and above. It has two parts, the left side with the transistors must be located near the arduino, and the R4 resistor is located at the servomotor level, between the command wire and the ground wire (usually the yellow and black ones). A current of about 4 mA is forced in the command wire, and is converted by the R4 resistor to 4mA x 1.2Kohms = 4.8V. So the command is done through a current on the line, not a voltage. Please note that I used 2N2222 and 2N2907, because I had it at hand, but any small transistors will do.

In my design, if you have followed my project, I have planned for 10 servomotors for the moment. So i realized a simple board with 10 similar units as described above, here’s the picture :

It’s very effective, I made some tests with cable length above 10 meters (30 feet), and it works like a charm.

Posted in Tech Tips | Leave a comment