|
'__________________________________________________________________________
' BI-PED PROGRAM FOR STAMP1 ' de Regis CHEVREUIL version 1.1 'Septembre 1999 '__________________________________________________________________________ ' This robot use two servos, one connected to the body makes it slant 'to the right or left, thus raising the opposite feet. 'the second is connected to both legs, when the right feet goes forward 'the left goes backward, and vice versa. ' To walk one step forward, it needs to slant to one side to raise 'the opposite feet. To move this feet forward, slant to the other side ' and thus move the other feet which looks more like a penguin than 'a tyranausorus rex ! ' To turn, it needs to move the feet (one forward thus the other ' backward) while they are both on the ground so both feet slip and the 'robot turns. ' So far, it works well on flat and horizontal (!) ceramic floor or 'carpet. If you go for a holiday in Pisa (Italy) please don't bring it with 'you on your visit to the tower ! '__________________________________________________________________________ ' CONSTANTS : ' symbol av=0 'port servo legs symbol lat=1 'port servo body symbol sw=4 'port detection switches symbol eye=6 'port infra-red eye symbol so=7 'port buzzer piezo symbol led=3 'port led symbol latd=200 'max position lateral right symbol latg=75 'max position lateral left symbol lat0=133 'position lateral 0=straight symbol avg=90 'max position left leg forward(right back.) symbol avd=190 'max position right leg forward(left back.) symbol av0=140 'center legs symbol speed=4 'speed of body+legs movements symbol out=7 '__________________________________________________________________________ ' MAIN LOOP : main: gosub lr 'gosub lateral right loop gosub fl 'gosub left leg forward loop gosub test gosub ll 'gosub lateral left loop gosub fr 'gosub right leg forward loop gosub test 'gosub test loop (legs switches) 'THIS IS ONE FULL STEP FORWARD ! goto main '(test the switches after each movement 'forward of the feet) '_________________________________________________________________________ ' STRAIGHT POSITION LOOP l0: 'body straight position,do not mind legs !
'_________________________________________________________________________
lr:
'__________________________________________________________________________
ll: 'same as before for left
'__________________________________________________________________________
fr:
'same loop for right leg forward
return
fl:
'same loop for left leg forward
return
turnr: 'this is the loop for avoiding object
turnl: 'same as before for backward and left turn
'one switch on each feet is parallel to
|
Cliquez ici pour le plan des pièces du robot ! |
Dernière
modification :