Joint Encoders using I2C ports

hey everyone!

I ran into an issue when using the electronics interface board with the neurobionics image where the joint encoders were updating slowly and dragging down the control loop (at a set frequency of 300 Hz). After some debugging, I realized the I²C buses that the encoders use did not have a baud rate set, so they were running at the default (slow) speed.

I opened a PR in robot-ci repo so this should be fixed soon. But in the meantime, if you’re using the interface board and your encoders seem slow or are lagging, here’s how you can fix it manually

  1. find your config.txt file (boot/firmware/config.txt)
  2. under the i2c settings which look like: dtparam=i2c_arm=on dtoverlay=i2c2-pi5,pins_12_13 dtoverlay=i2c3-pi5,pins_14_15

** add this:**

dtparam=i2c_arm=on, i2c_arm_baudrate=400000 dtoverlay=i2c2-pi5,pins_12_13, baudrate=400000 dtoverlay=i2c3-pi5,pins_14_15, baudrate=400000

did anyone else encounter this?

1 Like

Yeah, I did encounter it 2 days ago but in a different manner, was running a logger on an encoder with live plots and there were repeated peaks in the plots, makes sense now that this is what was causing the lag and the peaks as a result.

1 Like