Network based CDU

CDU project for PMDG NGX Data and Events Server

Author: Ireneusz Niemirowski

01_CDU

Contents

Introduction. 
How it works. 
What is needed. 
Software. 
Hardware. 
Installing Windows IoT Core on Raspberry Pi 
Installing CDU application on Raspberry Pi
CDU Keyboard. 
LEDs connections. 
Short manual of CDU application. 

Introduction

I started this project with the intention of building a home simulator based on PMDG 737 NGX. The idea of CDU was born after the completion of electronics to 737 MCP. I installed Peter’s Virtual CDU and began to think about whether it could be implemented on a platform that would allow running a stand-alone CDU with its own screen and keyboard, communicating with PMDG NGX Data and Events Server.

After searching the Internet, the most convenient platform seemed to be Raspberry Pi, the more so – as it turned out – it could work on Windows 10 IoT core. I wrote about it on the forum, and Peter confirmed that he was also thinking about something like that. Encouraged by him, I decided to try, naively thinking that it would be enough to compile the code of his Virtual CDU for RPi processor (ARM). Unfortunately, reality turned out to be more difficult.

As Windows IoT (Internet Of Things) is intended for mobile devices and various types of “smart” devices, applications running under this system are written in the new Universal Windows Platform interface. It is to ensure that applications can be run on a wide range of devices. So it became clear that Peters’s Virtual CDU needs many modifications to migrate to UWP. As my knowledge of C# was none (and in general, my programming skills are at basic level), the case seemed hopeless. Nevertheless, I decided to work on this topic. Starting from learning C# syntax, I slowly read the Virtual CDU code to understand the principle of how the program works and how it communicates with PMDG Data and Events Server.

Getting into the topic more and more I came to the conclusion that it would be easier for me to write the application from the beginning, basing on the knowledge I gained from Virtual CDU. Now, after five months, I have a working, stand-alone CDU, communicating over the network with PMDG 737 NGX, via Peter’s PMDG Data and Events Server.

You can see a short video o working CDU application on Youtube (left CDU – RPi 3B+, right – RPi 2):

https://www.youtube.com/watch?v=SNP6_JbkSgA

I wrote this tutorial for people who would like to test this solution.

How it works

PMDG 737 NGX serves data variables of current states and values ​​of indicators, switches, displays etc. It can also transmit data displayed on CDU screens. This data can be sent over the network via PMDG Data and Events Server. The application running on Raspberry can read and display these data on the LCD screen, also controls the CDU LEDs. In the opposite direction, the CDU keystrokes are received by Raspberry and sent over the network to PMDG Data and Events Server, which further transfers the appropriate events to PMDG 737 NGX.

What is needed

Software

  1. PMDG 737 NGX with SDK broadcasting enabled – you can read about this here: https://phpjj.wordpress.com/pmdg-data-and-events-server/
  2. PMDG Data and Events Server – download links are on Peter’s forum about FSIO: https://www.tapatalk.com/groups/phpjj/
  3. CDU_Malyna application for Raspberry Pi – can be downloaded from here:
    http://petrifiedwood.pl/cdu/CDU_Malyna_1.0.0.0_ARM.appx
  1. Two .NET Native packages for ARM processor:

Microsoft.NET.Native.Framework.1.7.appx

Microsoft.NET.Native.Runtime.1.7.appx

They can be found and downloaded from the Internet, for example from this project:
https://github.com/colinkiama/Mango-App-Store-Public/releases/tag/v1.2.4.0-prerelease

Hardware

  1. Raspberry Pi 3 Model B or B+.

RPi 2 also works, but a bit too slowly. RPi 3 Model B+ works but so far it is not fully supported by Windows IoT, which causes some problems (mentioned below in the Installing Windows IoT section). So I suppose that RPi 3B will be the best choice for now, although I tested the application on RPi 2 and RPi 3B+.

02_RPi

  1. 5” ZJ050NA 08C 640×480 LCD Screen with VGA AV LCD Controller Driver Board KYV-N2 V6.

I bought it on eBay as a set. They are in two versions: with HDMI and – cheaper – analog VGA input (both have also composite video input). VGA version will require an additional HDMI-VGA adapter (the quality of picture is very good in this configuration – I use it).

03_VGA

  1. Micro SD card – class 10, 16 GB will be enough.

You will need a card reader to install Windows IoT on the SD card.

It is very important to have good quality SD card, for good system performance.  RPi boot problems and slow working speed are reported with poor quality SD cards.

Microsoft Verified Micro SD Cards to work with Windows IoT Core are:

  • Samsung EVO 32GB Class 10 Micro SDHC Card,
  • SanDisk Ultra Micro SDHC, 16GB Card.

I use SanDisk Ultra like this:

04_microSD

  1. CDU keyboard’s PCB.

PDFs (1200 dpi) for make two layers PCB (140×200 mm) by the toner transfer method can be downloaded from this link:

http://petrifiedwood.pl/cdu/Malyna CDU ver. 1.1.zip

05_PCB.jpg

  1. DELL SK-8115 USB Keyboard.

I bought two of them as used for a few dollars.

It is possible that other very similar DELL models will have the same controller and the same matrix keymap.06_SK-8115.jpg

07_SK-8115a.jpg

  1. Some electronic parts: 69 TACT switches 6x6x7.3 mm, LEDs, resistors, wires.08_tact.jpg

Installing Windows IoT Core on Raspberry Pi

To install Windows IoT Core you will have to download and install Windows 10 IoT Core Dashboard from:

https://docs.microsoft.com/en-us/windows/iot-core/downloads

Run Windows 10 IoT Core Dashboard and select “Set up a new device”. Set device type, select drive (SD card), input device name (for ex. Left-CDU) and admin password to the system.

Click “Download and install” and wait for the whole process to be completed.

09_Setup.jpg

Note: In case of Raspberry Pi 3 Model B+ you cannot install Windows IoT Core in the above way. RPi 3B+ so far it is not fully supported. For RPi  3B+ you have to download RaspberryPi 3B+ Technical Preview Build 17661. To do this you must join Windows Insider program. Microsoft will probably support RPi 3B+ in one of the future releases of Windows IoT Core, but so far it is not (May 12, 2019).
The only limitations I noticed in the RPi 3B+ operation are lack of Wi-Fi and a longer system start time. RPi 3B+ boots Windows IoT Core around 2:45 min compared to RPi 2, which boots it about 1 min.

Here you can read Release Notes for Raspberry Pi 3B+ and download Technical Preview Build 17661:
https://docs.microsoft.com/en-us/windows/iot-core/release-notes/insider/rpi3bp

Full instructions for installing Technical Preview Build 17661 on RPi 3B+ are available here:
https://www.ewebville.com/10-simple-steps-to-install-windows-10-iot-on-raspberry-pi-3-b/

After system installation on the SD card, three new virtual disks will be connected: EFIESP, MainOS and Data. Windows can report messages about unformatted disks – just cancel them.

On the disc labeled EFIESP there will be a file config.txt This is the configuration file for Raspberry.

To force Raspberry to operate at the resolution of 640×480 (CDU application resolution) you have to edit config.txt and change some graphics settings.

In Video section comment with hash # sign lines:

#hdmi_group=2                # Use VESA Display Mode Timing over CEA
#hdmi_cvt 800 480 60 6 0 0 0 # Add custom 800x480 resolution (group 2 mode 87)

Add new lines in Video section:

hdmi_group=1
hdmi_mode=1

You can read more about Raspberry video settings on: https://www.raspberrypi.org/documentation/configuration/config-txt/video.md

Write config.txt, insert the SD card into the Raspberry, connect the monitor, network cable, mouse, usb keyboard and power on the RPi.

First boot of Windows IoT Core takes a few minutes. During the first start you will have to choose system language and enter the administrator password (the same as during installation). After the correct startup, you will see the standard system application screen like below.

10_IoT.jpg

Installing CDU application on Raspberry Pi

To complete the next steps you must have your Raspberry working in the local network (RPi has a local IP address assigned).

In Windows 10 IoT Core Dashboard select “My devices”. If your Raspberry works properly in the network you will see it on the list.

11_devices.jpg

Right click on the device will open the pop-up list. Select “Open in Device Portal” and login with your administrator password. You can also do it directly in the browser by entering the IP address of your Raspberry with port 8080 (for ex. 10.0.0.2:8080).

In the Windows Device Portal select “Apps manager” next “Add” and “Install app packages from local storage”. Select applications from your hard disk one by one and install them in the following order:

  • NET.Native.Framework.1.7.appx
  • NET.Native.Runtime.1.7.appx
  • CDU_Malyna_1.0.0.0_ARM.appx

After installation, all you have to do is mark the dot next to CDU_Malyna application in the “Startup” column. The CDU will start working and will automatically run every time you start Raspberry.

12_run_CDU.jpg

CDU Keyboard

The CDU application is controlled by a keyboard connected to Raspberry via USB port. I designed a CDU keyboard and connected it using the USB controller removed from the PC keyboard – DELL SK-8115.

Below are pictures of DELL SK-8115 controller and pins. The pins are covered with carbon, which has to be scratched to get to the copper tracks that can be soldered.13_SK-8115.jpg

14_SK-8115_pins.jpgThe controller’s pins connections to the PCB (top side) are as follows:15_PCB_pins.jpg

CDU keyboard is a matrix of 11 x 8 inputs. If you want to make your own PCB for CDU keyboard, you have to design the following matrix:

  B12 B11 B10 B9 A5 A4 A3 A2
B8 L1 L2 L3 L4 L5 L6 CRZ
B7 INIT RTE CLB R1 R2 R3 R4 R5
B6 MENU LEGS HOLD PROG EXEC R6
B5 N1 FIX A B C D E
B4 PREV NEXT F G H I J DES
B3 1 2 3 K L M N O
B2 4 5 6 S T
B1 7 8 9 U V W X
A13 .
(DOT)
Z SP DEL /
A10 P Q R Y
A9 0
(ZERO)
DEP +/- CLR

Below are dimensions of the LCD and input points positions on the screen.

Note: These are dimensions of 5 inches LCD used in this project and my application screen data displayed – not dimensions of real 737 CDU.16_dimensions.jpg

It is possible to connect any PC USB keyboard for do some testing, but its use will be painful. There is mapping picture for testing purposes:17_testmap.jpg

LEDs connections

The CDU LEDs are connected to the Raspberry’s GPIO pins. The PCB provides connections for one or dual LEDs for each indicator. LEDs have common anode and it is powered from RPi 3.3V. You have to choose resistors suitable for your LEDs. Below pictures with LEDs connections to Raspberry and CDU keyboard.

18_GPIO.jpg

19_LEDs.jpg

Short manual of CDU application

Start menu works like a typical CDU screen. It has input line and options operated by L and R buttons.

20_CDU_Menu.jpg

L1 – input IP address,
L2 – input port,
L4 – change between  LEFT/RIGHT CDU,
L5 – autoconnect ON/OFF,
R1 – info about application,
R4 – connect to PMDG Data and Events Server,
R6 – shutdown the system.

IP and port numbers are stored in the config file for use during next startup. The file is saved when you press Connect.

The application should detect errors in the connection. In this case, you have to wait some time until the application resumes working and returns to the start menu.

It is recommended to turn off the system with the Shutdown button, however, I have not noticed any problems with the hard power off, except, that if you turn off the power and turn it on too quickly, the data in the config file may be lost (the file will be rebuilt).

If you enable Autoconnect the application will attempt to automatically connect to the server during startup. To make it possible to return to the start  menu, an additional Restart button (L6) on the main CDU menu is available. It restarts the application without restarting the system.21_MENU.jpg

That’s all. I will be very pleased if you use this project for your simulator.

Good luck. Irek.