Servo mystery
bluejay
Posts: 131
Could someone explain why the servo does not stay in the last position? The servo goes to the zero position first, then goes to the 180 degrees position. The problem is that after reaching the
180 deg position after a slight delay the servo the travels to the 175 deg position and stays there. I want the servo to stay in the 180 deg position and NOT go to the 1175 deg location.
Will someone solve this mystery? I appreciate a response. Thanks.
180 deg position after a slight delay the servo the travels to the 175 deg position and stays there. I want the servo to stay in the 180 deg position and NOT go to the 1175 deg location.
Will someone solve this mystery? I appreciate a response. Thanks.
bs2
291B
Comments
To keep the servo at a certain position, you have to continue to supply control pulses to it. For your simple program, you can just turn the last FOR / NEXT loop into a DO / LOOP loop like this If your program will have to do something else that can't be done in the 18ms or so left in the 20ms servo control pulse cycle, you'll have to add some kind of external servo controller to handle this like the Propeller Servo Controller or the ServoPAL (temporarily unavailable).
Dr. Green, in the Stamp Forum, with a DO loop.
counter VAR Byte
For counter = 1 to 150 '0 deg for about 3 sec
PULSOUT 14, 250
PAUSE 20
NEXT
DO
For counter = 1 to 150 '180 deg for about 3 sec
PULSOUT 14, 1248
PAUSE 20
NEXT
LOOP
DO
PULSOUT 14, 1248
PAUSE 20
LOOP
What sometimes helps reduce glitching is:
1) before you power down, have your program drive the servos to where you want them to be on powerup, and
2) turn on power (3.3 or 5V) to your controller (thus sending control pulses to the servo) before seperately switching on power to your servos (typ 6V).