Shop OBEX P1 Docs P2 Docs Learn Events
HB-25 Motor Controller — Parallax Forums

HB-25 Motor Controller

MarkCrCoMarkCrCo Posts: 89
edited 2014-05-12 20:48 in General Discussion
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

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2014-05-12 06:37
    You're using a HB25 to run a servo with?
  • MarkCrCoMarkCrCo Posts: 89
    edited 2014-05-12 08:28
    No the motor is on pin 14 (with the hb-25 and http://www.vellemanusa.com/products/view/?id=524519) and a servo happens to be on 15 http://www.parallax.com/product/900-00025.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-05-12 08:42
    You might start by moving the Pin 14 oand Pin 15 uses further apart. If you have empty pins, use them fro space inbetween.
  • MarkCrCoMarkCrCo Posts: 89
    edited 2014-05-12 08:44
    Here is the whole story since there seems to be some confusion. I have my robot all built and he goes around sweeping the floor http://www.youtube.com/watch?v=t00JWWQIWrc
    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.
  • xanaduxanadu Posts: 3,347
    edited 2014-05-12 08:52
    If everything is wired correctly, and your code is correct, and there are no bad or damaged components it's possible you're drawing too much power from the main source which could cause glitches.

    Just putting it out there because so many of my problems are power related and I have no idea what source you're using.
  • MarkCrCoMarkCrCo Posts: 89
    edited 2014-05-12 09:02
    4 AA batteries for the robot itself and a separate bank of 4 AA's attached to the HB-25.I think this should be correct if I understand this right. The power from the robot should only be controlling the control components of the HB-25 and the separate bank of batteries should be just used to drive the motor.
  • RDL2004RDL2004 Posts: 2,554
    edited 2014-05-12 09:17
    Just a guess, but you have every thing connected to port B on the Stamp (pins 10-17). There is a per port power limit. Maybe try moving some stuff to port C (pins 18-25).
  • PublisonPublison Posts: 12,366
    edited 2014-05-12 09:25
    Just checking...are the grounds of the two banks of batteries tied together?
  • MarkCrCoMarkCrCo Posts: 89
    edited 2014-05-12 11:16
    There are only 16 pins available ( 0 through 15 ). The battery pack for the Motor is connected to the HB-25 + and - terminals. The Battery pack for the robot is connected to the Board of education power port. The only way I see that the grounds could be connected is if it is in the internal circuitry of the HB-25.
  • PublisonPublison Posts: 12,366
    edited 2014-05-12 13:41
    The HB-25 has a VIN, (your second pack), and Ground, (GND). The GND from the HB-25 needs to be connected to GND on the BOE.
  • MarkCrCoMarkCrCo Posts: 89
    edited 2014-05-12 14:11
    WP_20140512_002[1].jpg
    WP_20140512_003[1].jpg
    Thats the wiring setup. I think that is correct. Oh the disconnected wires in the bottom of the first pic are my on/off switch for the HB-25.The red and white wires in the second picture are not conected its just my shakey photgraphy.

    http://youtu.be/K0DbdbIez4s
    1024 x 575 - 48K
    1024 x 575 - 51K
  • xanaduxanadu Posts: 3,347
    edited 2014-05-12 15:41
    Publison is saying that you need to have the grounds on both of your AA packs connected. Even if it isn't the problem it's a step in the right direction.

    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.
  • MarkCrCoMarkCrCo Posts: 89
    edited 2014-05-12 16:32
    You may be right about the RF interference other than that I don't know what the ret of the robot could have to do with the test. The wiring makes sense to me all yellows go to ground. When he is actually doing his job the wires are needed because he uses IR and ultrasound for navigation but none of that is in use during the test. Connecting the grounds of both battery packs leads to the same results. The motor runs according to the test but the sweeper moves to which makes no sense. Something is making the pulses that should be going exclusivly to pin 14 go to pin 15 also and I can't figure it out.
  • xanaduxanadu Posts: 3,347
    edited 2014-05-12 17:08
    Do you have a scope or multi-meter?

    Try some test code, disconnect everything from pins 14 and 15.
    DO
    High 14
    Pause 1000
    Low 14
    Pause 500
    LOOP
    

    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.
  • MarkCrCoMarkCrCo Posts: 89
    edited 2014-05-12 18:04
    OK its something with the HB-25 assembly. I took the HB-25 assembly (HB-25, motor, and Battery pack) out and replaced it with a servo. The servo on pin 14 ramped up and down as expected and the servo on pin 15 did nothing as expected. I replaced my home-made wiring harness with a parallax servo extension cable, Replaced the battery holder with one that had an on/off switch. Plugged it into pin 14 and back to the motor ramping up and down but the servo on pin 15 turning also.
  • xanaduxanadu Posts: 3,347
    edited 2014-05-12 18:33
    Interesting, is there any way you can get a better pictures, maybe close-ups of all of the connections?

    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.
  • xanaduxanadu Posts: 3,347
    edited 2014-05-12 18:36
    Also try everything as it is with no load on the HB25, in other words disconnect the motor from the HB25. Some inductive loads can cause a lot of noise. You can solve that with some capacitors later.
  • MarkCrCoMarkCrCo Posts: 89
    edited 2014-05-12 19:11
    I still don't know what it was. I got frustrated and gave up. I disconnected everything from pin 14. Loaded his floor cleaning program back in and sent him off to clean floors. That worked fine so I decided to plug the HB-25 assembly back in and give it another test with the test program. It works fine the motor ramps up and down and the servo on pin 15 does nothing. I guess he was just a bad robot and needed to go sweep the floors for a while as his punishment.
  • xanaduxanadu Posts: 3,347
    edited 2014-05-12 20:48
    Glad to hear it's working, nothing a little time out to think about what it was doing wouldn't solve lol.
Sign In or Register to comment.