Close

Much Ado About Busses

A project log for Flight Simulator Helicopter Collective

DIY helicopter collective for flight simulation applications, with interchangeable heads.

ryan-spicerRyan Spicer 03/29/2018 at 02:060 Comments

One of the key requirements I set up for this project is the ability to interchange the "button boxes" on the end of the collective to match the switchology of different helicopters that I might simulate. I also wanted to be able to configure the throw of the collective lever to match different platforms: within DCS, the Ka-50 attack helicopter's collective barely moves from the horizontal, while something like the Mi-8 or Gazelle has something more like 30-40 degrees of travel. To address this challenge  I went through several revisions of the concept to get to where I am now: PCBs out to oshpark for fabrication and components in flight from Mouser.

My initial thought was to use several 74HC165 shift registers to convert parallel switch inputs to a serial line, to connect to the microcontroller in the base. This is the approach that Thrustmaster uses in their Warthog and Cougar lines: microcontroller in the base and each interchangeable grip contains two 165s.  The good news is, this is pretty simple to set up: you need six lines: voltage, ground, clock, clock enable, latch, and serial out lines from the 165s to the microcontrollers, but the code for an arduino-ecosystem board is readily available. The bad news: you need pull-ups for each parallel input, which means either fun with routing resistor packs, or a bunch of individual resistors. Also, because of the way 165s daisy chain, I could not find an easy way to avoid hard-coding the number of 165s in the system. In practice, every control grip I'm looking at has between 10 and 16 buttons, so two 165s could cover everything, but I didn't want to restrict my ability to add analog inputs later. 

The next thought was to use an ATMega acting as an I2C slave in each grip, and connect the 165s and/or any additional IO gear to the ATMega165. Using I2C means that I only need four lines from the base to the grip (Voltage, ground, clock (SCL) and data (SDA)). I2C also means that I can do things like have the ATMega store information about what inputs it makes available, and report that on power-up. The downside here was size and complexity. I am not comfortable soldering a tiny ATMega328 surface-mount part quite yet, and it seemed silly to re-create an Arduino Pro Mini on every grip.

Reading around on flight simulator forums, I came across discussion of an I2C IO expander board, the MCP23017. This chip is handy because it has 16 GPIO controllable via I2C, including 100k pullup resistors configurable via I2C at runtime. This reduces part count, and simplifies the PCB layout. Bad news is, without the AVR playing gatekeeper, I wasn't sure how I could achieve the "grip reports its capabilities and preferences" feature. After chewing on it for a day or two, I decided to look into I2C EEPROMs. With something like the 24LC256 I could just burn the data onto the EEPROM and then access it via I2C. Since I'm not going to be changing the data frequently -- all I really expect to write is a map of GPIO pins to DirectInput button IDs, and a min/max angle, and maybe later some data about axis definitions. There's also I2C ADCs available.  I have some concerns about sampling rate, especially since I'm also using I2C for the hall effect potentiometer, but hopefully that should work out reasonably well.

Discussions