Ideation

Since I have done a bit of CAD in the past, my main objective for this project was to get more familiar with arches and curves in SolidWorks. I started thinking how could I adapt the example we saw in class to create an interesting oscillating movement using the servo. After some sketches, I decided to work with an “S” shape that would tilt and then go back to its original position, resembling a snake of sorts.

First iteration

After designing the shape in SolidWorks, I cut it to analyze its mechanical behaviors. I had some idea of what should happen, but I felt more comfortable testing the physical model itself.

First version

As I learned after playing with it for a while, the “S” shape was incredibly unstable. Any slight tilt from its equilibrium position was enough for it to fall. Also, the first version was considerably heavy and the servo arm was not enough to support it.

Second (and final) iteration

The most considerable change from the first version to the second is their sizes. In order to reduce weight, I made the “S” shorter and thinner. I also cut circular holes closer to the top to lower the center of mass in an attempt to make it more stable. The finishing touch was adding a ball bearing opposite to the servo in order to balance its weight.

Second version

Software

When working the software, it was important to make sure the servo did not move too abruptly, or else it shook the part and the whole snake fell down. By using for loops with delays when increasing or decreasing the angle of the servo, I could create a rather smooth transition from each tilt angle to the other.

#include <Servo.h> 

Servo snake;

void setup()
{
  snake.attach(9);
}

void loop()
{
  float ang = 55;
  //snake.write(80.5);
  //delay(2000);
  for (int i=0;i<90; i++){
    ang += 0.5; 
    snake.write(ang);
    delay(15);
  }
  delay(1000);
  for (int i=0;i<90; i++){
    ang -= 0.5;
    snake.write(ang);
    delay(15);
  }
  delay(500);
}

Citations

The braces I used to connect both sides of the “S” shape were the braces provided in the rocker example from the assignment page. I also got the servo dimensions from those files.