Shop OBEX P1 Docs P2 Docs Learn Events
Prop to RC Servo Interface Question — Parallax Forums

Prop to RC Servo Interface Question

DroneDrone Posts: 433
edited 2008-01-15 18:57 in Propeller 1
The comments in the 4 servo driver on the Object Exchange says,

"normal servos are driven from a prop pin through a 4.7k resister".

Is this 4.7K resistor just to be absolutely safe, or is there an electrical requirement for it?

Typical servos have three wires:

1. Black - Ground

2. Red - 4.8-6.0VDC (use 5V)

3. White - Pulse width control input, 1-2ms pulse repeated every 20ms (connect to Prop pin).

Regards,

David

Comments

  • deSilvadeSilva Posts: 2,967
    edited 2008-01-13 13:21
    There is no need for the resistor.

    But it is a general issue what to do with "output" lines.
    The outputs of the Propeller are relative short-circuit proof, driving 50 mA if forced to. But this might disturb another chip's output that has erroniously been connected to this Propeller pin smile.gif

    It is just good practice to limit this current to a value safe for standard situations, which will be 10mA = 220 to 470 Ohms

    As generally no current is needed such output protection resistors can be made MUCH higher. But this resistor forms a low-pass filter with all capacitance around (input pin, traces, cords 10..100pF or even higher) this defines the limit.

    I personally recommend 1k in all cases, except the signals go > 1Mhz or real current is needed

    Post Edited (deSilva) : 1/13/2008 1:28:11 PM GMT
  • DroneDrone Posts: 433
    edited 2008-01-13 15:55
    Thanks deSilva, I thought so... no series resistor necessary. But then again, I'm plan to crack open a servo I bought yesterday to see if I can get it to do 360 rotation. These servos are small, and if something gets mis-wired, it IS probably a good idea to use a series resistor during experimentation; but resistor not needed in a production board.

    This is the first time I'm dealing with servos, never a need in the past - or future; but just taking a stab at it this weekend just for fun. Bought a handful of little 8 gram analog servos in Singapore on Saturday for around $7 USD ea. retail. The 4 servo driver from ObEx is working - sort of. 1ms to 2ms isn't giving full travel out-of-the box, but the servos do seem to center at 1.5ms. Never-mind... I'll write some simple code to test/verify/calibrate these little servos - they're quite generic: E_Sky 8 gram units, very often used in low-end helicopters.

    Rgds, David
  • deSilvadeSilva Posts: 2,967
    edited 2008-01-13 17:01
    Drone,
    try my 24 channel driver (reference to the thread in propeller.wikispaces.com/pwm )

    For modifying sevos to motors (I did that, too!) see here: www.seattlerobotics.org/guide/servohack.html

    But I took a 30 g servo... much more tricky with the small ones...
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2008-01-14 03:36
    deSilva and David,

    "There is no need for the resistor." - This is generally true for short length runs between the Propeller, and servo, but using a 4.7K resistor for lengthy runs (> 12 inches) can make all the difference in the world by
    attenuating any back emf generated from the servo itself or "noise" that might be picked up in the signal wire when it acts like an antenna.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • deSilvadeSilva Posts: 2,967
    edited 2008-01-14 08:26
    Beau Schwabe (Parallax) said...
    ... by attenuating any back emf generated from the servo itself ..
    Why do you expect back emf at the control input?
    said...
    ..or "noise" that might be picked up in the signal wire when it acts like an antenna.
    So the resistor should best be placed near the servo input? I have limited experience with varieties for the PWM line, but I should expect that not all servos use a standard CMOS input.. Some might need to draw current around mA ?
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2008-01-14 22:57
    deSilva,
    You said...

    Why do you expect back emf at the control input?
    Not all servo's are created equal, and in some cases, electrical noise from the motor can be seen on the input.· In this case, using a·resistor is a good practice that will·limit the input current and voltage from entering back into the I/O.
    You said...
    So the resistor should best be placed near the servo input? I have limited experience with varieties for the PWM line, but I should expect that not all servos use a standard CMOS input.. Some might need to draw current around mA ?
    In an ideal circumstance you would place a resistor on BOTH ends.· When you increase the distance from the Propeller to the Servo, you essentially create what is called a transmission line.··A transmission line can be simplified as a PI filter.

    Long wire pair  PI-Filter  
      IN >--o--))))))--o--> OUT
            |          |
           ---        ---
           ---        ---
            |          |
    GND1 >--o--))))))--o--> GND2 
    
    

    Notice, that the IN and OUT can be interchanged.· The typical characteristic of this filter produces 2 frequency poles... One·tends to provide extreme gain, while the other tends to provide extreme attenuation.· To complicate matters, you can also see reflections within the transmission line that can create multiple frequency poles as you increase or decrease the physical length of the line.· It is unlikely that the actual servo pulse will hit a resonate frequency pole because of the relatively low frequency involved.· You could however see edge ringing between transitions, but you are more likely to hit a resonate frequency from dirty brush contacts on the motor as it spins.· But with that·said, as you increase the length of the transmission line, so do you increase the potential to receive (as an antenna) any stray external energy that would couple into the transmission line.· In this case, using a·resistor is also a·good practice that will·limit the input current and voltage from entering back into the I/O.





    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 1/15/2008 4:38:10 AM GMT
  • deSilvadeSilva Posts: 2,967
    edited 2008-01-15 00:27
    Beau, that was a very dep explanation, useful for all high speed/long distance transmission we do with the propeller...

    The discussed case however seems much simpler to me:
    - the frequency involved is around 10kHz
    - the stepper motors have no brushes
    - the output is driving with quite low impedance <100 Ohm
    - I just expect no back EMF.

    But if you consider a 4k7 resistor a good safety belt I certainly agree; in fact - as said - I generally use a 1k, though I am not always fully aware why I do it smile.gif
  • DroneDrone Posts: 433
    edited 2008-01-15 18:57
    Whew... didn't expect a thread to develop about my simple question about thte Prop & Servo interfacing: But it's a good-thing in the end given the response. Sorry about my late resply, I've been a bit busy

    Now I've got four E_Sky 8g servos working fine using Bob's (from ObEx) 4-servo driver (thanks Bob). These are nice little servos, seen a offer on ebaY for 4 of them for less than $5 USD each. Yeah, I paid more for them in Singapore, but still around the retail price at a bit less than $10 USD a piece.

    Anyway, the servos (all four of them) are waggling away happily. I wrote some simple .spin code to test the travel range and centering. The servos center around 1.5ms, and have +/-60 degrees of travel.

    On the topic of series resistors: Initally I take the safe route by putting a series resistor on all output pins when experimenting (per Beau's commant). But ultimately you guys are right - no need in most cases for driving genric RC servos, if you want to risk it (oops, plugged a wire into the wrong pin on the protoboard).

    The cap bypass comments from Beau seem to be warranted. When searching for a substantive datasheet for these E_Sky 6g servos (didn't find one) I saw a threads about how the E_Sky helicoper product suffers from RF interference from the (brush commutator) DC moters in these servos. Solutions seem to be bypass caps. Some state this interference can appear on the control input' but I can't imagine how, especially given relatively short lead length for servo interconnection.

    Next step - try to hack one of these servos into 360 mode.

    Thanks deSilva; will give your 24 driver a try, Gotta go for now...

    Rgds, David
Sign In or Register to comment.