DEMO: Using a continuous Rotation Servo as an INPUT device
Beau Schwabe
Posts: 6,566
The title says it all... here is a simple way to use a Continuous rotation servo as an INPUT <---- that's right, and INPUT device!!
Detect Clockwise and Counter-Clockwise direction as well as how fast.
Enjoy!!
http://obex.parallax.com/object/721
http://www.parallax.com/product/900-00008
http://www.parallax.com/product/900-00025
Detect Clockwise and Counter-Clockwise direction as well as how fast.
Enjoy!!
http://obex.parallax.com/object/721
http://www.parallax.com/product/900-00008
http://www.parallax.com/product/900-00025
Comments
How about a bit of theory on how it works ?
Thanks,
Bean
http://forums.parallax.com/showthread.php/84991-Propeller-Application-Proportional-feedback-from-a-Standard-Hobby-Servo-%28Upda?p=582447&viewfull=1#post582447
...but since the feedback portion of the servo is fixed in a continuous rotation servo, we don't need to sweep the servo pulse to try to hunt for the position as in the above link. Lets backup a little bit .... through observation and testing, it is discovered that the servo electronics are designed to provide somewhat of a proportional speed to the motor in the direction of the error. Meaning, that the more error you have in the feedback from the servo versus the pulse you are commanding to the servo, the more the servo electronics will try to move the motor to correct the error. Knowing this, and applying a small offset to the commanding pulse (20us) in this particular demo, we create a situation where the servo electronics try to drive the servo motor at about 50% duty cycle. <- this was found through a little trial and error. (The program calibrates the servo readings to this position value)... Since the servo in this example has enough power to supply the electronics, but not quite enough to turn the motor it relies on YOU to turn the servo. By turning it one direction you lessen the amount of error, and by turning it the other direction you increase the amount of error. Consequently the amount of error translates into a PWM signal produced by the servo electronics. By looking at the duty cycle that the servo electronics are trying to apply to the motor you can determine the direction and speed (<-magnitude) in which you turn the servo.