Exporting MPCD and avionics to a secondary monitor

Howdy! I have bought a small 7″ LCD, resolution 800×600 for my setup. Here’s a quick guide about how to export avionics to an external / secondary LCD or monitor.

My main monitor is a 1920×1080 23″ or something. It’s fairly small, due to the lack of space on my desk. I have configured the additional 7″ monitor as the primary then I created an ad hoc configuration for it. The simplest way to do this is by copying and existing similar config and edit it.
Monitor cfg files can be found in \Config\MonitorSetup.

I created a few different config files but most of them are similar so I’m going into the details of just three of them:

  • RW: a single file to display the ABRIS (Ka-50), the TV screen and the RWR of the SA342;
  • F/A-18: the AMPCD is not in a really comfortable position hence I decided to export it;
  • AV8B NA: just for the sake of experimenting, I have exported the Right PCD.

Setting up the Views

This is the file for the RW. The first part of the file is similar for both configs.
_ = function(p) return p; end;
name = _('RotaryWing');
Description = 'RotaryWing: Ka-50; SA342 profile'
Viewports =
{
Center =
{
x = 0;
y = 0;
width = 1920;
height = 1080;
viewDx = 0;
viewDy = 0;
aspect = 1.777;
}
}

RIGHT_MFCD =
{
x = 1921;
y = 0;
width = 600;
height = 800;
}

SA342_TV =
{
x = 1953;
y = 0;
width = 570;
height = 490;
}

GazelleRWR =
{
x = 2071;
y = 495;
width = 300;
height = 300;
}

UIMainView = Viewports.Center

Viewports describes the main monitor, RIGHT_MFCD represents the ABRIS (default name) wherease the other two entry are included using a different tecnique I will cover later.

This is the cfg file for exporting the AMPCD:

_ = function(p) return p; end;
name = _('fa18');
Description = 'fa18'
Viewports =
{
Center =
{
x = 0;
y = 0;
width = 1920;
height = 1080;
viewDx = 0;
viewDy = 0;
aspect = 1.777;
}
}

CENTER_MFCD =
{
x = 1921;
y = 0;
width = 600;
height = 600;
}

F18RWR =
{
x = 1921;
y = 650;
width = 150;
height = 150;
}

UIMainView = Viewports.Center

It includes the code to export to the RWR. I am not currently using it since the monitor is not big enough to host both views (I have also attached a Thrustmaster MFD on top of it. Velcro rules!). I haven’t tried exporting the Left or Right MPCD but I guess the standard nomenclature will do (RIGHT_MFCD and LEFT_MFCD).

Last example, the Harrier’s Right MPCD. The beginning of the file is the same as the F/A-18 (of course the name and description are different) so I paste just the interesting part:
RIGHT_MFCD =
{
x = 1921;
y = 0;
width = 600;
height = 600;
}

Please not that this will not export the MPCD unless you bind the reletive buttons from the Controls options and activate the export in-game. The easiest way to find these controls is to open use the Search function, type “export” and bind them.

export-binding-harrier
Binding the MPCD Export controls for the Harrier.

More lua editing

Now that the Views are up and running we need to tell DCS what to export. In some cases there’s no need to do it because DCS deals with that on its own, for instance the ABRIS or the AMPCD. In other cases, we have to manually specify what to export and link them to the Views.
NOTE: these files might be overwritten in case of Repairs or Updates. You can either make a copy of the modified file and overwrite the new file every time or use OvGME or similar tools.

Exporting SA342 RWR and TV

The RWR file is located in \Mods\aircraft\SA342\Cockpit\RWR\indicator\init.lua. This is the code I have appended in order to export the RWR:
dofile(LockOn_Options.common_script_path.."ViewportHandling.lua")
try_find_assigned_viewport("GazelleRWR")

As you can see, it’s quite easy. The same principle applies to the TV; its file is located in \Mods\aircraft\SA342\Cockpit\TV\Indicator\init.lua.

dofile(LockOn_Options.common_script_path.."ViewportHandling.lua")
try_find_assigned_viewport("SA342_TV")

I have found these info on ED’s forum, credits to them.

Pictures time!

Some pics of the setup and the 7″ LCD. Note that the MPCD is not centered relatively to the TM MFD simply because of the position where I took the picture.

As usual, feel free to comment and ask if you need any help πŸ™‚

Advertisements

132nd VW Training Mission: Op Snapshot

Training mission run last Sunday, it has been my first taste of multi-asset combined operation.. Juicy taste but also a very hard bite.

This slideshow requires JavaScript.

Asset that partecipated:
3x Ka-50
1x Mi-8
6x A-10C
6x F/A-18C
2x Controllers (ATC/AWACS)

Kudos to everyone involved in the planning; in particular AssafB, great mission maker, Junior that has prepared the RW package briefing and led it and the controllers. Coordinating so many assets plus having to deal with a good number of green pilots must have been tough!

This is an extract from my stream with complete Briefing and Debriefing. The full stream was 3h59’10”.

Arduino Control Box: a Step by Step Guide – Part 7 – Closing the cirle

At this point, the Control Box should be finished, the last step is downloading the firmware and upload it to the board. I have covered the whole process in this post.

Now it’s testing time!
In order to test buttons and encoders, you can use the Windows Game Controllers (Startβ†’”Set Up USB controllers”). It can check the status of up to 32 buttons, so it’s very, very limited.

A great alternative is Pointy’s Joystick Test. This simple yet very useful program allows you to test way more buttons. I have used it to test both my Auxiliary Panel and the Virpil MongoosT-50 Throttle.

Throubleshooting this Control Box is quite straightforward: software-wise there’s little to nothing to do; the harware continuity test should have been performed and passed already.

Now open DCS and start assigning you buttons. The Control Box will be seen by DCS as any other controller such as joysticks or pedals and identified by the name you have defined when you have changed the VID and PID.

SbS_7-dcs-controls
Assigning functions to the Control Boxes in DCS

Reviewing DCS-BIOS & TFT

Due to the changes to my setup, I had to rotate the TFT. I originally planned to rewrite the code from scratch since in the first implementation I have used different techniques but, at the end of the day, I decided to keep most of the code.

This is the original TFT for the Ka-50, based on DCS-BIOS:
tft

..aaand *drum rolls* this is the new one!

tft-new-dcs-bios
The new implementation of the TFT

I haven’t recorded a video yet, I will do it sooner or later.
I have added a few useful information that normally are not easy to read, such as the RPM limits for the left and right engine (impossible to read if head-down or zoomed in), the UGM8 selector (НР/АКБ in Russian) to check the ballistic settings before firing a rocket / gunpod and a reminder of the Auto/Manual authority over the weapons.
A message will also remind me when it’s time to turn on the fuel tanks Cross Feed, plus a status light will confirm the switch position. The four circles represents the external pumps: when they turn off, the external tank is empty.
Finally, the VVI is now digital, with a big symbol indicating the current status: ↑, ↓, =.

October ’18 – Current Setup & Future plans

This is the current status of my setup, although it won’t last long πŸ™‚

setup-201810-complete

The UFC/PRTz/PVI-800 is proving to be one of the best and most useful box I have built so far. I don’t fly the F/A-18 much so I don’t have a concrete idea of how much the UFC is used, but on the Ka-50 is great: the bottom encoder and buttons control the ABRIS, the numpad is great to input data such as target coordinates in the PVI-800 and, by simply toggling the Master Mode, I have control over the PRTz.

setup-201810-UFC

But my update is not finished yet! I have found a 7″ 800×600 LCD monitor that might fit well as Shkval or the F/A-18 moving map (MCPD?).
This is a diagram of the current setup (I always plan my changes in this 1:1 LibreOffice Draw-made diagram):

setup-201810-diagram-1

The first step will be the addition of two boxes, one for each MFD. The TFT will be also rotated horizontally and placed on top of the UFC.

setup-201810-diagram-2-new

Finally, I plan to attach the Saitek Throttle Quadrant to the bottom of the left box to increase the whole stability and, starting by one, adding the 7″ monitors. The Thrustmaster MFDs will be fixed by means of Velcro, so I can remove them in case of flying on the Ka-50.

setup-201810-diagram-3-final

I’m still not sure about the right LCD. It will be a later addition to the setup; I might place it vertically so it will be a decent ABRIS.

Arduino Pills – Setting up IDE and Libraries

Another quick pill about Arduino, this is about setting up the IDE and manage libraries.

Arduino IDE (Integrated Development Environment) is not as advanced as other solutions but it’s quite light and easy to use. It can be found here.

Once installed, you might want to change the default sketchbook location by opening File→Preferences.
Now download, save and open a source file, for instance the one we are using in the Step by Step guide (it can be found here on AM-STUDIO’s GitHub) then compile it. You will get a number of errors, let’s review them.

Libraries

Libraries are, simply put, a collection of methods and functions that tell the board how to perform certain tasks. The default package contains only a little fraction of the available libraries, not to mention the fact that you can write your own. The “Joystick” library, that our project requires, does not come by default so we have to install it in a specific location. That location is the “libraries” subfolder of the aforementioned default sketchbook location.

arduino-pills-2-libraries
“libraries” subfolder location

Let’s download the Joystick library from GitHub and install it.
Careful though to respect the order of the subfolders: the ZIP file comes with a folder called “ArduinoJoystickLibrary-master”; if you copy this folder in your libraries your project won’t compile. So:

  1. open the ZIP file;
  2. open the “ArduinoJoystickLibrary-master” folder;
  3. copy the “Joystick” folder;
  4. Paste it into your Arduino “libraries” folder.

A couple of friends had to install the “keypad” folder as well. This library can be installed in a different and faster way. Go to Sketchβ†’Include Libraryβ†’Manage Libraries and look for “keypad”. Scroll until you find the library I have selected in the following screenshot and install it.

arduino-pills-2-keypad-library
Installation of the Keypad library

Lord of the boards

Last step is selecting the correct board and the relative port. Depending on which board you have bought, select either “Arduino Leonardo” or “Arduino/Genuino Micro” from the Toolsβ†’Board: “xyz”. Then, in a similar way, select the correct port from the “Port” menu: Toolsβ†’Port: “xyz”.
Both entries report the last option selected.

Quick troubleshooting

Always try to isolate the issue. Since we are using a source code that definitely work you should fairly easily found the issue, at this stage is either a library problem or missing or a connectivy issue. The IDE suggests you where the problem is. The following, for instance, is caused by the selection of an incorrect Port.

arduino-pills-2-error
Arduino uploading error: wrong port selected

Arduino Control Box: a Step by Step Guide – Part 6 – Release the Solderer!

“Solderer” – Is that even English? Not sure.. I’ve just seen the release trailer for the Kraken in Star Citizen and I got carried away..


Anyway, part 5 ended with every component allocated and screwed in its location. Now it’s time to replicate the wiring diagram into reality.

SbS_6-soldering-control-column

Soldering the wires is not difficult at all, it’s just a matter of practice. Here are a couple advices that might help you:

  • Don’t overheat! don’t leave the soldering iron in contact with wires and components for too long. You can melt the plastics of both the components and the wires.
  • Leave the Arduino board for last. Especially if you are not used to solder, it might happen to drop drops of melted solder wire. If one of them falls on the board, it might cause severe damages to it.
  • Place the wires first. Most of the components have a small hole on their pins. You can usually place your wire there before soldering it.
  • Pre-solder wires and contacts of any component that haven’t the aforementioned hole. By doing that you will need to hold your wire with one hand, the soldering iron with the other and that’s it: the solder material is already in place.
    To pre-solder just place the iron and the solder in contact with the uncovered core of a wire. You will notice that it will be quickly covered by the solder; making your life much, much easier.
  • Clean your soldering iron every now and then. Solder and antioxidant might accumulate on the iron after a while (they usually form a black mass). Hold the soldering iron tight with your hand, make sure there’s nothing in the area underlying the iron and hit your table with your fist: the burnt material will drop from the soldering iron. Nice and easy.
  • Save your furniture! Melted solder and the iron itself are hot, easily more than 300+ deg C. Although the solder becomes cold in milliseconds, it can still damage your furniture. Place some cardboard or do your soldering on an appropriate surface. You will thank me when your wife won’t kill you for damaging her precious table πŸ˜‰
  • If you have to connect a wire where another one is already soldered, add some solder and pre-solder the new wire. The new material will help spreading the heat.
  • Same as the previous point, if you do a mistake and can’t remove a soldered wire, add some solder: it may sound unintuitive but it helps spreading the heat uniformly.

That being said, this phase is quite straightforward as long as you follow a plan. I usually follow the same order I adopt when designing the wiring diagram; therefore I start from the wire that comes from the top pin of the board (although the board is always my last step) then proceed with every common connection such as GND. When the matrix is completed I then solder the encoders.

SbS_6-soldering-ufc

After completing the soldering of the circuit we can proceed and perform a quick test the continuity of GND, lines and buses by means of a multimeter. Do this check before connecting the board to the USB. The board is protected and we are working with low tensions but you know, better safe than sorry.
If the test doesn’t show any issue we can plug the board, load up Arduino IDE and write our firmware.