I2C Error Compendium: Difference between revisions
Line 37: | Line 37: | ||
Thus, for any I2C system there is an "intrinsic" maximal length up to which the I2C communication works. In practice this maximal length is not achieved, since, as discussed in the introduction, other I2C error source may be present, reducing the practical length. The capacitive load by the cables depends also on the type of cables. Thin wires for instance have a smaller capacity than thicker wires. In practice, however, there is usually little room to play with that factor. | Thus, for any I2C system there is an "intrinsic" maximal length up to which the I2C communication works. In practice this maximal length is not achieved, since, as discussed in the introduction, other I2C error source may be present, reducing the practical length. The capacitive load by the cables depends also on the type of cables. Thin wires for instance have a smaller capacity than thicker wires. In practice, however, there is usually little room to play with that factor. | ||
Capacitive load | Capacitive load also arises from anything conducting in the surrounding of the I2C clock and/or data wires. | ||
That's indeed a major factor, and - fortunately - it is under our control to a high degree. The possible contributors falling into this category are very diverse; they range from things such as spacing between the wires among themselves or to GND or Vcc, shields such as in coax wires, twisted or non-twisted wires, conducting areas to which the IMU module is mounted or the cables are fixed to, connectors, and so on. It is as it was said, it arises from '''''anything''''' conducting in the surrounding. Fortunately, the rules which determine the value of capacitors are well known. In a nutshell, the larger the conducting area the larger the capacitance, and the larger the distance to the conducting area the smaller the capacitance. This immediately gives us the rules at hand to control them. | That's indeed a major factor, and - fortunately - it is under our control to a high degree. The possible contributors falling into this category are very diverse; they range from things such as spacing between the wires among themselves or to GND or Vcc, shields such as in coax wires, twisted or non-twisted wires, conducting areas to which the IMU module is mounted or the cables are fixed to, connectors, and so on. It is as it was said, it arises from '''''anything''''' conducting in the surrounding. Fortunately, the rules which determine the value of capacitors are well known. In a nutshell, the larger the conducting area the larger the capacitance, and the larger the distance to the conducting area the smaller the capacitance. This immediately gives us the rules at hand to control them. |
Revision as of 12:26, 12 January 2015
by OlliW
I2C errors are probably the most annoying side effect of the technology we are using in our brushless gimbals.
I2C errors occur then the signals on the I2C clock and data lines (SCL,SDA) are disturbed beyond certain limits, and this happens due to two main reason:
- capacitive load on the I2C clock and/or data lines
- induced signal disturbances due to capacitive coupling to outside fields
Importantly, all error sources add up. One hence can't give decisive threshold values, such as, for instance, that the length of the I2C wires should not be longer than 40 cm. Without any further error sources one might be able to use even much longer wires, while if motor wires are nearby only shorter wires might be acceptable.
It's like a glass of wine: When it's full, it's full. It doesn't matter if it had been filled with Bordeaux, Chianti, or any mixture. When the glass is filled with only a tiny bit of Bordeaux, one can add a lot of Chianti before it overflows, but when the glass is nearly filled with Bordeaux, only a tiny drop of Chianti is acceptable. So, you're not going to get an answer here to how much Chianti is acceptable, since this depends on how much Bordeaux is there, but "only" that the more Chianti you poor in the more probable it is that the glass spills over.
Methods to Reduce I2C Error Rate
Before we look at the I2C errors, the methods shall be briefly summarized which can help to reduce the error-proneness of the I2C connection to the IMU module:
- reduce length of cable
- twist wires of the cable; this comes in many variants such as twisting all four, just twisting SCL and SDL, twisting SCL with GND and SDA with VCC, and so on
- shield the wires; using e.g. a coax cable or wrapping the wires with (self adhesive) conductive cloth EMI shielding
- add ferrite rings; this comes in many variants such as to put it to the I2C wires and/or the motor wires, or to the left and/or right ends of the wires, and so on
- lower the (motor) voltage
- increase spacing between I2C cables and motor wires
- reduce the I2C pullup resistors on e.g. the IMU module
Capacitive Load
Capacitive load decreases the slew rate of the signal, and eventually prevents the electronics to detect it correctly, and an I2C error occurs.
Capacitive load arises from the cables itself, and the longer the cables are the higher is the capacitive load.
Thus, for any I2C system there is an "intrinsic" maximal length up to which the I2C communication works. In practice this maximal length is not achieved, since, as discussed in the introduction, other I2C error source may be present, reducing the practical length. The capacitive load by the cables depends also on the type of cables. Thin wires for instance have a smaller capacity than thicker wires. In practice, however, there is usually little room to play with that factor.
Capacitive load also arises from anything conducting in the surrounding of the I2C clock and/or data wires.
That's indeed a major factor, and - fortunately - it is under our control to a high degree. The possible contributors falling into this category are very diverse; they range from things such as spacing between the wires among themselves or to GND or Vcc, shields such as in coax wires, twisted or non-twisted wires, conducting areas to which the IMU module is mounted or the cables are fixed to, connectors, and so on. It is as it was said, it arises from anything conducting in the surrounding. Fortunately, the rules which determine the value of capacitors are well known. In a nutshell, the larger the conducting area the larger the capacitance, and the larger the distance to the conducting area the smaller the capacitance. This immediately gives us the rules at hand to control them.
The acceptable capacitive load, from both the cables and the surrounding, depends on additional factors, such as the current capabilities of the I2C drivers and the pullup resistors.