Shop OBEX P1 Docs P2 Docs Learn Events
Servo jerks on starting — Parallax Forums

Servo jerks on starting

mac1947mac1947 Posts: 2
edited 2013-09-07 22:59 in BASIC Stamp
The Boe-Bot Basic Stamp 2 is my introduction into Robotics and I’m working my way through the manual. I’ve noticed that sometimes when the servos are pulsed, there’s a jerk or hesitation when starting. When pulsing the servos using sequential loops, the problem is demonstrated with first servo in the loop. If I pulse both of them in the same loop, the problem can be see with both servos. I added short High-Low loop at the beginning of the program and seems alleviate the problem, but this can’t be right? The High-Low loop is pulses an I/O pin attached to a LED and I can see the extra pulse. Here’s the code I’m using:
counter VAR Byte
FOR counter = 1 TO 25 ' I inserted these lines to prevent the first servo
HIGH 14 ' from jerking or hesitating
PAUSE 10
LOW 14
NEXT
FOR counter = 1 TO 100 ' This servo will sometimes jerk before running without the aboe lines
PULSOUT 13, 700 ' The problem doesn't follow the servo
PAUSE 20
NEXT
FOR counter = 1 TO 40
PULSOUT 12, 750
PAUSE 20
NEXT
FOR counter = 1 TO 22 ' This servo starts right up
PULSOUT 13, 850
PAUSE 20
NEXT
END

Thank You.

Comments

  • ercoerco Posts: 20,257
    edited 2011-12-20 09:38
    Analog servos usually jerk when first switched on as their A/D circuitry charges up, and when you send them their first control signal, they will jump to the commanded location from wherever they were parked. That's a typical response that we mostly have to live with. If you find a gentler startup sequence that works for your particular servo, good on ya!
  • mac1947mac1947 Posts: 2
    edited 2011-12-20 12:32
    I appreciate your respond. However, why would introducing a short delay prevent it from happening? Furthermore, why doesn’t second servo have the problem? When I viewed (oscilloscope)the signal applied to the servo, it follows the erratic oscillations being applied during the first milliseconds. Well, I suppose I could live with it.
    Thanks
  • ercoerco Posts: 20,257
    edited 2011-12-20 13:47
    I always start a program with pause 1000, just to avoid transients from everything being switched on at once and resetting. Servos suck a lot of power when they glitch, which can reset a Stamp. That may be what you're experiencing without the delay. Your high/low on unused pin14 is just such a delay since your servos are on pins 12 & 13.

    Try that pause 1000 instead of your for/next loops. If it works, it saves that much space for your program.

    BTW, are your 2 servos identical?
  • ParkMMParkMM Posts: 1
    edited 2013-09-04 04:07
    Don't use pin 13. I had the same issue and just used another port to fix the problem.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2013-09-06 14:58
    ParkMM wrote: »
    Don't use pin 13. I had the same issue and just used another port to fix the problem.

    There's no reason you shouldn't be able to use P13 just like any other I/O pin.
  • ogg1ogg1 Posts: 1
    edited 2013-09-07 22:59
    I have seen a similar problem in the lab, it is usually related to a damaged stamp. May I suggest a little trouble shooting may help answer this.
    What I would do is move your servos into the lower register for testing the original code and servos.
    This is done by changing from pulsout pins 12 and 13 to say pulsout 5 and 6.
    It looks like you are using a BOE, so you will need to provide power, ground, and signal to the servo using a header strip to connect the servos to the new pin assignments.

    If the servos work properly on the lower pins, you have a damaged port in the stamp.

    If you need help understanding how to connect servos to pins 5 and 6, reply to post and I will find a reference link.

    Silly me, I just noticed the date of the original OP.
Sign In or Register to comment.