Electronics > Electronics

How to control a servo


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?



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.

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.
Very easy to understand.




[0] Message Index

Go to full version