Project Objectives

The main objective was to produce a physical mechanism that produces a pattern of motion over time. My project rocks back and forth at increasingly steeper angles. The servo motor starts off at 0 degrees, then rotates at 45, 90, 135, and then 180 degrees before going back to 0 degrees. This process is repeated.

The outcome is that the smaller angles, such as 45 and 90 degrees are not as prominent in the rocking motion. It is only when the servo motor turns at 135 or 180 degrees is the physical rocking motion prominently visible in the mechanism.

Design

My initial design included 2 semicircle pieces connected by 2 brace pieces. However, I cut a V-shaped indent at the top of the semicircle to see how that would alter the dynamics of motion. The final design looks like this:

2 of these pieces were used with 2 6×8 mm holes to fit the braces and a 23×13 mm hole to fit the servo.
2 brace pieces were used to connect the main pieces above.

Video

Code

#include <Servo.h&gt; 

Servo myservo;

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

void angle()
{
  for(int i = 0; i <= 4; i++)
  {
    myservo.write(i*45);
    delay(1000);
  }
}

void loop()
{
  angle();
}

Citation

The brace design is taken from the example design rocker-example.zip shown on the course website.