HB-25 motor conntroller problems
frostysnowman
Posts: 8
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.
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
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
·
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
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 Savage
Parallax Tech Support
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
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.
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