Friday, December 16, 2016

R2 at Destiny USA for Rogue One premier

R2 visiting old friends... making new ones...


All the while BB8 sat there chirping sadly....










Friday, November 18, 2016

Bad Motivator and Sound chip fixed

Syracuse Silver Knights Star Wars Night

Had an awesome time with the families at Silver Knights Star Wars Night on 11/18/2016
When we brought R2 up to the main entrance, we decided to get him all squared away before the kids saw him... so, I shoved the new motherboard into the system and I think we ended up shorting both the sound chips and the sabertooth foot drive controller out.

my daughter and nephew pushing R2 through downtown Syracuse... what a trip!

Turning him on... bam... nothing - light and dome controls worked though

Here is R2 looking at us and saying... "why me?"

Some great characters made an appearance... we had our R2 on this side and Kightshade's R2 (from Rochester) on the opposite entrance.

We could see the dark knight making is way through the crowd to get the droid.

I think this storm trooper tipped him off... the kids were very excited to see R2

This little guy almost knocked out the lower vent on the front... thank goodness it was easy to fix.

Here is the dark lord of the sith and a desert trooper from the 501st visiting... Knightshade's was running into issues with his drive system as well that night.

Knightshade's wife with his droid, and me with mine... notice how clean mine is :)

Darth is trying to explain to little kids that he is friendly.... right.

my daughter with a group photo  -she is the droid wrangler for the evening

Overall - great evening.... R2 worked out well although no sound or movement.... everyone loved their picture taken with him.


Thursday, November 17, 2016

Ive lost my mind!

I was just thinking... sure charge the batteries while they are in the belly of R2 (they are in series as 24v btw) and I don't have to lift those suckers out!

right.....

I had it connected for like 6hrs and it was never finishing... I needed 24v charger - jackasssss, palm plant!

So... here we are ETA 3 hrs till the event with me panic charging the batteries for R2. :)



I also decided to cut the motherboard in half to reduce size and make it easier to pop in and out... last minute charley strikes again!





Monday, July 25, 2016

R2 readiness for Rogue One

Since February we have moved, lost pieces of R2 and BB8 like his head...



Now as we enter August, work begins on some key items for R2:
  1. Migrate the Shadow Collision system to Raspberry PI 3 (its currently Arduino only)
  2. Add some navigation travel using GPS for road travel... in the neighborhood.


Monday, February 1, 2016

I2C Communication Update


Fault in our stars: I2C Crashing either the sensor or master (SHADOW) controllers.


When working with the Sensor controllers, I believe I have swapped the wires out at least 4 times now.  Either swapping for better shielding, gauge or just plain different wire to combat issues with the I2C channels simply crashing either the MEGA or the NANO CPUs.

What I was doing was setting up the arduino nano's which were on sleds or shields that the CPU plugs into. and was connecting to I2C and common grnd/pwr from the arduino mega in the body.

The design



I2C was setup in a MASTER MASTER configuration where every device had an address on the channel.

REVISION 1: Force it down the throat

The code was using interrupts on the mega to simply listen and when something came across the wire it would listen and store the next variables into an array of bytes.
simple right? riiiight.

What would happen is the nanos would basically flood the shadow controller until all of a sudden it would lock up when trying to use the BLUETOOTH controller or it was in the middle of something else.

Many re-writes, pull up configurations as well as wiring scenarios...

Some of the outcomes were very poor or simply unresponsive sabertooth controller response (like delayed by several seconds) this was probably due to the mega having to stop what it was doing every 3 secs and listen on wire.

REVISION 2: Ask and you shall receive

The code now incorporates the mega participating still in a MASTER MASTER scenario BUT it asks only when I am doing collision avoidance from each of the foot controllers.
This appears to be more stable, after roughly 2-3 minutes though depending upon where the arduino is in the code it will then lock.  Only the SHADOW controller will lock though as the nanos keep pinging away!

Here is the code used and differences:
On each SENSOR device I have the following definitions to help me remember what address is what as well as for the system to use these addresses as needed.
// ==========================================// This function determines I2C addressing // ==========================================#define I2C_ADDRESS_SHADOW  0x1#define I2C_ADDRESS_LEFT    0x2#define I2C_ADDRESS_RIGHT   0x3#define I2C_ADDRESS_DOME    0x4#define I2C_ADDRESS_CENTER  0x5#define I2C_ADDRESS_VOICE   0x6#define I2C_ADDRESS_BODY    0x7#define I2C_ADDRESS_TCAADDR 0x70 adafruit multiplexer

Then I simply within SETUP()

  #ifdef LEFTFOOT // If this is the leftfoot sensor slave
    Wire.begin(I2C_ADDRESS_LEFT);
    Wire.onRequest (requestSensorData);  // interrupt
    partnum=1;
    #ifdef PIRSENSOR
      pinMode(DS1P, INPUT);
      delay(2000); // calibrate for about 2 seconds
    #endif
  #endif

Configure this for each foot and voice controller, when you uncomment comment variables this tells the compiled code which device it is controlling.

LEFTFOOT, RIGHTFOOT and VOICE are all I use currently.

What the above does is when a request from SHADOW is made, it will call the function requestSensorData which is below:

void requestSensorData()
{
  uint8_t Buffer[4];
  Buffer[0]=cm[0];  // Send the IR Sensor from front
  Buffer[1]=cm[1];  // Send the IR Sensor from side
  Buffer[2]=cm[2];  // Send the IR Sensor from back
  Buffer[3]= pir;   // Send the PIR Sensor from ankle
  Wire.write(Buffer,4); 
}

The above basically reads in each sensor from the CM array as well as PIR state of HIGH or LOW and sends it across the I2C channel when asked.

This has prevented a lot of the issues BUT there are still lockups that occur.

on the SHADOW, there is similar setup to assign SHADOW an address but here is the code for it to ask.

void getFootSensorData()
{
  if (isR2Automation)
  {
    currentTime = millis();
    int sensortable[]={0,0,0,0};
    if ((currentTime - lastDecisionTime) >= PingWaitInterval) // Wait for PingWaitInterval and then send results
    {
      lastDecisionTime = millis();
      Wire.requestFrom(I2C_ADDRESS_LEFT, 4);    // request 4 bytes from slave device I2C_ADDRESS_LEFT
      for(int i=0;i<4;i++)
      { 
        int c = Wire.read(); // receive a byte as character
        sensortable[i]=c;
      }
        leftfront =  sensortable[0];
        leftside  =  sensortable[1];
        leftback  =  sensortable[2];
        leftpir   =  sensortable[3];
      #ifdef SHADOW_SENSOR
        Serial.print("\n");
        Serial.print("Left Foot Sensors: ");
        Serial.print(sensortable[0]);
        Serial.print('\t'); 
        Serial.print(sensortable[1]);
        Serial.print('\t'); 
        Serial.print(sensortable[2]);
        Serial.print('\t'); 
        Serial.print(sensortable[3]);
        Serial.print('\n');
      #endif
      Wire.requestFrom(I2C_ADDRESS_RIGHT, 4);    // request 4 bytes from slave device I2C_ADDRESS_LEFT
      for(int i=0;i<4;i++)
      { 
        int c = Wire.read(); // receive a byte as character
        sensortable[i]=c;
      }
        rightfront =  sensortable[0];
        rightside  =  sensortable[1];
        rightback  =  sensortable[2];
        rightpir   =  sensortable[3];
      #ifdef SHADOW_SENSOR
        Serial.print('\n');
        Serial.print("Right Foot Sensors: ");
        Serial.print(sensortable[0]);
        Serial.print('\t'); 
        Serial.print(sensortable[1]);
        Serial.print('\t'); 
        Serial.print(sensortable[2]);
        Serial.print('\t'); 
        Serial.print(sensortable[3]);
        Serial.print('\n');
      #endif
    }
  }


}

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.








Thursday, December 24, 2015

R2 Upgraded to 24v for Christmas!

Going from 12v to 24v equals FAST!

I got the courage to serial the 2 batteries I have been using (they worked great during the release event in that each one gave me roughly 5 hours of run time while the other charged) and generate 24v to the 2 motor controllers on the R2 unit.

Foot Motor Controller: Dimension engineering Sabertooth 2 x 25 controller (2 x 25amp max)
Dome Motor Controller: Dimension engineering Syren 10a (1 x 10amp max)

The new connections now are:
  1. Serial 2 x 12v 18ah batteries connected to power distribution board
  2. a. Distribution board connects both the syren and sabertooth input to 24v now
    b. Distribution board connects to a 24/30v step down to 12v 10ah convertor
  3. 12v Convertor connects to the original 12v distribution board that powers everything else


Works perfectly!  he moves!

MERRY CHRISTMAS EVERYONE!

Wednesday, December 23, 2015

Drive Train Issues solved!

Dual Tensioner

Tensioner on the opposite side solved the issue of drive slippage...  due to "eyeing" it... its a little tight but solved the issue of slippage... I will do the second wheel a little looser and send back to Frank for design updates.


Bored a hole into the side of the drive mount and took a 1/4" - 20 X 1" machine screw and drilled a hole "eyeing it" offset from the main shaft hole on the opposite side. the above photo shows me drilling in the screw...


I took a left over 1/2" spacer that was leftover parts from the Razor Scooter pieces for the motor... it allows enough clearance between the outer wall and the wheel to protect the screw as the chain rubs against it.



Fitting the spacer onto the screw as I drive it into the frame... it pushes down the opposite side snug... should have gone a bit higher in placement, probably could have matched elevation of the drive hub.


Put the opposite side tensioner back in removing all access slack on the chain now.  The chain is very snug and pulls correctly both directions across the drive hub... no slippage VIOLA!


Top view showing the chain without any slippage as well as the screw completely in


Yes another view of the screw and the spacer inside the mount


Another view of the screw sit into the mount and space installed along with tensioner.  The chain is nice and slack free...


Sunday, December 20, 2015

Chain issues with drive train


Drive Train Issues

After using R2 for a full weekend event, there was tons of drive slippage
"The sound it makes similar to changing gears on a 10speed bike" and its horrendous...  Many times preventing R2 from moving forward correctly.

Once we got him home, removed the outer feet and disassembled the shells from the motor mounts.

Potential issues:
  1. There is maybe too much slop in the chain (although we cannot tighten it any more or move it any more on the links.
  2. The gears are loosing grip and letting the chain jump off the gear

I removed the retaining clip on the chain and tried to tighten, there is not enough slack to go another link.





Looking for answers



Friday, December 18, 2015

Baby's First day out: Broken HP and Dome Gear

The first time out for R2 exposed him to many challenges:
  • Children and adults all leaning on the dome when he is in automated mode (turning and making chirps randomly).
  • Weight when little hands press against the dome features such as the HPs

All this resulted in a very successful first day in the wild.
  1. The top dome HP fell into the dome due to some small child pushing it in.
  2. The dome gear tore off and snapped the screws due to fighting the weight of people when it wanted to turn :)

Bore out new holes through the gear into a new piece of plastic with the correct height.


The screws (4X40) were too long so I will cut them down once I add all the nuts.


Here they are cut down and ready to rock n roll!



All in all everything was fixable... no major issues, and...

The 12V 18amp Battery lasted roughly 5.5 hours and could have gone longer...


This is why we build R2s - I believe all the builders feel the same

When you see this all day long... watching children's eyes light up, smiles and hugs as well as feeling like R2 is really really alive is all worth it!


More to come from Day 2....

Thursday, December 17, 2015

Pre Release Visit to DESTINY USA


R2 made his first road trip to Destiny USA (Carousel Mall, Syracuse NY) and made a splash before the big event.

Baby's first day out


He will be there from Thursday till Friday night and then will be heading over to Shopping Town Mall on Saturday and Sunday for his whirl wind tour.

First Elevator Ride:

Then received some attention as we made our way down into the IMAX/RPX area where he will stay the evening till Release day.



Will post more as the event continues... stay tuned.

Wednesday, July 1, 2015

Wiring issues persist

Wiring for the weary hearted

Working with the design and putting it into code is one thing, but to actually connect it all and ensure it works is another.

Key things when we are wiring this system together:

  1. Keep the GND or ground common always between all devices
  2. Use the right gauge wire between the heaver loaded items (more amps = thicker gauge)
  3. Purchase a few spare knock off Arduino Mega - your gonna blow a few... trust me.  The magical fairy of blue smoke will come and visit you often.


Currently as of 7/1/2015 the design calls for

  • Arduino nano in each foot (nothing is in the center foot just due to lack of path to the foot shell from the body.
  • There is a cable that connects the nano A4 and A5 (SCL SDA or I2C) through the leg into the body and connecting to the SHADOW main controller or Arduino Mega or DUE,
Learn more about I2C here working with Arduinos:


Purchasing a DUPONT cable kit allowed me to create ends either MALE or FEMALE on each wire that ran from the body to the feet.


The kits run for $12 per and come with 1P - 6P connectors (housings) and both male as well as female ends.

You will need a proper crimper for these devices... you can purchase a good crimper for roughly $20 on ebay or amazon.



Currently because I am using a nano screw terminal sled connected to each nano I only needed to create connectors on one end of the long run from the foot to the body.

Because a majority of the connectors I will be interfacing with are MALE into the boards, I made the ends into FEMALEs.

I also needed a I2C hub of some fashion because of the amount of devices chattering across the lines.

Currently the device count is at 7 where the following is using I2C to communicate.
2 x Compass [Magtometers]
3 x arduino nano (PING Sensor units and PIR sensors)
1 x arduino mega (SHADOW main)
1 x arduino uno (EasyVR Voice recognition)
1 x marcduino (custom automation board for panel controls and sound)
1 x SD card reader unit
total: 10 items chatting....

Found these to be useful, low on stock I purchased 2 but only 1 arrived so far.

I2C Hub on Amazon


Saturday, May 23, 2015

Aluminum Dome PIE Panel installation

Began sanding and sanding and sanding


The dome is the most recognizable piece to R2 so very important to get it right the first time...



Very important to mark and number your panels with a number so you can easily re-match them to the correct area when gluing them back on or mounting them to the hinges.



Once marked I then removed all the inner panels from the dome using a small metal cutting saw.  This allowed me to make roughly 2 back and forth movements before cutting through the little tabs remaining that were connecting the panel to the shell.


What a mess... also note the outer dome is very sensitive to bending without the support of the inner dome. You will need to be very careful not to put too much force or lean on it while cutting.


Aluminum fragments... anything that had the residue left on it from the laser cutting was cleared off using the strong metal brush as seen below... this is very strong and sharp... cut myself many times.


Both pieces fit together very well and remove easy too...


Here is the lower dome pan as well as assembly pieces.  I have removed the dome gear from the frame so I can assemble it in the correct order.


Here are a few of the dome pie panel servo hinges...



Installing the hinge requires a few things...
You hand place the hinge inside and move it by hand each time testing clearance of the pie panel hinge back that it clears the opening.  This was tough as the hinge backing plate was almost cut to exact size... I ended up trimming down the lower edges to allow easy clearance.


Once in the correct placement, I quickly hot glued the assembly onto the dome inside and allowed it to cool.  This allowed me to work on getting all the hinges installed.  Once I got them all installed and in the correct placement, I drilled through from the inside out through the hinge to install #4x40 flat head screws to hold the hinges in place permanently.  

Since the outer dome covers the inner, it covers the screws as well.  To ensure flatness, I counter sinked the holes where the screw heads were to be installed outside in.


A great view of the hinges in place, you can see where I marked the holes connecting each of the hinges.



Once pie panel is not going to open at this time, this is due to money and I will configure it later.


Great shot of counter sink holes where the screws will be inserted.



I then install the screw and tighted down the bolt nut using a screw driver.



While I am in there I screwed through the inner dome to allow connecting the HP shells to the inner dome.




You can see where the inner shells are connecting through the screws and as I connect them down with the nuts, it holds the HPs inside securely.




Great view of all items connected and secured


Ran into some issues, as I was connecting the two domes together, I realized I hadnt cut the port for the camera to view out the radar eye!

Got out the saw and proceeded to almost cutoff my hand :)


Notice the oooops here where the saw kinda flung out... no prob, thank God that is behind the radar eye shell and quite hidden.


The PSI lens area I took 3" pipe, cut it and hot glued to the inner dome area


Purchased 3" 5mm thick lens material to work as a defuser for the lights that will be installed behind.



The upper HP that sits on the exposed pie panel didnt match or align with the holes.. I will hot glue this piece instead.


Started to install the panels against the hinges... note, I use painters tape and sit the pie panel against the hinge... I then flip the dome over and push the hinge against the pie panel and hot glue it temporarily in place...

I then installed the radar eye as well as lens I got from Guy Varden from the R2 builders group.


Here are the dome hinges all opening perfectly.