This is my take on the subject. I like the servos placed on a drawer that slides into a bracket fixed on the layout. This simplifies maintenance and replacement of the servo unit.
The latest version of this concept is now presented. The servo is bolted to the drawer. A springy element inserted in the drawer, the tip that will engage the turnout bar goes in top slot, the two arms go into the parallel slots and the remaining tip goes in the servo arm The springy element is just made of 0.3 steel wire folded in a T shape (starting from the vertical part) with the last fold of the wire sticking out of the plane at 90 degrees The drawer can be slid in and out of the bracket
Here is how it works, with a Märklin turnout that had a 0.5mm hole drilled in the throwbar and a 3 mm slot drilled under that hole
Drawer and bracket were printed in PLA filament with a 0.4mm extruder
Here are the files, if anybody wants to use them and the test code that moves the servo in the video
Code: Alles auswählen
// modified from Arduino servo code example
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards
int pos = 0; // variable to store the servo position
int endpos = 15; // variable to store the end servo position (starting position is 0)
int speed=30; // increase that if you want a slower motion
void setup() {
myservo.attach(9); // attaches the servo on pin D9 of the arduino
myservo.write(0);
}
void loop() {
for (pos = 0; pos <= endpos; pos += 1) { // goes from 0 degrees to endpos degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(speed); // waits 'speed' millisecond for the servo to reach the position
}
delay(500);
for (pos = endpos; pos >= 0; pos -= 1) { // goes from endpos degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(speed); // waits 'speed' millisecond for the servo to reach the position
}
delay(500);
}