Howto:Build your own Panel or Cockpit - Communicating with the Simulator

From FlightGear wiki
Jump to navigation Jump to search

The panel consists of a number of physical switches, rotary encoders, meter movements, numeric and alphanumeric displays, led indicators, rotation sensors. Even a small plane such as the C172P contains over 100 distinct items that must communicate with the simulator.

A way is needed to communicate changes for each of these elements to the appropriate item in the property tree in the running simulator.

From the hardware perspective this communication involves

  1. Physical cockpit hardware: switches, encoders, instrument movements etc.
  2. Low level interfaces to gather or distribute raw data for the cockpit hardware
  3. A Master Client to
    1. interpret between raw and simulator data
    2. handle communication between the cockpit and the simulator software

For the complete C172p there are:

  • 12 volume controls
  • 9 multi position switches
  • 17 meter movements
  • 50 spst switches
  • 9 spdt switches
  • 17 rotary encoders
  • 7 instruments with rotational movement
  • 12 3 to 6 digit numbers
  • 4 3 letter Alpha displays
  • 23 on/off indications on radios and instruments

The simplest implementation would about 300 gpio pins to drive every hardware element. We can reduce this number greatly by thinking carefully about how to

Some low level interfaces can use an ATMega processor of some type, probably an ATMEGA8535 or ATMEGA8515. Each of these can handle inputs and outputs for specific controls, switches, instruments and radios. Because the number of pins on the microprocessors is limited, there will be several of them. Other interfaces such as the display of 7 and 16 segment Numbers and letters can be handled using a driver chip such as the Max7221. Another approach is to use I2c or SPI to aggregate data from multiple cockpit elements into a single message.


From a software perspective, we'll need programming for:

  1. a telnet client handling communicating between a raspberry pi and Flightgear
  2. managing communication between the raspberry pi and lower level interfaces
  3. interpreting various types of simulator properties
  4. handling raw data for
    1. single and multi position switch data
    2. data from rotary encoders
    3. data going to numeric displays
    4. rotation and rotational position sensing for certain instruments