Shop OBEX P1 Docs P2 Docs Learn Events
How to turn off the Boe Bot after 90 secs? — Parallax Forums

How to turn off the Boe Bot after 90 secs?

ChristjChristj Posts: 13
edited 2007-03-29 12:53 in Robotics
Any idea, how to stop the Boe Bot after it moves randomly 90 seconds?

Thanks in advanced.

Best Regards,

--chris

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-03-25 11:49
    So, you have some "random" routine to run through·inside a Loop, say, and that takes·some given time to execute.· You time it once and then program it to repeat so that it's running for 90 seconds (e.g. once through = 5 seconds, then repeat it 18 times)·--

    FOR X = 0 TO 17
    GOSUB Dry_Run
    END
     
    Dry_Run:
     'the random movement subroutine program
     RETURN
    
  • Skywalker49Skywalker49 Posts: 172
    edited 2007-03-25 15:48
    Intersting, what to do if the Dry_Run routine has not a fixed length in time which will be the case I assume?

    Thx,
    Ed
  • DiablodeMorteDiablodeMorte Posts: 238
    edited 2007-03-25 16:43
    I would probably go use some type of time chip. Check the seconds every few seconds and if it's > 80 seconds since he start shutdown
  • Skywalker49Skywalker49 Posts: 172
    edited 2007-03-26 14:37
    Sounds like a good idea .. or what was mentioned in another thread, use a 555.

    Check this out:
    http://forums.parallax.com/forums/default.aspx?f=5&m=180588
  • rokickirokicki Posts: 1,000
    edited 2007-03-28 23:31
    Because the moters need to be pulsed at 20ms (50 times a second), just increment a counter every time you send
    out a pulsout command. After 4500 increments, you can power off.
  • DiablodeMorteDiablodeMorte Posts: 238
    edited 2007-03-29 03:52
    Also, if you are truly dependent on shutdown @ 90seconds(I'm assuming this is for a competition where they disqualify you if you run over) make the first action set the ALARM time on a time keeping chip(Pocket Watch B or that new shiny Dallas time chip) and make it so the ALARM pin triggers a relay which physically cuts power to the bot.
  • Skywalker49Skywalker49 Posts: 172
    edited 2007-03-29 12:53
    rokicki said...
    Because the moters need to be pulsed at 20ms (50 times a second), just increment a counter every time you send
    out a pulsout command. After 4500 increments, you can power off.
    My experience with timing based on loops with PAUSE xx is that the overhead of even a small loop
    (IF THEN) is already 1-2 ms. So depending on what the robot is doing - remember, it's a random process -
    the loop·cycle time·will vary or even vary a lot.

    I think that reasonable timing can not be done without an RTC or a 555 as described in
    the thread I mentioned earlier.

    have a nice day
    Ed
Sign In or Register to comment.