Author Topic: How to control a servo  (Read 2780 times)

0 Members and 1 Guest are viewing this topic.

Offline hazzer123Topic starter

  • Supreme Robot
  • *****
  • Posts: 460
  • Helpful? 3
How to control a servo
« 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
Imperial College Robotics Society
www.icrobotics.co.uk

Offline Somchaya

  • Robot Overlord
  • ****
  • Posts: 180
  • Helpful? 0
  • You know it's cute!
Re: How to control a servo
« Reply #1 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.
Somchaya - Back after a year of misc things
http://whisker.scribblewiki.com

Offline hazzer123Topic starter

  • Supreme Robot
  • *****
  • Posts: 460
  • Helpful? 3
Re: How to control a servo
« Reply #2 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.
Very easy to understand.

Thanks

Harry
Imperial College Robotics Society
www.icrobotics.co.uk

 


Get Your Ad Here