Shop OBEX P1 Docs P2 Docs Learn Events
HB-25 motor conntroller problems — Parallax Forums

HB-25 motor conntroller problems

frostysnowmanfrostysnowman Posts: 8
edited 2007-06-25 22:53 in Robotics
Hi, I'm a newbie and needs some helps on the HB-25 motor controller.
I just bought a pair of HB-25 yesterday and tried to control DC motor using them. But I failed. The power light on of one HB-25 didn't light on while I applied 12V to it, but the fault led (Red) was on. I'm very sure about the power connection is correct. The power led of the other one· is on but when I connected them according to the manual and programmed the bs2p, the motor didn't move at all.· Both operations were under mode 1. Would you please provide any clue on what could be the reasons?
Thanks a lot in advance.

Comments

  • FranklinFranklin Posts: 4,747
    edited 2007-06-22 01:06
    Would you please provide a drawing of how you connected them and your code?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • frostysnowmanfrostysnowman Posts: 8
    edited 2007-06-22 01:33
    pin of HB-25
    Vin ---- +12V of power supply
    GND ---- GND of power supply
    W
    P15 of BS2p
    B
    GND of BS2p
    M1&M2
    DC motor

    I used Mode 1 for the operation (Jumper in place). By the way my power supply is only up to 6A, could that be the reason?

    The test code i used is almost the same as the code provided in the manual, but I used BS2p and only one motor. The code is list below:
    ' =========================================================================
    '·· File...... HB-25 Motor Test.bs2
    '·· Purpose... Tests One Or Two HB-25's Connected To P15
    '·· Author.... Parallax, Inc.
    '·· E-mail.... support@parallax.com
    '·· Updated... 01-18-2006
    '
    '·· {$STAMP BS2p}
    '·· {$PBASIC 2.5}
    '
    [noparse][[/noparse] Program Description ]
    ' This program tests the HB-25 by waiting for it to power up, then pulsing
    ' the output to ramp the motors up in opposite directions, wait 3 seconds
    ' then ramp them back down to a stopped position.· While the code is
    ' written for two HB-25/motors you can use it with just one by commenting
    ' out or removing the lines for the second motor, commented below.· If you
    ' have two HB-25/motors connected, remember to remove the jumper block from
    ' the second HB-25.

    '
    [noparse][[/noparse] I/O Definitions ]
    HB25··········· PIN···· 15············· ' I/O Pin For HB-25

    '
    [noparse][[/noparse] Variables ]
    index·········· VAR···· Word··········· ' Counter For Ramping

    '
    [noparse][[/noparse] Initialization ]
    DO : LOOP UNTIL HB25 = 1··············· ' Wait For HB-25 Power Up
    LOW HB25······························· ' Make I/O Pin Output/Low
    PAUSE 5································ ' Wait For HB-25 To Initialize
    PULSOUT HB25, 750······················ ' Stop Motor 1
    '
    [noparse][[/noparse] Program Code ]
    Main:
    · PAUSE 20····························· ' Wait 20 mS Before Ramping
    · FOR index = 0 TO 250················· ' Ramp Up To Full Speed
    ···PULSOUT HB25, 750 + index·········· ' Motor 1 Forward
    ·· PAUSE 20··························· ' 20 mS Smoothing Delay
    · NEXT
    · PAUSE 3000··························· ' Wait 3 Seconds
    · FOR index = 250 TO 0················· ' Ramp Back Down
    ··· PULSOUT HB25, 750 + index·········· ' Motor 1 Forward Slowing
    ··· PAUSE 20··························· ' 20 mS Smoothing Delay
    · NEXT
    · STOP································· ' Use STOP To Prevent State Change
    ·
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-06-22 16:25
    Frosty,

    The PULSOUT values you are using are for a BS2. The BS2p uses different values and your code is not adjusted for this. This means the values you are sending out outside the allowed range of a servo and therefore the HB-25. You can find the information on changing your PULSOUT values in either the BASIC Stamp Manual or the Editor Help File. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • frostysnowmanfrostysnowman Posts: 8
    edited 2007-06-22 16:40
    Thanks, Craig. I changed the value according to the manual, i.e. PULSOUT HB25, 1875, since for bs2p each pulse is 0.8us rather than 2us. But still, it did not work. I checked the motor, it worked when it is connected to the power supply directly. Then I check the output waveform for the M1 & M2.·It turned out that one of the the peak-to-peak voltage is only around 1.3V and and the average voltage is only around 300mV. Is that normal?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-06-22 17:38
    Without a load on the output you won’t be able to measure anything on the M1 or M2 terminals…These are the output of the H-Bridge and are pulse modulated. Also, just changing the 750 to 1875 may not be enough since with the range specified you may be well within the dead band of the motor still.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • frostysnowmanfrostysnowman Posts: 8
    edited 2007-06-22 18:46
    Hi, Chris,
    Would you please give me more information about the relationship between the working band of the motor (the output of HB-25)·and the inputs of HB-25? To my understand, HB-25 controls a DC motor just like a continous rotation servo, so that 1.5ms corresponding to the Neutral state and that's why I used value 1875. But I don't know how it related to the outputs. Following·I listed·the modified codes for the bs2p.
    Thanks a lot for your help!
    Frosty

    '
    [noparse][[/noparse] Initialization ]
    DO : LOOP UNTIL HB25 = 1··············· ' Wait For HB-25 Power Up
    LOW HB25······························· ' Make I/O Pin Output/Low
    PAUSE 5································ ' Wait For HB-25 To Initialize
    PULSOUT HB25,·1875····················· ' Stop Motor 1
    '
    [noparse][[/noparse] Program Code ]
    Main:
    · PAUSE 20····························· ' Wait 20 mS Before Ramping
    · FOR index = 0 TO·625················· ' Ramp Up To Full Speed
    ···PULSOUT HB25,·1875 + index·········· ' Motor 1 Forward
    ·· PAUSE 20··························· ' 20 mS Smoothing Delay
    · NEXT
    · PAUSE 3000··························· ' Wait 3 Seconds
    · FOR index =·625 TO 0················· ' Ramp Back Down
    ··· PULSOUT HB25,·1875 + index·········· ' Motor 1 Forward Slowing
    ··· PAUSE 20··························· ' 20 mS Smoothing Delay
    · NEXT
    · STOP································· ' Use STOP To Prevent State Change
    ·
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-06-22 20:08
    At first glance the new code you have should work…Are you powering the HB-25 up after the BASIC Stamp Module?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • frostysnowmanfrostysnowman Posts: 8
    edited 2007-06-22 21:31
    Yes. But what could be the reason?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-06-22 22:20
    If everything’s connected properly, voltages are correct, there is not red fault LED and the code works then there is now reason I can think of. Re-reading your first message you said you never get a power light…Is the fuse blown? The last time I saw someone have these problems we had the units sent in to us and the connectors were shorting out the fuse terminals as well as the signal headers. Can you post a picture of the top of your HB-25 showing its connections?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • frostysnowmanfrostysnowman Posts: 8
    edited 2007-06-22 23:08
    I bought a pair of HB-25. the power led of one of them·is·never on·but the other one does. I tried the other one but even this one (with green power led on), the motor did not work. I just cannot think of any of possible reasons. I don't have camera with me now and I may post the picture tomorrow.
  • frostysnowmanfrostysnowman Posts: 8
    edited 2007-06-25 20:31
    Today I tried both of them again and it worked!
    But·the green power led of one of the HB-25·was still off even·it·did drive the motor and the motor was moving.·Is there any concerns about it? I attached two pictures of the HB-25 when it was running.
    2256 x 1504 - 1M
    2256 x 1504 - 1M
  • frostysnowmanfrostysnowman Posts: 8
    edited 2007-06-25 20:35
    Chris Savage (Parallax) said...
    Without a load on the output you won’t be able to measure anything on the M1 or M2 terminals…These are the output of the H-Bridge and are pulse modulated. Also, just changing the 750 to 1875 may not be enough since with the range specified you may be well within the dead band of the motor still.

    By the way, could you please tell me how can I find out·the dead band of the motor still? Thanks a lot!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-06-25 22:53
    Frosty,

    Don’t know what happened to your LED…As for dead band, all you need to do is send values moving away from 1.5 ms until the motor starts to move. You’ll find this will change slightly between the motor being load/unloaded. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
Sign In or Register to comment.