Shop OBEX P1 Docs P2 Docs Learn Events
HB-25 Motor Controller & 12V motor First Use Problems — Parallax Forums

HB-25 Motor Controller & 12V motor First Use Problems

Mike113Mike113 Posts: 6
edited 2012-04-22 10:11 in BASIC Stamp
Hello,

I just opened my HB-25 motor controller and am having problems even getting the sample code to run my motor.

I am using BS2, BOE.

I am using the 12 Volt geared motor also from parallax.

I am trying to use the second sample code from the motor controller's web page. It is for up to two motors, but says to simply comment out the code for the 2nd motor to use for one motor. I am using this sample code instead of the 1st because the first is BS1.

The sample code is posted below.

My board is hooked up as follows:
  • A servo cable to the HB-25 pins designed for it. Black to Black, White to White,Red to Red
  • The servo cable is brought over to BOE bread board w/ 3-pin header, I am jumping my white wire to PIN 15, Balck to Vss, and red to nothing ( Literature calls it not connected for the HB-25, though ive tried it with 5V as well).
  • The M1 & M2 both the 12V motor from parallax
  • The positive Terminal on the HB-25 by the fuse to a power source: Have tried a 12V Sealed Lead Calcium Batt from Hobbico & a DC power source turned to 12V
  • The Negative Terminal on the HB-25 by the fuse to a neg term. on a the same two power sources.
The code below is uploaded, commented as shown, and other ways tried.

When I turn on the MicroController first, with code uploaded, and then my 12V power source to the HB, the fan on the unit comes on, the green LED for power on the HB-25 comes on, but the motor never runs.

I have Tried putting the motor straight to my 12V DC power sourve that plugs in the wall, and the motor does run.

Thanks A Ton In Advance if Anyone can Help!!!!


_______________________________________________________________________________________________
Here is the code: Text in Green is What I commented out.
' =========================================================================
' 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 15 ' 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

  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-04-21 16:10
    You need to uncomment both "PAUSE 20" statements. The pause applied to both motors not just the second.
  • Mike113Mike113 Posts: 6
    edited 2012-04-21 16:29
    Hey ,

    Thanks, I did uncomment both the 'Pause 20' Commands just now, but still nothing from the motor.

    I am posting a couple Pics of my set up in case that may help!

    Thanks, Mike

    IMAG0578.jpg
    IMAG0579.jpg
    IMAG0580.jpg
    1024 x 575 - 98K
    1024 x 575 - 120K
    1024 x 1823 - 328K
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-04-21 16:53
    The pictures are a good idea.

    I don't see anything that would keep your setup from working. Maybe someone else will spot something.
  • tjwebertjweber Posts: 20
    edited 2012-04-21 17:39
    Double check your connections on your processor board. It looks like the connections are reversed on your 3 pin cable to the HB-25.P15 should be connected to signal (white) and ground should be connected to ground (black).
  • Mike113Mike113 Posts: 6
    edited 2012-04-21 17:58
    Hey Thanks,

    You are correct those leads were backwards, i swithched the greena and orange to the correct position on the bread board, with orange to white and black to green.

    However, it appears the issue remains, still no output from the motor.

    But at least we may be getting closer, thats two issues fixed! Man I really thought that one was gonna do it too!

    Thanks, Mike
  • John BoardJohn Board Posts: 371
    edited 2012-04-21 20:54
    G'day,

    Funny you should have this problem, I just had pretty much EXACTLY the same problem (Except with the propeller chip) . As per the manual, turn the Basic Stamp on before the HB-25, make sure the basic stamp has started up before the HB-25.

    Hope this helps,

    -John

    [EDIT] Ohh.. you've already done that... hmm... well :/ I don't think I can really help, check out this thread to see if it helps though: http://forums.parallax.com/showthread.php?139575-HB-25-w-Propeller-Issues-Revised-name&p=1092675#post1092675
  • Mike113Mike113 Posts: 6
    edited 2012-04-22 07:53
    Hey,

    I noticed in the pic # 1 & 2 of the link you posted that you have a wire from the positive terminal on the HB-25 and its runs to a pin, possibly number 14, does anyine think i need sometghing similiar possibly?

    I was wondering how the stamp knows when the HB25 =1 , if HB25 is pin 15.

    Thanks, Mike
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-04-22 08:03
    Mike113 wrote: »
    I was wondering how the stamp knows when the HB25 =1 , if HB25 is pin 15.

    Yeah, how does that work?

    I don't understand that either.
  • tjwebertjweber Posts: 20
    edited 2012-04-22 09:38
    Mike,

    Check you 3 pin connection on the HB-25. There are two sets of pins. I think you should be using the pins on the "outside". See figure 1 in the HB-25 manual.
  • Mike113Mike113 Posts: 6
    edited 2012-04-22 09:48
    Hey,

    I just tried that, but the motor still does not run. THnks for looking!

    So, now I have the 3 pin servo cable hooked to the outside row.

    Thanks, Mike
  • Mike113Mike113 Posts: 6
    edited 2012-04-22 10:11
    Looks like i got it!

    I changed the code to have HB25 equal to PIN0 instead of PIN15 and it works as it should!!

    Must have a problem in my board with PIN15.

    Thanks for all the help!

    Thanks, Mike
Sign In or Register to comment.