Shop OBEX P1 Docs P2 Docs Learn Events
HB-25 Motor control won't stay on. — Parallax Forums

HB-25 Motor control won't stay on.

offlandersofflanders Posts: 9
edited 2009-02-22 23:32 in BASIC Stamp
I recently acquired 2 HB-25 motor controllers. I got them all hooked up, and they seem to work with the test program on parallax's documentation. But when try them in even a simple program I wrote they will work for about 1.5 seconds and then shut off. My understaning from the documentation was they were "like" a servo in that you can set it and forget it.

Here is a copy of the program I made

LOW 15
PAUSE 200
PULSOUT 15,750


Main:

PULSOUT 15,1200
PAUSE 9000

STOP

Comments

  • SRLMSRLM Posts: 5,045
    edited 2009-02-20 16:44
    When you give it a pulse outside of 1 - 2 uS, the unit shuts off and waits for another command. I'd assume that's what is happening here. The BS2 pulsout range for servo control is 500-1000.
  • dandreaedandreae Posts: 1,375
    edited 2009-02-20 16:45
    The code that you have listed will only work for one step basically.· You can use a "DO LOOP" to make it a continous motion or use a "FOR and NEXT" routine to move it a specific amount of turns.



    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Parallax Tech Support·
  • PropabilityPropability Posts: 142
    edited 2009-02-20 18:28
    Here is the link to the pdf on the HB-25.

    http://www.parallax.com/Portals/0/Downloads/docs/prod/motors/HB-25MotorController-V1.2.pdf

    In there they do mention the ability to keep the motor going with a single pulse (no timeout ) but it might have to·be enabled by doing a few steps. Please read the docs.
  • dandreaedandreae Posts: 1,375
    edited 2009-02-20 20:17
    My mistake, you are correct.· I noticed that this could be related to a missing pause command between the two pulsout commands.

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Parallax Tech Support

    Post Edited (Dave Andreae (Parallax)) : 2/20/2009 9:49:32 PM GMT
  • offlandersofflanders Posts: 9
    edited 2009-02-20 20:26
    The auto shutoff engages after 4 seconds, the motor control should \ stay active for more then one.

    As for the "do" and "for" loops, am I was under the impression that you could issue a single pulse to the HB-25 and it would run indefinitely (or at least 4 seconds if you have auto shut off)

    I tried a different PULSOUT to deal with SRLM comment, I used PULSOUT 15,900, and was met with the same results, breif motion and then nothing.
    I have two of these units and they both are exibiting the same problem, I would guess that the odds of both of them failing in the same way are remote.
  • PropabilityPropability Posts: 142
    edited 2009-02-20 21:30
    Although I have not tried it,the manual does tell how to do it. Here is the section of it describing the process.

    To toggle the state of the Timeout mode:
    1. Disconnect the servo input cable from the HB-25. If there is a daisy-chained cable to a
    second unit remove it as well. It makes no difference whether the Mode Jumper (J) is
    installed.
    2. Apply power to the HB-25.
    3. With the power on change the state of the Mode Jumper by installing the jumper if it is
    removed or removing it if it is installed.
    4. Remove and re-apply power.

    The timeout state should now be toggled. To change it back, repeat the above steps.



    Post Edited (Propability) : 2/20/2009 11:28:51 PM GMT
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2009-02-20 22:27
    offlanders--

    Are you using a BS2? Your "stop" command implies a BS2. However, if you are using a different speed Stamp, the pulses are different. Additionally, when using a BS2, nothing over 1000 is valid. (It is on faster Stamps, however.)

    The HB-25 is a great motor controller. I use them a lot. They work as advertised. And, yes, you can "fire and forget" it by giving it a command then allowing your program to wander off and do whatever you want it to. There is no need to refresh the HB-25 until you want to change what you told it to do.

    Just for your information, when using a BS2, the valid PULSEOUT values are from 500 to 1000. However, this range is split into two halves with 750 as the mid-point. Anything below 750 causes the HB-25 to use one polarity, thus, motor direction and anything over 750 causes the HB-25 to send the other polarity, thus, motor direction. The PULSEOUT numbers from 749 to 500 cause the motor to run very slow at 749 (in fact, it probably won't even move) to full speed at 500.

    The reverse is true for the PULSEOUT numbers from 751 to 1000; 751 will cause the motor to move very slowly and in the opposite direction of 749. Like 749, the motor will probably not even move at 751. 1000 causes the motor to move as fast as 500, but in the other direction. (Of course, 750 is causes the motor to stop.)

    The HB-25 was certainly the answer for a motor controller for me. The only thing I would love to see Parallax do to improve on the HB-25 is create an HB-50.

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2009-02-21 16:21
    offlanders--

    You should put a PAUSE statement after each PULSOUT statement directed at the HB-25. This allow the HB-25 to "settle down" and get its head on straight before execution. (Gee. That sounds kinda grim.) I notice that you have no PAUSE statement after the PULSOUT 15,750.

    I would have put·a PAUSE 20 after the PULSOUT 15, 750 statement.

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2009-02-22 17:28
    offlanders--

    How are your HB-25 issues working out? Did that code I sent via PM give you any clues?

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • offlandersofflanders Posts: 9
    edited 2009-02-22 19:01
    Thank you Bill that was very useful code. I did in fact get my HB-25 to stay on using the following code...

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    '--Initilizaion--

    HB25 PIN 7
    Start:
    DO : LOOP UNTIL HB25 = 1
    LOW HB25 ' Make I/O Pins Output/Low
    PAUSE 20 ' Wait For HB-25s To Initialize
    PULSOUT HB25, 750 ' Stop the motor

    '--Program--

    Main:
    PULSOUT HB25, 450
    PAUSE 20

    GOTO Main

    This will keep it running, but whenever I leave the loop and try to get the BS2 to execute a different part of the program it won't keep the motor running. And by that I mean, i have already tried the failsafe part of the HB-25 controler. Any thoughts?

    Offlanders
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2009-02-22 20:39
    offlanders--

    Your description of the problem meets the exact diagnosis I would give if I really knew anything about the HB-25's "timeout" mode. I BELIEVE this is·the mode in which the HB-25 needs to be refreshed, just like or much like,·a servo. By keeping it in the loop, you are doing the required refreshing.

    Take a careful look at the documentation again. Make sure the HB-25s are not in the "timeout" mode . . . I think that is what it is called.

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • offlandersofflanders Posts: 9
    edited 2009-02-22 22:45
    Thanks Bill, I believe I got the problem fixed

    The problem was in giving the right pulsout.

    Thanks again for the input

    Offlanders
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2009-02-22 23:32
    offlanders--

    Great!!!

    And, thanks for letting everyone know.

    --Bill


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