Shop OBEX P1 Docs P2 Docs Learn Events
Maximum number of servos the BS2 can control? — Parallax Forums

Maximum number of servos the BS2 can control?

RennyRenny Posts: 3
edited 2008-09-08 23:18 in BASIC Stamp
Is there a maximum number of servos that the BS2(on the rev c board of education) can control? It seems to work ok to control 4 servos but as soon as the·5th one is added it acts erratically and doesn't run the program.· Just doing a simple program like this will even cause problems:··
· PULSOUT 11, 750
· PULSOUT 3, 750
· PULSOUT 4, 750
· PULSOUT 15, 750
· PULSOUT 8, 750

I've tried putting several servos on one pin to see what happens and it acts the same way with the fifth servo throwing everything out of whack....rolleyes.gif

thanks for any info!

Comments

  • GICU812GICU812 Posts: 289
    edited 2008-09-06 03:35
    Can your power source supply enough power for the servo's?
  • RennyRenny Posts: 3
    edited 2008-09-06 03:41
    All the servos rotate but they don't stop when the program says, they keep turning.· I'm using the battery pack that comes with the board.
  • Beau SchwabeBeau Schwabe Posts: 6,563
    edited 2008-09-06 03:56
    Renny,

    You need a PAUSE in there somewhere. The servo's require a 15ms to 25ms pause in-between each PULSOUT it receives.

    So try something like this...

    MainLoop:
    PULSOUT 11, 750
    PULSOUT 3, 750
    PULSOUT 4, 750
    PULSOUT 15, 750
    PULSOUT 8, 750
    PAUSE 13 ' <--- 5 servos at 1.5ms = 7.5ms ... 20ms - 7.5ms = 12.5 or 13
    GOTO MianLoop

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

    IC Layout Engineer
    Parallax, Inc.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-06 04:01
    Servos can draw up to 1 Amp each when under heavy mechanical load or stalled. They draw roughly 250mA when under light load. 5 servos draw in excess of 1 Amp (roughly 1.25 Amp) under light load. If you're running the servos directly off a 4 x AA Alkaline battery pack, it can supply over 1 Amp for a while. If you're trying to supply over 1 Amp of regulated +5V, the regulator will eventually shut down due to overcurrent or overheating.

    The number of servos that a BS2 can control depends on timing. Control pulses are at most 2-2.5ms in width and have to be repeated about every 20ms. That means that a BS2 (or any Stamp) can control at most 8 servos. Other microcontrollers (like the SX or Propeller) are able to control more than that by controlling several simultaneously (overlapping).
  • RennyRenny Posts: 3
    edited 2008-09-08 23:18
    Thanks everyone.· I'll give those suggestions a try.·
Sign In or Register to comment.