HB25 motor controller help
i am currently in the proses of building a robot with 2 HB25 motor controllers and i have a few questions.
1. i was looking at the example code and it had some sort of a "Initialization". Is this Necessary?
2. Do i need DO's and LOOP's, like a servo?
3. how should i start my robot? turn on the HB25's or the BOE first?
4. i'm a little confused where to put the "PAUSE 20/PAUSE 20's" in my code
5. when i have both motor's spinning and i turn the BOE off before the HB25's one of the motor's continues to spin. Why dose this happen?
Thanks,
Miles
P.S. this is for the 8th grade science fair.
1. i was looking at the example code and it had some sort of a "Initialization". Is this Necessary?
2. Do i need DO's and LOOP's, like a servo?
3. how should i start my robot? turn on the HB25's or the BOE first?
4. i'm a little confused where to put the "PAUSE 20/PAUSE 20's" in my code
5. when i have both motor's spinning and i turn the BOE off before the HB25's one of the motor's continues to spin. Why dose this happen?
Thanks,
Miles
P.S. this is for the 8th grade science fair.
Comments
1) The initialization is absolutely necessary.
2) The Do/LOOP structure is a general programming entity and is simply convenient to use with the HB-25 initialization. DO/LOOP has nothing, per se, to do with servos.
3) Bring up the microcontroller FIRST. After that, I always brought up the 12 volt system that powered the HB-25s and motors. Then, initialize the HB-25s as mentioned above.
4) After every command sent to an HB-25, you MUST pause a certain length of time for the command to be recognized by the HB-25. I always used PAUSE 20, but I think even shorter times will work. The PAUSE x comments are in reference to the BS2 environment. Faster processors will have different PAUSE x requirements.
5) When you turn the microcontroller off prior to the HB-25, you leave the HB-25 in "limbo." Always shut down the HB-25 and then the microcontroller.
Good luck on your project.
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
3. It helps if you have two switches: one for the uC and one for the HB-25. If you turn them on simultaneously or the HB25 before the uC then it will receive a pulse on it's pin, interpret that as a command, and rush off (not what you want).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Powered by enthusiasm
What SRLM·said is correct. I use a solid state relay (SSR)·which the microcontroller activates after the microcontroller comes up. The SSR then brings up power to the HB-25s.
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
I would like to do that. Could you please show me how to connect the SSR to the MCU? I have 2 HB-25s in a tank that I am working on,
and presently I turn on the power to the motors manually. This is a neat way to do it. I guess I would need some resistor (10k ?) or something besides the SSR.
Thanks, John
The SSR I used does not require a resistor . . . it is built in (as far as I know). Mike Green recommended the part to me long ago. It is DIRT SIMPLE to use. I bought it from Futurlec. The part number is SSRDC100VDA.
I just looked it up. When I bought one a few years ago, it was $19.90. Today, it is $21.90. To gain the functionality I needed, I would have paid much more. Let me know if you need pictures.
Good luck!
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
Thanks for the fast response. I'll check Futurlec and see how they recommend connectivity. If I need anything else I'll let you know.
Thanks again for your willingness to help.
John
I have NO CLUE what kind of tech support Futurlec may offer. Maybe it is the best in the world. Just in case it is not the best in the world, here is how I hooked that baby up . . .
The terminal marked 2+ runs straight to the positive terminal of my dual 12v lead acid battery pack. The terminal marked·-1 supplies power to the white distribution block on the left. (As you can see, there is only a single wire hooked to the white terminal block. It runs to the two HB-25s.) The terminal marked -4·is connected·to ground. The terminal marked·3+ (well, I guess you can't actually see the label because it is hidden by a wire: trust me) goes directly (no resistor) to PIN n on a Stamp. (In my case, a BS2p40.)
You turn the SSR on by raising PIN n. You turn the SSR off by lowering PIN n. The simplest case might look like this assuming n is actually pin 1 . . .
HIGH 1··· ' This turns the SSR on
'do as much·stuff as you want
LOW 1··· ' This turns the SSR off
You might add a little pause after the HIGH and LOW statements. Maybe PAUSE 1. I don't think I ever PAUSEd, though.
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
Thank you very much for sharing the diagram. I checked out Futurec, and like you said, they do not offer much of assistance.
I will play a little with what you suggested.
Thanks, John