Jump to content
 

Servo control on the cheap


eldavo

Recommended Posts

  • RMweb Premium

I'm currently in the process of developing a cheap servo controller to operate points on a club layout. We have a large number of turnouts to operate so want to use cheap servos but all the off the shelf controllers seem a bit pricey. Having played with Arduino process controller boards for other things (exploiting the output of my solar panels) I discovered just how flexible these things are. One thing they can do without any extra componentry is control servos.

Here is one of the smallest members of the Arduino family, a Pro Mini...

post-7010-0-45227300-1504814932.jpg

It's fitted with standard pin headers down either side of the board at 1/10th of an inch pitch. It's pretty small but provides 14 digital input/output ports 6 of which can generate PWM which is what is needed to control a servo.

To make it usable we need to mount it on a bit of vero board. To do this we use a couple of rows of sockets...

post-7010-0-92235900-1504814947.jpg

I'also added a small push to make switch. Underneath the tracks are cut to isolate the two sides of the Arduino board...

post-7010-0-81474000-1504814956.jpg

The push button is wired between the ground pin (0 volts) and a digital input pin, in this case pin 1...

post-7010-0-23364400-1504814978.jpg

The board needs a power supply, 0 volts and 5 volts, plus for each servo to be controlled an input and a PWM output. The board below has been wired to a bit of tag strip for convenience and is rigged for just one servo. The white wire to the board is the switch input and the yellow is the control signal to the servo. To switch a servo its input is simply connected to 0 volts.

post-7010-0-96711800-1504814989.jpg

The pushbutton on the vero board is used to make adjustments to the individual servo settings. A quick push of the switch puts the most recently used servo into throw set up mode allowing the definition of the extremes of throw. By default they all throw 55 degrees either side of the centre (90 degree) point. Pushing and holding the button for 3 seconds reverses the operation of the last switched servo. Pushing and holding the button for more than 10 seconds resets everything back to defaults.

So how cheap is cheap?

An Arduino Pro mini can be had for between £2.20 and £5 through the famous auction site. A bit of veroboard is about 50p, the female pin headers about 50p and a pushbutton for about 25p. All in all you can probably knock up a controller for 6 servos for about £3.50.

With this particular board you will also need an FTDI serial to USB cable in order to program it but you only need one for any number of boards. The software development stuff is all free from the Arduino site (http://www.arduino.cc).

If you really want to go "off piste" you can probably use an even cheaper board!

Cheers
Dave

Link to post
Share on other sites

  • RMweb Premium

Dave,

Have you looked at doing something like this for controlling semaphore signals? It seems like a much cheaper alternative than some of the available products already on the market.

Michael

It would be a very simple software mod to control semaphores with a "pull up" and bounce on return.

 

You have explored the options offered by MERG I assume?

I did look at the MERG stuff and it is good value but to be honest this version is actually a stripped down version of a previous experiment. The previous version also had DCC accessory decoder function for a few pence more and controlled 5 servos or Tortoise motors.

 

I guess I'm just an inveterate fiddler.

 

Cheers

Dave

Link to post
Share on other sites

I use servos on all my points, i just soldered wires directly to the motor, a DPDT switch to change direction and a momentary push switch for power. 

 Hi,

and what did you put at the other end of the wires 230Vac, 16Vac, 12Vdc or ???? Pray tell.

 

Cheers Godders

Link to post
Share on other sites

I use servos on all my points, i just soldered wires directly to the motor, a DPDT switch to change direction and a momentary push switch for power. 

That's not a servo, at least not unless you also butchered the servos.

 

Andrew

Link to post
Share on other sites

  • RMweb Premium

I use servos on all my points, i just soldered wires directly to the motor, a DPDT switch to change direction and a momentary push switch for power.

That sounds more like a solenoid than a servo. These servos are used in radio controlled planes, boats, cars etc. and also in robotics. They take a pulsed control signal that determines the exact position they move to and hold. Here's one of the cheapo jobbies I'm using...

 

post-7010-0-04133600-1504815210.jpg

 

The bits of white plastic in the background are the two halves of a piece of cable conduit that I have chopped about to a make a simple mount. Here's a selection of them mounted up and ready to go. Some have a small micro switch mounted for switching frog polarity...

 

post-7010-0-93381700-1504815289.jpg

 

I have another version that operates at 90 degrees...

 

post-7010-0-49674000-1504815220.jpg

 

This simple servo controller started of as a DCC accessory decoder controlling 5 servos...

 

post-7010-0-39193100-1504815302.jpg

 

I have a couple of bugs to sort out in the code and then I'll post it up for anyone interested.

 

Cheers

Dave

Link to post
Share on other sites

It's great to see someone singing the praises of the Arduino system.

 

I was going to suggest using an Atmega328 chip (the one in the Arduino Uno) on a piece of veroboard but if you can get a pro mini for £5 the small saving would hardly be worth the trouble.

 

Anyone starting out with the Arduino system should buy themselves at least one genuine Arduino Uno as they are the most "standard" of the Arduino boards and the one for which most advice is available. You can prototype your project on the Uno and then move it to a cheaper board when you know how to make it work. If you temporarily pull the Atmega328 from the Uno (carefully) you can use the Arduino board instead of an FTDI cable; but it's probably worth the small extra cost to buy an FTDI cable as well.

 

One thing that seems to flummox a lot of Arduino beginners is the fact that the Arduino can't supply enough power to drive servos. They must have a separate power supply.

 

You would buy an Arduino Uno and a couple of servos for the price of 2 tortoise point motors -  and the Uno would be far more versatile.

 

The Arduino forum provides practically instantaneous answers to questions.

 

...R

Link to post
Share on other sites

Sorry, But I think you will find the attached photos are of a servo they are run off two batteries giving 3 volts

Nope. You have disconnected the internal controls which means it is no longer a servo. It is a servo case with a motor in it now.

Link to post
Share on other sites

  • RMweb Premium

Sorry, But I think you will find the attached photos are of a servo they are run off two batteries giving 3 volts

Interesting. I don't think I have ever seen servos used that way. I guess the only downside is the need to manually control the throw by having the pushbutton power control.

 

Cheers

Dave

Link to post
Share on other sites

yes, you are using the 'stall' method but if you don't apply power for too long you won't damage the SERVO. I have seven of them on my layout connected to points and they all work fine. I am also using them to power signals as well

Link to post
Share on other sites

  • RMweb Gold

I use servos on all my points, i just soldered wires directly to the motor, a DPDT switch to change direction and a momentary push switch for power. 

 

The little devices were bought as “Servos” and re-arranging some of the “inards” has left them largely the same – in the eyes of the user – thus they are servos!

 

To an electronics/control engineer a servo is a motor positioning control system.

 

In your case, (rather cleverly I might add), you have bypassed the control circuitry, ignore the position feedback device and just energise the motor, in the required direction and through the gearbox, until the point changes. Nice, slow and under complete user control.

 

Simple, cheap and effective.

The only down side is that there is no limiting the user from energising the motor too long and you have to "eye-ball" (or listen for the "click") each and every point change.

 

Just another way of operating points.

 

 

Kev.

Link to post
Share on other sites

  • RMweb Premium

I too have used the KISS method of using servo-motors for point control, like daveyg. This was after trying, and failing, to control them electronically. They may no longer technically be servo-motors, but they are cheap ( around £2 ), strong and reliable motors. Mine are held in a housing made of scrap bits if wood, which also limits movement so they cannot damage the points. A micro-switch is used for frog polarity as I am using push buttons to control the motor. A 1.5V AA battery is enough to throw a peco point with a slow action. The photo shows three of them, operating points by wire in tube.

 

post-6821-0-33136700-1390085601_thumb.jpg

Link to post
Share on other sites

I use servos on all my points, i just soldered wires directly to the motor, a DPDT switch to change direction and a momentary push switch for power. 

 

Having read the subsequent posts I can't help wondering if @daveyg deliberately left out an explanation in order to be controversial - which wasn't helpful, because the idea is very clever.

 

...R

Link to post
Share on other sites

how did not explain how I did what I did? I just stated what i do to the servos and posted a picture how can that not be clear? This forum has so meany people who are too ready to jump on posters that it really isn't worth posting. Remember This. you don't know me,you have never met me you would not do this face to face so why online?

Link to post
Share on other sites

how did not explain how I did what I did? I just stated what i do to the servos and posted a picture how can that not be clear? This forum has so meany people who are too ready to jump on posters that it really isn't worth posting. Remember This. you don't know me,you have never met me you would not do this face to face so why online?

I would certainly tell you to your face that they are not servos! It's nothing to do with being pedantic or being on line.

 

"Servo" has a very specific meaning in the cotext of point control. If you had admitted in your first post that they were not really servos any more, just a motor and gearbox, then there would be no issue.

 

Andrew

Link to post
Share on other sites

  • RMweb Premium

Anyone starting out with the Arduino system should buy themselves at least one genuine Arduino Uno as they are the most "standard" of the Arduino boards and the one for which most advice is available. You can prototype your project on the Uno and then move it to a cheaper board when you know how to make it work. If you temporarily pull the Atmega328 from the Uno (carefully) you can use the Arduino board instead of an FTDI cable; but it's probably worth the small extra cost to buy an FTDI cable as well.

 

Alternatively, you can use the Uno itself as a programmer for any ATmega (or ATtiny) chip (i.e. instead of an FTDI cable).

Link to post
Share on other sites

how did not explain how I did what I did? I just stated what i do to the servos and posted a picture how can that not be clear? This forum has so meany people who are too ready to jump on posters that it really isn't worth posting. Remember This. you don't know me,you have never met me you would not do this face to face so why online?

If this is aimed at me, may I point out that there were no pictures in your first post :)

 

Alternatively, you can use the Uno itself as a programmer for any ATmega (or ATtiny) chip (i.e. instead of an FTDI cable).

 

This is certainly a very useful feature, and I have used it, but it isn't strictly an alternative because (as far as I know) if you have the Atmega 328 in the Uno board you can't use the board to conduct a serial "conversation" with another board.

 

...R

Link to post
Share on other sites

  • RMweb Premium

How's about we keep this thread positive. There are many ways to skin a cat, feline or your favourite furry creature. A little more description originally of how the rewired servos were being used would have helped but we now know how it's done and it is certainly a useful way of doing it for those that don't want the work of creating a servo controller, aren't using DCC turnout control or just plain prefer it.

 

I've learnt something if nothing else.

 

Cheers

Dave

Link to post
Share on other sites

  • RMweb Premium

If pushed, I'd describe mine as modified servo motors. Rather than getting bogged down with the terminology, I'd be interested in peoples experience of using these motors in their intended way, particularly regarding reliability.

I have a friend that tried the MERG system. His first problem was he couldn't get the programmer to work. He was able set the servos up using a PC and the MERG software. All seemed to be working fine until he found that when running certain locos the points would change at random, not good on an exhibition layout. Another issue I had was the motors twitching when the system was switched on. I thought this could potentially cause damage to hand made track or signals.

Has anybody else experienced this sort of thing? Was it because cheap servos were being used?

I'd be interested in how reliable your system is, Dave. It certainly looks interesting.

 

I can dig out photos of how I converted mine, if anyone is interested.

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...