Shop OBEX P1 Docs P2 Docs Learn Events
Centering/Positioning a servo? — Parallax Forums

Centering/Positioning a servo?

bulkheadbulkhead Posts: 405
edited 2005-10-14 02:15 in Robotics
If I want my servo to be at a certain position, do I have to just test values on my stamp until I find the right pulse length to get the desired position? Does this mean I must change my code (or rather, one INT), reload the code, and run it again EACH time, over and over until I find the right spot? Is there an easier way to do this with the stamp, or is there some circuit that can help find the desired pulse length? I'd just like to know if theres an easier way before I go headlong and start guessing and checking values for about 6 servos...thanks.

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-13 04:09
    You could write a program that accepts numeric input from the DEBUG window and then moves the servo to that position.· Then you'd have the values you need.· Use the actual PULSOUT values during entry.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2005-10-13 09:22
    There are really two aspects to centering.

    First is the mechanical.
    Try having the software code generate an ideal value for center [noparse][[/noparse]one that allows you 50% left and 50% right], then adjust the physical set up to as near perfect as possible.

    After that, you have to observe if it is physically right on or if it is skewed to one direction in actual use. More than likely it is skewed.

    Generally, you don't have to re-input your adjustments once they are correct unless you change the mechanical setup. But, you do have to search for a value either through DEBUG or re-programing. To save time, try going too far, then halving the first input to see if you are getting a finer adjustment in the right direction. Repeat the 'zig-zag' process until satisfied.

    Also, it is nice to be able to use DEBUG to 'tweak' the variable as you may change your mind as you observe the robot for longer periods of time. This way may get you there faster, but once you have your value it need to be programed into the EEPROM or you have to re-enter DEBUG at every start.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • bulkheadbulkhead Posts: 405
    edited 2005-10-14 02:15
    Ok, I think I understand-first center the servo digitally, then mechanically. But to find the next position for the servo, with respect to that arbitrary center pulse length, I should use the DEBUG window to send values to the stamp and instantly have the servo move to its corresponding position?

    Does the DEBUG work with the Javelin stamp too? Is the "Javelin Stamp IDE V.2.0.03" all I need to download to send stuff to the stamp and use the DEBUG feature?

    Thanks.
Sign In or Register to comment.