Shop OBEX P1 Docs P2 Docs Learn Events
Third servo on Boe Bot interfere with other servos — Parallax Forums

Third servo on Boe Bot interfere with other servos

JPFJPF Posts: 10
edited 2008-08-01 04:05 in Robotics
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
attachment.php?attachmentid=73631
6 x 1 - 35B

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2008-07-29 16:41
    When you 'refresh' the servo positions, you only need ONE 20 msec pause. It looks like you have a "pause 20" for EVERY pulsout command.

    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
    ·
  • JPFJPF Posts: 10
    edited 2008-07-29 17:11
    Thanks for your answer. probably I was not clear in my question. I am not trying to use simultaneously the three servos. I just want the boe bot to be stopped and in that moment activate the third servo but for some reason when I control the third servo, also the left servo is running. The complete program that pretend to move the third servo to two different positions is as simple as:

    ' {$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
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-07-29 18:01
    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
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2008-07-29 18:02
    If you have any additional PAUSE statements in your program, they·can·effect the timming to your servos in a negative way. Try posting your entire code.
  • JPFJPF Posts: 10
    edited 2008-07-29 18:41
    Thanks for all the help. I will try refresing the stop position to the wheels... but anyway I don't understand why do I have to do that. Why pin13 or pin14 is receiving signals when I am only sending signal to·pin 15?


    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
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-07-29 18:48
    Probably you need to put a "LOW 13: LOW 14" in the start of your program.

    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.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-29 18:49
    The only way this program can cause motion in servos attached to other I/O pins is if there is some kind of wiring mistake or possibly by some kind of noise induced in the wiring to the other servos. Try putting a 10K resistor from the signal pin to one other servo to ground. If the unexpected movement stops, then induced noise is the culprit.
  • JPFJPF Posts: 10
    edited 2008-07-29 18:59
    It works using the suggested LOW 13: LOW 14.

    Thanks a lot,

    JPF
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-07-29 19:29
    Ah, glad it worked for you.

    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.
  • JPFJPF Posts: 10
    edited 2008-07-29 19:31
    Hi Mike,

    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
  • kemprofkemprof Posts: 12
    edited 2008-08-01 02:16
    JPF, I've occaisionally had something like you're describing, on a BS1 not BS2. Separating the i/0 pins running the servos solved problems for me.
    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
  • JPFJPF Posts: 10
    edited 2008-08-01 04:05
    Thanks 4 the info... I will try that aprouch the next time

    /Juan Pablo Ferrer
Sign In or Register to comment.