Video playlist here:
https://www.youtube.com/playlist?list=PLhzyHYgY_Dtu8BNphVEEyBGgYpNtjF_TX
Written instructions:
Print all parts at the layer height you choose, obviously finer layers will yield a smoother finish.
Print in the orientation they are in from the file.
Add supports for the Tippler base, I prefer not to use tree supports for this.
Add a brim to both struts.
Check the video on how to print the servo arm.
1: Remove supports and brims from all parts.
2: Widen out holes to accept 2mm brass rod (see videos). Widen out the platform holes with the 1mm drill bit.
3: Tie a knot in the elastic thread, pass it through the front of the right strut in the diagonal hole. Thread it through the corresponding square hole on the base, then out the back round hole. Bring the elastic around the back, in through the other round hole, through the square hole and then out through the left strut. Tie a knot in the elastic so that the left strut stays in place.
4: Cut the brass rod to length and insert into the upper bar holes on the struts.
5: Attach the left and right platforms with superglue, encasing the magnet in the slot.
6: Cut the pivot rod to length and thread through the base, pass it through the strut, through the platform and then through the other strut before locating in the base.
7: Fix the servo in place using screws.
8: Program Arduino using the code at the bottom of this description.
9: Fix the Arduino in place, solder terminals, button and servo connector.
10: Connect the arduino to power, and to the servo to set it to 0 degrees.
11: Bend the floristry wire so it connects to the tippler platform and servo arm. The linkage should be roughly 5cm long.
12: Fix the servo arm in place.
13: Test the control, check that the servo is not stalling and adjust endpos as necessary.
14: Add track, magnets to wagons and test.
Code:
#include
Servo myServo;
const int buttonPin = 2;
const int servoPin = 3;
int buttonState = HIGH;
int lastButtonState = HIGH;
unsigned long buttonPressTime = 0;
bool longPressTriggered = false;
const unsigned long longPressDuration = 2000;//Change this to alter the amount of time needed to trigger the full cycle.
const unsigned long debounceDelay = 50;
int startPos = 0;
int midPos = 18;//Change this to alter the mid position of the platform.
int endPos = 160;//Change this to alter the maximum swing of the servo arm.
int stepDelay = 25;//Change this to alter the speed that the tippler tips at.
int pressCount = 0;
void setup() {
myServo.attach(servoPin);
pinMode(buttonPin, INPUT_PULLUP);
myServo.write(startPos);
delay(1000);
}
void loop() {
int reading = digitalRead(buttonPin);
unsigned long currentTime = millis();
// Button just pressed
if (reading == LOW && lastButtonState == HIGH) {
buttonPressTime = currentTime;
longPressTriggered = false;
}
// Button is held down
if (reading == LOW && !longPressTriggered && (currentTime - buttonPressTime >= longPressDuration)) {
// Long press detected
longPressTriggered = true;
moveServo(startPos, endPos);
delay(3000);//Change this number to alter the amount of time the tippler pauses at it's maximum tip.
moveServo(endPos, startPos);
pressCount = 0;
}
// Button just released
if (reading == HIGH && lastButtonState == LOW) {
if (!longPressTriggered && (currentTime - buttonPressTime >= debounceDelay)) {
// Short press logic
pressCount++;
if (pressCount == 1) {
moveServo(startPos, midPos);
} else if (pressCount == 2) {
moveServo(midPos, endPos);
delay(3000);//Change this number to alter the amount of time the tippler pauses at it's maximum tip.
moveServo(endPos, startPos);
pressCount = 0;
}
}
}
lastButtonState = reading;
}
void moveServo(int fromPos, int toPos) {
int stepDirection = (toPos > fromPos) ? 1 : -1;
for (int pos = fromPos; pos != toPos; pos += stepDirection) {
myServo.write(pos);
delay(stepDelay);
}
myServo.write(toPos);
}