Shop OBEX P1 Docs P2 Docs Learn Events
i feel like an idiot, i can't figure this out — Parallax Forums

i feel like an idiot, i can't figure this out

nhs groupnhs group Posts: 1
edited 2008-04-04 13:37 in BASIC Stamp
i have the hb-25 motor controller and a bs2 stamp. i can get it to go one direction, but i can't figure out how to change directions.

Comments

  • DgswanerDgswaner Posts: 795
    edited 2008-04-03 19:28
    The speed and direction of the motors are controlled by the pulse width you are sending it. 2000 is full speed forward, 1000 is is full reverse, so for reverse you would need to send a value between 1000 and 1500. look at the example code, it provides a sample of how to control it in both directions.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "A complex design is the sign of an inferior designer." - Jamie Hyneman, Myth Buster

    DGSwaner
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2008-04-04 00:33
    DGSwaner and nhs group--

    For a BS2/HB-25 combination, "stop" is represented by 750. Full forward is 1000. Full reverse is 500. So, you have 250 "speeds" in both directions . . . from 750 to 1000 is forward and from 750 to 500 is reverse. (Note that the pulse widths are dependent on processor speed. The numbers I quoted are for the BS2. Other Stamp/HB-25 combinations will use a different range. Not a problem; it is dirt simple.)

    Note that 751 is the slowest forward speed theoretically possible, while 749 is the slowest reverse speed theoretically possible. In practice, probably neither one will cause the motor to move. Depending on the motor, you will have to give it a little more "juice." For example, I use a couple of motors of a certain kind that will not turn forward until I send them something like 770 or 730. Both numbers are dead slow, forward and reverse, respectively.

    The HB-25 is a truly great motor controller.

    Parallax needs to design and build the HB-50!

    Have fun!
    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • DgswanerDgswaner Posts: 795
    edited 2008-04-04 04:07
    I should have double checked, I have mine connected to a propeller. and the values I stated work, I guess they are not the same for PBasic.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "A complex design is the sign of an inferior designer." - Jamie Hyneman, Myth Buster

    DGSwaner
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2008-04-04 13:37
    DGSwaner--

    Well, double-checking is always a good thing. On the other hand, my post may be the only information I have put on this board that is even semi-correct, so don't feel bad! When I graduate to the Propeller I will look you up for help.

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
Sign In or Register to comment.