Shop OBEX P1 Docs P2 Docs Learn Events
BS2 BOE Walker — Parallax Forums

BS2 BOE Walker

Carol HazlettCarol Hazlett Posts: 312
edited 2012-12-26 10:25 in Robotics
This is a basic walker based on the old Milford Instruments Stampbug from the early 1990's. It is built using the Minds-i building system (mymindsi.com) and a BOE. The BOE may be a bit of overkill but I have a stash of them so I used what was readily available. Here is the code for it:

' {$STAMP BS2}
' {$PBASIC 2.5}
' Program for Minds-i walking robot.  Designed and constructed by
' Carol Lynn Hazlett on Dec. 2, 2012.

' -----[ Variables ]----------------------------------------------------------

irDetectLeft       VAR  Bit          ' Variable to store IR detection value
irDetectRight      VAR  Bit          ' Variable to store IR detection value
counter            VAR  Word         ' Variable for walking speed counter
reps               VAR  Nib          ' Variable for repitions of steps

' -----[ Initialization ]-----------------------------------------------------

FREQOUT 4, 2000, 3000                ' Send pulse to piezo speaker

' -----[ Main Routine ]-------------------------------------------------------

DO
  FREQOUT 8, 1, 38500               ' Store IR detection values in
  irDetectLeft = IN9                ' bit variables.

  FREQOUT 2, 1, 38500               ' Store IR detection values in
  irDetectRight = IN0               ' bit variables

  IF (irDetectLeft = 0) AND (irDetectRight = 0) THEN ' Both detects
    HIGH 10                         ' Turn on left LED
    HIGH 1                          ' Turn on right LED
    GOSUB BackWalk                  ' Back up
    GOSUB LeftTurnBack              ' U-turn (left twice)
    GOSUB LeftTurnBack
  ELSEIF (irDetectLeft = 0) THEN    ' Left detects
    HIGH 10                         ' Turn on left LED
    GOSUB BackWalk                  ' Back up
    GOSUB LeftTurnBack              ' Turn left
  ELSEIF (irDetectRight = 0) THEN   ' Right detects
    HIGH 1                          ' Turn on right LED
    GOSUB BackWalk                  ' Back up
    GOSUB RightTurnBack             ' Turn right
  ELSE                              ' None detect
    LOW 10                          ' Turn off left LED
    LOW 1                           ' Turn off right LED
    GOSUB ForwardWalk               ' Walk forward
  ENDIF                             ' and check again
LOOP

'-----[Subroutines]------------------------------------------------------

BackWalk:
FOR reps = 1 TO 5                   ' Repeats steps 5 times
  FOR counter=1 TO 20               ' Determines speed of walk
    PULSOUT 14, 850                 ' Left side of middle leg goes down
    PULSOUT 13, 1100                ' Right legs swing forward
    PULSOUT 12, 1000                ' Left legs swing backward
    PAUSE 20                        ' Pause for servo signal
  NEXT

  FOR counter=1 TO 20               ' Determines speed of walk
    PULSOUT 14, 700                 ' Right side of middle leg swings down
    PULSOUT 13, 450                 ' Right legs swing backwards
    PULSOUT 12, 400                 ' Left legs swing forward
    PAUSE 20                        ' Pause for servo signal
   NEXT
NEXT
RETURN

LeftTurnBack:
FOR reps = 1 TO 12                  ' How many times steps repeat
  FOR counter=1 TO 20               ' Determines the speed of walk
    PULSOUT 14, 700                 ' Left side of middle leg goes down
    PULSOUT 12, 1000                ' Left legs swing backwards
    PAUSE 20
  NEXT

  FOR counter=1 TO 20               ' Determines speed of walk
    PULSOUT 12, 400                 ' Left leg swings forward
    PAUSE 20                        ' Pause for servo signal
   NEXT
NEXT
RETURN

RightTurnBack:
FOR reps = 1 TO 12                  ' Number of times step repeats
  FOR counter=1 TO 20               ' Determines speed of walk
    PULSOUT 14, 850                 ' Right side of middle legs goes down
    PULSOUT 13, 450                 ' Right legs swing backwards
    PAUSE 20                        ' Pause for servo signal
  NEXT

  FOR counter=1 TO 20               ' Determines speed of walk
    PULSOUT 13, 1100                ' Right legs swing forward
    PAUSE 20                        ' Pause for servo signal
   NEXT
NEXT
RETURN

ForwardWalk:
FOR counter = 1 TO 20               ' Determines speed of walk
  PULSOUT 14, 700                   ' Right side of middle leg goes down
  PULSOUT 13, 1100                  ' Right legs swing forward
  PULSOUT 12, 1000                  ' Left legs swing backwards
  PAUSE 20                          ' Pause for servo signal
NEXT

FOR counter = 1 TO 20               ' Determines speed of walk
  PULSOUT 14, 850                   ' Left side of middle leg goes down
  PULSOUT 13, 450                   ' Right leg swings backwards
  PULSOUT 12, 400                   ' Left leg swings forward
  PAUSE 20                          ' Pause for servo signal
NEXT
RETURN

You can see videos of this project on facebook.com/Robothon or facebook.com/CarolLynnHazlett.
100_0295.jpg
100_0300.jpg
1024 x 768 - 93K
1024 x 768 - 92K

Comments

  • Martin_HMartin_H Posts: 4,051
    edited 2012-12-20 06:20
    I've been meaning to build a three servo hexapod for years now, so congratulations on getting one done. The Minds-i system looks similar to Lego Technic. Is it about the same size and hole spacing?
  • Carol HazlettCarol Hazlett Posts: 312
    edited 2012-12-20 20:24
    No, it is much bigger than Legos and is made of polycarbonites so it is also much stronger. The studs used to lock the beams together, actually lock in place so the final construct is very sturdy. These are strong enough that many people build RC vehicles with them.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-12-26 10:25
    Wow these minds eye kits are ALOT, 419 for a four wheel drive set up!! Its a shame these look like a really good way to quickly build all kinds of bots. I saw they have a basic builders kit for 75 bucks, im wondering if that has enough parts in it to build a nice bot.

    Id like to see a video of this, looks like a neat little bot!
Sign In or Register to comment.