Shop OBEX P1 Docs P2 Docs Learn Events
Servo control — Parallax Forums

Servo control

BitRacerBitRacer Posts: 1
edited 2004-11-28 06:55 in Learn with BlocklyProp
I recently bought a homework board from Radio Shack and upon completing the servo chapter I have a few questions about servos.

1) Vdd is 5.0v, Vss is 0v or ground, Vin is unregulater power, so with the battery it is 9v, is this all correct?

2) I'm not really sure i understand the functioning of the servo, I understand how to control it, but not really what is going on. Does the servo contain its own microcontroller?

I think that the pulses being sent via Vdd to the white wire are just signals to tell the servo to pull power from the red/Vin, the duration of the pulses notes the position.

Is this accurate? If I'm wrong(which I'm betting I am) can someone please explain how this is working, I guess I want to know what is going on in the servo... rather than just accepting it as a "black box".... then I'll go back to treating it black box [noparse]:)[/noparse]

Thanks

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2004-11-25 22:37
    As for question #1, the answers are all yes.

    As for question #2, servos are semi-intelligent devices...That it, they don't have a processor like the BASIC Stamp, but they are able to make adjustments depending on the signal you send them.

    The servo get's it's voltage from the Red & Brown (Colors sometimes vary) wires to power it's motor and on-board electronics.· The white wire (sometimes orange) is what you send the signal to the servo telling it what position you want it to go to.· That is between 1mS and 2mS.· When you send this pulse to the servo, it is compared to an internally generated pulse, and depnding on whether it's equal, great or less than that pulse, the servo moves.· When the servo moves, internally a POT moves with the shaft which adjusts the internal oscillator until it matches the signal you are sending it.

    Also the pulse needs to be received every 20mS to 50mS for the servo to maintain it's position and to continually adjust it's position.· If you just send a single pulse of a given width, the servo most likely won't make it to the new position since it hasn't got a continual pulse to compare with.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Knight Designs
    324 West Main Street
    P.O. Box 97
    Montour Falls, NY 14865
    (607) 535-6777

    Business Page:·· http://www.knightdesigns.com
    Personal Page:··· http://www.lightlink.com/dream/chris
    Designs Page:··· http://www.lightlink.com/dream/designs
    ·
  • allanlane5allanlane5 Posts: 3,815
    edited 2004-11-26 01:26
    Yes, a Servo has within it a comparator, that compares the pulse width you send it to an internal pulse width. The internal pulse width is generated with the assistance of a variable resistor attached to the Servo gears.

    So, when you send a pulse width of 1.5 mSec (for a Futaba servo), the Servo 'centers' itself. It controls the motor (it has a motor driver, too) to move in the direction which will make the resistor turn so that the internal pulse width is 1.5 mSec.

    For this to work, every 20 mSec to 50 mSec you must repeat sending the pulse to the servo, so it can compare and move every 20 to 50 mSec.

    It's actually quite an active little device, really. It works really well with the single-tasking BS2, since the BS2 can command 2 or more servo's, go do some other work (like listening to a serial port), and come back and refresh the servo. The servo will move while the BS2 is off doing other things.
  • edited 2004-11-28 06:55
    Chris and Allan have pretty much got you covered, I've just got one thing to add regarding:
    BitRacer said...
    I think that the pulses being sent via Vdd to the white wire are just signals to tell the servo to pull power from the red/Vin, the duration of the pulses notes the position.
    Nicely stated!· That's an excellent summary.

    Post Edited (Andy Lindsay) : 11/28/2004 6:58:32 AM GMT
Sign In or Register to comment.