Shop OBEX P1 Docs P2 Docs Learn Events
ServoPAL pulse timing — Parallax Forums

ServoPAL pulse timing

snit3snit3 Posts: 12
edited 2012-01-19 21:47 in Robotics
The ServoPAL doc specifies the time between servo pulses is fixed at 10-15ms while operating. The continuous rotation servos from Parallax require an optimum delay between pulses of 20 ms, although they will function somewhat outside this range. However, I'm finding that the servo speed control - especially at very low speeds around PULSOUT 750 - is irratic and undependable. For instance, I can't get a Boe-Bot to travel a straight line no matter how I fine tune the pulse widths. I suspect it's because of the tighter than optimum separation of pulses. Is this true, and is it correctable?

Comments

  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2012-01-06 21:21
    Most two-wheel robots won't travel a straight line in any case, but you can test if it's the higher-than-usual refresh rate of the ServoPAL by coding the servos directly in the Stamp. The PAUSE 20 delay is what provides the 20ms gap between the pulses, so you can directly play with the values to see how things work.

    I was a little surprised to read your comment and looked at the ServoPal documentation, and you're right that it says the pulses repeat every 10-15ms. While there really isn't an "optimal" refresh rate (more like in- and out- of spec), faster refreshes consumes more current, because in analog servos the motor is driven more often. This is how digital servos work, and one reason they have higher torque. They may be directed by standard servo pulses, but internally the motors are driven at a much higher pulse rate.

    The better servos -- and the Futaba-made CR servo that Parallax sells is in this group -- are made to tolerate a very wide range of input variables. But some brands may not be so cooperative. Given refresh rates of up to 100 Hz they start to get the heebie-jeebies.

    Finally, consider that the slower speeds the torque of the motor is very, very low. At low torque the motors give way to the friction effects of the wheels over whatever ground they're traveling over. Even the direction of the nap of the carpet can have a difference. The slower the bot, the more you need encoders to keep things in a straight line.

    -- Gordon
  • snit3snit3 Posts: 12
    edited 2012-01-10 07:26
    Gordon,

    I was surprised at the 10-15ms too. The servos I'm using for the Bot have been calibrated from 750ms up and down in 5ms increments, so I have a really accurate graph of their performance. The Bot runs predictably straight on my hardwood floors, so I'll probably do what you suggested and program a variable refresh time (without the ServoPal) and see what effect it has on their predicted RPM. Thanks for the idea...
  • ercoerco Posts: 20,256
    edited 2012-01-10 08:34
    Given refresh rates of up to 100 Hz they start to get the heebie-jeebies.

    -- Gordon

    Was that term covered in the RBB4 glossary... ? :)
  • snit3snit3 Posts: 12
    edited 2012-01-11 13:46
    erco,

    I don't recall seeing Robie R carrying that, er..., girl in any of his movies. Which one was that? :-)
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2012-01-11 14:29
    It was on all the poster art for the movie. Terrific fake-out. We were all waiting to see that scene!

    This scene wasn't in that other movie, either:

    http://en.wikipedia.org/wiki/File:Day_the_Earth_Stood_Still_1951.jpg

    -- Gordon
  • ercoerco Posts: 20,256
    edited 2012-01-11 14:46
    Robots & monsters always get the girls!

    attachment.php?attachmentid=88506&d=1326321964
    1024 x 768 - 243K
  • snit3snit3 Posts: 12
    edited 2012-01-11 19:00
    Wow! In 56 when I first saw the movie I was 14. What was I thinking? How did I miss this?
  • ajwardajward Posts: 1,130
    edited 2012-01-12 02:10
    It was on all the poster art for the movie. Terrific fake-out. We were all waiting to see that scene!

    This scene wasn't in that other movie, either:

    http://en.wikipedia.org/wiki/File:Day_the_Earth_Stood_Still_1951.jpg

    -- Gordon

    "The Day the Earth Stood Still"!!! Excellent movie. I bought the Blu-ray of the 2008 version (Kind of okay) and it included a dvd of the original movie. Sweet!

    @
  • ercoerco Posts: 20,256
    edited 2012-01-12 08:57
    Michael Rennie was great in the original version. And his 2-part Lost in Space episode "The Keeper" was one of the show's finest! http://www.youtube.com/watch?v=OvCY3x1fsLM
  • ercoerco Posts: 20,256
    edited 2012-01-12 09:03
    Getting back to the OP's question, I've seen a lot of schematics for "servo testers" using 555 timers that simply output a 50% duty cycle, so the pulse rate is MUCH faster than 50 hz. They say anything faster than 50 hz is fine, but that's not the case per Gordon's post on "heebie jeebies". I've always built my testers using a 556 (a dual 555 chip), so the pulse rate and width were individually adjustable.

    Of course, now I just buy the testers from Ebay for $3...
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2012-01-12 15:51
    It takes some effort (or luck) to get a 555 to have a 50% duty cycle, but the usual 555 has an inverted output that's opposite of what a servo needs, and a good method is to use a dual timer or two 555s (which should be an 1110, right?). Still, it's possible to do it with only a single 555 , though, as I show here:

    http://www.robotoid.com/appnotes/circuits-servo-control-with-555-timer.html

    This one has a nominal 50 Hz refresh (I recall it changes from about 45 to 55 Hz as you rotate the pot), and a range about .8 to 2.2 ms, depending on the tolerance of the components. It uses the old diode trick. That said, depending on construction, there's a lot of jitter, so it's good only for general experimenting. More filtering would help, too.

    I've tried some &^@%#&^ brand servos at about 90-95 Hz and they just feebly wiggled into position, rather than moved there in a smooth sweep. Really fast and the servo heats up considerably, and draws a lot of current. Unless the servo has some circuit in it to reject excess pulses, I really doubt many would survive a refresh rate of 250 to 500 Hz.

    -- Gordon
  • ercoerco Posts: 20,256
    edited 2012-01-12 16:00
    That's worth trying... as soon as I find a 20K pot! :)

    99 cents: http://www.ebay.com/itm/20K-Ohm-B20K-Taper-Potentiometer-Pot-17mm-Shaft-/140607732877
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2012-01-12 17:54
    erco wrote: »
    That's worth trying... as soon as I find a 20K pot! :)

    99 cents: http://www.ebay.com/itm/20K-Ohm-B20K-Taper-Potentiometer-Pot-17mm-Shaft-/140607732877

    4 for $1, and a nice cozy trip to the Valley:

    http://www.allelectronics.com/make-a-store/item/TPS-20K/20K-SINGLE-TURN-TRIMPOT/1.html
  • ercoerco Posts: 20,256
    edited 2012-01-12 19:39
    Death before trimpots! 10-turn Bournes units maybe, but never those little things from All!
  • W9GFOW9GFO Posts: 4,010
    edited 2012-01-12 23:08
    It takes some effort (or luck) to get a 555 to have a 50% duty cycle, but the usual 555 has an inverted output that's opposite of what a servo needs...

    <---- This single 555 based servo tester has a frame rate close to 50 Hz. It's been a while since I designed it so I don't remember the specifics but I have been very pleased with the results - no jitter at all.
  • ercoerco Posts: 20,256
    edited 2012-01-19 19:49
    erco wrote: »
    That's worth trying... as soon as I find a 20K pot! :)

    Here's a dual 10K slider pot for a buck. http://www.goldmine-elec-products.com/prodinfo.asp?number=g18660&utm_source=Goldmine&utm_campaign=06c741845d-Jan18-2012&utm_medium=email

    Lots of uses, including connecting both in series to make a 20K pot.
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2012-01-19 21:47
    Ask Rich where he got his for the commercial unit. Looks like a nice one. You could also select a different cap value to increase the value of the resistor. Play with the numbers and you'll probably hit on a 47K or something that will do the trick.

    This one is a $1.20 on Digikey, for the next time you go mail ordering within the US:

    http://search.digikey.com/us/en/products/EVU-F3MFL3B24/P3E5203-ND/243614

    I saw some cheaper ones -- 85 cents or so -- but they don't have a bushing. I like my pots to have bushings.

    There. Happy now?

    -- Gordon
Sign In or Register to comment.