Skip to content

17. Machine design

My Contribution

Along with designing and fabricating the 2 axis mechanism that play a glockenspiel, I also helped coordinate the group project. To test the mechanism I wrote the code bellow to run on an Arduino with a motor driver. Jim is working to fabricate the microprocessor and motor driver. I imagine we will use a version of this code or at least the logic. I also put togethe the initial documentation on the group page.

Teamwork

Unfortunately, working as a remote student in Texas with 5 other students spread across the country proved to be difficult. I knew from the beginning the group project was going to be a challenge. So, I worked hard to ensure that the project we picked could scafold up into a complicated project if everyone contributed, but could also be something I could accomplish by myself if others did not hold up thier end of the bargain. My fear was I would do my part and others would not do their’s, leaving me unable to graduate and no way to hold the group accountable from 2000 miles away.

In the end Jim, Brigette and I were the only contributers and I made all the parts, with the exception of the copper tines made by Brigette. Jim worked on the electronics but did not get it working and he used my code to test his electronics. I used Output Week to make the board controlling the servos and added serial communication to the simple servo board. The serial communication made it possible to write an application to control the servos in Week 16 - Interfaces and Applications

I’m documenting this on my personal page and not the group page because Jim and Brigette might come back and add to the group pages down the road to complete Fab Academy.

Prototype Calibration Code

/* Sweep
 by BARRAGAN <http://barraganstudio.com>
 This example code is in the public domain.

 modified 4 April 2019
 by Brent Richardson

*/

#include <Servo.h>

Servo servo1;  // create servo object to control a servo
// twelve servo objects can be created on most boards
Servo servo2;
int c1 = 93;
int d = 82;
int e = 74;
int f = 68;
int g = 60;
int a = 54;
int b = 46;
int c2 = 39;



int note[] = {
  e, g, g, g, g, g, f,d
};       // an array of pin numbers to which LEDs are attached
int pinCount = 8;           // the number of pins (i.e. the length of the array)


int beat[] = {
   200, 200, 200, 100,200 , 100,200, 200
}; 


void setup() {
  servo1.attach(9);  // attaches the servo on pin 9 to the servo object
  servo2.attach(10);  // attaches the servo on pin 9 to the servo object
}

//39-c, 46-B, 54-A, 60-G, 68-F, 74e, 82d, c93, 

void loop() {


  for (int thisPin = 0; thisPin < pinCount; thisPin++) {
 hammer();
  servo2.write(note[thisPin]);              // tell servo to go to position in variable 'pos'

    delay(beat[thisPin]);                       // waits 15ms for the servo to reach the position

   }
}


  void hammer(){

    servo1.write(145);              // tell servo to go to position in variable 'pos'
      delay(50); 


    servo1.write(157);              // tell servo to go to position in variable 'pos'
      delay(65); 


      servo1.write(145);              // tell servo to go to position in variable 'pos'
      delay(50); 
}

Group Project Page