Wireless Group Critical Design ReviewMovementIR NavigationLight SearchingSearching AlgorithmProgram flow (FSM)Prog_0: “Initialization”Prog_1: “Listen and Learn”Prog_2: “To boldly go…”Prog_3: “Listen”Prog_4: “Find node”Communication Program TestingPowerPoint PresentationWireless Group Critical Design ReviewMovementServoL ServoR ServoL ServoRForw ard 847 1695 1265 2500Reverse 1695 847 2535 1300Left 847 847 2500 2535Right 1695 1695 965 1000Expe rim entalCalculate d•BS command -> PULSOUT pin, period–BS2P units for period = 1.18s•1.0ms pulse = CW, 2.0ms pulse = CCW–CW: period = 1ms/1.18s = 1695–CCW: period = 2ms/1. 18s = 847IR NavigationIR led must pulse @ 38.5kHzBS command -> FREQOUT pin, period, freqBS2P units for freq = 3.77Hzfreq = 38.5kHz/3.77Hz = 10212Can increment to decrease distance of sensitivity10212 -> 10-14 inchesNominal: 12000 -> 2-6 inchesLight SearchingLight location can be found with photoresistors included with kitPhotoresistors have high resistances with little light, and low resistances with more lightWe can find relative values of the resistance using RC circuits and use these to navigateSearching AlgorithmTo introduce some randomness, have all Bots go in random directions from a base point as soon as they are released.Afterwards, use IR navigation to avoid collisions with other robotsUse photoresistors to find sources of light and move towards themProgram flow (FSM)Prog_0: init Prog_1: get IDProg_2: Search for lightProg_3: ListenProg_4: Search for botIf RxIf timeoutIf RxIf light is foundIf end of exeIf end of exeIf timeoutProg_0: “Initialization”PROG_0pollin 5,1 'poll for Rxpollmode 3 'polled-run onlypollrun 1 'run slot 1token var bittoken = 1time var wordtime = 0ID var byteTIMeOUT con 30000 'may need something better'---------main-----------start: if time > TIMEOUT then start_token 'listen, if nothing, start new token time = time + 1 goto startstart_token: token = 1 'give node right to Tx ID = 1 'give node ID = 1 put token, 0 'save token and ID in RAM put ID, 0 'before calling new program run 2Listen for Rx in background If Rx, run prog_1Set token = 0While !Timeout, loop Else Start_TokenStart_Token: Token = 1 ID = 0 Save token, ID in RAM Run prog_2Prog_1: “Listen and Learn”node VAR bytenode_next VAR bytenode_list VAR bit(254) x VAR byteID VAR byteSYNCH CON "A" 'Establish synch byteBAUD CON 16780 'N2400 baud (MAX)trash VAR word SERIN 5,BAUD,[WAIT(SYNCH),node] SERIN 5,BAUD,[WAIT(SYNCH),trash] node_list(node) = 1START: SERIN 5,BAUD,[WAIT(SYNCH),node_next] 'get node SERIN 5,BAUD,[WAIT(SYNCH),trash] 'trashnode_list(node_next) = 1 if node = node_next then GET_IDGOTO STARTGET_ID: for x = 0 to 254 if node_list(x) <> 1 then SET_ID nextSET_ID: ID = x'-------wait for Invitation to join ring---------Set token = 0Listen for ID’s in useChoose unique IDWait for invitation to join RingRun prog_2Prog_2: “To boldly go…”Listen for Rx in background If Rx, run prog_3Get token, next_ID from RAMIf token = 1, then TalkContinually Search if timeout, then run prog_0 if light is found, found =1Talk: tell if light is found Send tokenContinue searchProg_3: “Listen”If found = 1, run prog_4Listen for tokenSave token on RAMRun prog_2Prog_4: “Find node”Search for node by beaconIf timeout, goto prog_2Communication Program TestingBegin with wired networkAvoids RF latency and reception due to distanceAll Tx run to OR gate. This simulates the possiblility of collisions.Allows all nodes to “promiscuously” listen to all Tx’sTimeline3 4 5 6 7 8 9 10 11 12 13 14 15 16PresentationTestingIntegrateRF SoftwareIntegrateSearching SoftwareInitial movement of BotsBuild BotsParts ListProposalWeekOriginal scheduleIn the w orksCompleted
View Full Document