Applied Robotics with the SumoBot Student Guide VERSION 1.0
Page vi · Applied Robotics with the SumoBot SPECIAL CONTRIBUTORS Parallax Inc. would like to recognize the Education Team members who made this book
Page 96· Applied Robotics with the SumoBot Figure 3-8 Front Left and Right QTI Schematics Each QTI has four components mounted on its PCB, a 220 Ω
Chapter 3: EEPROM Tricks and Program Tips · Page 97 The QRD1114 has an IRLED in it that shines IR light on the surface it's facing. Unlike the I
Page 98· Applied Robotics with the SumoBot uses RCTIME to measure and store the time it took for V0 to decay to 1.4 V in a variable named temp: HIGH
Chapter 3: EEPROM Tricks and Program Tips · Page 99 Figure 3-11 QTI RC-Decay for Different Surfaces If there is no surface to reflect IR from the QT
Page 100· Applied Robotics with the SumoBot Figure 3-12 White Tawara vs. Black Sumo Ring Surface Example Program - TestFrontQtiLineSensors.bs2
Chapter 3: EEPROM Tricks and Program Tips · Page 101 ' {$STAMP BS2} ' Target = BASIC Stamp 2 ' {$PBASIC 2
Page 102· Applied Robotics with the SumoBot Your Turn - Detecting Tilt What if the QTIs were to give you a unique signature when the SumoBot is tilte
Chapter 3: EEPROM Tricks and Program Tips · Page 103 should measure the QTI readings for the black surface and use them as a basis for setting a thres
Page 104· Applied Robotics with the SumoBot Figure 3-13 White Tawara vs. Black Sumo Ring Surface
Chapter 3: EEPROM Tricks and Program Tips · Page 105 ' {$STAMP BS2} ' Target = BASIC Stamp 2 ' {$PBASIC
Chapter 1: Mechanical Adjustments · Page 7 Chapter #1: Mechanical Adjustments BEFORE YOU GET STARTED To complete the activities in this book, you wil
Page 106· Applied Robotics with the SumoBot DEBUG "Black" ENDIF PAUSE 100 ' Delay for slower
Chapter 3: EEPROM Tricks and Program Tips · Page 107 √ Save and then run the modified program, starting with both QTIs over a black portion of the p
Page 108· Applied Robotics with the SumoBot With some creative programming, you can actually check as many QTIs as you want, and it will only a frac
Chapter 3: EEPROM Tricks and Program Tips · Page 109 The code block below takes less time than an RCTIME command would over a black surface. It start
Page 110· Applied Robotics with the SumoBot Figure 3-15 Pulse-Decay Trick Timing Accounting for Command Execution Times Figure 3-15 shows the id
Chapter 3: EEPROM Tricks and Program Tips · Page 111 Example Program: QtiPulseTrickLeft.bs2 The QtiPulseTrickLeft.bs2 program verifies that this techn
Page 112· Applied Robotics with the SumoBot Your Turn - Incorporating the Right QTI Here's the interesting part, you can add another QTI measure
Chapter 3: EEPROM Tricks and Program Tips · Page 113 Incorporating the Pulse-Decay Trick into Another Program Here is how to incorporate the test code
Page 114· Applied Robotics with the SumoBot Read_Line_Sensors: HIGH qtiPwrLeft ' Turn on QTIs HIGH qtiPwrRight HIGH
Chapter 3: EEPROM Tricks and Program Tips · Page 115 ' -----[ I/O Definitions ]--------------------------------------------------- qtiPwrLeft
Page 8· Applied Robotics with the SumoBot its opponent. The less friction, the more easily the SumoBot slips, which means it can no longer push as h
Page 116· Applied Robotics with the SumoBot LOOP ' -----[ Subroutine - Calibrate_Qtis ]---------------------------------------- Calibrate_Qti
Chapter 3: EEPROM Tricks and Program Tips · Page 117 Your Turn - Active High vs. Active Low At present, the alert for the SumoBot encountering the whi
Page 118· Applied Robotics with the SumoBot Figure 3-16 Sensors and Indicators Built on the Breadboard Building and Testing the Side-Mounted IR Obje
Chapter 3: EEPROM Tricks and Program Tips · Page 119 Figure 3-17 Side-mounted IR Object Detection Circuits Right Left Figure 3-18 Wiring Diagram
Page 120· Applied Robotics with the SumoBot You will see that TestSideIrObjectDetectors.bs2 is just a modified version of TestFrontIrObjectDetectors.
Chapter 3: EEPROM Tricks and Program Tips · Page 121 Example Program: TestSideIrObjectDetectors.bs2 ' -----[ Title ]-----------------------------
Page 122· Applied Robotics with the SumoBot Your Turn - Testing All Four Your SumoBot will eventually need to check and process information from all
Chapter 3: EEPROM Tricks and Program Tips · Page 123 √ Start by opening all of the following programs: o TestLedSpeaker.bs2 o TestPushButton.bs2 o
Page 124· Applied Robotics with the SumoBot has to be changed back to an input first. So, the Main Routine of TestPushButton.bs2 will not serve our
Chapter 3: EEPROM Tricks and Program Tips · Page 125 qtiPwrLeft PIN 10 ' Left QTI on/off pin P10 qtiSigLeft PIN
Chapter 1: Mechanical Adjustments · Page 9 Setting up the SumoBot Competition Ring Poster The SumoBot robot and SumoBot Robot Competition Ring poster
Page 126· Applied Robotics with the SumoBot ' -----[ Main Routine ]------------------------------------------------------- DO
Chapter 3: EEPROM Tricks and Program Tips · Page 127 HIGH qtiPwrLeft ' Turn on QTIs HIGH qtiPwrRight HIGH qtiSi
Page 128· Applied Robotics with the SumoBot Your Turn - Cleaning up Names These variable declaration names have some room for improvement: irLS
Chapter 3: EEPROM Tricks and Program Tips · Page 129 √ Repeat by using this feature to change qtiStateLeft to qtiLF. √ Some of the comments may now
Page 130· Applied Robotics with the SumoBot irLS VAR sensors.BIT3 ' State of Left Side IR irLF VAR sensors.BIT2
Chapter 3: EEPROM Tricks and Program Tips · Page 131 Figure 3-22 shows an example of how these modified routines display the contents of the sensors b
Page 132· Applied Robotics with the SumoBot √ In order from BIT0 to BIT6, test the sensors in this order: infrared object detectors - right side, ri
Chapter 3: EEPROM Tricks and Program Tips · Page 133 ' qtiThreshold VAR Word ' Stores black/white threshold temp VAR
Page 134· Applied Robotics with the SumoBot RCTIME qtiSigLeft, 1, temp ' <--- New measure charge time LOW qtiPwrLeft
Chapter 3: EEPROM Tricks and Program Tips · Page 135 ' PULSOUT DummyPin, qtiThreshold ' Wait for threshold time PULSOUT DummyPin, te
Page 10· Applied Robotics with the SumoBot Testing Plow Adjustments A simple program to make each SumoBot go forward should be used to test the plows
Page 136· Applied Robotics with the SumoBot IrLedRS PIN 3 ' Right IR LED connected to P3 IrSenseRS PIN 0
Chapter 3: EEPROM Tricks and Program Tips · Page 137 DO ' DO...LOOP repeats indefinitely GOSUB Read
Page 138· Applied Robotics with the SumoBot WRITE QtiThresh, Word multi ' <--- New threshold to EEPROM RETURN ' --
Chapter 3: EEPROM Tricks and Program Tips · Page 139 INPUT pbSense pushbutton = pbSense ' Store state of pbSense RE
Page 140· Applied Robotics with the SumoBot SUMMARY This chapter reviewed how the SumoBot's IR detectors work, then introduced basic IR detector
Chapter 3: EEPROM Tricks and Program Tips · Page 141 11. What factors should you keep in mind when selecting a frequency for a given SumoBot ring? 12
Page 142· Applied Robotics with the SumoBot Projects 1. Write a program that beeps at different notes to tell you which sensor it detects. 2. Place
Chapter 4: Navigation Tips · Page 143 Chapter #4: Navigation Tips Effectively using four object detectors and two QTI line sensors for SumoBot naviga
Page 144· Applied Robotics with the SumoBot ACTIVITY #1: SERVO CONTROL WITH LOOKUP COMMANDS Since all the other subroutines in this book have utilize
Chapter 4: Navigation Tips · Page 145 Figure 4-2 The Servo Control Loop The FOR...NEXT loop's EndValue is the number of 1/41 second increments
Chapter 1: Mechanical Adjustments · Page 11 √ Repeat five to ten times to be sure which SumoBot's plow adjustment has the advantage. √ Adjust t
Page 146· Applied Robotics with the SumoBot With some experimentation, you can also control the speed of the servos too. Note from Figure 4-3 that t
Chapter 4: Navigation Tips · Page 147 ' Applied Robotics with the SumoBot - ServoControlExample.bs2 ' {$STAMP BS2} ' {$PBASIC 2.5} co
Page 148· Applied Robotics with the SumoBot Your Turn - Using PIN Definitions and Constants Instead of the number 13 in the PULSOUT command's Pi
Chapter 4: Navigation Tips · Page 149 Let's take a second look at that LOOKUP command from Chapter 2, Activity #4. If counter is 0, the LOOKUP c
Page 150· Applied Robotics with the SumoBot √ Save the example program as LookupExampleYourTurn.bs2 √ Add these constant declarations with the CON
Chapter 4: Navigation Tips · Page 151 The servo control subroutine will send pulse values to the servos. Constants for full speed counterclockwise (
Page 152· Applied Robotics with the SumoBot Example Program: ServoControlWithLookup.bs2 √ Enter and save ServoControlWithLookup.bs2 √ Move the 3-po
Chapter 4: Navigation Tips · Page 153 NO_ROT CON 750 ' No rotation ' -----[ Variables ]----------------------
Page 154· Applied Robotics with the SumoBot Your Turn Here is a wider variety of maneuver constants along with extra servo pulse width rotation const
Chapter 4: Navigation Tips · Page 155 √ Modify the Pulse_Servos subroutine to accommodate the rest of the maneuvers in the SumoBot maneuver constants
Page 12· Applied Robotics with the SumoBot DEBUG "Main program running...", CR ' Display program status ' -----[ Main
Page 156· Applied Robotics with the SumoBot motion and the opponent collides with it at that moment, it will be at a disadvantage. If the SumoBots a
Chapter 4: Navigation Tips · Page 157 Figure 4-6 Nearby Opponent Seen by one IR object detector, but not for long if curving is the only method em
Page 158· Applied Robotics with the SumoBot way to ensure this is to keep a subroutine that's in charge of both sending pulses to the servos and
Chapter 4: Navigation Tips · Page 159 You can test this next example program by positioning the SumoBot so that neither of its IR object detectors see
Page 160· Applied Robotics with the SumoBot ' -----[ Title ]-------------------------------------------------------------- ' Applied Roboti
Chapter 4: Navigation Tips · Page 161 temp VAR Word ' Temporary variable counter VAR Byte
Page 162· Applied Robotics with the SumoBot RETURN ' -----[ Subroutine - Pulse_Servos ]------------------------------------------ Pulse_Ser
Chapter 4: Navigation Tips · Page 163 ELSEIF irLF = 1 THEN ' Just left? DO UNTIL (irLF = 1 AND irRF = 1) OR counter &
Page 164· Applied Robotics with the SumoBot GOSUB Servos_And_Sensors counter = counter + 1 LOOP ELSE
Chapter 4: Navigation Tips · Page 165 Figure 4-8 Peripheral Vision for Opponent Detection Responding to an Object Detection on the Side This code f
Chapter 1: Mechanical Adjustments · Page 13 an even number of times, including zero, the Reset_Button routine just displays the message prompting you
Page 166· Applied Robotics with the SumoBot Example Program: FrontAndSideIrNavigation.bs2 The beauty in terminating the rotate loop as soon as one of
Chapter 4: Navigation Tips · Page 167 IrLedLF PIN 4 ' Left IR LED connected to P4 IrSenseLF PIN 11
Page 168· Applied Robotics with the SumoBot IF irLF = 1 AND irRF = 1 THEN ' Both? maneuver = Forward &
Chapter 4: Navigation Tips · Page 169 sensors = 0 ' Clear previous sensor values GOSUB Read_Object_Detectors
Page 170· Applied Robotics with the SumoBot Your Turn - Limiting Rotation Unlike the front IR detectors, the loops for the side IR detectors do not
Chapter 4: Navigation Tips · Page 171 state machines". However, the term "state machine" is commonly used to refer to finite state mac
Page 172· Applied Robotics with the SumoBot that state while pbSense = 1, and the other that transitions to LED off when pbSesnse = 0. State diagra
Chapter 4: Navigation Tips · Page 173 Your Turn Figure 4-10 shows a modified version of the state machine diagram that involves a variable named count
Page 174· Applied Robotics with the SumoBot LOOP ELSEIF irRF = 1 THEN ' Just right? counter = 0
Chapter 4: Navigation Tips · Page 175 Figure 4-11 Hybrid State Machine Diagram √ Compare Figure 4-11 to the Main Routine from FrontIrNavigation.b
Page 14· Applied Robotics with the SumoBot Figure 1-4 SumoBot Servo Connections The instructions that make the SumoBot move forward starts with thes
Page 176· Applied Robotics with the SumoBot Your Turn - Drawing a State Machine Diagram √ Try drawing a hybrid state machine diagram for the Main Ro
Chapter 4: Navigation Tips · Page 177 ' -----[ Main Routine ]------------------------------------------------------- DO IF qtiLF = 1 THEN
Page 178· Applied Robotics with the SumoBot FOR counter = 1 TO 12 ' Look right maneuver = RotateRight GOSUB S
Chapter 4: Navigation Tips · Page 179 √ Press and hold the Reset button until you place it on the ring as shown in Figure 4-12. √ Let go of the Rese
Page 180· Applied Robotics with the SumoBot DummyPin PIN 6 ' I/O pin for pulse-decay P6 ' -----[ Constants
Chapter 4: Navigation Tips · Page 181 maneuver = Backward ' Back up GOSUB Servos_And_Sensors NEXT FOR coun
Page 182· Applied Robotics with the SumoBot LOW qtiPwrLeft ' Turn left QTI off multi = temp
Chapter 4: Navigation Tips · Page 183 ' Pause between pulses (remove when using IR object detectors + QTIs). PAUSE 20 RETURN ' ----
Page 184· Applied Robotics with the SumoBot Figure 4-13 Sample SumoBot Search Pattern This one is different because the SumoBot looks around bef
Chapter 4: Navigation Tips · Page 185 √ Add the GOTO Look_About command to the end of the Initialization routine. ' -----[ Initialization ]----
Chapter 1: Mechanical Adjustments · Page 15 Figure 1-5 Other Collision Paths One SumoBot can approach at an angle, or even with a curved
Page 186· Applied Robotics with the SumoBot ACTIVITY #6: FULLY FUNCTIONAL SUMO EXAMPLE PROGRAMS This activity features two fully functional SumoBot e
Chapter 4: Navigation Tips · Page 187 ' -----[ Title ]-------------------------------------------------------------- ' Applied Robotics with
Page 188· Applied Robotics with the SumoBot FS_CW CON 650 ' Full speed clockwise NO_ROT CON 750
Chapter 4: Navigation Tips · Page 189 NEXT ELSEIF qtiRF = 1 THEN ' Right QTI sees line? FOR counter = 1 TO 15
Page 190· Applied Robotics with the SumoBot IF sensors <> 0 THEN GOTO Next_State NEXT Look_About: &a
Chapter 4: Navigation Tips · Page 191 ' -----[ Subroutine - Calibrate_Qtis ]---------------------------------------- Calibrate_Qtis: HIGH qt
Page 192· Applied Robotics with the SumoBot ' Pulse to left servo LOOKUP maneuver, [ FS_CCW, FS_CW, FS_CW, FS_CCW, NO_
Chapter 4: Navigation Tips · Page 193 qtiLF = ~qtiSigLeft ' Snapshot of QTI signal states qtiRF = ~qtiSigRight LOW
Page 194· Applied Robotics with the SumoBot maneuver = Backward GOSUB Servos_And_Sensors NEXT FOR counter = 1 TO 15
Chapter 4: Navigation Tips · Page 195 closely matches the conditions for your competition ring, taking into account nearby objects, whether or not the
WARRANTY Parallax Inc. warrants its products against defects in materials and workmanship for a period of 90 days from receipt of product. If you d
Page 16· Applied Robotics with the SumoBot A notebook for your observations - keep notes on the various results you observe for developing wrestling
Page 196· Applied Robotics with the SumoBot IrSenseRS PIN 0 ' Right IR detector to P0 ' -----[ Constants ]---
Chapter 4: Navigation Tips · Page 197 GOSUB Reset ' Wait for Reset press/release GOSUB Start_Delay
Page 198· Applied Robotics with the SumoBot FOR counter = 1 TO 5 ' 5 beeps, 1/second PAUSE 900 FREQOUT LedSpeak
Chapter 4: Navigation Tips · Page 199 GOSUB Read_Line_Sensors ' Look for lines RETURN ' -----[ Subroutine - Pulse_S
Page 200· Applied Robotics with the SumoBot READ QtiThresh, Word temp ' Get threshold time INPUT qtiSigLeft
Chapter 4: Navigation Tips · Page 201 RETURN ' -----[ Subroutine - Track_Front_Left_Object ]------------------------------- Track_Front_Left
Page 202· Applied Robotics with the SumoBot Track_Side_Right_Object: DO UNTIL irRF = 1 OR irLF = 1 ' Rotate right maneuver
Chapter 4: Navigation Tips · Page 203 SUMMARY This chapter introduced a technique that uses the LOOKUP command for adapting servo control to use with
Page 204· Applied Robotics with the SumoBot 9. What combination of PULSOUT commands does it take to make the SumoBot execute a pivot-right turn? 10.
Chapter 4: Navigation Tips · Page 205 Projects 1. Hold some sumo matches, and make sure to draw cards from the list in Figure 4-7 between each round.
Chapter 1: Mechanical Adjustments · Page 17 Figure 1-6 Top Speed vs. Low Time As mentioned earlier, taking too much time between pulses to check sens
Page 206· Applied Robotics with the SumoBot
Chapter 5: Debugging and Datalogging · Page 207 Chapter #5: Debugging and Datalogging If the SumoBot exhibits a problem behavior in the ring, figurin
Page 208· Applied Robotics with the SumoBot Slow motion debugging leaves out one crucial element: the actual conditions the SumoBot experiences durin
Chapter 5: Debugging and Datalogging · Page 209 Before testing each of these questions, it's important to make a disposable copy of the SumoWrest
Page 210· Applied Robotics with the SumoBot √ Try it in the practice ring with the 3-position power switch set to 2. √ Start your test SumoBot wi
Chapter 5: Debugging and Datalogging · Page 211 GOSUB Servos_And_Sensors LOOP LOW LedSpeaker ' <--- Add
Page 212· Applied Robotics with the SumoBot √ Modify the main routine so that this bug is incorporated. ELSEIF irLS = 1 THEN
Chapter 5: Debugging and Datalogging · Page 213 itself that you have declared two symbols, LED_MODE, which has been set equal to one, and DEBUG_MODE,
Page 214· Applied Robotics with the SumoBot #SELECT DEBUG_MODE #CASE 0 DEBUG "DEBUG_MODE is zero." #CASE 1 DEBUG "DEBUG_M
Chapter 5: Debugging and Datalogging · Page 215 √ Enter, save, and run Compiler directives.bs2 and check the program's behavior against your pre
Page 18· Applied Robotics with the SumoBot With a couple modifications to Forward100Pulses.bs2 from Activity #1, you'll be ready to go. √ Save
Page 216· Applied Robotics with the SumoBot DO DEBUG CRSRX, 0, ? counter counter = counter + 1 #IF LED_MODE = 1 #THEN DEBUG "LED st
Chapter 5: Debugging and Datalogging · Page 217 performs. This kind of tool can be really helpful for isolating both program and circuit bugs. One i
Page 218· Applied Robotics with the SumoBot ' -----[ Variables ]---------------------------------------------------------- . . . #IF D
Chapter 5: Debugging and Datalogging · Page 219 . . ' -----[ Subroutine - Avoid_Tawara_Right ]------------------------------------ Avoid_T
Page 220· Applied Robotics with the SumoBot ENDSELECT DEBUG CRSRX, 20 ' Cursor to column 20 SELECT maneuv
Chapter 5: Debugging and Datalogging · Page 221 right sides (irLS and irRS) do not detect objects, because they store 0s. The same applies to the lef
Page 222· Applied Robotics with the SumoBot In the first row, none of the sensors see anything, the state is search pattern (SP), and the SumoBot is
Chapter 5: Debugging and Datalogging · Page 223 ServoLeft PIN 13 ' Left servo connected to P13 ServoRight PIN
Page 224· Applied Robotics with the SumoBot ' State constants. ATL CON 0 ' Avoid_Tawara_Left ATR
Chapter 5: Debugging and Datalogging · Page 225 ' -----[ Main Routine ]------------------------------------------------------- DO IF qtiLF =
Chapter 1: Mechanical Adjustments · Page 19 √ Compare the results of the two trials and determine which program gives the SumoBot better performance.
Page 226· Applied Robotics with the SumoBot RETURN ' -----[ Subroutine - Calibrate_Qtis ]---------------------------------------- Calibrate
Chapter 5: Debugging and Datalogging · Page 227 RETURN ' -----[ Subroutine - Pulse_Servos ]------------------------------------------ Pulse_
Page 228· Applied Robotics with the SumoBot INPUT qtiSigLeft ' Start the decays INPUT qtiSigRight PULSOUT Dumm
Chapter 5: Debugging and Datalogging · Page 229 #IF DEBUG_MODE = 1 #THEN state = GF #ENDIF maneuver = Forward ' 1 f
Page 230· Applied Robotics with the SumoBot #IF DEBUG_MODE = 1 #THEN state = TSLO #ENDIF DO UNTIL irRF = 1 OR irLF = 1 ' Rota
Chapter 5: Debugging and Datalogging · Page 231 GOSUB Servos_And_Sensors IF sensors <> 0 THEN GOTO Next_State NEXT Next_State:
Page 232· Applied Robotics with the SumoBot ENDSELECT DEBUG CR ' Carriage return for next line PAU
Chapter 5: Debugging and Datalogging · Page 233 √ Click Run -> Memory map again and compare how much EEPROM is used by the code that was added for
Page 234· Applied Robotics with the SumoBot #IF DEBUG_MODE = 1 OR DATALOG_MODE > 0 #THEN ' State constants. ATL CON 0
Chapter 5: Debugging and Datalogging · Page 235 Figure 5-4 Memory Map The highest EEPROM address not occupied by PBASIC program code is $257. An
Page 20· Applied Robotics with the SumoBot LOOP DEBUG "Press/release reset", CR, ' User instructions "twice to
Page 236· Applied Robotics with the SumoBot because we do not want to overwrite all the recorded records from the round the SumoBot just finished bef
Chapter 5: Debugging and Datalogging · Page 237 ' -----[ Subroutine - Servos_And_Sensors ]------------------------------------ Servos_And_Sensor
Page 238· Applied Robotics with the SumoBot #IF DATALOG_MODE = 2 #THEN Playback_Round: FOR logIndex = 0 TO MaxBytes STEP 2 ' Loop
Chapter 5: Debugging and Datalogging · Page 239 To display all the datalogged values when DATALOG_MODE = 2, the same Display_All subroutine from the p
Page 240· Applied Robotics with the SumoBot √ The SumoBot will log data as it competes for just under 10 seconds, then it stops. √ After the Sumo
Chapter 5: Debugging and Datalogging · Page 241 qtiPwrLeft PIN 10 ' Left QTI on/off pin P10 qtiSigLeft PIN 9
Page 242· Applied Robotics with the SumoBot GF CON 2 ' Go-Forward TFLO CON 3
Chapter 5: Debugging and Datalogging · Page 243 #ENDIF ' -----[ Initialization ]----------------------------------------------------- GOSUB Res
Page 244· Applied Robotics with the SumoBot sensors = temp.HIGHBYTE ' state = temp.NIB1 maneuver = temp.NIB0
Chapter 5: Debugging and Datalogging · Page 245 multi = temp ' Free temp for another RCTIME HIGH qtiPwrRight
Chapter 1: Mechanical Adjustments · Page 21 The distance traveled will not be exactly the same because the servos don't turn as fast with 40 ms p
Page 246· Applied Robotics with the SumoBot Pulse_Servos: ' Pulse to left servo LOOKUP maneuver, [ FS_CCW, FS_CW, FS_CW, FS_CCW,
Chapter 5: Debugging and Datalogging · Page 247 qtiLF = ~qtiSigLeft ' Snapshot of QTI signal states qtiRF = ~qtiSigRi
Page 248· Applied Robotics with the SumoBot RETURN ' -----[ Subroutine - Track_Front_Left_Object ]------------------------------- Track_Fro
Chapter 5: Debugging and Datalogging · Page 249 GOSUB Servos_And_Sensors LOOP RETURN ' -----[ Subroutine - Track_Side_Right_Object ]---
Page 250· Applied Robotics with the SumoBot RETURN ' -----[ Subroutine - Display_All ]------------------------------------------- #IF DEBUG
Chapter 5: Debugging and Datalogging · Page 251 PAUSE 200 ' Pause 0.2 seconds for reading #ELSE PAUS
Page 252· Applied Robotics with the SumoBot Displaying the sensors variable can help for quick trouble-shooting between rounds. The LCD Terminal App
Chapter 5: Debugging and Datalogging · Page 253 SUMMARY This chapter introduced three techniques to help find the cause(s) of SumoBot problem behavior
Page 254· Applied Robotics with the SumoBot 4. Modify SumoWrestlerWithDebugMode.bs2 so that it displays numbers next to each record. Projects 1. De
Appendix A: System Requirements and Parts Listing · Page 255 Appendix A: System Requirements and Parts Listing System and Software Requirements • PC
Page 22· Applied Robotics with the SumoBot √ Run the modified program. √ Repeat the 10 second measurement and record the servo speed. √ Keep incre
Page 256· Applied Robotics with the SumoBot Table A-1: SumoBot Robot Competition Kit (#27402) Parts and quantities subject to change without notice
Appendix A: System Requirements and Parts Listing · Page 257 Table A-2: For SumoBot Robots purchased separately Parts and quantities subject to change
Page 258· Applied Robotics with the SumoBot
Index - # - #. See conditional compile directives - $ - $. See hexadecimal, See compiler directives - . - .BIT operato
friction force, 31 friction forces, 26 frictional force diagram, 29 - G - gram, 23 gravity, 24 Guarantee, 2 - H - hardware requir
programs CompilerDirectives.bs2, 214 Forward100Pulses.bs2, 11 ForwardLowTimeTest.bs2, 18 FrontAndSideIrNavigation.bs2, 166 FrontIrNavigation.bs2, 159
Scientific Method, 208 SELECT...CASE, 66 self calibrating QTI sensors, 102 sensor flags, 143 servo connections, 13 servo control, 145 servo rotationa
Chapter 1: Mechanical Adjustments · Page 23 Scales that show both ounces and grams are not uncommon, likewise with scales that show both kilograms and
Page 24· Applied Robotics with the SumoBot Since weight is a force, and gravity is a form of acceleration, an equation you will find useful in your
Chapter 1: Mechanical Adjustments · Page 25 If you measure an object's mass to be a certain number of grams, converting to kilograms is a matter
DISCLAIMER OF LIABILITY Parallax Inc. is not responsible for special, incidental, or consequential damages resulting from any breach of warranty, or
Page 26· Applied Robotics with the SumoBot These unit conversions take some practice; here are some tips: √ Find the equality with your desired r
Chapter 1: Mechanical Adjustments · Page 27 Figure 1-8 also shows a close-up of the contact surfaces, where little components of the force you apply
Page 28· Applied Robotics with the SumoBot WN0WN0Fy==−=∑ N = W indicates that the normal force, N, is pushing back just as hard as the object&
Chapter 1: Mechanical Adjustments · Page 29 To appreciate how different the coefficients of friction can be for different pairs of materials, take a l
Page 30· Applied Robotics with the SumoBot Figure 1-10 Friction vs. Applied Forces Another Strategy Consideration Figure 1-9 shows that the Sumo
Chapter 1: Mechanical Adjustments · Page 31 Coefficients of friction do not have units. A friction force is always equal to the coefficient of frict
Page 32· Applied Robotics with the SumoBot Figure 1-12 Individual Free Body Diagrams Since we already know that T = T1, we now know that T = W1.
Chapter 1: Mechanical Adjustments · Page 33 Next, convert to the corresponding units of force (newtons): N86.6s/m8.9kg7.0fN58.20s/m8.9kg1.2NmgW2
Page 34· Applied Robotics with the SumoBot Problem: The coefficient of static friction for two surfaces is 0.1 (pretty slippery). How much force wil
Chapter 1: Mechanical Adjustments · Page 35 Don't worry if you don't happen to have a gram scale or pulley and attachment. Thanks to the po
Page 36· Applied Robotics with the SumoBot Figure 1-14 Friction Force Test When you have constructed this setup, follow these steps. √ Draw free
Chapter 1: Mechanical Adjustments · Page 37 √ Use your weights and the equations introduced in this activity to calculate the coefficients of static
Page 38· Applied Robotics with the SumoBot SUMMARY This chapter introduced a variety of mechanical adjustments you can make to the SumoBot. Adjustin
Chapter 1: Mechanical Adjustments · Page 39 10. What's the British Engineering unit of mass? 11. How does force relate to mass and acceleration
Page 40· Applied Robotics with the SumoBot 13. It takes 70 lbs of force to start a 100 lb object sliding along a level surface. Calculate the coeff
Chapter 2: EEPROM Tricks and Program Tips · Page 41 Chapter #2: EEPROM Tricks and Program Tips The BASIC Stamp's EEPROM is a great tool for stor
Page 42· Applied Robotics with the SumoBot As the SumoBot programs get larger and more complex, both good EEPROM management and strict adherence to
Chapter 2: EEPROM Tricks and Program Tips · Page 43 Figure 2-1 shows what the DATA directives will store in the EEPROM bytes with addresses 0 to 31.
Page 44· Applied Robotics with the SumoBot EEPROM stands for Electrically Erasable Reprogrammable Read Only Memory. EEPROM memory is nonvolatile. T
Chapter 2: EEPROM Tricks and Program Tips · Page 45 READ RunStatus, temp DEBUG DEC temp, CR DEBUG "Address of UndefData...", DEC Undef
Table of Contents · Page i Table of Contents Preface...
Page 46· Applied Robotics with the SumoBot the right by 161 = 16, then the third digit from the right by 162 = 256, and so on. Add up all the produc
Chapter 2: EEPROM Tricks and Program Tips · Page 47 √ Modify the RunStatus DATA directive like this: RunStatus DATA @10, Word 500 √ Modify the com
Page 48· Applied Robotics with the SumoBot READ EepromCounter, temp To make the program count the number of consecutive resets, simply add 1 to the
Chapter 2: EEPROM Tricks and Program Tips · Page 49 temp = temp + 1 WRITE EepromCounter, temp temp = temp - 1 IF temp = 0 THEN DEBUG "Since
Page 50· Applied Robotics with the SumoBot binary value from the right is accessed with .BIT1; the third binary value is accessed with .BIT2, and so
Chapter 2: EEPROM Tricks and Program Tips · Page 51 Figure 2-3 Debug Terminal Transmit and Receive Windowpanes Illustrating Many Jobs with a Few Vari
Page 52· Applied Robotics with the SumoBot DEBUG CR, "Enter up to 20 values", CR, "between 100 and 1000", CR, &
Chapter 2: EEPROM Tricks and Program Tips · Page 53 DEBUG CRSRX, 0, DEC5 temp, CRSRX, 12 IF temp > compare THEN DEBUG "greater t
Page 54· Applied Robotics with the SumoBot ' Get values and store them to EEPROM DEBUG CR, "Enter up to 20 values", CR, &
Chapter 2: EEPROM Tricks and Program Tips · Page 55 LOOP ENDIF DEBUG CR, "All done!" END ACTIVITY #3: PROGRAM ON/OFF WITH RESET It&apo
Page ii · Applied Robotics with the SumoBot ACTIVITY #3: Using Peripheral Vision...16
Page 56· Applied Robotics with the SumoBot temp is even, it displays "Program running..." and returns the program to initialization and onw
Chapter 2: EEPROM Tricks and Program Tips · Page 57 continues to the rest of the program. As you keep pressing the Reset button, the odd/even pattern
Page 58· Applied Robotics with the SumoBot END ' -----[ Subroutine - Reset ]------------------------------------------------- Reset: READ
Chapter 2: EEPROM Tricks and Program Tips · Page 59 Building and Testing the LED and Piezospeaker Circuits The LED and piezospeaker circuit shown in F
Page 60· Applied Robotics with the SumoBot LedSpeaker PIN 5 After declaring this PIN directive, the name LedSpeaker can be used as either an input
Chapter 2: EEPROM Tricks and Program Tips · Page 61 FOR counter = 1 TO 30 ' Flash LED on/off 15 times TOGGLE LedSpeaker
Page 62· Applied Robotics with the SumoBot Parts List (1) Jumper wire (1) LED - red (1) 1 Resistor - 470 Ω (yellow-violet-brown) (1) 1 Resistor - 10
Chapter 2: EEPROM Tricks and Program Tips · Page 63 Figure 2-6 Debug Terminal Displaying the State of pbSense Zeros repeat every 1/10 second while
Page 64· Applied Robotics with the SumoBot pbSense PIN 6 ' Pushbutton connected to P6 ' -----[ Initializati
Chapter 2: EEPROM Tricks and Program Tips · Page 65 ACTIVITY #5: PUSHBUTTON PROGRAM MODE SELECTION In some competitions, changing strategy between sum
Preface · Page iii Preface INTRODUCTION Robotics is currently enjoying ever increasing popularity with students. Especially when it involves a conte
Page 66· Applied Robotics with the SumoBot has still not been released, the outer loop repeats again, the inner loop beeps three times, and so on. &
Chapter 2: EEPROM Tricks and Program Tips · Page 67 CASE 1 DEBUG "one" CASE 2 DEBUG "two" CASE 3
Page 68· Applied Robotics with the SumoBot ' -----[ EEPROM Data ]-------------------------------------------------------- ModeSelect DATA
Chapter 2: EEPROM Tricks and Program Tips · Page 69 NEXT PAUSE 1000 ' 1 second between beeps IF pbSense
Page 70· Applied Robotics with the SumoBot One of the most important ingredients of modular programs is keeping the same naming conventions for varia
Chapter 2: EEPROM Tricks and Program Tips · Page 71 While all the steps up to this point were purely mechanical, the Initialization section will take
Page 72· Applied Robotics with the SumoBot ' -----[ I/O Definitions ]---------------------------------------------------- LedSpeaker PIN
Chapter 2: EEPROM Tricks and Program Tips · Page 73 DEBUG "five" ENDSELECT ENDIF ResetTest: DEBUG CR, "Done!"
Page 74· Applied Robotics with the SumoBot PAUSE 100 FREQOUT LedSpeaker, 100, 4000 NEXT PAUSE 1000
Chapter 2: EEPROM Tricks and Program Tips · Page 75 SUMMARY This chapter introduced a variety of EEPROM and program management techniques. EEPROM man
Page iv · Applied Robotics with the SumoBot EDUCATOR RESOURCES While the SumoBot Competition kit is designed for the classroom, it really provides an
Page 76· Applied Robotics with the SumoBot 9. What is the decimal number for hexadecimal-E? 10. What PBASIC operator allows you to examine individu
Chapter 3: EEPROM Tricks and Program Tips · Page 77 Chapter #3: Sensor Management The SumoBot's sensors are critical components to its performan
Page 78· Applied Robotics with the SumoBot ACTIVITY #1: TESTING AND TUNING INFRARED OBJECT DETECTORS Figure 3-1 shows the SumoBot and the locations o
Chapter 3: EEPROM Tricks and Program Tips · Page 79 to the header. The right column shows the components that you plugged into the header, the IR rec
Page 80· Applied Robotics with the SumoBot If the IR receiver is sending 5 V to P11, it means it doesn't see any reflected infrared. If this is
Chapter 3: EEPROM Tricks and Program Tips · Page 81 The IR receivers are active-low, meaning they send a low signal to signify the active condition (I
Page 82· Applied Robotics with the SumoBot Figure 3-3 Opponent Detected at Front-Right Example Program - TestFRontIrObjectDetectors.bs2 √ Enter,
Chapter 3: EEPROM Tricks and Program Tips · Page 83 ' -----[ Title ]-------------------------------------------------------------- ' Applied
Page 84· Applied Robotics with the SumoBot Your Turn - Headlight Adjustments A small change in the direction the SumoBot's IR LEDs are pointing
Chapter 3: EEPROM Tricks and Program Tips · Page 85 Testing for Sources of IR Interference Fluorescent lights have a part called a ballast built into
Preface · Page v “Applied Sensors”, Student Guide, Version 1.3, Parallax Inc., 2003 “Basic Analog and Digital”, Student Guide, Version 1.3, Parallax
Page 86· Applied Robotics with the SumoBot ' -----[ Main Routine ]------------------------------------------------ DO
Chapter 3: EEPROM Tricks and Program Tips · Page 87 Always test for and eliminate sources of IR interference near your SumoBot Competition Ring. &a
Page 88· Applied Robotics with the SumoBot Testing for Electrical Continuity The leads on the IR LEDs and receivers tend to be thinner than jumper wi
Chapter 3: EEPROM Tricks and Program Tips · Page 89 other parts can be clipped into small segments and inserted into very loose-fitting X8 and X9 sock
Page 90· Applied Robotics with the SumoBot Figure 3-5 Opponent vs. Distraction If your SumoBot has a tendency to get distracted by nearby object
Chapter 3: EEPROM Tricks and Program Tips · Page 91 and at each frequency, the Debug Terminal displays a "yes" if the IR receiver detected a
Page 92· Applied Robotics with the SumoBot The next example program is another modified version of TestIrFrontObjectDetectors.bs2. The IrFreq const
Chapter 3: EEPROM Tricks and Program Tips · Page 93 √ If zero "yes" readings appear, move the SumoBot 5 cm closer to the wall. If several
Page 94· Applied Robotics with the SumoBot ' -----[ Initialization ]----------------------------------------------------- DEBUG CLS, "FRO
Chapter 3: EEPROM Tricks and Program Tips · Page 95 √ Modify TestIrFrontObjecDetectors.bs2 so that it has 3 or 4 useful versions of the IrFreq CON di
Comentarios a estos manuales