Shop OBEX P1 Docs P2 Docs Learn Events
DEMO: Using a continuous Rotation Servo as an INPUT device — Parallax Forums

DEMO: Using a continuous Rotation Servo as an INPUT device

Beau SchwabeBeau Schwabe Posts: 6,566
edited 2013-11-11 06:46 in Propeller 1
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

Comments

  • average joeaverage joe Posts: 795
    edited 2013-11-09 20:11
    Wow! That's very neat! My only concern is if this could possibly damage the servo? I remember reading a warning about not turning servo by hand. Still very cool!
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2013-11-09 20:26
    "My only concern is if this could possibly damage the servo? I remember reading a warning about not turning servo by hand" ... As long as you don't go nuts turning the servo.... Turning the servo slowly won't damage it
  • potatoheadpotatohead Posts: 10,261
    edited 2013-11-09 21:15
    What is "slowly?"

    :)
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2013-11-09 21:22
    What is "slowly?" ... the danger is stripping the gears out. This can happen with quick, deliberate motion. If you are aware of this and use caution when turning a servo you won't have any problems.
  • average joeaverage joe Posts: 795
    edited 2013-11-09 21:29
    Thanks Beau! I just tried this out and it works quite well. This will come in handy for a project I've been thinking about for a while. Excellent work, as always!
  • prof_brainoprof_braino Posts: 4,313
    edited 2013-11-10 09:13
    You rock as always!
  • W9GFOW9GFO Posts: 4,010
    edited 2013-11-10 10:00
    I would expect that the high speed servos would be far less likely to strip gears due to their much lower gear ratio, maybe they would offer a higher resolution input as well?
  • BeanBean Posts: 8,129
    edited 2013-11-11 05:34
    Beau,
    How about a bit of theory on how it works ?

    Thanks,
    Bean
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2013-11-11 06:46
    The application is derived from this earlier discovery...

    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.
Sign In or Register to comment.