Shop OBEX P1 Docs P2 Docs Learn Events
Simple Servo Help — Parallax Forums

Simple Servo Help

edited 2005-01-14 19:31 in Robotics
Im building my own robot based off the Boe Bot with a BS2 and two servo's for the locomotion. Im using the small breadboard purchased from parrallax along with the 360 degree servo's. Im really not good with the specific terms for this stuff but bear with me, I've got 4 AA's in a pack powering the two servo's by putting the positives and negetives of all three in the same respective columns of the breadboard (does that make sense?). Then I plugged one servo's white wire into the pin 12 column and the others into Pin 13's column. I made a simple
DO
pulsout 12, 750
LOOP

so I can calibrate the servo's but this is where Im having trouble. First of all BOTH servo's turn, even though I only pulsout to 12. I even disconnected the white wire of the other servo so just the one was on 12 is connected·and they both still spin. Very weird. Secondly I can't seem to get either to stop spinning by messing with the potometer, but I feel as though these problems might be related?

Post Edited (Trinitrogen Oxide) : 1/13/2005 2:54:42 AM GMT

Comments

  • John RitzJohn Ritz Posts: 14
    edited 2005-01-13 18:57
    Are you sure you zero'd the servos? It sounds like they are not calibrated properly if you have the pin disconnected and it is still spinning, since all you are doing is adding power and no pulses.
  • edited 2005-01-13 19:04
    It sounds like you might have a wiring problem. Are your servos drawing power directly from the battery pack (Vin)? They should not be trying to draw power from Vdd, the red wires should be connected directly to Vin. Also, double-check the BASIC Stamp's pin map and make sure that only the wite wire is connected to P12. Does the BASIC Stamp Editor successfully program the BASIC Stamp? Can you get it to send the Debug Terminal a "Hello" message?

    Also, make sure to calibrate servos with a PAUSE 20. Your loop should look like this:

    DO
    PULSOUT 12, 750
    PAUSE 20
    LOOP
  • edited 2005-01-14 00:51
    Andy Lindsay said...
    It sounds like you might have a wiring problem. Are your servos drawing power directly from the battery pack (Vin)? They should not be trying to draw power from Vdd, the red wires should be connected directly to Vin. Also, double-check the BASIC Stamp's pin map and make sure that only the wite wire is connected to P12. Does the BASIC Stamp Editor successfully program the BASIC Stamp? Can you get it to send the Debug Terminal a "Hello" message?

    Also, make sure to calibrate servos with a PAUSE 20. Your loop should look like this:

    DO
    PULSOUT 12, 750
    PAUSE 20
    LOOP
    The Basic stamp is powered by VIN and a 9V, the servo's are powered by·the 4AA batter pack. It successfully recognizes the stamp along with programming. Im 90 percent sure my wireing is okay but Im gonna double check it. Here's how its set up:

    The basic stamp is in the breadboard, I have 9V with the positive connected to VIN and the negative to the stamps ground. The servo's white wire is connected to pin 12. On a seperate column of the breadboard I have a 4AA battery pack with the positive in one column and the negetive in another. I then put the positive and negetive wires in each of the they're respective columns. Both servo's are powered, but only the one is connected to pin 12. Anybody see any glaring flaws here?
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-01-14 01:02
    It doesn't sound like the BS2 ground is connected to the Servo ground. This is needed for the Servo to properly get the BS2 signal.
  • edited 2005-01-14 01:11
    Yes, the negative terminal of the 4 AA supply should also be connected to Vss. The positive terminals should be kept separate, but there should be a common ground for the two systems (the servos and the BASIC Stamp). I have seen servos behave the way you describe when the grounds are not common.
  • edited 2005-01-14 19:19
    Okay, so I've got the wiring down... maybe. Now Im using the program from the Robotics Book

    ' {$STAMP BS2}

    DEBUG "Program Running!"

    counter VAR Word

    FOR counter = 1 TO 122
    PULSOUT 12, 650
    PAUSE 20
    NEXT

    DEBUG "Finished 1..."

    FOR counter = 1 TO 40
    PULSOUT 12, 750
    PAUSE 20
    NEXT

    DEBUG "Finished 2..."

    FOR counter = 1 TO 122
    PULSOUT 12, 850
    PAUSE 20
    NEXT

    DEBUG "Finished 3..."

    END


    It goes through it all, the servo spins non stop, doesn't stop for the 1 second its supposed to in the middle, and never switches directions, it just keeps going then stops. Can I get a little help with this.
  • edited 2005-01-14 19:31
    That indicates that your servo is not yet centered. Now that you have your wiring fixed, go back and run the program on pages 68 - 69. The instructions will guide you through adjusting the potentiometer to the right place to get the servo to stop. Page 70 repets the process for the servo connected to P13. After you've gone through that, re-try the program you posted and see if it works properly.
Sign In or Register to comment.