[nzlug] Controlling a basic servo-motor ...

Andrew Errington a.errington at lancaster.ac.uk
Mon Dec 3 01:03:19 NZDT 2007


Hi,

I agree with the advice given so far.  Although it is possible to drive the 
servo directly from the PC it is preferable to us something else to control 
it, which itself is under control of the PC (via the serial port).  A PICAXE 
is a great low-cost way to get started quickly, or you could get something 
like the Scott Edwards SSC:

http://www.seetron.com/ssc.htm

If you want to do the whole thing on the PC I recommend using the parallel 
port.  You will have to grab a pin and have low-latency code which runs to 
set the pin's state.  See here for a discussion of how to do that:

http://www.andrew.cmu.edu/user/suppe/mobot/mobot2.html

The technique on that page could also apply to the serial port if you can grab 
control of a pin (such as one of the handshake outputs), but you will need a 
level converter.

A servo needs a fairly grunty power supply at 5V.  It can draw quite a high 
current when it moves to a new position, or if it meets any (mechanical) 
resistance.  Use an external bench PSU.  The 'control' pin (driven by the 
micro) is a logic-level signal and only draws a small current.

I'd recommend you go to the local library and look for books on hobby 
robotics.  Christchurch has a few good ones, and I expect things to be the 
same in Auckland.  Incidentally, there is a (fairly active) robotics group in 
Christchurch- go here to subscribe, and ask away:

http://lists.ourshack.com/mailman/listinfo/chchrobotics

We also have links to a group of enthusiasts in Auckland (are you listening, 
Keith?).  Maybe you could meet up for a beer.

A

On Saturday 01 December 2007 18:08, Bernard O'Leary wrote:
> Hi all,
>
> I'd like to spend a bit of time over Christmas messing with a servo-motor.
> Initial goal is to get my head around how to control it via the serial
> port, more long term to be able to apply the techniques I learn to
> small-scale robotics projects.
>
> Am hoping to be able to be able to do things from (more-or-less) first
> principals - write the device driver that will be the source of the PCM
> signal, some sort of controlling application, etc. I'm aware that there is
> some risk of damaging the servo if it is sent a PCM signal that is out of
> range.
>
> At this stage I'm looking for pointers, advise, and answers to a few
> questions. For example - is it advisable to test the serial port output
> using an oscilloscope prior to hooking up the servo? And is it sweet to
> hook the serial port output directly to the PCM signal input on the servo,
> or should there be some hardware in-between? What is the recommended way to
> power a servo (I assume the serial port lacks the necessary juice
> requirements)? etc ...
>
> Clearly I'm no electronics engineer. I do have some basic digital
> electronics experience and knowledge though, and tons of textbooks. One way
> or the other I'll be going ahead with this project - so some time (and
> potentially harware) saving guidance would be appreciated ;-)
>
> Ta,
>
> Bernard.
> _______________________________________________
> NZLUG mailing list NZLUG at linux.net.nz
> http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug



More information about the NZLUG mailing list