Re: Driving servos from a PC




Pete Verdon wrote:
As part of a construction project for a charitable event, I need to
build a number of big analogue dials (like an old-fashioned voltmeter)
controlled by a series of PCs (each computer drives two dials). Accuracy
isn't critical, but I do have a fairly strict budget restriction.

One possibility seems to be to use an RC servo to move a big cardboard
needle. I've not used servos before, but a little research suggests that
the required position is commanded by altering the pulse width of a ~5v
50Hz square-wave signal a little either side of 2ms.

As I said, I don't have much of a budget. I also have limited
electronics knowledge. But is it totally unrealistic to consider
controlling these servos via a soundcard output? I envisage putting one
dial on each of the left and right channels, and getting the card to
spit out an appropriate wave-form to each of them. I realise this won't
be a proper square-wave, but am I likely to get close enough?

What else have I missed? Do you have another (cheap) suggestion, whether
involving servos or not?

Thanks,

Pete

Hi, Pete. You already have the capability in your parallel printer
port -- output logic level signals. You can also use the PC to supply
5V power for the servo. But the devil is in the details.

You didn't mention the other jobs you're having the computer do, or
even what operating system you're using or what programming language.
If you're using DOS and your PC isn't doing anything else, you can just
set your printer port for SPP in the BIOS and then use QBASIC or
anything else that provides direct control of the PC's ports to program
a timing loop to output the pulses (which are supposed to be 5V logic
level, positive-going pulses, 1-2ms. pulse width every 20ms). Voilla
-- done. Additional cost = zero.

If you've got other things to do with your program, or if you're using
Windows, it gets a little stickier. That's because the servo turns off
unless it gets at least one pulse every 30ms. or so. Using Windows,
you'll need help with DLLs and drivers.

You might want to try going to the Jan Axelson/Lakeview Research
website for more information. Chances are you'll find what you need
there (and you might want to get a copy of the book "Parallel Port
Complete", provided with a CD that has the support software for various
languages).

http://www.lvr.com/parport.htm

Good luck
Chris

.



Relevant Pages

  • Re: Multiple R/C servo control
    ... I've been doing lots of tests with controlling R/C servos lately, some good experiences and some bad experiences. ... Now I'm working on a improved version of my servo controller that will theoretically get rid of the flicker and support unlimited servos. ... Set new TMR0 interval as the difference between next servo pulse width and current one. ... If you are controlling 4 servos, TMR0 should trigger 5 times in the worst case, 1 time for driving all servo lines up and 4 times to drive them low. ...
    (comp.robotics.misc)
  • Re: Interesting discovery regarding servos and current
    ... servo power line. ... I put a low pass filter on the ... current square wave starts right after the PWM signal's falling edge. ... the longer the current pulse gets. ...
    (comp.robotics.misc)
  • Re: Simple mosfet question
    ... with a 1500us pulse corresponding to neutral. ... To control the servo, you command it to a certain angle, measured from ... the transistor, it is basically just inverting the input and changing ... the zener would connect, I'm new enough at this sort of thing ...
    (sci.electronics.design)
  • Interesting discovery regarding servos and current
    ... Hi - on my 6 legged robot I put high side current amplifiers on each ... servo power line. ... current square wave starts right after the PWM signal's falling edge. ... the longer the current pulse gets. ...
    (comp.robotics.misc)
  • Re: Multiple R/C servo control
    ... Changing the pulse width ... > the TMR1 register. ... > you have to get out of the interrupt routine before TMR1 wants ... > It picks the next servo delay from the array and stuffs it into ...
    (comp.robotics.misc)