Shop OBEX P1 Docs P2 Docs Learn Events
HB-25 and BS2 — Parallax Forums

HB-25 and BS2

Pale_FlyerPale_Flyer Posts: 11
edited 2010-05-24 18:41 in BASIC Stamp
i am trying to use a SumoBot board with BS2 that i have lying around to control three motors.· I know i need to have an HB-25 per motor, and i do, but i can not get the HB-25 to drive the motor.· i am running it off a 7.2v Ni-MH battery pack.· i have been trying the demo program, with two diffrent pwm cables, two diffrent motors (both work direct off batt.) and two of the three HB-25's.· I have even tried modifying the code, but it just wont drive the motor!· it is for a class project, and i need to get it to work soon!!!!!· the fuse is good, and the green LED is bright.· but the red (Fault) LED is just lit, almost looks like spill off from a circuit.· But BOTH HB-25's have it, and they are brand new.· When i have them connected to power the cooling fane spins.

Comments

  • Let's Go!Let's Go! Posts: 124
    edited 2010-05-09 12:29
    If your connections are correct, i would check out the motor specs, and if the voltage is ok on them regarding your supply of 7.2, then i would go to a 12 volt battery to drive the hb25 and motors.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The smarter I get, the more I understand I don't know!
  • Pale_FlyerPale_Flyer Posts: 11
    edited 2010-05-09 13:13
    Thanks for the reply, but I got the 7.2v batt for the motors, and I know it is in range for the HB-25's. I think I might have the wrong port selected in the program, I think I'm reading the silkscreen print wrong, been awile since I messed with a SumoBot, and much longer since I messed with connections.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2010-05-11 22:19
    Can you post some kind of picture of how you have things wired up?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Engineering
    ·
  • Pale_FlyerPale_Flyer Posts: 11
    edited 2010-05-16 17:39
    i figured out that the sumo bot board was no longer able to output a servo pulse, it was old, beat up... so i am now using a BOE-Bot board, which has a REV G BS2 module. it runs the HB-25's perfectly. i am trying to make an autonomous hovercraft, with the 2 HB-25's running ducted fan motors to inflate a skirt i still need to design, and a LISY300 gyro module for spin correction. i have the gyro running a servo, but it will only spin one direction. it is a Hitec HS-322HD. it will go one direction, and then return to center, but not both directions. i am also trying to use an infrared headlight set up for object detection. i have the gyro coded to only run when there are no detects, but the servo is not cooperating. I don't know if the gyro is interfering with the servo, commands from the ir set up, but i have been trying to get the servo controlled for the last week, and it just wont work. this is the code i have been trying. i also have the range finding in there to determine the best course of action based on distance to obsacle, but have also tried with out, i think i have the servo coded wrong since it is a 180 degree. the servo is going to be mounted to my base, and a third fan mounted to it. with a third HB-25 controlling it.

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

    '
    [noparse][[/noparse] I/O Definitions ]

    Dout PIN 0 ' P0 <-- Dout (LISY300.2)
    SCLK PIN 1 ' P1 --> SCLK (LISY300.4)
    CSn PIN 2 ' P2 --> /CS (LISY300.5)


    '
    [noparse][[/noparse] Constants ]

    Yes CON 1 ' Yes Constant
    No CON 0 ' No Constant
    Kpl CON -35
    Kpr CON 35
    SetPoint CON 2
    CenterPulse CON 750


    '
    [noparse][[/noparse] Variables ]

    value VAR Word ' ADC Result Value
    freqSelect VAR Nib
    irFrequency VAR Word
    irDetectLeft VAR Bit
    irDetectRight VAR Bit
    distanceLeft VAR Nib
    distanceRight VAR Nib
    pulseleft VAR Word


    '
    [noparse][[/noparse] Initialization ]

    Initialization:
    HIGH CSn
    LOW SCLK
    PAUSE 250


    '
    [noparse][[/noparse] Program Code ]

    Main:
    DO
    IF (irdetectleft=1) & (irdetectright=1) THEN
    DO
    GOSUB Get_Ir_Distances
    pulseleft = 750
    GOSUB Send_Pulse
    LOOP
    ELSEIF (irdetectleft=1) THEN 'something left
    pulseleft = 650
    ELSEIF (irdetectright=1) THEN 'something right
    pulseleft = 850
    ELSE
    GOSUB Read_Gyro
    IF value < 505 THEN ' gyro control servo
    PULSOUT 15, (value) - 750
    ELSEIF value > 520 THEN
    PULSOUT 15, (value - 511) + 750
    ELSE
    PULSOUT 15, 750
    ENDIF

    ENDIF
    LOOP





    '
    [noparse][[/noparse] Subroutines ]

    Read_Gyro:
    LOW CSn
    SHIFTIN Dout, SCLK, MSBPOST, [noparse][[/noparse]value\13]
    HIGH CSn
    RETURN

    '
    [noparse][[/noparse] Subroutine - Get IR Distances ]
    Get_Ir_Distances:
    distanceLeft = 0
    distanceRight = 0
    FOR freqSelect = 0 TO 4
    LOOKUP freqSelect,[noparse][[/noparse]37500,38250,39500,40500,41500], irFrequency
    FREQOUT 8,1,irFrequency
    irDetectLeft = IN9
    distanceLeft = distanceLeft + irDetectLeft
    FREQOUT 4,1,irFrequency
    irDetectRight = IN3
    distanceRight = distanceRight + irDetectRight
    NEXT
    RETURN
    '
    [noparse][[/noparse] Subroutine – Get Pulse ]
    Send_Pulse:
    PULSOUT 15, pulseLeft
    PAUSE 5
    RETURN
  • logan996logan996 Posts: 281
    edited 2010-05-16 23:34
    you should buy this http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/motor/List/0/SortField/4/ProductID/491/Default.aspx you control it by a 1 pin serial, it is harder thatn PWM but it s easier in that the chip can control 2 motors and the chip is not even 1 in long, you can buy 2 for the same price as one HB-25 and control 4 motors at 127 differnt speeds, you can also make a really simple DB9 serial plug to control the chip directly from your pc, i think you can even send the serial bits using the Parallax serial terminal. (correct me if i am wrong)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "WOAH! that wasn't supposed to happen!"
  • logan996logan996 Posts: 281
    edited 2010-05-16 23:35
    oops sorry read the pdf at the bottom of the page too! http://www.parallax.com/Portals/0/Downloads/docs/prod/motors/plolumtorcontr.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "WOAH! that wasn't supposed to happen!"
  • Pale_FlyerPale_Flyer Posts: 11
    edited 2010-05-17 18:17
    I already have the HB-25's, and i actually want the individual motor control since my fans are not exactly the same thrust.· i dont have the issue with the motor controllers.· i am trying to have a servo act as steering, because i am going to mount the third fan to the servo horn, and use the servo/fan assembly as my steering/thrust system.· my issue is that the gyro appears to be overriding the ir system.· the code i posted yesterday was what i have so far.· i am willing to lose the distance detection, but not object detection.
  • Pale_FlyerPale_Flyer Posts: 11
    edited 2010-05-17 19:25
    realized i forgot the FREQOUT command for the ir system, and have dumped the distance detection.· i think everything is goodconfused.gif· but check back in a couple days after i run a test to see if any other bugs came up please!turn.gif
  • Pale_FlyerPale_Flyer Posts: 11
    edited 2010-05-24 18:41
    I have the object detection work, but the gyro does not work at all.· the system appears to be making it throught the code, and i know it is wired right.· i may just need to check the null zone setting... it was too jittery as i coded it to ignore a 5-10 mv change.· it may be too much. but please check the code anyway incase i missed something
Sign In or Register to comment.