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

HB-25 Motor Controller Questions

Vern GranerVern Graner Posts: 337
edited 2009-04-01 18:31 in Robotics
I was looking for some insight on the HB-25 motor controllers I am trying to use in a project. I am having trouble getting the motor controller to respond properly to the instructions issued from the Basic Stamp. My setup is as follow:

A BS2p24
A Super Carrier board
A Parallax HB-25
A 12v Gearhead motor (not under load, just sitting on the desk)

I am using a 12v 1a "wall wart" to supply power to the HB25
I have a 12 volt gear head motor connected to the HB25
I have a 3 wire "WRB" jumper wire from the Super Carrier board to the HB-25
I have a second 7.5vdc "wall wart" adapter to power the super carrier board/BS2.

When I run the test code that comes with the HB25, The motor will move forward, then stop. It will not enter reverse. It will reliably go "forward" each time I download the code or press "reset" on the super carrier board.

Things I've tried:

-Replace the HB25 (I have two HB-25's) problem persists.
-Replaced the BS2P24 with a "plain" BS2, problem persists.
-Manually connect the gear motor to the 12v wall wart and motor runs fwd and reverse if I switch the wires (i.e. its not that the motor is restricted from turning in reverse)

Other things noticed:

The HB25 fan speed seems to change RPM on occasion (based on the pitch of the sound created by the fan). I haven't been able to associate the speed change with any actions from software.

Any ideas on how to troubleshoot this issue?

Vern

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Vern Graner CNE/CNA/SSE    | "If the network is down, then you're
Senior Systems Engineer    | obviously incompetent so why are we
Texas Information Services | paying you? Of course,if the network
http://www.txis.com        | is up, then we obviously don't need
Austin Office 512 328-8947 | you, so why are we paying you?" ©VLG

Comments

  • eyyYoeyyYo Posts: 14
    edited 2007-10-08 17:43
    Maybe your source code is wrong? I am not the person to ask about this, im just giving you a tip, so others can look at your source and solve the problem [noparse]:)[/noparse]
  • Vern GranerVern Graner Posts: 337
    edited 2007-10-08 22:16
    eyyYo said...
    Maybe your source code is wrong?

    Thanks for the response. [noparse]:)[/noparse] It could be, but I started with the "gold standard" by using the example source code provided by Parallax here:

    http://www.parallax.com/dl/src/prod/HB-25-SampleCode-V1.1.zip

    It's supposed to ramp the motor up to full forward, then ramp it back down to a stop. I adapted the source code, taking out the ramping loops and just sent the full commands like this:

    
    PULSOUT HB25, 500   ' Motor  STOP
    PAUSE 2000
    
    PULSOUT HB25, 750   ' Motor  Full Forward
    PAUSE 2000
    
    PULSOUT HB25, 500   ' Motor  STOP
    PAUSE 2000
    
    PULSOUT HB25, 1000   ' Motor  Full Reverse
    PAUSE 2000
    
    PULSOUT HB25, 500   ' Motor  STOP
    PAUSE 2000
    
    



    I get the "forward" motion, but no reverse..? confused.gif

    Vern

    Vern

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Vern Graner CNE/CNA/SSE    | "If the network is down, then you're
    Senior Systems Engineer    | obviously incompetent so why are we
    Texas Information Services | paying you? Of course,if the network
    http://www.txis.com        | is up, then we obviously don't need
    Austin Office 512 328-8947 | you, so why are we paying you?" ©VLG
    
    
  • D FaustD Faust Posts: 608
    edited 2007-10-08 22:28
    Isn't 750 stop, 500 one way, 1000 the other?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    LOOKDOWN ThisThread, [noparse][[/noparse]Your_?, My_?, Cool_Thing], looknum
    LOOKUP looknum, [noparse][[/noparse]1, 2, 3], subnum
    ON subnum GOTO Hope_this_helps, Thanks!, WOW!!
    END 
    
  • Vern GranerVern Graner Posts: 337
    edited 2007-10-08 22:39
    D Faust said...
    Isn't 750 stop, 500 one way, 1000 the other?

    blush.gif Sheesh. Yup, you're correct, they had the wrong values. smile.gif Ok, so I redid the code now it's this way:

    PULSOUT HB25, 750   ' Motor  STOP
    PAUSE 2000
    
    PULSOUT HB25, 1000   ' Motor  Full Forward
    PAUSE 2000
    
    PULSOUT HB25, 750   ' Motor  STOP
    PAUSE 2000
    
    PULSOUT HB25, 500   ' Motor  Full Reverse
    PAUSE 2000
    
    PULSOUT HB25, 750   ' Motor  STOP
    PAUSE 2000
    
    
    



    Just tested it again, and Unfortunately, though it starts and stops, it just won't go in reverse! Dang it this is frustrating. sad.gif

    Vern

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Vern Graner CNE/CNA/SSE    | "If the network is down, then you're
    Senior Systems Engineer    | obviously incompetent so why are we
    Texas Information Services | paying you? Of course,if the network
    http://www.txis.com        | is up, then we obviously don't need
    Austin Office 512 328-8947 | you, so why are we paying you?" ©VLG
    
    
  • D FaustD Faust Posts: 608
    edited 2007-10-08 22:50
    Do you have a way of measuring the direction of current flow?· Try making the pauses longer, mabey the motor needs more time to turn around.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    LOOKDOWN ThisThread, [noparse][[/noparse]Your_?, My_?, Cool_Thing], looknum
    LOOKUP looknum, [noparse][[/noparse]1, 2, 3], subnum
    ON subnum GOTO Hope_this_helps, Thanks!, WOW!!
    END 
    
  • CrashmdcCrashmdc Posts: 8
    edited 2007-10-09 01:15
    Some silly questions...
    Your motors are reversible? (Not all are)
    You have it wired across the HB25, and not to ground?

    I have not used one of these, but that is all I can think of...
  • Tom CTom C Posts: 461
    edited 2007-10-09 01:48
    Vern,

    I have reviewed the BS2 code in the HB-25-Sample Code link that you gave and it clearly states the following:

    ······· STOP = 750

    ······· FULL FORWARD = 1000

    ······· FULL REVERSE = 500

    You must have misread the code when you created your STOP, FORWARD, REVERSE code.

    One thing I did notice is that your code does not allow for initialization of the HB-25 as is shown in the HB-25-Sample Code link before you begin sending pulses to the HB-25.

    Are you showing all of your code or did you just leave out the initialization portion for the HB-25?

    Just a thought.

    Regards,

    TCIII

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If you are going to send·a Robot·to save the world, you·better make sure it likes it the way it is!
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2007-10-09 16:51
    This may or may not be important, but I've learned the hard way.

    Check the 12v wall wart to be sure it isn't providing more than 12VDC. Some do and some don't. You cannot really rely on the lable.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Everything in the world is purchased by labour; and our passions are the only causes of labor." -- David·Hume (1711-76)········
    ···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • LarryLarry Posts: 212
    edited 2007-10-09 17:11
    Not only can a wart provide the wrong voltage, but I've run across ones that put out AC when the label says DC, and ones that provide power on the black wire instead of the red.

    I just finished a project where I had to go through 5 wall warts from scrapped consumer devices before I found one that was putting out even remotely what the label said.
  • D FaustD Faust Posts: 608
    edited 2007-10-09 19:00
    What is the free spin current of the motor?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    LOOKDOWN ThisThread, [noparse][[/noparse]Your_?, My_?, Cool_Thing], looknum
    LOOKUP looknum, [noparse][[/noparse]1, 2, 3], subnum
    ON subnum GOTO Hope_this_helps, Thanks!, WOW!!
    END 
    
  • chance2222chance2222 Posts: 2
    edited 2007-10-10 02:15
    I have had the same trouble with bs2px. I believe it is a timing issue. Refer to the web-bsm-v2.2.pdf found in the downloads section, page 351 about the pulsout command. The sample code that comes with the hb-25 documentation is written for the regular BS2 stamp that has a timing duration of 2 micro seconds for the pulsout comand. The bs2p series of chips have a timing duration of .8 micro seconds. A 1.5mS pulse from the stamp to the HB25 will cause the motor to remain motionless. If you take 1.5ms and divide it by 2 micro seconds, you get 750; thus pulsout {pin}, 750. Since bs2p has a duration of .8 micro seconds (.8 e-6), take 1.5ms divided by .8 micro seconds and you will get 1875 as your motionless setting (through experimentation, I find 1850 works better.) I have found that pulsout {pin}, 1000 is the lowest I can go for reliable motion speed one direction, and pulsout {pin}, 2700 is the highest. Try these values in your program and they should work. Have fun.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-10-10 16:20
    Chance is correct…I have been going down this thread watching that in all examples posted by everyone the values are those for a BS2, but in your earlier post you’re using a BS2p24 and it’s timing is different, have a center pulse value of 1875 rather than 750. Once you plug in the right values everything should start working as expected. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • D FaustD Faust Posts: 608
    edited 2007-10-10 18:22
    blush.gifblush.gifblush.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    LOOKDOWN ThisThread, [noparse][[/noparse]Your_?, My_?, Cool_Thing], looknum
    LOOKUP looknum, [noparse][[/noparse]1, 2, 3], subnum
    ON subnum GOTO Hope_this_helps, Thanks!, WOW!!
    END 
    
  • skorpelaskorpela Posts: 3
    edited 2009-03-30 17:06
    I have a problem with my new HB-25. I use the example source code provided by Parallax here:

    http://www.parallax.com/dl/src/prod/HB-25-SampleCode-V1.1.zip

    I can't get no motion to the motors I have tested: wiper motor and a 80 mm computer fan. I'm using Anderson's Homebrew Basic Stamp 2 on a Protoboard. Other applications I have tested with this board work well. I have not destroyed the HB-25 with reverse power, the fan is running and the led is glowing green.

    http://www.phanderson.com/stamp/homebrew_protoboard.html

    Any hints for this "no action" problem?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-03-31 17:40
    Hello,

    An 80mm PC fan won’t work because these are not the right type of motor for the HB-25, which was designed to drive brushed DC motors. The fan is a brushless DC motor with its own internal controller. As for the wiper motor, can you please list a connection diagram as to how you have the HB-25 connected to the motor?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • skorpelaskorpela Posts: 3
    edited 2009-03-31 18:15
    There is only one way to connect the motor connectors to the wiper motor as it only has two electrical terminals wired to the motor. Other 3 terminals are not wired. The wiper motor comes from VW Golf (I don't know the year of manufacure of the car).
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-03-31 21:23
    Without the information requested I am unable to further help you. If you’d like to provide the power, motor and signal connections I can check that for possible wiring errors. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • skorpelaskorpela Posts: 3
    edited 2009-04-01 15:47
    I wrote: "I have not destroyed the HB-25 with reverse power, the fan is running and the led is glowing green. ". Now when I try to remember what I've done, one thing bothers me. Initially when testing with PC fan I didn't do any polarity errors with the power source. But I have to admit that with my test with the wiper motor I connected the first wire from HB-25 to car battery terminal supposed to be positive and when I after this tried to connect the other wire to the "negative" terminal, I saw some sparking at the terminal and I immediately withdrew the wire from contacting the terminal. Then I found that the first terminal really was negative. Could this brief reversed polarity really have "killed" the electronic circuits? This is important to know.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-04-01 18:31
    Yes, it could have damaged it. Reverse polarity will damage most electronic circuits...in your case you have the added advantage of >100A of current to help.· Contact our Tech Support Dept. as they may have other options for you.· Be sure to tell them what happened so they know.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
Sign In or Register to comment.