For this week, I wanted to have my Arduino control the movement of my kinetic
sculpture. First, I had to make some edits to my sculpture so that it would
actually work. This entailed modifying the gears to attach them to the motor and
the rest of the sculpture and fabricating a new stand to mount the sculpture on.
The re-designed cardboard stand, including notches at the bottom for a shelf to hold the motor.
Once those were printed and assembled, I was able to test the sculpture with my
motor. I ran into some problems with friction -- at first, I had tightened the
various axles and hinges of my sculpture too much, so the motor couldn't turn the
gears at all. Next, the shelf I had made for the motor to sit in was causing friction
and preventing the motor from turning. Once I fixed both of those problems, I found
another issue, which was that I was having trouble fixing the center axle to
the center gear on the far side, so the motor was only turning one side of the
sculpture. I decided to leave that problem for another day, and focused on getting
the motor to work with one side of the sculpture. Eventually, I succeeded, although
I had to hold the motor in place:
It lives!
Now I could add in the Arduino part. I hooked up a simple circuit with my Arduino
Uno, my motor, a motor controller, and a few wires, and wrote a simple program to
supply power to the motor:
const int A1A = 3; // define pin 3 for A-1A
const int A1B = 5; // define pin 4 for A-1B
void setup() {
pinMode(A1A, OUTPUT); // specify these pins as outputs
pinMode(A1B, OUTPUT);
digitalWrite(A1A, LOW); // start with the motors off
digitalWrite(A1B, LOW);
}
void loop() {
// start the motor
digitalWrite(A1A, HIGH);
digitalWrite(A1B, LOW);
}
I figured out that I had to reverse the direction of the motor to make the panther's
running motion go the right way, so I flipped pin A1-B to do that and then also
added some delay functions to create a pattern of motion. Here's a video of the
result:
The panther running on a timed delay.
Lastly, I went back and added a potentiometer to my circuit to adjust the speed
the panther runs at. The motor is still not held in place well, so if I were to
come back to this design I would rethink the motor housing so it doesn't have to
be held in place.