DIY Flight Sim Multi-Function Displays (MFDs)
by LimaJuliett in Circuits > Computers
5297 Views, 14 Favorites, 0 Comments
DIY Flight Sim Multi-Function Displays (MFDs)
This article is out-of-date. I do not recommend this build without a different mounting method. I believe the force from button presses on the display panel caused premature failure of the monitor I used for this project. I am working on a version 2 and will add a link when it's complete. This article will be left up for posterity.
~~~
I am a long-time flight simulation enthusiast and recently started flying the F/A-18C Hornet in DCS. The Hornet includes three cockpit displays which use buttons around their perimeter for controls. In DCS (as with many other flight simulators), the mouse is used to click on cockpit buttons and switches. This is usually fine, but there are three factors that make using the mouse to click these buttons a problem.
- The buttons are relatively small and it's difficult to keep the viewpoint still enough to accurately click these buttons. (I use a headtracker, which means in order for the viewpoint to be still, my head has to be completely still.)
- I am right-handed, so I'm used to using a mouse with my right hand. However, I also follow the usual configuration of the stick in my right hand and the throttle in my left. This means I have to either remove my hand from the stick for a few seconds and effectively lose control of the aircraft, or remove my hand from the throttle and use the mouse with my non-dominant hand.
- In the Hornet particularly, the radar is controlled primarily through these buttons, and the radar also needs to be constantly adjusted in rapidly evolving combat environments, which means quick and accurate control is necessary.
Thrustmaster sells the Cougar MFD in a pack of two for around $100. I considered just buying those, but I had a few issues with them.
- They cost about double the price of my estimated material costs to build it myself, and I'm a broke college student so it counts. :)
- They don't come with displays. I have a second monitor that I could use, but mounting them would be a challenge. I would have to build something custom.
- They're small. My second monitor can comfortably fit two larger displays side-by-side, which is important since the monitor sits at the back of my desk, and if the displays are too small I won't be able to read them.
With these issues in mind, I elected to build my own.
Since my desk setup is pretty unique, most of this article will be explaining what I did and why, not telling you what to do. I will include advice where I think it's important, but just know that blindly following everything I do probably won't give you a good final product.
I recorded most of the step and put them on YouTube in this playlist.
Supplies
- Microcontroller
- I used a Sparkfun Pro Micro but any ATMega32U4 Arduino will work. I've previously used Teensy boards for similar projects but I wouldn't recommend it because they are generally more expensive.
- Buttons
- Finding the right size and shape button is difficult, so I used small and cheap tactile buttons (tactile is important, no tactile = no clicky = sad) and 3D printed a plate and button faces to provide the right size and shape
- Perfboard (also called prototyping board or protoboard)
- You could conceivably use stripboard, which has rows of holes already electrically connected. Using stripboard could make soldering easier, but at the cost of a larger board footprint. I chose to use non-stripboard for my design.
- PCB Standoffs/Risers
- You will need many of the same height, so I would recommend against buying a kit of assorted sizes. In the end, I used 40 standoffs (M3).
- Solder
- Soldering is required. Your choice of solder, soldering iron, etc. is largely personal.
- This is not a good first/second soldering project. It would just be frustrating and discouraging. That said, the soldering part of this project is not that difficult if you have a little experience and the right tools.
- Soldering carries some inherent dangers (burn/fire hazards, toxic fumes, etc.) that I am not responsible for.
- 3D printed parts: you don't need any 3D printed parts for this to function, but I added faceplates and buttons to make it look nicer and be easier to use.
Total cost of supplies was about $30. You can usually get a lower cost per unit if you buy more, especially the microcontoller and especially if you're buying online.
More details in this video.
Plan
I was planning this project on and off for about six months. It is very important that you have some way to show the cockpit displays in the right place on a second monitor for this to work as intended. DCS (the simulator I use) has a way to do this natively that involves some relatively low-level file editing (discussed in Step 7). This can also be done with third-party software. Either way, make sure you can properly show cockpit displays at any place and at any size on a second monitor.
Also plan out the circuit you will use, both for each board and the entire rig. For clarity, each small board that housed a row of five buttons I call button boards and the board with the Pro Micro is the main board. I drew abstract circuit diagrams for these boards first, then translated them into sketches to be soldered onto perfboard.
Some of you may have noticed that there are 40 buttons total and less than 40 pins on the Pro Micro. For one Pro Micro to handle that many inputs, we require a button matrix. (Google "button matrix" for more info.) Simply put, this allows us to test each button board separately for depressed buttons, which means we can reuse pins on the Pro Micro and reduce the number of pins required. I used an 8x5 matrix, with a common line going to each button board and five "output" lines running back to the main board. This gives the ability to handle 40 buttons with 13 pins.
Diodes: Keyboard button matrices contain diodes to prevent shorts to ground that can happen if certain combinations of keys are pressed simultaneously. In this project, I decided diodes were unnecessary due to the low probability of the proper combination ever being pressed, the sturdiness of the Pro Micro (it probably wouldn't care if there were a short from power to ground even for a few seconds), and the slight increase in complexity and cost diodes would bring.
Planning the electronics are important, but planning the mechanics is equally important. I attached everything to a piece of plywood cut to the exact size of my monitor and sanded to fit. (The back is also sanded to reduce the risk of scratching the display.) The plywood sits inside the lip surrounding the display and holds itself there surprisingly well. While convenient, this mounting strategy meant putting the PCB risers' small machine threads into thin plywood through the use of exact pilot holes. I used a scrap piece of the same plywood as a tester to make sure I didn't drill the pilot holes too big. To position the pilot holes, I used a 1:1 scale paper template. This worked almost perfectly (all standoffs correctly positioned and only one of two stripped), but it was very stressful since the holes had to be perfectly sized and therefore perfectly positioned.
If I were to do this again, I would use some sort of threaded insert or 3D printed mounting solution to attach the PCB risers to the plywood.
Prototype and Write Software
For developing the code, I used a 3x3 button matrix on some solderless breadboards. This was useful for creating the code and building an understanding about button matrices. If you want to use my code, it's attached to this step.
I didn't prototype the entire assembly with plywood because wood is incredibly expensive at the moment. However, every technique I was planning on using I had done before with similar projects, so this was not as necessary. I did however do extensive physical prototyping with cardboard to refine the size and position of the two displays and determine the spacing of the buttons around the perimeter of the displays. This was important so that the buttons on the finished product would align with the corresponding items on the display as in the real aircraft.
More details here.
Downloads
Create Mounting System
Like I've described above, I used a piece of plywood cut to just the right size to slide into my monitor. Holes in the plywood, precisely drilled using a paper template, had PCB standoffs screwed in, onto which the boards attached. However, this system was difficult to implement since the holes had to be drilled exactly the right size and in exactly the right places. It may be preferable to use threaded inserts or a different mounting solution altogether.
More details in this video and this video.
Solder Main Board and Fix Pro Micro
This board was designed to be as small as possible, since space on the monitor's face was limited. It may be desirable to put the Pro Micro upside down to prevent the red power LED from shining in your face. However, an LED also flashes every time a button press is sent to the computer, which is nice visual feedback. You could 3D print a cover to block the power LED but not the other one. Consider all options before deciding whether to mount your Pro Micro facing outwards or inwards.
At first, I planned to make my own cables with ribbon wire and DuPont ends to connect the button boards to the main board. However, I realized that the wire (32 AWG stranded ribbon wire) and connector type (DuPont) I was trying to use just weren't compatible. However, I had some 22 AWG solid-core wire, which has the advantage of fitting perfectly into standard female pin headers. I therefore soldered female pin headers to the main board, then stripped the last few centimeters of the wire and pushed the bare metal straight into the pin header, which worked perfectly.
The Pro Micro has a fairly serious design flaw: the Micro USB port is surface-mount soldered, not through-hole soldered, which means it's very easy to rip off after even gentle use. I was extremely lucky and didn't damage any critical connections when this happened, so I was able to superglue it back on. However, the same thing happened to me again on a different project, and I now take the practice of putting some two-part epoxy around the MicroUSB port on all my Pro Micros right after verifying that they work. The image in this step is JB-Quik applied with a popsicle stick with the end cut at an angle with scissors to make it sharp enough. Make sure not to get any inside the port itself or you might not be able to get a connector in!
Solder Button Boards
Once I actually began soldering, I realized some flaws in my initial plan and continued iterating until I was happy. Functional boards were still used (no sense in throwing them out if they work), but once I had a design I liked, I switched from making one board at a time to producing them assembly line style. I first cut boards to size with the score and snap method, using a sharp screwdriver and the edge of a table. Then, I drilled mounting holes, then soldered all the buttons on, then ran lines of solder to make connections. Once that was done, I positioned a board, spooled out the approximate length of wire required to connect it to the main board, and soldered those wires on. I would then screw down that board to keep them from getting mixed up and repeat for the next board.
Some board design here and more details on the button boards here.
Test Hardware
This is a good time to test that everything is working as intended, since all the electronics are still exposed and easy to measure and adjust. A note on testing: I use joy.cpl (Windows 10) to test my flight sim hardware, which is very useful but only displays a maximum of 32 buttons. This means if you have all 40 buttons wired up and the code creates a joystick with 40 buttons, only 32 will show up in joy.cpl. This doesn't mean anything other than the first 32 buttons are working. To test the last 8 buttons, I used the flight simulator I planned to use the MFDs with (DCS).
Configure Simulator
This section is about DCS specifically. If you have a different flight sim, this section does not apply.
DCS comes with a bunch of "monitor setup" presets. They allow for things like expanding the view across multiple monitors and showing the MFDs in different places. Each monitor setup is stored as a .lua file in .../DCS World (OpenBeta)/Config/MonitorSetup by default. I started with the 1Camera.lua file and added the LEFT_MFCD and RIGHT_MFDC with an x, y, width, and height.
My second monitor is left of my main monitor, and (0, 0) is at the top left of Monitor 1 (my main monitor), which means if I were to put the MFCDs on the left monitor without changing the display layout, their x coordinates would be negative. However, I could never get this configuration to work with DCS. I solved this problem by moving the second monitor to the right of the first in Settings (I didn't bother to physically move the second monitor), and making the x coordinates of the MFCDs positive. I also had to change the horizontal resolution in DCS to have it stretch across both monitors. Applying these changes requires a restart of the simulator.
Add 3D Printed Parts
I modeled and printed the parts to attach on top of the button boards. I tried to print with sharp square corners on the outside at first, but they peeled up so I switched to rounded outside corners. I kept the sharp inside corners to make sure the whole display would remain visible.
The holes in the model for bolts are quite large relative to the bolt because 3D printers print horizontal circles a little small.
As you can see in the pictures, I used tape to keep the buttons from falling out while I was placing the top covers on the button boards. Since I now have access to a 3D printer, a future design may be much more 3D printed to increase help with tolerances and consistency between buttons.
Avoid My Mistakes
Some things I would do differently (listed from most to least important):
- Figure out how to attach PCB risers without putting them straight into the plywood.
- Explore more options for connecting the button boards to the main board. Ribbon wire would be nice if it were easy to create ends, and a different connector type could be more viable than DuPont.
- 3D printing more components could help give the buttons a more consistent feel and solve some of the mounting problems.
- Mount Pro Micro upside down or add 3D printed cover to eliminate red power LED shining in face.
It would also be nice to avoid this issue, which is another reason to pursue an alternative mounting method.