Using linear servos as switch motors


kleiner

Well-Known Member
These gadgets have become new favorite toy. This is a linear servo intended for use in radio controlled airplanes. I am planning to use these as switch motors in my new layout. They have several advantages:
  • They are easy to control from a Raspberry Pi using GPIO pins. You move the control arm by changing the duty cycle of use width modulation. No extra hardware is necessary and the software to generate the signal is really simple.
  • They cost less than $10
  • They generate more than enough force to throw turnouts.
  • They are small and can be installed on top of the layout. I hate installing bulky switch motors under the roadbed (lots of cursing involved usually :) when installing Tortoises). I plan to build some small styrene covers for them or perhaps get some 3d printed on Shapeways.
  • These appear to be much smaller than the rotary servos that companies like Tam Valley sells.
Has anyone else tried these?

IMG_2345 (1).jpeg
 
They are easy to control from a Raspberry Pi using GPIO pins. You move the control arm by changing the duty cycle of use width modulation...
You do what to your who now?
I really need to start studying programming...

Has anyone else tried these?

Haven't heard of them, but they look great. I have one turnout on my layout that I, at 6'1" with pretty long arms, can still reach if I stretch. I've been considering installing a switch motor of some kind on it (scratch built turnout), but the tortoise style may not work just due to where it is located (benchwork obstructions underneath). One of these little dandies look like they would do a great job of it. I'd love to see what you come up with for this.
 
You do what to your who now?
I really need to start studying programming...



Haven't heard of them, but they look great. I have one turnout on my layout that I, at 6'1" with pretty long arms, can still reach if I stretch. I've been considering installing a switch motor of some kind on it (scratch built turnout), but the tortoise style may not work just due to where it is located (benchwork obstructions underneath). One of these little dandies look like they would do a great job of it. I'd love to see what you come up with for this.

Apologies - I have been working in the software business for such a long time, I just take these terms for granted!

Raspberry Pis are low-cost Single Board Computers (SBCs). Typically, they cost about about $30. They run the Linux operating system and have many uses in model railroading. They can directly be used for both control and feedback pretty easily using a set of pins called GPIO (General Purpose Input Output)

These servos are controlled using Pulse Width Modulation. What this means is that the computer generates a square wave signal and you change how much of each cycle, the signal is high to get the servo to move.
 
This is interesting, I'm in the process of using servo controllers and servos to do a similar thing. This looks like it may wind up being more complicated, but more flexible as well. Certainly allow for more flexibility in terms of pairing off turnouts.

Before you go reinventing the wheel, consider this: https://1fatgmc.com/RailRoad/Servo Control/Servo Control-Index.html , no software, and quite a few switches.

And yes, I realize these are larger, but it seems to me that a similar approach could be used with linear servos just as much as with ones that rotate.
 
Before you go reinventing the wheel, consider this: https://1fatgmc.com/RailRoad/Servo Control/Servo Control-Index.html , no software, and quite a few switches.

And yes, I realize these are larger, but it seems to me that a similar approach could be used with linear servos just as much as with ones that rotate.

Thanks for the link - this looks fascinating but seems to involve a lot more hardware than the approach I'm planning to take. I generally prefer to solve these kinds of things using software if at all possible. Incidentally, I did contact Tam Valley to ask if their servo controller would work with these linear servos but they were not sure.

Anyway, I decided to bite the bullet and see what I could do on my own. To my pleasant surprise, it turned out to be much easier than I expected to control these servos without any additional hardware. There is a lot of good documentation on how to do it like this for example.

Once I understood the basic principle of servo control, it took me just a few minutes to write a few lines of Python to control the servo. My layout will be under full computer control so I will be using a bunch of Raspberry Pi boards. It will be easy to write a small Python server using a framework like CherryPy to allow me to control turnouts remotely.

I also plan to use the Raspberry Pis to handle track occupancy feedback. I already have some thoughts on how to do that and will post about that separately.
 



Back
Top