Thursday, December 21, 2017

XMSnakeRobot - Construction Completed - Testing - I2C issues

Snake Robot structure completed and electronics fitted.
Now into testing and modification.
The good news is that all servos are responding to test commands as planned.
The main challenge is that any test command that runs I2C code is causing the Master Arduino Nano to freeze. Here is a rewording for less-specialist readers: The "I2C" consists of 2 wires running the length of the snake which act as its "spinal cord", enabling 3 x electronic circuit boards to "talk to each other".

Searching .. From Arduion forum thread "I2C with internal pullups"

"Koepel" says:
"If an Arduino is Slave, and it has the power turned off, that will keep the SDA and SCL low via the diodes." 
I am testing parts of the snake robot first before powering it all up so I do indeed have "Arduino Slaves" with power turned off. Good candidate.

Some contributors state that I2C needs "pullup resistors". "Budvar" writes"
"I tested I2C with the internal pullups a time ago. My experience is that it doesn't work. I2C works with the pullup ~10k on short distance. Recommended value is ~5k on most devices so internal pullup is unusable."
Suggested values in the posts include 10K, 4.7K and 2.2K. I have added 6.8K pullups.

One contributor, Nick Gammon, has a detailed article with example code on his own website:
Nick Gammon recommends 4.7K. I read this after soldering 6.8Ks into the snake but I will keep this in mind!

The plan is to work through these possible fixes to try to get I2C to work.
If still no go, then "Plan B" is to turn to "SoftwareSerial" on the master Arduino to run separate Serial conversations with the 2 slaves.

Snake Robot structure with version01 electronics in place.

L to R ribs 3, 4, 5. Rib04 has the highest complexity
because it includes the master microcontroller.

Close up on Rib04 with the "master" Arduino Nano.
Managing the wiring of 20 servos - use of dashes and dots:
Dashes indicate horizontal movement servo, dots for vertical.
Also colour coding. Section Front-Back: orange, white, yellow, green

Rib05, bottom view here, is a battery holder.
Battery mount on the left - regulator and fuse on the right.

Rib05, bottom view, with battery in place

No comments:

Post a Comment