HB25 Motor Controller
After hooking up the controller I found I could only make it function by sending each command twice 20ms apart. Any ideas as to what is going on here?
' {$STAMP BS2}
' {$PBASIC 2.5}
HB25· PIN 0···'Motor Controller HB25
M_Stop· CON ·750·'Motor Full Stop
M_Fwrd· CON ·850·'Motor Half Speed Forward
M_Revs· CON·· 650·'Motor Half Speed Reverse
LOW HB25
PAUSE 5
GOSUB MotorStop
GOSUB MotorFwrd
Do
Loop
END
MotorStop:
· PULSOUT HB25,M_Stop
· PAUSE 20
· PULSOUT HB25,M_Stop
· PAUSE 20
RETURN
MotorFwrd:
· PULSOUT HB25,M_Fwrd
· PAUSE 20
· PULSOUT HB25,M_Fwrd
· PAUSE 20
RETURN
MotorRevs:
· PULSOUT HB25,M_Revs
· PAUSE 50
· PULSOUT HB25,M_Revs
· PAUSE 50
RETURN
' {$STAMP BS2}
' {$PBASIC 2.5}
HB25· PIN 0···'Motor Controller HB25
M_Stop· CON ·750·'Motor Full Stop
M_Fwrd· CON ·850·'Motor Half Speed Forward
M_Revs· CON·· 650·'Motor Half Speed Reverse
LOW HB25
PAUSE 5
GOSUB MotorStop
GOSUB MotorFwrd
Do
Loop
END
MotorStop:
· PULSOUT HB25,M_Stop
· PAUSE 20
· PULSOUT HB25,M_Stop
· PAUSE 20
RETURN
MotorFwrd:
· PULSOUT HB25,M_Fwrd
· PAUSE 20
· PULSOUT HB25,M_Fwrd
· PAUSE 20
RETURN
MotorRevs:
· PULSOUT HB25,M_Revs
· PAUSE 50
· PULSOUT HB25,M_Revs
· PAUSE 50
RETURN
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
You should probably follow Parallax's HB-25 documentation upon startup. In other words, if it all possible bring the Stamp up first, then the HB-25. The code looks a lot like this . . .
DO : LOOP UNTIL HB25 = 1···············
LOW HB25
PAUSE 5································
So, you are only missing the first line.
Good luck and have fun. The HB-25 is a great little machine.
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.