HB-25
ericbong84
Posts: 9
Hi, everyone
I'm eric from malaysia. I have just bought 2 HB-25 motor drivers but i have encountered some problem with it. I might need some help·from the members·help on this.
·I have tested out both·of them using my BS2p40. As for the code, i just copy paste it from the HB-25 Motor Controller (#29144) pdf for the test run. The result is that HB-25 (no.1) can only response to forward rotation. It doesn't response to the rest of the code. Not only that, HB-25 (no.2) is not responding at all to the DC motor.
Both of the cooling fan of HB-25 are working fine and so is the green power LED.
Can anyone help me on this? Thank you.
Regards
Eric
I'm eric from malaysia. I have just bought 2 HB-25 motor drivers but i have encountered some problem with it. I might need some help·from the members·help on this.
·I have tested out both·of them using my BS2p40. As for the code, i just copy paste it from the HB-25 Motor Controller (#29144) pdf for the test run. The result is that HB-25 (no.1) can only response to forward rotation. It doesn't response to the rest of the code. Not only that, HB-25 (no.2) is not responding at all to the DC motor.
Both of the cooling fan of HB-25 are working fine and so is the green power LED.
Can anyone help me on this? Thank you.
Regards
Eric
Comments
You MUST include your code and how they are connected to the BS2 for us to help. Give it some more facts and I am sure someone here can help.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave W.
Here is a portion of how it should look for a BS2p
PULSOUT HB25, 1875 ' Stop Motor 1
FOR index = 0 TO 875 ' Ramp Up To Full Speed
PULSOUT HB25,· 1875 + index ' Motor 1 Forward
Jeff T.
' =========================================================================
' 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}
'
[noparse][[/noparse] 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.
'
[noparse][[/noparse] I/O Definitions ]
HB25 PIN 15 ' I/O Pin For HB-25
'
[noparse][[/noparse] Variables ]
index VAR Word ' Counter For Ramping
'
[noparse][[/noparse] 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
'
[noparse][[/noparse] 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
Thank you for your help on this.·It really helped me a lot.·It seems that BS2p has different resolution compared to the BS2. I have found some posting regarding this from this forum http://forums.parallax.com/forums/pr.aspx?f=10&m=130692
So, the·stop position should be PULSOUT HB25, 1875 rahter than 750. How about for the rotation of clockwise (500) and counterclockwise (1000)?
Just my assumption:
1000/0.8 = 1250 (clockwise)
2000/08 = 2500··(counterclockwise)
Thank you
Regards
Eric
Take a look at the PULSOUT command in the PBASIC Reference Manual, or the PBASIC Help File. In either place you will learn that the "time" argument supplied is in timer units (TU). The reason for this is that various models of the Stamp operate at different speeds. The value of the TU's for each of the Stamps is listed with the PULSOUT command. Mathematically, you can change from one model Stamp to the other thusly:
Old time parameter·············· X (new time parameter)
=
Old timer unit value··············· New timer unit value
I hope that unveils the mystery
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Involvement and committment can be best understood by looking at a plate of ham and eggs. The chicken was involved, but the pig was committed. ANON
Post Edited (Bruce Bates) : 9/7/2008 10:41:36 AM GMT
Thank you for the assistance. I have read the manual regarding the pulsout. A bit uncertain·for now·but i know what you mean. I will give it a try and see how it goes.
Regards
Eric
Full speed forward = 2.2 mS / Units of time = 0.0022 / 0.0000008 = 2750
Full speed reverse = 0.8 mS / Units of time = 0.0008 / 0.0000008 = 1000
Motor stop = 1.5 mS / Units of time = 0.0015 / 0.0000008 = 1875
There are 875 units of time either side of the midway point.
Jeff T.
I have tested out the code and everything seems working good now. Thanks to all of you helping me out on this. I apprieciate it. My sincere gratitude to you all.
Here's my main program
Main:
PAUSE 20
FOR index = 0 TO 625
PULSOUT HB25, 1875 + index
PAUSE 20
NEXT
PAUSE 5000
FOR index = 0 TO 500
PULSOUT HB25, 1875 - index
PAUSE 20
NEXT
STOP
Unfortunately, when i tested out the other HB-25 (no.2) there's a minor problem occuring. It was working normal but it doesn't stop rotating. It continue on and on. It is as if it doesn't execute the STOP command.
Regards
Eric
Once it gets a pulse, it doesn't need another one until the speed changes. There is a timeout mode in the HB-25 that can be enabled
(see the HB-25 documentation, page 5, for how to enable/disable it). It may have been enabled in one of your HB-25s and disabled
in the other one.
You can also put a PULSOUT statement just before the STOP that puts out a stop pulse (PULSOUT HB25,1875).
Thank you for pointing out timeout mode. I have enable it and that HB-25 is once again working nice.·The PULSOUT HB25, 1875 also works well too.
I apprieciate all the help i'm getting from this forum. Thank you very much, guys
This is just the beginning of my project. Might have to ask for·more pointers·from you guys in near future.
Take care,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Also, the protection circuits in the HB25 are for over temperature, over voltage, and over current.· If you exceeded the "over current", won't the fuse blow?
Thanks deno·
Pulse time can be anywhere from 0.8 ms to 2.2 ms. If the HB-25 receives a pulse outside of
this range, it will temporarily shut off the motor until it receives a valid pulse.
I don't know what the actual difference in speed would be , if any , between the 0.2mS of the extremities.
With regard to overcurrent protection I see the fuse as motor protection which can be sized at a smaller value than the HB25 rating, and I see the internal overcurrent protection as being for the HB25 itself, which being electronic would act faster than the fuse. These are only assumptions.
Jeff T.
Jeff,
·· Actually there wouldn't be any difference for the HB-25...The deviation is only there to allow for a margin in error of the output signal.· For example, what if your microcontroller sent .8mS instead of 1.0mS?· We don't want the HB-25 to shut down for a small degree of innacuracy.··Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering