Friday, September 23, 2011

Updates


It has been some time since my last post.  Originally, much was intended to be accomplished over the summer months, completing the mechanical portion of the ball and finishing the programming side of the ball.  However, this did not occur.  Progress was once again reached with the start of the fall semester.

Starting the semester off, a new design was intended for the inner workings of the hamster ball.  The wood platform was cast aside for a new sleeker aluminum casing.  The rubber corks were removed and replaced with aluminum rod used as couplings.  To prevent the center mechanics from torqueing under weight, bushings were used to make the axis more rigid.  Pictures can be seen below:

 Fully Assembled Hamster Ball

 Gearbox Assembly Showing Aluminum Couplings and Bushings

 Closeup of the Bushings on both sides


Closeup of the attachment of the bushing


Servo and Pendulum Attachment with Electronics

The bushing was soldiered to a makeshift brass coupling where an oversized hole was punched to allow the bushing to move ever so slightly since the aluminum coupling is not perfectly centered.  This setup is troublesome and presents serious problems when disassembly is required (which it has been several times).

Another issue that was presented was the lack of space for the electronics (as you can see from the dangling XBee shield present in the electronics shots.  To solve this problem, it has been deteremined a combined circuit board, containing all the components needed on the Arduino with all the XBee shield components as well as the motor driver and its associated components.  Seeing as the Arduino plans are associated to Eagle files, the plans will most likely be compiled within.  Further research is being done on this.

The servo was attached to the top of the gearbox assembly with an adjustable arm to allow the center of gravity to be moved based on the battery used.  Through observation of this design, it was also noticed the pendulum may very well hit some of the electronic components on the XBee shield, thus furthering the need for a compiled board to be manufactured.

On the programming side of this contraption, much more progress has been made from my previous post. Originally, a joystick was used on a separate Arduino to drive the gearbox inside the ball.  This was great for a proof of concept (which it worked barely), however, the ultimate goal is to control the ball through the computer.  To do this, the controls need to be migrated to the computer.  Exploring the many options, Java was determined to be a very useful language seeing as it’s web-friendly and has a plethora of tools associated.  The Processing program was determined to be user-friendly from the programming aspect since it is C based and works with Java wonderfully.  Experimentation with this setup is well under way.   An example of controlling a window through processing code is shown below.

/* Color_Box draws a rectangle in a standalone window and fills rectangle
   based on how long any key is pressed.  This is done through a counter
   global variable.
*/


void setup()
{
  size(100,100); // Define size of window
}

int counter = 0; // Defines global variable for counting time key is pressed

void draw()
{
  
  rect(25, 25, 50, 50); // Draws rectangle inside window
  if (keyPressed == true) // Tests if key is pressed
  {
    counter++;
  } 
  else // Tests if key is not pressed
  {
    counter = 0;
  }
  
  /* Fills the contents of the rectangle with color associated
     to value of "counter."  This will cycle the colors from black to white. */
  fill(counter); 
}





No comments:

Post a Comment