Working With Servos

Madman

Madman

Registered
25 Oct 2009
13,613
528
Pennsylvania, USA
I've played around with servos in the past. I would like to make more use of them. There is an article in Classic Toy Trains about using servos to animate various things on our layouts.

I don't quite understand how to activate the servo without using R/C. The article talks about a servo driver. but how's the servo driver controlled ?

IMG_1385.jpg
IMG_1386.jpg
IMG_1387.jpg
 
P

Paul M

Registered
25 Oct 2016
4,850
868
57
Royston
I'm not sure, but I'm going to follow this thread. I do know not to use cheap servos in locations you can't easily get to!
 
dunnyrail

dunnyrail

DOGS, Garden Railways, Steam Trains, Jive Dancing,
25 Oct 2009
17,257
1,811
72
St.Neots Cambridgeshire UK
Typically Servo drivers use a simple toggle switch. Have a look at MegaPoints downloads.

 
PhilP

PhilP

G Scale, 7/8th's, Electronics
5 Jun 2013
25,878
1,462
Tamworth, Staffs.
Hi Dan,

Look at the Servo Tester here:


There is an underlined 'see more' link.. Follow that for more info on the tester.


The servo drivers in the article, have push-buttons on the board. With a little bit of delicate soldering, you can extend these to a convenient position for you to operate.

PhilP.
 
The Shed

The Shed

Registered
Dan, great article.

Think of a Servo as a geared DC motor, requires POS & NEG voltage, plus a Signal (pulse string), using PWM, (PPM or PCM individually or combinations or conversions of all three).

All the Servo driver does (can be something as simple as a 555 Timer IC) is produce the Signal, to enable the Servo to move, either to a preset or defined point, or freely between any two given points (Start point & End point).

To answer your question, the Servo driver can be set up to produce a specific pulse to move the Servo to a defined position, once this information is put in place it's permanent, until as and when the User changes it, now all that is required is a method to trigger (start) the Servo to move, can be anything, Switch, Reed, TTL Logic Signal, PIR Sensor, Hall Sensor, so on and so forth.

As I use DCC and DIY Arduino Decoders, precise, infinite, unlimited movement of a Servo or multiples of Servo's can be achieved with a minimum of hardware (electronic components) and as the control program (Sketch) is completely under User (Human) control, anything and everything is possible, yep even boiling the kettle to make the tea is feasible!
 
Last edited:
The Shed

The Shed

Registered
As rain stopped play outside, a few pictures.

The Arduino UNO has 6 pins ~3, 5 ,6, 9, 10 & 11 are able to produce a PWM Signal that can be used for Servo's, below are a couple of simple ideas for use with Servo's, and the Arduino IDE programming environment, simple or complex, single or multiple Servo or Servo's.

Unlike commercial Servo Drivers or Servo Testers where you are restricted on what you can do, no such restriction with the Arduino, plus the question of economics, for instance why would I purchase something, that is in relative terms is more expensive as in a ready made product and would have a restrictive use?

Arduino UNO setup for a Servo Tester, Servo sweeps back and forth.
servo sweep.png



Sketch (Program Code for above), #include <Servo.h> is known as a "library" file, the "brain" so to speak for the sketch to work correctly.
servo sweep sketch.PNG



Servo, position control with a potentiometer.
servo pot left.png


servo pot right.png


Sketch (Program Code for above)

servo pot sketch.PNG


One thing I would emphasis is careful thought needs to given to the design of the voltage regulator circuit to drive the Servo or Servo's with a clean electrically noise free, for a voltage range of 4.8 V to 6 V DC voltage.

Servo's can be very nitpicking on dodgy power regulator circuits.

The voltage regulator shown is one of the many that are attached to my DCC systems, fortunate that both the Massoth and PIKO CS's are exceptionally good in that they both are, clean and noise free as in electrical supply, very little filtering is required to convert the bipolar DC from the DCC signal to rectified DC voltage.

Servo's are heavy users of both Voltage and Amp, and don't forget to tie the GND's from any external source to the Arduino.
 
Last edited:
a98087

a98087

Registered
8 Nov 2009
1,620
151
32
Wiltshire
THe item that’s PhilP LinkedIn to is what you need, it needs an external power supply 5v I think, and then it becomes the servo control box.


Twist the knob and the servo moves, or reset the servo, or make it continuously move.

What are you actually trying to achieve?

Dan
 
Madman

Madman

Registered
25 Oct 2009
13,613
528
Pennsylvania, USA
Hi Dan,

Look at the Servo Tester here:


There is an underlined 'see more' link.. Follow that for more info on the tester.


The servo drivers in the article, have push-buttons on the board. With a little bit of delicate soldering, you can extend these to a convenient position for you to operate.

PhilP.

I found a picture of a servo tester like the one in your link. I can see where to connect the 4.8-6 volt power. But what is the third pin used for ?

Image 6-30-20 at 11.11 PM.jpg
 
P

Paul M

Registered
25 Oct 2016
4,850
868
57
Royston
Looks like the outer works has several uses other than a servo tester, all they do is change the bits inside.
 
M

Michael

Registered
26 Jan 2010
130
87
You will probably find that this doesn't move the servo to it's end points without adjusting the resistor values so I wouldn't recommend it. You really need a microprocessor based one.

If you search for "servo controller model railway" you will find that there are many controllers designed for indoor model railways to drive points for instance. Here's a UK based one but I'm sure there will be similar US based ones too. It's designed for the popular 9 gm servos which are the ones I use on my steam loco.

Servo-Controller-600x618.jpg.png
 
PhilP

PhilP

G Scale, 7/8th's, Electronics
5 Jun 2013
25,878
1,462
Tamworth, Staffs.
I found a picture of a servo tester like the one in your link. I can see where to connect the 4.8-6 volt power. But what is the third pin used for ?
It is not used.. For speed, they are using a standard 3-pin servo connector..

PhilP.
 
GAP

GAP

G Scale Trains, HO Trains
14 Jun 2011
2,768
318
Bundaberg Queensland, Australia
You will probably find that this doesn't move the servo to it's end points without adjusting the resistor values so I wouldn't recommend it. You really need a microprocessor based one.

If you search for "servo controller model railway" you will find that there are many controllers designed for indoor model railways to drive points for instance. Here's a UK based one but I'm sure there will be similar US based ones too. It's designed for the popular 9 gm servos which are the ones I use on my steam loco.

View attachment 269283
The servo tester most certainly does move the servo to it's end points using the variable control knob.
I have one and for manual control I connect the power to the pins labelled + and - Feed and the servo to the Servo Signal Output and it will move to a position corresponding to the knob position.
This is a very simple manual servo controller that can have as many a use as the user can dream up.
To get fancier with R/C and microcontroller control I would use another driver depending on what is desired to be achieved.
 
a98087

a98087

Registered
8 Nov 2009
1,620
151
32
Wiltshire
This is my servo test set up,

It’s nice and simple,
All you need a-power supply
Ubec- produces 5v dc for the servo tester
Servo tester

By extending the wires you could fit it into a model if you wish
11BEF5A8-F98F-4C16-B0F0-155A06794B98.jpeg
 
M

Michael

Registered
26 Jan 2010
130
87
The servo tester most certainly does move the servo to it's end points using the variable control knob.
I have one and for manual control I connect the power to the pins labelled + and - Feed and the servo to the Servo Signal Output and it will move to a position corresponding to the knob position.
This is a very simple manual servo controller that can have as many a use as the user can dream up.
To get fancier with R/C and microcontroller control I would use another driver depending on what is desired to be achieved.
That's interesting. I use the same SG90 9gm microservo that is in this video and it appears to only travel through 90°.


When I drive the same servo with an Arduino, I get around 160° of movement.
 
D

Dan

Registered
28 Jan 2010
302
25
Eastern MA
In digital (DCC) engines, some decoders have servo capability. Zimo largescale decoders have 4 programmable servo outputs, and the smaller scale decoders (MX645) have 2.
I use these and add remote uncoupling via a standard servo, chain, Kadee coupler. Others have used the servo outputs to animate a arm waving or door opening on the loco.