Third servo on Boe Bot interfere with other servos
I am connecting the GWS-Pico servo (normal servo selled by Parallax) to the Boe Bot but when I am controlling this servo (in either pin 15 or 14) it make "noise" to the wheels servos. the program is:
counter VAR Word
FOR counter = 1 TO 150
PULSOUT 15, 1000
PAUSE 20
NEXT
FOR counter = 1 TO 150
PULSOUT 15, 500
PAUSE 20
NEXT
Thanks for any advice about
JPF
counter VAR Word
FOR counter = 1 TO 150
PULSOUT 15, 1000
PAUSE 20
NEXT
FOR counter = 1 TO 150
PULSOUT 15, 500
PAUSE 20
NEXT
Thanks for any advice about
JPF
Comments
The Servo will work with a 20 mSec to 50 mSec 'pause' between 'refresh' pulses. This is great for one or two servos. When you add the third servo, the first servo now sees a 60 mSec pause -- and 'relaxes' giving you 'jitter'.
So, you should probably use:
FOR Counter = 1 to 150
· Gosub Refresh1
· Gosub Refresh2
· Gosub Refresh3
· Pause 20
NEXT
Refresh1:
· Pulsout 15, 1000
· RETURN
Refresh2:
· PULSOUT 14, 500
· Return
Refresh3:
· Pulsout 13, 500
· RETURN
In reality, I'd probably replace the "1000", "500" values with a WORD temp variable. So it becomes:
FOR Counter = 1 to 150
· ServoPos = 1000
· Gosub Refresh1
· ServoPos = 500
· Gosub Refresh2
· ServoPos = 500
· Gosub Refresh3
· Pause 20
NEXT
Refresh1:
· Pulsout 15, ServoPos
· RETURN
Refresh2:
· PULSOUT 14, ServoPos·
· Return
Refresh3:
· Pulsout 13, ServoPos
· RETURN
·
' {$STAMP BS2e}
'{$PBASIC 2.5}
'Move to position A
PULSOUT 15, 1000
PAUSE 2000
'Move to position B
PULSOUT 15, 500
Thats all...but for some reason this program is also sending signals to the wheels...
Thanks for you advice
JPF
As Allan pointed out, you’re not refreshing the servos properly. A single PULSOUT instruction will not move the servo to the desired location. But even then, if your servo is moving erratically, I would bet refreshing it with the stop position will curb that issue. Even if the wheels are stopped, you should be refreshing them with the stop pulse value.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Next is the complete program. The program move the micro servo to two different positions but also (and that is the strange thing) is generating movements in servos attached to pin13 and 14.
' {$STAMP BS2e}
'{$PBASIC 2.5}
counter VAR Word
FOR counter = 1 TO 150
PULSOUT 15, 1000
PAUSE 20
NEXT
FOR counter = 1 TO 150
PULSOUT 15, 500
PAUSE 20
NEXT
END
This will force pin 13 and 14 to "Outputs", and prevent noise from being coupled onto those lines from pin 15.
And you "have to do that" because the Servo Control Signal was created for RF controls of model airplanes. The servo expected there to be a hand-held device on the ground, constantly sending "positioning" pulses to the servo. Which is the 1 to 2 mSec pulse (depending on commanded position) repeated every 20 to 50 mSec. The servo is not really "smart", it's actually a simple "comparator" which (when commanded) looks at the current position of the servo, looks at the commanded position, and runs the drive electronics to reduce any difference. This is why they only cost $20 or so. But it makes a VERY nice, easily controlled, inexpensive motor for the BS2.
Thanks a lot,
JPF
On reset, those pins are set to "inputs", which means any nearby "noise" could affect the level on those lines. The "LOW 13: LOW 14" commands told the BS2 to make those pins "Outputs", and put a "LOW" on those lines. Once that happened, there would be much less tendency for any "noise" on those lines.
That was the theory, anyway. That it worked for you proved the theory. Mike's 10 Kohm resistors to ground would ALSO have given you a "default low" on those lines, but the software commands were easier.
I tested using another normal servo (a normal parallax, not the pico servo) as third servo (pin 15), and with this servo everything works fine without the need of using the low13: low14 aproach. Is possible that the pico server is damage? but then again... I agree with you that is not normal to receive noise in pin12 or pin 13 even if that pico servo is damage...
I have looked carefully and there is not wiring mistake.. is really odd but I can live with the Low 12, low 13 aprouche.
Thanks
Juan Pablo Ferrer
For example, if I was pulsing a servo on pin7, it would effect the servo on pin6, but if I ran servos on 7 and 5 I wouldn't have the problem. So, with the Boe-bot if a third servo is effecting your drive wheels, try running off breadboard with pin11 or something, don't forget to power it with V-in, not Vdd.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Kemprof ,· Santa Ana High School
www.sahsrobotics.org
/Juan Pablo Ferrer