Shop OBEX P1 Docs P2 Docs Learn Events
HB-25 Speed Control — Parallax Forums

HB-25 Speed Control

blakrapterblakrapter Posts: 38
edited 2007-07-15 23:43 in General Discussion
Hello everyone,

I am working with a HB-25 controller and am have having trouble controlling speed.· I need the controller to be able to run at full speed forward, ~1/2 speed forward, full reverse and ~1/2 speed reverse.· I am using a·BS2 to control the controller.· It is my understanding that·a pulse of 1000 is full speed ahead, 750 is stop, and 500 is full reverse.· My problem is I am getting only full forward and full reverse (I am just measuring voltage, I do not have a motor connected), reguardless of the pulse width I put in the code.· What am I missing?· My code is below:



'·· {$STAMP BS2}
'·· {$PBASIC 2.5}

'
[noparse][[/noparse] I/O Definitions ]
HB25··········· PIN···· 12············· ' I/O Pin For HB-25
'
[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
'Program Code
PAUSE 2000
MAIN:
· PULSOUT hb25, 1000···················· 'Run motor at full speed
· PAUSE 5000···························· 'Run at speed above for 5 sec
· PULSOUT hb25, 750····················· 'Turn motor off
· PAUSE 3000···························· 'Leave off for 3 sec
· PULSOUT hb25, 875····················· 'Turn motor on at ~1/2 speed
· PAUSE 5000···························· 'Run at speed above for 5 sec
GOTO MAIN······························· 'Repeat
STOP



THANKS!

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-07-15 22:23
    Hello, the code you posted isn't set up for reverse.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • blakrapterblakrapter Posts: 38
    edited 2007-07-15 22:30
    Chris,

    Thank you for the reply. I pulled out the reverse part and tried just reducing the forward speed (875 pulse). I have been able to make the controller ouput a reversed polarity max voltage, but it does this for pretty much any pulse value between 500 and 750. It outputs a max foward polarity for just about every voltage bewtween 750 and 1000. The only difference is when I get very close to 750, say 750-760.

    Is there not a linear relationship between speed and pulse? i.e., for 1/2 forward speed, is it [noparse][[/noparse]1000-750]/2+750=875? Or, for reverse 1/2 speed [noparse][[/noparse]500-750]/2+750=625?

    Thanks!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-07-15 22:33
    That totally depends on the motor...I have seen a few unique motors which do not run properly on the HB-25 although we have never had possesion of the motors to see why. My guess is it has something to do with the motor impedance or there is some circuitry within the motor that is interefereing with the 10 kHz PWM signal. Can you link a datasheet to the motor?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • blakrapterblakrapter Posts: 38
    edited 2007-07-15 22:38
    Chris,

    Thank you again for the reply. For the test I have run today, I do not have a motor attached, I am simply reading the voltage across the terminals of the controller. I am using a power supply (parallax supply to controller via EFX DC-16) that is supplying right at 15V. I expected the voltage to read ~7.5 when the pulse was set to 875 and ~-7.5 when set to 625.

    Does a motor NEED to be connected to see the voltage difference? If so, I'll need to power it differently because the board I am running it through isn't rated for high current.

    Thanks
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-07-15 23:00
    Okay, this clears things right up…The answer is yes…Without a load on the output you most likely won’t see anything on the lead that is being pulsed. The output is an H-Bridge…You might better look at it as if an open collector output. One line will be high, while the other will be pulsing at a given duty cycle low. When polarity is reversed this all changes…The pin that was high (M1 or M2) is now being pulsed low while the other pin is now high. As I said, no motor no signal, but you could try this…Place a 1K resistor across the M1/M2 outputs and measure again. Remember that the outputs are running at almost 10 kHz, so use a scope. Also, remember to measure each output in relation to ground, not the other terminal. I hope this helps. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • blakrapterblakrapter Posts: 38
    edited 2007-07-15 23:43
    Chris,

    That worked beautifully. The controller is working as I expected.

    Thanks!
Sign In or Register to comment.