Servo control of a stub turnout

alhoop

Member
I want to use a 9g micro servo driven by a Picaxe-14M to control a stub N-Scale 3way turnout.
While the two endpoints are position repeatable the center is not due to servo backlash(?). If I approach the center position from the same direction the position is repeatable. Is there any way around this?
Here is my code which reads a 1 pole 3 position switch and uses case statements. The highs out control relays that provide correct track polarity to the three frogs.
Thanks for any help or new code.
 
Last edited:

bluejets

Senior Member
How about using an optical sensor as an input, (slotted type using a vane)such as is used in printers, copiers, all sorts of equipment. This way the servo would drive to the exact spot regardless of backlash. They are very accurate and I have used them many times. There are a few different types and I usually set them up with an additional output transistor for inverting.
If you want details, call back.
 

Attachments

inglewoodpete

Senior Member
It would be wise to look at all possibilties before going down the sensor-and-software path. This sort of solution can give you a lot of work.

One alternative would be a mechanical solution. A detent track/spring may be simpler to implement. What method is used on a manually operated pointset (turnout)?

Another solution could be a small stepper motor.
 

westaust55

Moderator
If as you indicate the servo has the desired repeatability from each side then can you not just use a different value from each side/end as the mid point?
 

allison1947

New Member
Can you send the servo to one side eg "left side" then send to centre? That way it will always be approching from a known side.

case 2 'center
low 2
low 4
high 3
servopos 5,75 'go left first
pause 100 'pause long enough to get to "left" from any position
servopos 5,150 'now go to centre position

It may work.
 

alhoop

Member
My bad - my problem was caused by not enough current from a 5 volt supply to reliably drive the servo.

More Info:

I am using the Picaxe-18M2 with the attached code.
Without the pause 1000 command I was getting servo jitter about every 2-3 seconds. The pause command seems to have fixed it - I don't know why.
Servo can onlly be used on port b and I am using b.4,b.5 and b.6 for switch inputs and b.1,b.2 and b.3 for outputs with servo out on b.0.
When I read pins b does that effect servopos out on b.0?

Al
 

Attachments

Last edited:

hippy

Ex-Staff (retired)
Guess I need to bump the above post up.
I was wondering why, re-read your post and noticed the question tucked at the end. Sorry for missing it !

Servo can onlly be used on port b and I am using b.4,b.5 and b.6 for switch inputs and b.1,b.2 and b.3 for outputs with servo out on b.0.
When I read pins b does that effect servopos out on b.0?
Reading the pins shouldn't have any affect on the servo output.
 
Top