Controlling Servo Direction
Hello everyone...
I've just bought a BS2 and two continuous servo motors.
I would like to control the direction of rotation of the servo... (clockwise/anticlockwise)
How can I do that? Thanks!
ServoL_pin CON 12
ServoR_pin CON 13
Start:
PULSOUT ServoL_pin, 750
PULSOUT ServoR_pin, 750
PAUSE 20
GOTO Start
I can only make the motors turn in clockwise direction with this code...
How can I make one turns clockwise while another one turns anticlockwise??
Post Edited (koolitude) : 1/30/2007 8:01:52 AM GMT
I've just bought a BS2 and two continuous servo motors.
I would like to control the direction of rotation of the servo... (clockwise/anticlockwise)
How can I do that? Thanks!
ServoL_pin CON 12
ServoR_pin CON 13
Start:
PULSOUT ServoL_pin, 750
PULSOUT ServoR_pin, 750
PAUSE 20
GOTO Start
I can only make the motors turn in clockwise direction with this code...
How can I make one turns clockwise while another one turns anticlockwise??
Post Edited (koolitude) : 1/30/2007 8:01:52 AM GMT
Comments
FOR i = 1 TO 20
PULSOUT 12, 650
PULSOUT 13, 850
PAUSE 20
NEXT
Don't forget to adjust the servo, so it will be stop when giving a 750 width pulse.
just some follow up questions....
Would the speeds of the motors be the same?
How did you decide the value of 650 and 850?
Thanks once again~~~~~~~~~~~~~~~~~~
Just download the book "What's a Microcontroller?" Parallax makes it available for free download. You can either download it or read it online at . . .
http://www.parallax.com/dl/docs/books/edu/Wamv2_2.pdf
In any case, I believe exactly what you want is in chapter 4, which begins on page 103.
Have fun!
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
In practice, one sends pulsout 750 to the modified servo and adjusts the pot until the motor stops turning, then sends pulsouts of > 750 to move the 'bot forward and <750 to move it opposite. Since the servos are likely mounted on opposite sides of the robot, one servo must go clockwise and one must go anticlockwise to move both wheels 'forward', hence Christj's code commands one servo to 650 (<750) and one to 850 (>750).
PAR
Y'all are very helpful!