7.5 Implementation
We started manufacturing with this SolidWorks model, from the design process page.
The design biased laser cut manufacturing with wood and acrylic to allow for rapid prototyping and manufacturing. Although the design was created with simplicity in mind, components like bearings and axles were required for revolute joints in order to improve backlash and allow for proper constraints for the gears. The return mechanism for the dice shaking motion was initially meant to be gravity, but the weight and resultant angle of the box required a return spring to aid the shaking motion. Our design also features adjustable spring perch positions to tune the return spring tension and force.
The motor directly drives the input slip gear, which interacts with an output gear bonded to Link 2 of the 4 bar linkage. The direct driven motor was chosen to simplify mounting and calculation of the input motion, but it proved to be difficult to achieve a low speed with the current motor gearing. If done again, we would opt either for a lower speed and higher torque motor, or have another gear reduction before the slip gear.
In our initial tests we discovered the two gears sometimes caught against each other, and our current motor wasn’t strong enough to overcome the friction. Rather than buying an even more expensive motor, we sanded and sawed off some teeth to make room for them to pass. Below, the CAD model and photo show the teeth removed on the driving gear.
Motor speed was the last major problem we encountered during implementation. The lowest speed was still too fast for the spring to release and swing the 4-bar back, so we had to program in “stops” to slow and stop the motor, allowing more time for the spring to activate.
Motor speed was the last major problem we encountered during implementation. The lowest speed was still too fast for the spring to release and swing the 4-bar back, so we had to program in “stops” to slow and stop the motor, allowing more time for the spring to activate.
const int IN3 = 8;
const int IN4 = 9;
const int ENB = 10; // PWM for speed control
int motorSpeeds[] = {230, 0, 230, 0, 230, 0, 255, 0}; // The sequence of motor speeds
unsigned long rotationDelay[] = {640, 800, 410, 800, 640, 800, 315, 800}; // Time to wait for each state (ms)// unsigned long rotationDelay[] = {530, 800, 430, 800, 530, 800, 590, 800}; // Time to wait for each state (ms)
void setup() {
// Set motor control pins as outputs
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
pinMode(ENB, OUTPUT);
// Always set the motor direction forward
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
// Loop through each speed setting
for (int i = 0; i < sizeof(motorSpeeds) / sizeof(motorSpeeds[0]); i++) {
analogWrite(ENB, motorSpeeds[i]); // Set motor speed
delay(rotationDelay[i]); // Wait
}
// Stop the motor completely
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
analogWrite(ENB, 0);
}
void loop() {
}