Detect position of servo?
firestorm.v1
Posts: 94
(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!
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
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".
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
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