Shop OBEX P1 Docs P2 Docs Learn Events
Max servo speed? — Parallax Forums

Max servo speed?

Ol' GeoOl' Geo Posts: 30
edited 2007-08-20 17:33 in Learn with BlocklyProp
Just finished Chapter 4 - Controlling Motion in WAM 2.2.

I am trying to determine what max servo speed is for Parallax std servo. The code below is to estimate the max speed by observing the difference between clockwise and counterclock rotations. Both FOR-NEXT loops have the same number, that is, 20. So, both rotational speeds appear about the same but in the opposite directions. Since I don't have an oscilloscope with me (yet), each loop takes about 20ms. Hence, the total elapse time is 400ms from 10 to 2 o'clock. The rotational travel from 10 to 2 o'clock is 120 degrees. Based on those figures, the max. speed is 400ms / 120 degrees or 133ms / 60 degrees. The figure seems reasonable as compared with those speeds specified at Futaba website. However, the data sheet given for Parallax std servo says 0 degree to 180 degrees in 1.5 sec, or 500ms / 60 degree. Why different? The data sheet hasn't been updated yet? Or, did I miscalculate?

Ref:
www.futaba-rc.com/servos/digitalservos.html
www.parallax.com/dl/docs/prod/motors/stdservo.pdf

' {$STAMP BS2}
' {$PBASIC 2.5}

duration VAR Word
counter  VAR Word

DO
  ' Rotate from 10 to 2 o'clock
  FOR duration = 1000 TO 500 STEP 25
    PULSOUT 14, duration
    PAUSE 20
  NEXT

  ' Return to 10 o'clock quickly
  FOR counter = 1 TO 20
    PULSOUT 14, 1000
    PAUSE 20
  NEXT
LOOP


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ol' Geo
Retired Software Engineer

An oscilloscope is a window of unseen electronic world. - GM

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-08-19 00:32
    Neither loop will tell you anything about the servo speed since there's no positional feedback from the servo to the Stamp.

    The first loop simply attempts to position the servo using a pulse width of 2ms (2000us) to 1ms (1000us) in steps of 50us. There's roughly 20 pulses each with a 20ms pause between them for a total time of about 400ms. The loop will always take that time no matter how fast the servo moves. The second loop just puts out repeated pulses of 2ms (2000us) for about the same total time. Again, the motor may or may not complete its movement during this timeframe.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-08-19 16:57
    Geo,

    The speed of the servo will be dependant on many factors…Supply voltage/current, loading on the servo, even age. The fastest safe speed would be determined by moving the servo from one extreme to the other by going immediately from the one pulse value (repeated every 20 ms) to the other pulse value (also repeated every 20 ms). The servo will travel at its maximum speed in this manner. If you step the output pulses then you are really slowing down the overall speed. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Ol' GeoOl' Geo Posts: 30
    edited 2007-08-19 19:26
    Too bad the hobby servo does not have a feedback as Mike pointed out. As Chris suggested, I replaced the loop counters as FOR counter 1 to 20 and duration of 500 for one extreme and 1000 for other extreme. I tried 30 repeats or so at first but the rotation stopped briefly. That's too long. The 20 seems optimized. So, the max rotation speed is still approx. 133 ms / 60 degree at a certain factor as Chris pointed out, that's, 5 VDC applied to the servo and 20 ms between pulses. Thanks, guys.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ol' Geo
    Retired Software Engineer

    An oscilloscope is a window of unseen electronic world. - GM
  • LilDiLilDi Posts: 229
    edited 2007-08-20 04:21
    Try putting a 0.1 ohm resister in line with the +6 volts to the servo power. Connect each end of the resistor to 2 input pins of the stamp with about a 10K resistor in line to the input pins to protect the Stamps input pins from electrical damage. Use the COMPARE command to read the voltage difference across the 0.1 ohm resistor. There should be a dramatic difference between the servo in motion and at rest.

    Never tried this before, but I'm hoping that will work as an accuate feedback for when the servo reaches the end of travel.
    Two more used up I/O lines though. On the other hand, why not give it a test.

    As an after thought, I think COMPARE only works with the BS2px Stamp.

    Post Edited (LILDI) : 8/20/2007 4:47:21 AM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-08-20 15:40
    Geo,

    That doesn’t sound right…Especially since it stopped briefly…I would recommend changing the 20 to 100 or even 150. 20 iterations/refreshes does not seem like enough to get the servo to the other extreme…There will be a pause before it changes directions, but you’re looking for speed from one extreme to the other anyway, so that doesn’t matter.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Ol' GeoOl' Geo Posts: 30
    edited 2007-08-20 17:33
    More than 20 iterations in each loop will cause the servo paused for some time at both extremes/ends. But, the 20 gives me an idea how fast the servo travels. That's all I care about. Ok, Chris?

    Yes, LILDI. I don't have BS2px stamp that has COMMARE command to compare voltages. Only one I have is BS2 that comes with BOE kits. Thanks, anyway.

    Geo

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ol' Geo
    Retired Software Engineer

    An oscilloscope is a window of unseen electronic world. - GM
Sign In or Register to comment.