18.4 Implementation
Fabrication & Assembly:
Before beginning fabrication and assembly, we ensured that all critical secondary components—such as bearings, motor flange, shafts, and shaft collars—were included in the CAD model. This allowed us to check for potential interferences and make necessary adjustments prior to manufacturing. Most of our components were laser-cut or 3D printed, enabling quick iterations and easy fitment modifications. The only issue adjustments we had to make were drilling the holes in the spacers due to thermal shrinkage in the 3D printed parts and adding a rubber band to the links; as the weight of the links would cause the mechanism to get stuck at a position near the toggle points.
Because we invested significant time refining the CAD model, especially by incorporating secondary components and designing adjustable slots for parts influenced by external forces, assembly went smoothly with minimal issues. For instance, we added mounting slots for the cherry hopper, which allowed us to adjust its height and angle to compensate for friction and gravity affecting linkage movement. One minor issue arose when shaft collars scratched the acrylic; we resolved this by inserting washers as spacers. A more significant challenge occurred when the motor’s rapid motion flung the cherry off the toothpick after pickup. To address this, we repurposed an old acrylic piece from a previous project, which acted as a ramp and successfully redirected the cherry into the cup.
Electronics & Circuitry:
Our electronics system has the bare minimum necessary to drive the motor. Users were surprised and happy to see that the plate for the cup acts as a button that triggers the system. We also include an emergency stop (that ended up being extremely useful as users would forget their cup on the pressure pad).
Software Development:
int x_pos, y_pos;
int SW = 5;
int IN1 = 7;
int IN2 = 8;
int ENA = 9;
int LED = 13;
void setup() {
Serial.begin(9600);
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(LED, OUTPUT);
pinMode(ENA, OUTPUT);
pinMode(SW, INPUT_PULLUP);
digitalWrite(ENA, LOW);
digitalWrite(LED, LOW);
}
void drive(int pwm, int dir){
digitalWrite(IN1, !dir);
digitalWrite(IN2, dir);
analogWrite(ENA, pwm);
}
void loop() {
if(digitalRead(SW) == 0){
Serial.println("Rotate");
digitalWrite(LED, HIGH);
drive(255,1);
delay(10);
} else {
Serial.println("Stop");
digitalWrite(LED, LOW);
drive(0,1);
delay(10);
}
}
To develop our system in as robust a way we possible we first unit tested the electronics seperate from the mechanical assembly. This included testing for buttons, motor controller function, and logical correctness. Part of this process was using serial communication/toggling an LED to simulate commands being sent to the motor controller before actually testing with the electronics.