Shop OBEX P1 Docs P2 Docs Learn Events
How Do I Eliminate Multi-Servo Jitters ??? — Parallax Forums

How Do I Eliminate Multi-Servo Jitters ???

wperkowperko Posts: 66
edited 2009-05-15 04:08 in BASIC Stamp
Hi,

I'm trying to control multiple servos tied to the BOE w/a BS2 but I get uncontrollable jittering ...

How Do I Eliminate Multi-Servo Jitters ???

This happens with other control systems too ... separate channels and/or parallel on one channel ...

Jitter Example Video

Post Edited (wperko) : 4/14/2008 2:17:15 AM GMT

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-04-06 15:58
    busted.jpg
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-06 16:25
    That depends on what you're trying to do. You've supplied very little information other than that you get jittery movement with the use of more than one servo. Since it's quite easy to get smooth movement with 2 or 3 servos and a BS2, there must be something wrong with your setup. It's likely to be one of two things:
    1) Inadequate power for the servos causing a drop in the power supply voltage to the BS2 which causes the Stamp to reset.

    2) You're not sending control pulses to the servos at least 50 times a seconds. This is a requirement for any R/C servo for smooth movement.
  • wperkowperko Posts: 66
    edited 2008-04-06 16:56
    Hi,

    Can you post a simple output routing to servos (parallel operation) plugged into ports 12, 13, 14 and 15 on a BOE with a BS2 module?

    Maybe that is all I need ... I'm just using a simple pulseout loop ...

    DO
    PULSOUT 12, 600
    PULSOUT 13, 600
    PULSOUT 14, 600
    PULSOUT 15, 600
    PAUSE 5
    LOOP

    Post Edited (wperko) : 4/6/2008 5:05:57 PM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-06 18:39
    What you posted is the general idea of what you need. The pulses don't need to be as often as you have them. Once every 20ms is better, so use a PAUSE 10 rather than the PAUSE 5 you showed. With 4 servos, power drain is the main problem. Servos can draw up to 1A peak currents. If all 4 have to move at the same time, that's a peak drain of 4A when there's a significant mechanical load. Average current is 200-250mA each. If your power supply can't handle that, your BS2 will reset from the drop in power supply voltage.
  • wperkowperko Posts: 66
    edited 2008-04-06 18:49
    Hi,

    Actually, I have tried this with various cycles from 5ms cycles to 10ms cycles to 15ms cycles to 20 etc... all the way past 50ms cycles ...

    I actually used a two trim pots in series to get a wide range of cycle triggering ... slowly moving one at a time to see if I could find a stable setup ... I never really get a stable jitter free system.

    I have used seperate power source capable of 2A service ... I still get jitter.

    The jitter is minor most of the time when things aren't changing ... but when I try to move just one servo on one port the whole structure jitters like a caged wild animal.
  • PARPAR Posts: 285
    edited 2008-04-06 19:50
    wperko said...
    Hi,

    Actually, I have tried this with various cycles from 5ms cycles to 10ms cycles to 15ms cycles to 20 etc... all the way past 50ms cycles ...

    I actually used a two trim pots in series to get a wide range of cycle triggering ... slowly moving one at a time to see if I could find a stable setup ... I never really get a stable jitter free system.

    I have used seperate power source capable of 2A service ... I still get jitter.

    The jitter is minor most of the time when things aren't changing ... but when I try to move just one servo on one port the whole structure jitters like a caged wild animal.
    Your setup and testing conditions are still not clear to me. "...when things aren't changing" means what? I.e., which "things" are not changing? You get jitter when nothing (literally) is changing ?

    "...the whole structure jitters..." ? What "structure" ? I.e., is the jitter caused _by_ the one servo that is not turning smoothly, or are you referring to some other kind of jitter? And, when moving more than one servo, do you also get the jitter ?

    And, how are the pots connected to the circuit (in series with what)? How much load is being put on the system by those pots ?

    PAR
  • wperkowperko Posts: 66
    edited 2008-04-06 20:01
    As I stated earlier ...

    Four Servos on Four Different BS2 OUTPUTS

    PULSOUT 12, 600
    PULSOUT 13, 600
    PULSOUT 14, 600
    PULSOUT 15, 600
    PAUSE 5

    But even if the servos are all attached in parallel on one port the problem is the same. And yes as I stated before, I've tried this with seperated power to servos and controller and even using 5-seperate power supplies one for each component! It's all the same jitter.

    If I have the program send a new PULSOUT 14, 600 and there is no other changes in any settings all the servos jitter (causing the whole structure to shudder/jitter like a caged wild animal)... This occurs for all robotic structures I've built ... whether being a robo arm, a snake, a bipdeal etc... when I cause just one servo to move in programming or by a pot change ... just a little bit ... all the other servos jitter.

    Then even if I am not making any changes the structures I built from multiple servos will jitter and sometimes very wildly.

    It doesn't matter if I use a pot or a program code change ... the structures jitter ... the pot is a RC circuit tied to ground ... negligible load.
  • PARPAR Posts: 285
    edited 2008-04-06 23:42
    wperko said...
    ...
    But even if the servos are all attached in parallel on one port the problem is the same. And yes as I stated before, I've tried this with seperated power to servos and controller and even using 5-seperate power supplies one for each component! It's all the same jitter.

    If I have the program send a new PULSOUT 14, 600 and there is no other changes in any settings all the servos jitter ... when I cause just one servo to move in programming or by a pot change ... just a little bit ... all the other servos jitter.

    Then even if I am not making any changes the structures I built from multiple servos will jitter and sometimes very wildly.

    It doesn't matter if I use a pot or a program code change ... the structures jitter ... the pot is a RC circuit tied to ground ... negligible load.
    When using separate/multiple power supplies,··do they all·(including the BS2's power) share the same ground ?

    PAR
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-04-06 23:45
    The Servo control pulse is a 1 mSec to 2 mSec pulse, repeated every 20 mSec to 50 mSec. That's it.

    If you don't output that control signal, then all bets are off. Repeating it every 5 mSec is NOT outputting that control signal.

    Now, with a BS2, the "PULSOUT" values is in 2 uSec ticks. So 600 is 1.2 mSec, which is okay.

    A servo is designed to hold a position against a very small force. It could be you're trying to use servo's which are too small for the forces you're trying to control. It could also be that your power supply is too small -- a servo can pull 500 mA against a large force.

    It's also possible that when you put in the code to read a potentiometer, that you're taking too long, and getting outside the 50 mSec refresh interval -- which will cause jitter against external force.
  • wperkowperko Posts: 66
    edited 2008-04-06 23:47
    Hi,

    Yes, the grounds are tied ... the servo signal wouldn't do anything if they were not!

    I'm looking for a solution not 20 questions ...
  • PARPAR Posts: 285
    edited 2008-04-06 23:50
    wperko said...

    Jitter Example Video
    BTW, PJ Allen suggested your "jitter example video" doesn't run with his QuickTime. It doesn't run with mine either. So I (we?) wasn't able to observe an example of the jitter.

    PAR
  • wperkowperko Posts: 66
    edited 2008-04-06 23:52
    Hi,

    Again, read all the information first ... then give me a solution ...

    Servos move between about 0.5ms to 2.5ms pulses on a 30ms-50ms trigger.

    I tried shortening and expanding the trigger through several values between about 5ms up through over 50ms to see if there would be a "sweet spot" where the servos didn't jitter ... there was none.

    The servos are only carrying themselvs as a load ... that's almost nothing for a standard size hobby servo.

    I want to know how to send signals out to a bunch of servos without getting any jitter ... not answer 20-questions.
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-04-06 23:53
    If you leave out critical detail, because you don't see it as critical, then a responsible person would ask questions about that detail.

    You haven't said what current your power supply can put out, what voltage you're running your servo's at, or what physical force your robotics projects require.

    Since you haven't, 20 questions is appropriate.

    BECAUSE -- if you really are using that code, and you've 'bumped' the pause to 20 mSec, then you already HAVE the "simple test code" you keep asking for -- that should work.
  • wperkowperko Posts: 66
    edited 2008-04-06 23:54
    Hi,

    Sorry, I use DVD MPEG video ... if your Mac can't view standard codec videos then you need to upgrade.

    MS Windows PCs and Linux machines don't have this problem.
  • wperkowperko Posts: 66
    edited 2008-04-06 23:55
    Again, Allanlane5 ...

    I asked for a solution ... not 20-questions about my setup.

    As I explained a long time ago ... I am using several different setups with batteries and power supplies with up to 2A available for the simple circuits.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-04-07 00:16
    wperko said...
    MS Windows PCs and Linux machines don't have this problem.
    Actually, they do. My Windows (XP) media player errored out on the video. Both KMPlayer and Xine under Ubuntu Linux simply did nothing.

    -Phil
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-07 00:53
    I don't believe you will find your solution here. Problem solving in these forums seems to be a process characterized by a lot of give and take and a great deal of work on both the part of the person asking for help and the volunteers who, out of the goodness of their hearts and their curiousity and intellectual satisfaction, spend their spare time participating. Most problems here, usually involve simple, often repeated issues of power supply capacity and stability, and other straightforward difficulties. Some problems are not so simple and the start of the discussions involves eliminating the common, simple problems. You say that you have dealt with some of these, but you may not appreciate the number of times that people who seem to have a lot of experience have made a mistake and have a missing ground connection or are using an inadequate power supply, etc.

    We don't have a working copy of your video nor a schematic nor a complete listing of your program. It's not helpful to blame others for not having the "right codec". I have a Mac with the latest stuff and I run Windows XP under it and keep that up to date as well. I can't get your video to play.

    Good luck finding out what your problem is. As I mentioned, it's not likely to have anything to do with the Stamp itself or the servos since operating 2 or 3 servos smoothly and simultaneously with a Stamp is straightforward using code essentially the same as what you've shown.
  • rjo_rjo_ Posts: 1,825
    edited 2009-05-14 04:24
    Another classic thread... particularly when combined with the link listed by Phil. Must reading for anyone that loves the Propeller and this forum[noparse]:)[/noparse]

    I am waiting for someone to announce: "This has just been a test; you can now return to your normally scheduled entertainment."

    Before that happens let me offer an excerpt from a poem by Sylvia Plath, called

    Love is a Parallax Analysis

    'Perspective betrays with its dichotomy:

    train tracks always meet, not here, but onlyin the impossible mind's eye;

    horizons beat a retreat as we embark

    on sophist seas to overtake that markwhere wave pretends to drench real sky.''Well then, if we agree, it is not odd

    that one man's devil is another's godor that the solar spectrum is

    a multitude of shaded grays; suspense

    on the quicksands of ambivalenceis our life's whole nemesis.

    So, wperko you are anything but ambivalent.
    but me thinks you are thrice wrong.

    No morons here... nor gorish intent.
    No replies that were anything but honest.
    A poor substitute for time well spent.

    You have misinterpreted the remarks and remakes
    of good replies in two different threads.

    These are real people... owed an honest apology.
    But you will turn heal, and flee
    instead.

    Rich

    For those anxiously awaiting the final release of my 96 bit pixel... I've been forced out of my office by the mysteries of child rearing [noparse]:)[/noparse] In my head, the pixel was done before I started. So... any day now[noparse]:)[/noparse]
  • rjo_rjo_ Posts: 1,825
    edited 2009-05-14 04:30
    I know... you are all wondering... "when am I going to be able to order a 96 bit pixel." or "Geez, I wonder if I am going to be able to afford a 96 bit pixel... considering the development costs." Maybe you are worried that a 96 bit pixel... might be one bit too many.

    I don't know.

    I just don't know.

    Sorry
  • W9GFOW9GFO Posts: 4,010
    edited 2009-05-14 16:09
    wperko said...

    I have used seperate power source capable of 2A service ... I still get jitter.

    I was able to view the 1.2 MB, 5 sec video on my Mac. It might be because I have "Perian" installed.

    Here you can see the power supply he is using. rolleyes.gif

    attachment.php?attachmentid=60912

    Rich H
    721 x 484 - 121K
  • BADHABITBADHABIT Posts: 138
    edited 2009-05-14 20:14
    WOW...Duracell makes a 9volt w/ 2000ma. Where can I get one of those?!
  • hover1hover1 Posts: 1,929
    edited 2009-05-14 23:19
    W9GFO said...
    wperko said...

    I have used seperate power source capable of 2A service ... I still get jitter.

    I was able to view the 1.2 MB, 5 sec video on my Mac. It might be because I have "Perian" installed.

    Here you can see the power supply he is using. rolleyes.gif

    attachment.php?attachmentid=60912

    Rich H
    And on a nice conductive bag smilewinkgrin.gif

    Jim
  • PhilldapillPhilldapill Posts: 1,283
    edited 2009-05-15 03:19
    Rich, that was a great Poem, and I usually hate poetry! Nicely said!
  • BADHABITBADHABIT Posts: 138
    edited 2009-05-15 04:08
    LOL, it's probably bag jitters.
Sign In or Register to comment.