Shop OBEX P1 Docs P2 Docs Learn Events
BS2 to BS2p conversion (esp. for PULSOUT) — Parallax Forums

BS2 to BS2p conversion (esp. for PULSOUT)

edited 2005-04-06 04:13 in BASIC Stamp
Hello all, is there an exact conversion rate for PULSOUT commands and suchlike? I know it's approx 2.5 but I have some very sensitive PULSOUT values because the servo speeds are not the same. Also because I need exact speeds, and it would be a pain in the butt to do 100 PULSOUT calculations all over again. I don't even know max and min speeds for the BS2p! Help, please?

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-04-06 02:21
    Hello,

    ·· Why would you have to do 100 calculations?· Once you calculate for the center position, you can use an offset value for the forward and backward values.· Or, calculate one extreme and the other, and use that range.· I may be missing what you're trying to say, but it sounds like you're over complicating it.

    ·· How many values are you currently using for the BS2 code?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-04-06 04:13
    If you look in the help file (hint, hint) there is an example that shows you how to save yourself the trouble of calculating everything.

    #SELECT $STAMP
      #CASE BS2, BS2E, BS2PE
        Scale       CON     500             ' to ms for 2 us per unit
      #CASE BS2SX, BS2P
        Scale       CON     1250            ' to ms for 0.8 us per unit
    #ENDSELECT
    
    Flash           CON     25 * Scale      ' 25 milliseconds
    
    

    If you want to do it all manually divide your pulse width (in microseconds) by 0.8.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
Sign In or Register to comment.