Shop OBEX P1 Docs P2 Docs Learn Events
A servo oddity — Parallax Forums

A servo oddity

MechelecMechelec Posts: 7
edited 2005-04-12 16:24 in Robotics
I have a BS2 with the Board of Education Rev C, and I'm trying to use more than one continous rotation servo at a time.· I have the following code:

DEBUG CR,"Test 1"·
FOR scount = 1 TO pulsincr
· PULSOUT servo1, width1
· PAUSE pulswait
· PULSOUT servo2, width2
· PAUSE pulswait
NEXT

*all my symbols are defined and my signals are legit in size and width and everything.

When I run it, the servos jerk alittle while it prints to screen Test 1 continously.· How the heck is it looping back to before the FOR?· I don't have a good grip on continous servos I guess.

Why is it looping like that?

Also, are cont. servos supposed to lock on a position or a speed when commanded?· Also, how do you reverse direction without manually changing the pot?

Comments

  • dandreaedandreae Posts: 1,375
    edited 2005-04-12 01:06
    Hello,

    We examples of this of project in our "Robotics with the Boe-Bot" text.· Here is a link for the free download of the text:· http://www.parallax.com/detail.asp?product_id=28154·.

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    www.parallax.com

    ·
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-04-12 01:20
    Hello,

    ·· What's happening is your BS2 is restarting due to brownout.· Probably the batteries are low.· When the Stamp module restarts, it runs the code from the beginning, which is also why the servos are jerky.· You will notice if there's no power to the servos when you run the code the DEBUG line should print only once.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • MechelecMechelec Posts: 7
    edited 2005-04-12 04:38
    Thanks alot guys, you solved all my problems! I forgot to change the jumper to Vin instead of Vdd so that's why it browned out, and I didn't have my servos centered. It's all good now, thanks again.
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-04-12 14:11
    Note you only need a single "PAUSE pulsewait" for both PULSOUT commands -- each servo needs to be refreshed every 20 to 50 mSec.

    So:
    Cycle:
    PULSOUT Servo1, Width1
    PULSOUT Servo2, Width2
    PAUSE PulseWait
    GOTO Cycle
  • MechelecMechelec Posts: 7
    edited 2005-04-12 14:40
    I'm using an AC adapter for my project. How many servos can the board and stamp handle without brownout? I'm hoping to use atleast 10
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-04-12 15:46
    It depends on the current rating of your AC adapter, and the servo's you use. One poster was using 150 mA per servo as a rule-of-thumb -- his 3 Amp adapter would power 18 servos.

    So a 1.5 Amp adapter should be able to power 10 servos. Since the BOE board regulator will only supply 1 Amp, you might want to add another regulator, and only run 5 servos per regulator. And get a beefy AC adapter.

    You might want to verify how much current a servo really takes when running 'free', and when running with a little resistance -- hold your finger against the spinning wheel. And if you're not running all 10 servo's simultaneously, that also drops your need for current.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-04-12 16:05
    Hello,

    ·· Brownouts happen when too much current is drawn at once from the supply.· The supply temporarily lags (drops down) a bit and the Stamp resets.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • dandreaedandreae Posts: 1,375
    edited 2005-04-12 16:24
    Parallax also carries a Parallax Servo Controller that works great with the Board of Education.· You can control up to 16 servos per PSC and then you can daisy chain then to control up to 32 servos.· Here is a link for more information:· http://www.parallax.com/detail.asp?product_id=28023 .

    Dave


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    www.parallax.com

    ·
Sign In or Register to comment.