60 likes | 162 Views
Distance Navigation. TEJ3M BOE-BOT. Preparation required. Make sure you have found the centre (stop) pulseout value (see page 70) and completed the table on page 81 YOU MUST ADJUST PULSEOUT VALUES DEPENDING ON YOUR CENTRE VALUES for each motor (12 and 13)
E N D
Distance Navigation TEJ3M BOE-BOT
Preparation required • Make sure you have found the centre (stop) pulseout value (see page 70) and completed the table on page 81 • YOU MUST ADJUST PULSEOUT VALUES DEPENDING ON YOUR CENTRE VALUES for each motor (12 and 13) • Complete the Assignment 2 sheet for the servo motors and table
Distance Navigation • Set up subroutines (pg 140-43) for each type of movement: • Turning 90 degrees subroutines (right, left) • Ramp up & ramp down, and measure travel distance for each • Make forward and reverse subroutines including ramp-up and ramp-down • Take 3 – 4 trials of forward and reverse with 10, 30, 60 loops and measure the distance. Calc the avg. inches/loop
Ramping Up – pg. 137(modified: “STEP 10”) ‘ This code shows how to accelerate (or ‘ decelerate) smoothly with a counted loop FOR pulseCount = 1 TO 100 STEP 10 PULSOUT 13, 750 + pulseCount PULSOUT 12, 750 - pulseCount PAUSE 20 NEXT
Forward Forward: Maxloops = (inches / inchesPerLoop) ‘ insert ramp-up here FOR counter = 1 TO maxloops PULSOUT 13, 850 ' Left servo full speed ccw. PULSOUT 12, 650 ' Right servo full speed cw. PAUSE 20 NEXT ‘insert ramp-down here Return
Main Program Maxloops VAR Word Inches VAR Word Inches = 7 GOSUB Forward GOSUB Right Inches = 5 GOSUB Forward