Help With Servo Control
deanthorne
Posts: 5
I recently purchased the BASIC Stamp Activity Kit w/ Homework Board and am working my way through the accompanying "What is a Microcontroller" Text and now I'm stuck on Chapter 4 on controlling the servo.
No matter what I do I can not get the servo to move as the book describes. I have used this code to attempt to center the servo, then go all the way one way, then all the way the other, but all the servo does is jerk clockwise about 30 degrees per pulse until it reaches maximum limit.
I have even isolated the servo to it's own power supply (4 'AA' batteries) and still no luck.
So is it me or the servo or something else??
Thnaks in advance
No matter what I do I can not get the servo to move as the book describes. I have used this code to attempt to center the servo, then go all the way one way, then all the way the other, but all the servo does is jerk clockwise about 30 degrees per pulse until it reaches maximum limit.
PAUSE 1000 FOR x =1 TO 10 DEBUG HOME DEBUG CR, "Center to 90 Degrees" PULSOUT 0, 750 PAUSE 20 DEBUG HOME DEBUG CR, "Zero to Min (0 Degrees)" PULSOUT 0, 250 PAUSE 20 DEBUG HOME DEBUG CR, "Zero to Max (180 Degrees)" PULSOUT 0, 1250 PAUSE 20 DEBUG HOME DEBUG CR, CR, CR,"Cycles Remaining: ", DEC 10 - x PAUSE 1000 NEXT
I have even isolated the servo to it's own power supply (4 'AA' batteries) and still no luck.
So is it me or the servo or something else??
Thnaks in advance
Comments
There is also too much delay in your program between the PAUSE 1000 and your DEBUG statements that will cause your servos to behave this way
It can take many PULSOUT commands before the servos makes it to the desired stopping point. Even then, you must continue to send pulses every 20ms for the servo to hold position.
Mike, Beau Thanks for both your comments. Now I understand my problem.