Shop OBEX P1 Docs P2 Docs Learn Events
hb25 control of speed, direction,and time — Parallax Forums

hb25 control of speed, direction,and time

Let's Go!Let's Go! Posts: 124
edited 2009-11-26 13:20 in BASIC Stamp
the direction and time of the hb25 is controlled with the for index...next command and the pulsout hb25, 750 (+ or -) index. but how does one control the run·time·w/o affecting the speed?

i.e. how would you command the hb25 to operate the motor slowly, but for a predictable long period of time?

the examples given include ramping up and down for smoother control.

e.g., the for index = 1 to 250 will bring the motor a fast speed and long run time, whereas 1 to 50 will operate the motor slowly, but only for a short time.

thanks for your thoughts

































































































































▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The smarter I get, the more I understand I don't know!

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2009-11-25 14:50
    Generally, you would adjust the speed and watch the time in two separate subroutines.

    Attach the code you've tried and you'll get more concrete suggestions.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • Let's Go!Let's Go! Posts: 124
    edited 2009-11-26 11:17
    tom, here is a snippet of the hb25 code. thanks




    PAUSE 20
    FOR index = 0 TO 50····· 'ramp up,do this routine until pin 3 goes high, 2" per move
    PULSOUT turntable, 750 - index······· 'R to Left, reverse index, short moves
    PAUSE 20
    NEXT
    PAUSE 20
    FOR index = 50 TO 0········ 'ramp down, then make pin 3 decision below
    PULSOUT turntable, 750 - index
    PAUSE 20
    NEXT
    DEBUG ? IN3····· 'will indicate 0 or 1 on pin 3, must run to get debug screen
    IF (IN3 = 1) THEN GOSUB reset·· 'after above routine, if pin 3 = 1 then goto reset:
    DEBUG ? IN3
    PAUSE 30
    ·GOTO main············· 'otherwise goto main and move tt another 2" to position tt


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The smarter I get, the more I understand I don't know!
  • stamptrolstamptrol Posts: 1,731
    edited 2009-11-26 12:56
    So, turn to the left; turn to the right; if p3 is active then reset. Otherwise, go back to the beginning.

    Judging from the PAUSE length this will repeat every couple of seconds.

    Don't quite see where:
    "e.g., the for index = 1 to 250 will bring the motor a fast speed and long run time, whereas 1 to 50 will operate the motor slowly, but only for a short time."

    What's p3?, what does reset do? is this code "main"? How are you measuring the 2"?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • Let's Go!Let's Go! Posts: 124
    edited 2009-11-26 13:20
    tom, i found the answer to my question on page 139 of the robotics with the boe bot manual. the answer is to maintain a certain speed the code is as follows:

    'continue forward for 200 pulses at same speed

    for pulscount = 1 to 200··· 'sends 200 pulses

    pulsout 13, 770·· '200 pulses at "slow" speed, vs 850 which is near·"fastest" speed

    pause 20

    next



    thanks for your time

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The smarter I get, the more I understand I don't know!
Sign In or Register to comment.