Skip to content

CubanJew/msfs20_custom_spad_controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 

Repository files navigation

msfs20_custom_spad_controller

Microsoft Flight Simulator 2020 - Custom Flight Panel Controller

Description:

Custom control panel for Microsoft Flight Simulator 2020 using SPAD.neXt as interface between game and Arduino microcontroller. Designed with A320 in mind. Panel is meant to be mounted to the side of Logitech G Flight Simulator Panel bracket.

alt text alt text

Supports:

  • 17 pushbutton with LED (LED is controlled by state of control in the game). [fuel pumps 1-6, cross-feed pump, APU-master, APU-start, APU-bleed air, APU-gen, external power, auto-brake level control (low + med + max), x2 TBD (spare)]

  • 5 toggle switches [anti-skid, ground spoiler arm, engine 1 + 2 master starters, reverse throttle toggle]

  • 2 selector switches [engine mode switch (crank/normal/ignition), parking break]

  • 6 potentiometers (5 rotary + 1 slide) [lights: PFD/ND/FD, ECAM, flood, panel, x1 TBD (spare); speed brake (slide pot)]

  • 1 foot pedal switch [brake pedals]

Control board utilizes x3 MCP23017 I2C I/O expander ICs to provide control over 48 distinct inputs/outputs with just 2 Arduino pins. For LED outputs, each MCP23017 I/O pin is connected to an LED with a series resistor. For button inputs, each button is connected directly to an MCP23017 I/O pin, with an internal pull-up resistor enabled via software. All buttons are daisy-chained to ground on one side, and therefore no additional components are necessary for handling button inputs. Note that the pushbutton LEDs are controlled independently of the pushbutton meaning that the LED light state will reflect the state of the respective control in the game whether you cycle the control in the game or via the control panels physical button. The Arduino microcontrller handles detecting button presses and controls LED lights, and utilizes a 2-way serial connection with SPAD.neXT to interface with the game.

Installation Instructions:

  1. Build the control interface board by following schematics.

  2. 3D print STL files located in /Hardware/Panel 3D Files/STL/. You will need 3 Brackets, 1 Slide Potentiometer Lever Hat, and one of each of the three faceplates. Use soldering iron to heat insert four M3-4mm knurled brass inserts into each bracket's corner faceplate mounting holes and secure each faceplate to bracket with four M3-6mm bolts. Note that bracket top mounting holes are misaligned relative to the bottom mounting holes. If you wish to attach the three brackets vertically, drill new upper mounting holes to 2 of 3 the brackets. Bracket mounting hole alignment will be fixed in future.

  3. Install buttons/potentiometers on to faceplate holes (note: you will need to use a deburring tool to slightly enlarge the component holes as there is very little tolerance) and wire up connections between panel and control interface board. Daisy-chain switch/pot grounds together for each panel. Refer to Bill of Materials for parts information. Reference I/O connection summary table and schematic.

  4. To upload microcontroller firmware, install PlatformIO IDE and add /Software/AVR/FLIGHT SIM SPAD INTERFACE/ as new folder project. Upload code to your Arduino Pro Micro.

  5. Add control interface board to SPAD.neXt as a new Serial device to SPAD.neXt under settings->Devices->Serial Devices->"Add New Device" with the following settings:

    Serial Port = = your USB COM port

    Speed = 115200

    Enable DTR = ON

    32 Bit = OFF

    Save settings and restart SPAD.neXt. Verify control interface board serial device is connected to SPAD.neXt by going to panels->SERIAL COMXX and selecting "Show Log". If it is not connected press "Connect".

  6. Add each of the scripts included in /Software/SPAD.next Configuration/ folder to SPAD.neXt script panel.

  7. If you have flybywiresim's "A32NX" mod installed you will need to update the mod's light potentiometer indices in order to make the light potentiometers work (reference). Install Autohotkey and run script named A32NX Pot ID Fix.ahklocated in /Software/A32NX Pot ID Fix/

alt text

References:

Notes:

  1. Faceplate component holes do not have much tolerance; you will need to use a debururing to slightly enlarge the holes.
  2. The size of the microcontroller firmware is large relative to flash program memory of the Arduino Pro Micro. As such, many repeated firmware uploads may randomly corrupt the bootloader. You will need another Arduino or an AVR programmer to reupload the bootloader to allow firmware uploading from your IDE.

To-do list:

  • Fix bracket top mounting hole alignment.
  • Combine ground spoiler arm toggle switch and speed brake slide potentiometer into a single physical component.
  • Add logic to force game's initial state of anti-skid, ground spoiler arm, and parking brake to match control board when controller is first connected.
  • Implement spare 2 buttons and 1 potentiometer on panel.
  • Fabricate front faceplates with backlit labels using http://www.frontpanelexpress.com/
  • Clean up code
  • PWM brightness control for LEDs

Version History:

  • 10/14/20: Initial release
  • 01/05/21: Update valve indices due to game update for fuel x-feed (from 1 to 3) pushbutton & LED [main.cpp, digital.cpp]; ENG1 & ENG2 MASTER SWITCH (from 6 & 7 to 1 & 2, respectively) SPAD scripts [ENG1 MASTER SW.xml, ENG2 MASTER SW.xml]

About

Microsoft Flight Simulator 2020 - Custom Panel Controller

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published