User Tools

Site Tools


Sidebar

Dan's Wiki

DokuWiki Instructions (local) DokuWiki Manual
Site Checker (Orphans Wanted)

Edit Sidebar

projects:a4sim:troubleshooting

This is an old revision of the document!


Troubleshooting, Miscellaneous

Speedbrake control not working properly in X-Plane

Frustrating couple of days, because the Speedbrake control wasn't work. Turns out there were multiple problems.

  1. I was setting the value for speedbrake_ratio as an integer. Apparently this doesn't work, started working when I changed to float. The Raspberry Pi converts the boolean on/off from the switch to float properly. As long as the plugin copy of the a4SimConfig.json shows the simulation to need float.
  2. I'm using Arduino Mega from the throttle quadrant. I connected the Speedbrake Open input to Arduino Digital channel 26, and for some reason the internal pullup resister either doesn't work, or is inadequate. Had to add another pullup resistor to +5.
  3. The logic to respond to inNonZero was not properly working. As of this writing, this part seems to be configured correctly.

I2C Communications Issues

Had problems getting communications to work with Arduino Mega 2560, with 2.8 TFT display. The display was showing flight control positions in an “X.” It would work for a couple of minutes, then lock up. Wrote testing code to run in the Mega, then later ran it in an Arduino Uno to see if the problem was caused by the Mega. Problem continued in the same way.

Tried various things to get this working.

Pull-Up Resistors

I added pull-up resistors to the I2C channel. Sadly, I used the wrong values (too much resistance), which didn't fix the problem. After trying lower values (750 ohm worked, 1.5K ohm did not), settled on 950 ohm.

Change I2C Baud Rate

Experimenting with the I2C Baud Rate is what made the solution become apparent. 100Kbps is the default speed. When I changed the rate to 10Kbps, it all started working. 50Kbps continued to fail. Changed to 200Kbps, failed the same, until changing the pull up resistors as described elsewhere.

Multiplexer

Implemented a I2C Multiplexer so that individual I2C devices can be separated to their own channel. This also allows additional cable runs. This was a hardware change, as well as a software change. The Raspberry Pi must change the I2C channel (if needed) before sending/receiving to each device. This also adds isolation so that more cable can be used. Basically 1 Meter per I2C bus.

Solution

Placed stronger pull-up resistors between SDA and SCL and +5V. Tried different values. 950 ohm worked best. Was able to change the I2C Baud rate to 200K.

These resistors are soldered to the Arduino Mega 2560 Channel 46.

projects/a4sim/troubleshooting.1582509334.txt.gz · Last modified: 2020/02/24 01:55 by dwheele