Well, it turns out that last week's post titled: "Measurements Back Online" was incorrect. There is currently an issue with the I2C bus that is used for collecting orientation sensor data and also for collecting data from the new ADS1115 analog to digital converter that was added last week. I checked all the pull up resistors for the clock and data connections, and everything there seemed OK. The wiring also seemed OK, and I couldn't find any shorts. After repeated testing, I eventually noticed that the I2C problems only occurred after the PWM output to the rudder was turned on. What's kind of weird was that the problem persisted even if the PWM connection to the rudder servo motor was cut. If I removed the other end of the cable though, the problem went away.
I'm not sure what to make of this yet. I have found some related articles online about PWM sometimes interfering with I2C with certain wiring configurations. Also, the cabling I'm using is kind of long, about 2.5 m from the Raspberry Pi at the front of the boat to the rudder and ADS1115 at the back of the boat. Some possible solutions I can think of to try include:
1. Connect grounding wire in the same 2.5 m twisted pair Ethernet cable that currently has the I2C data and clock lines, as well as the 3.3V line and the PWM line. Currently the ground connection is shared across the boat electronics through other wires, but maybe having a ground wire in the same Ethernet cable as the signal wires will help somehow. This forum thread talks about inadequate grounding as a possible cause of I2C interference from other signals: http://forums.netduino.com/index.php?/topic/3670-can-pwm-interfere-with-i2c/
2. Try shortening the Ethernet cable a little bit. I can probably shorten the cable by a couple of feet and still have it reach. I doubt that will completely solve the problem though.
3. Move the ADS1115 into the same enclosure as the Raspberry Pi and orientation sensor. This would put all the I2C devices into the same small box, with minimal distances for the 100 kHz clock and data signals to travel. Probably this would work, but I really liked the idea of deploying the sensors from the back end of the boat.
There are probably other things to try too, but I can't think of them at the moment. Feel free to comment on this post to offer suggestions though!
Since every blog post seems to have at least one picture, here are the boat's spiffy new orange handles (at the stern and bow):
I glued down the electronics enclosures with epoxy and also used some of the epoxy for solar panel fastenings and the handles. So maybe now I'll have to paint this version of AMOS orange?
EDIT (Jan. 30, 2019): The issue with the interference on the I2C bus caused by the PWM signal has been solved. The problem was my ignorance of how the wires inside an Ethernet cable are actually organized. The kind I have is organized into twisted pairs of unshielded, color-coded wires (UTP 5E). It would be a bad idea (for example) to put the clock signal for I2C on one half of a twisted pair and the PWM signal for the rudder on the other half. Which is what I did. Voltage from the PWM signal was being induced into the I2C clock line. Switching the PWM wire to one of the ones available that were not twisted with the 2 ITC lines fixed everything up.
No comments:
Post a Comment