Monday, January 18, 2016

Testing Dome Panel and Utility Arm animations


Testing new code to trigger utility arms and dome panels to open and close in sequence.

Here is a video of the panels in action:


Sunday, January 17, 2016

Wiring Issues Resolved: Interference in the sensors

Sensor issues continued to plague the project


When combining the front PIR sensors and the IR Sensors connected to the single Arduino NANO per foot... everything seemed to come together.

We could detect and track human motion (heat) as well as sense distance to the object (sonar) and this was going as planned until...

When moving R2 forward, no matter the throttle speed etc. and changing directions, after roughly 30 seconds or more... both Arduinos in the feet would LOCK UP.  No more sensor data etc.

There were many possibilities to this:
  1. I2C code was not setup correctly
  2. Not enough pull up resistance on the I2C lines. (need at least 10k ohm pull ups connected between the vcc (5v) and the SCL and SDA lines between the master in the body and the feet runs.
  3. The I2C lines were not shielded enough so any interference knocked out the Arduino.
  4. issues with the nano being too near the foot motors (these were running at 24v now).

Video Log of the findings


1. The code:

Reviewed several different approaches to I2C for Arduino, one person even re-wrote the wire library and called it ITW. 

I re-wrote the sensor code as well as the master shadow code to allow for this as it had a error correction built in that if the Arduino loses I2C connectivity and locks, it will unlock it and continue communications.  This didn't effect it much other than I saw the Arduino reboot over and over when moving R2 around.

2. Not Enough Resistance

The built in pull ups were fine at this point, because connecting 10k ohms and using hardware pull ups didn't appear to correct the problem either.

3. Shielded sensor lines BINGO!

So I had narrowed the issue down to the connections between the sensors and the Arduino itself.  On the foot there are 3 IR sensors and 1 PIR sensor. 

Eventually I foresee 5 IR sensors (to track if its near stairs etc.) as well as better granular front and back sensor array.

Replaced the DUPONT 4 wire connectors with shielded CMR cable... this did the trick, the extra extra-shielding provided the needed interference blocking as well as allowed the Arduino to run without crashing. 

Learn more: http://www.awcwire.com/productspec.aspx?id=shielded-multi-conductor-riser


The fun part was re-running several of the wires once again...



Here is a great shot of the DUPONT wires coming off the left-side foot.
These wires pick up the electrical currents when applying power into the motor controls and feedback enough to cause the Arduino to lock up.


The new shielded CMR cable with 4 lines and 2 ground wires.  These were perfect as the PING and PIR sensor needed 3 lines and the HC-04 IR sensors needed 4.


Here is another look at the wire stripped to reveal its internal shielding individually around the 2 pairs.


Once stripped and connected, applied female 3 pin DuPont ends to each and connected to the sensor pins on the Arduino shield.  Here is a closeup of the cmr cable with the insulation removed.



Once complete we connected them back to the Arduino and then back to the sensors.


here is a great shot of the new cable connected to the PING sensor and going back into the foot and battery box.