HB-25 Motor Controller
MarkCrCo
Posts: 89
Ok I bought one of theses http://www.parallax.com/product/29144 Got it wired up to pin 14 and it works fine but.......
Its throwing pulses out to pin 15 which has a servo attached to it. I'm using the test code for the HB-25 and it never sends a pulse out to 15 but the servo is turning.
Any ideas???
' =========================================================================
' 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 BS2}
' {$PBASIC 2.5}
'
[ 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.
'
[ I/O Definitions ]
HB25 PIN 14 ' I/O Pin For HB-25
'
[ Variables ]
index VAR Word ' Counter For Ramping
'
[ 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
'PAUSE 1 ' 1 mS Delay
'PULSOUT HB25, 750 ' Stop Motor 2 (If Connected)
' The Above 2 Lines May Be Removed
' If You Are Using Single Mode
'
[ 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 1 ' 1 mS Delay For Motor 2 Pulse
' PULSOUT HB25, 750 - index ' Motor 2 Reverse
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 1 ' 1 mS Delay For Motor 2
' PULSOUT HB25, 750 - index ' Motor 2 Reverse Slowing
PAUSE 20 ' 20 mS Smoothing Delay
NEXT
STOP ' Use STOP To Prevent State Change
Its throwing pulses out to pin 15 which has a servo attached to it. I'm using the test code for the HB-25 and it never sends a pulse out to 15 but the servo is turning.
Any ideas???
' =========================================================================
' 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 BS2}
' {$PBASIC 2.5}
'
[ 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.
'
[ I/O Definitions ]
HB25 PIN 14 ' I/O Pin For HB-25
'
[ Variables ]
index VAR Word ' Counter For Ramping
'
[ 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
'PAUSE 1 ' 1 mS Delay
'PULSOUT HB25, 750 ' Stop Motor 2 (If Connected)
' The Above 2 Lines May Be Removed
' If You Are Using Single Mode
'
[ 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 1 ' 1 mS Delay For Motor 2 Pulse
' PULSOUT HB25, 750 - index ' Motor 2 Reverse
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 1 ' 1 mS Delay For Motor 2
' PULSOUT HB25, 750 - index ' Motor 2 Reverse Slowing
PAUSE 20 ' 20 mS Smoothing Delay
NEXT
STOP ' Use STOP To Prevent State Change
Comments
He has the wheel servos attached to pins 12 and 13 and his sweeper attached to pin 15. I bought the HB-25 to upgrade his sweeper from a servo to a motor. I wired it up to pin 14 (because it was not being used) to test the motor and my hook up. It worked fine during the test and ramped the motor up and down as it should except that it also turned the servo for the sweeper even though the code does not ever send a pulse to pin 15 where the sweeper servo is attached. I'm eventually going to replace the servo , currently attached to pin 15 with the motor pin 14. I want to make sure I'm not doing anything wrong that caused these wierd test results though before I build the motor mounts and destroy the servo mount.
Just putting it out there because so many of my problems are power related and I have no idea what source you're using.
http://youtu.be/K0DbdbIez4s
It looks like you need to organize your wiring as well, you'll never be able to troubleshoot issues with wiring like that, not only that it opens the door for RF interference which will add an entirely new set of problems.
For now try connecting the negative of pack 1 to the negative of pack 2. Also make sure to test each battery and make sure none of them are low on juice.
If that doesn't work I'd start trying to organize the rest of the wiring on the entire robot, systematically break down each section until you find the one with the problem.
Try some test code, disconnect everything from pins 14 and 15.
Check for voltage on pin 15. If there is no voltage present, it's your code or wiring. If there is voltage present there's a chance the pin is bad.
It seems like the HB25 works, it's possible something is feeding back on the ground wire just enough to get the servo pin next to it. I don't know if that would effect a servo though.
Possibly try grounding the HB25 ground signal wire (B pin) directly to the battery packs shared ground.
Then plug the signal wire (W pin) directly into the stamp port bypassing the servo header ports.