Servos

Madman

Registered
25 Oct 2009
17,192
2,984
Pennsylvania, USA
Best answers
0
Country flag
I would like to learn the correct way to control servos. At present, I have a small LGB tool car that uses a reworked servo to open and close the door. By reworked, I mean that I rewired the servo to allow reversing polarity from AA batteries to reverse the servo. It works rather well, but I know that servos are supposed to be operated in some other manner. I may be wrong but operating them the way I do, could cause damage to the servo. Here is a very short video of the operation.

http://youtu.be/VMjU2rJFf5A
 

PhilP

G Scale, 7/8th's, Electronics
5 Jun 2013
33,645
3,532
Nottingham
Best answers
0
Country flag
Hmmm. Gives me an idea for a guard looking out as the train passes a signal box..

Might have to get Greg involved with a Picaxe!
 

ge_rik

British narrow gauge (esp. Southwold and W&LLR)
24 Oct 2009
10,707
1,244
Cheshire
www.riksrailway.blogspot.com
Best answers
0
Country flag
PhilP said:
Hmmm. Gives me an idea for a guard looking out as the train passes a signal box..

Might have to get Greg involved with a Picaxe!
That was going to be my suggestion. A Picaxe circuit would do all the controlling you need. Really easy learning-curve to do the sort of controlling which you'll need for that sort of application. Here's a basic tutorial which would get you started - you can then always seek advice from Greg et al. As you can see from the tutorial - very little electronics involved and the programming is pretty straightforward once you get the hang of it. The beauty is that you can tailor the program to suit any type of control you need.
http://picaxe.hobbizine.com/servo.html

Rik
 

Madman

Registered
25 Oct 2009
17,192
2,984
Pennsylvania, USA
Best answers
0
Country flag
Thanks. I'm going to study the documents. Will be back with ???? I'm sure.
 

gregh

electronics, computers and scratchbuilding
1 Nov 2009
3,137
263
Sydney, Australia
www.members.optusnet.com.au
Best answers
0
Country flag
If you're interested in trying Picaxe, you could start here:

http://www.trainweb.org/SaTR/Picaxe tutes.htm

and look at tutorial 4.


or use one of these.
http://www.hobbyking.com/hobbyking/store/__17143__Simple_Servo_Tester.html
 

Martan

Computers, Airplanes, Trains, Software
8 Aug 2012
9
1
Central Virginia
martinsant.net
Best answers
0
If you are interested in the Atmel series (ardunio, etc) I've written some servo code in C and C++ for the Attiny 1634. It should work with most Atmel processors that have a 16 bit timer. You can find the source code on the 'files' page of http://controlwidgets.com/

It drives four servos but it wouldn't be hard to do more. It's just a simple state machine but it works well. It will build with Ardunio or the free Atmel Studio 6.