Servo jerks on starting
mac1947
Posts: 2
The Boe-Bot Basic Stamp 2 is my introduction into Robotics and Im working my way through the manual. Ive noticed that sometimes when the servos are pulsed, theres 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 cant be right? The High-Low loop is pulses an I/O pin attached to a LED and I can see the extra pulse. Heres the code Im 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.
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
Thanks
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?
There's no reason you shouldn't be able to use P13 just like any other I/O pin.
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.