Shop OBEX P1 Docs P2 Docs Learn Events
Detect position of servo? — Parallax Forums

Detect position of servo?

firestorm.v1firestorm.v1 Posts: 94
edited 2010-01-04 18:36 in BASIC Stamp
(Mods: I'm using a BS2 in this project, although I'm not sure if this post belongs here or in "Sensors", Please feel free to move where appropriate.)

I recently got my hands on the Dual Axis Accelerometer for the Basic stamp (one offered through RadioShack, m/n escapes me at this point.) and I remember that some time ago that someone here in the forums mentioned that there was a way using pulsin and pulsout to be able to pulse a servo and get a response. Through some basic math you could then calculate the relative position of the servo. I want to be able to apply power and after a short pause waiting for the servos to initialize, have the BS2 poll each servo and reset the servos to a "0" state which will be at 50% of each servo's travel distance.

The idea is that once everything is said and done, if I tilt the accelerometer a certain way the servos will react in kind, however they will not damage themselves in the process because the BS2 will be aware of their current position in relation to minimum and maximum position as determined through calibration beforehand. The ultimate end of this project will be a mount for a pan/tilt camera assembly using the accelerometer as the controlling element. (Tilt the accelerometer down, the camera looks down, turn it left, the camera looks left, etc...)

I remember reading about this servo polling and that it didn't require any additional hardware like photocells, IR transmitter/receiver pairs, etc but after searching the forums and even using Google to search the forums, can't find it to save my life. If any of you have the forum post bookmarked or know how I could achieve my goal, please let me know.

Thank you!

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2009-12-31 15:14
    Not sure what kind of 'servo' you're talking about here -- all the servo's I know about are "open-loop" to the BS2. By that, I mean the BS2 'commands' them to a position, and they go to that position. There's no feedback to the BS2 in the process.

    Now, you COULD put a 'shaft-encoder' on the output shaft, and read that to determine the position of the output shaft. But that's "additional hardware".
  • sylvie369sylvie369 Posts: 1,622
    edited 2009-12-31 15:22
    He's talking about a project that was posted here that used a couple of external components to read something about the interaction with the servo to determine its position. It looked pretty cool, and I am hoping to try it at some point. It did use standard servos, with some clever programming.

    Aha - here it is:

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



    Incidentally, is there any good way to search the forums? The special search link in the "Support for Using This Forum" forum doesn't seem to work anymore.

    Post Edited (sylvie369) : 12/31/2009 3:31:16 PM GMT
  • FranklinFranklin Posts: 4,747
    edited 2009-12-31 19:55
    sylvie, the best I've seen is to use search.parallax.com which then uses Google engine to do the site search.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • firestorm.v1firestorm.v1 Posts: 94
    edited 2010-01-04 18:20
    Mad props to sylvie369, that was the _exact_ post I was looking for! The forum search was useless, using "servo position" "servo turn" "servo pulse" "servo degrees" and such, did not return anything slightly relevant.

    I've also bookmarked the search.parallax.com link as well. The Google Search is much more thorough.

    Thank you all! Now I've got another crazy project idea to code. :P
  • sylvie369sylvie369 Posts: 1,622
    edited 2010-01-04 18:36
    Franklin said...
    sylvie, the best I've seen is to use search.parallax.com which then uses Google engine to do the site search.
    Well, that's the best I've seen too...but it doesn't seem to work anymore. Does it still work for you? Is it just me?
Sign In or Register to comment.