Shop OBEX P1 Docs P2 Docs Learn Events
hB25 and bs2sx — Parallax Forums

hB25 and bs2sx

robonutrobonut Posts: 3
edited 2007-03-03 19:23 in Robotics
Hello All,

I'm using the code provided in the manual of the HB25 however the code is written for a bs2, I'm trying to use it with a bs2sx does anybody know what i need to change in the code. I tried changing the constant of 750 to 1875 since the bs2sx is 2.5 times faster than the bs2. Is thos correct or is there something else i need to change.

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2007-03-02 15:33
    Get a copy of the 'standard template'. It has #defines for all the common constants.

    That, or look in the manual. Personally, I call these basic units a "tick size".

    For instance, in PULSOUT, the BS2 'plain' "tick size" is 2 uSec. You're specifying the output pulse width in 2 uSec 'units', or 'ticks'.

    So, 'tick size' varies for the following commands:
    SERIN/SEROUT, PULSIN/PULSOUT, RCTIME. I'm not sure if COUNT depends on the 'tick size' or not.
  • bjhamltnbjhamltn Posts: 21
    edited 2007-03-03 07:52
    For the bs2sx, 1875 shoud stop the motor or at least cause the motor to runs slow.
    Idealy 1875 should stop the motor but adjustments may be needed.

    1875<x<2500 should cause the motor to run in the forward direction
    1250<x<1875 should cause the motor to run in the reverse direction

    When using the bs2sx, Pulsout generates a pulse with a duration of 0.8 us = unit of duration.
    The spec for the HB25 state that
    1.0 ms = full speed reverse
    1.5 ms = stop
    2.0 ms = full speed forward

    To find the required number of units of durations use the following conversion

    (desired time in ms) * 1000/(unit of duration) = required unit duration

    Example for the case of bs2sx with pulsout unit of duration = 0.8

    1.7*1000/0.8 = 1.7*1250 = 2125

    2125 is the value that youwould use in the pulsout command
  • WarrlokWarrlok Posts: 77
    edited 2007-03-03 19:23
    can he declare somewhere pulseleft =750 *2.5
    or 750 * 25 / 10


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Problems are the "roads" of life,
    solutions are only "onramps" to the next problem



    ············································· "Brad Smith"


    Post Edited (Warrlok) : 3/3/2007 7:29:45 PM GMT
Sign In or Register to comment.