Shop OBEX P1 Docs P2 Docs Learn Events
Cheap Dirty Servo Position Sensor — Parallax Forums

Cheap Dirty Servo Position Sensor

skynuggetskynugget Posts: 172
edited 2008-11-22 09:55 in General Discussion
Hey All,
I needed to know if a servo made it to its destination for a prototype. I came up with this out of parts in my "bin". Its' a ratshack Trim Pot glued to the center of the servo horn. Below it is a ratshack Pot knob glued in place to hold it from spinning. To my complete surprise it has held up for over a year now of about 75-50 cycles a day. Just throw in a capacitor and read the value with RCTIME. You get a pretty decent resolution, and the better the pot, the more stable the result. Sorry about the poor picture, but it should be enough to get the point.

Post Edited (skynugget) : 11/20/2008 8:21:32 AM GMT
528 x 400 - 47K

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2008-11-20 08:39
    skynugget -

    What a GREAT idea! I realize you already apologized for the picture, but is there any chance of taking one which shows how the stationary part of the trimpot is mounted? Perhaps the new picture could have a bit more clarity.

    Thanks for sharing this feedback method. I've been looking for something like this for quite some time. The beauty of it for my application is the compact size and no PCB real estate is expended. I suppose two more advantages are: the price, and decent resolution.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When all else fails, try inserting a new battery.

    Post Edited (Bruce Bates) : 11/20/2008 9:16:39 AM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2008-11-20 14:50
    skynugget,

    You should check this thread out.· Although it was done with the Propeller, the same concept could be applied to any of the BS1,BS2, or SX.

    http://forums.parallax.com/showthread.php?p=582447

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • skynuggetskynugget Posts: 172
    edited 2008-11-20 22:16
    Beau That's Neat!!!

    Here are some slightly better pics Bruce.
    768 x 1024 - 176K
    1024 x 768 - 160K
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2008-11-20 23:04
    skynugget -

    Great pictures. Now I can easily see how it's attached.

    Thanks!

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When all else fails, try inserting a new battery.
  • skynuggetskynugget Posts: 172
    edited 2008-11-21 00:43
    No prob Bruce, Your posts have helped me learn a lot, glad i could help ya. Get out the crazy glue!
  • UghaUgha Posts: 543
    edited 2008-11-21 03:14
    Beau: I can't understand how this would work with a modified servo... the thread you linked to seemed to suggest it
    but I can't grasp the concept.

    Did I misunderstand or am I just missing something?

    skynugget: That's awesome [noparse]:)[/noparse] What is the project for?
  • skynuggetskynugget Posts: 172
    edited 2008-11-21 03:23
    Ugha,
    its the prototype for a wicked rfid door access system I'm working on. Basically my door doesn't always shut the whole way sometimes, so i needed to poll the servo to make sure the deadbolt actually went the whole way through the strike plate and locked.
  • Lab RatLab Rat Posts: 289
    edited 2008-11-22 01:38
    thats pretty cool to actualy see it done

    there is a technical term for it

    it is called leader/follower

    either way you put it , it is awsome
    Beau Schwabe (Parallax) said...
    skynugget,

    You should check this thread out.· Although it was done with the Propeller, the same concept could be applied to any of the BS1,BS2, or SX.

    http://forums.parallax.com/showthread.php?p=582447
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Parallax posesses power beyond belief.

    Believe in it.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2008-11-22 05:36
    Ugha,

    "Beau: I can't understand how this would work with a modified servo... the thread you linked to seemed to suggest it but I can't grasp the concept." - The only modification it seems that skynugget has done to the servo, is to mechanically mount a pot to the servo horn. In the "leader/follower" example, the concept is simple.... Sweep a valid pulse to a servo, only don't provide an adequate amount of current to the servo that would cause the servo to·move. If you monitor the servo current while sweeping a valid pulse signal, you will see a dip in current when the signal that you are sending it matches the position of the servo. Based on that information you can determine the position of a servo without a hardware modification to the servo.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • kjennejohnkjennejohn Posts: 171
    edited 2008-11-22 07:17
    OK, I'm simpler in the head than most. How do you mean,"sweep a pulse"? What equipment are you using? Where is it hooked into the servo drive circuit? Expound and expand, please.

    later!
    kenjj
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2008-11-22 08:24
    kjennejohn,
    ·
    "How do you mean,"sweep a pulse"? What equipment are you using?" - This can be done right from the Stamp, SX, or Propeller.
    ·
    The servo expects a positioning pulse that ranges from 1ms to 2ms... you just create a loop in software that sends a valid servo pulse that you would normally move the servo position with, only the servo doesn't move because your not giving it enough power to actually drive the servo motor.· When the pulse that you are sending the servo equals the position that the servo should be in,· you will see a dip in the current from the servo, because the servo electronics will no longer·attempt to engage the servo motor.
    ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • kjennejohnkjennejohn Posts: 171
    edited 2008-11-22 09:55
    Ah so! Thanks for the enlightenment!
    kenjj
Sign In or Register to comment.