A servo oddity
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?
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
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
·
·· 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
So:
Cycle:
PULSOUT Servo1, Width1
PULSOUT Servo2, Width2
PAUSE PulseWait
GOTO Cycle
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.
·· 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
Dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave Andreae
Tech Support
dandreae@parallax.com
www.parallax.com
·