Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: hazzer123 on April 03, 2007, 09:30:12 AM

Title: How to control a servo
Post by: hazzer123 on April 03, 2007, 09:30:12 AM
Is there any way to control a servo from a computer? I have controlled a stepper motor from the parallel port, but i can only get it to output pulses incrementing in milliseconds. Is there any software that can do this? Would the serial port be a better choice of interface?

Or am i going to have to use microcontrollers?

Thanks

Harry
Title: Re: How to control a servo
Post by: Somchaya on April 03, 2007, 09:34:47 AM
Yes it's possible. I managed to control a servo via a parallel port. The main thing to note is that the ground wire (usually the black one) has to go to both the negative terminal of the battery, and the ground pin of the parallel port. That little subtlety took me days to figure out.

So basically, the control wire is wired to a digital pin of the parallel port, the power + goes to a battery, and the ground goes to the ground of the parallel port, and the - of the battery. Then, by varying the pulse width, you can control the servo's position.

However, I noticed that it is somewhat difficult to get the computer to create accurate pulse widths, so you might notice the servo twitching generally. I couldn't find any way around that and so I bought a servo controller board ultimately.
Title: Re: How to control a servo
Post by: hazzer123 on April 03, 2007, 02:57:32 PM
I've found a great way to control up to eight servos from a PIC. I got it from this website - http://www.rentron.com/SerialServo.htm (http://www.rentron.com/SerialServo.htm).
Very easy to understand.

Thanks

Harry