LIGHT-FOLLOWING ROBOT - Inside...
Transcript of LIGHT-FOLLOWING ROBOT - Inside...
![Page 1: LIGHT-FOLLOWING ROBOT - Inside Minesinside.mines.edu/~whoff/courses/EENG383/projects/2012fall/Dubinsky... · LIGHT-FOLLOWING ROBOT EGGN 383 Final Project Jacob Dubinsky Tyler Scott.](https://reader030.fdocuments.in/reader030/viewer/2022021723/5c83c22c09d3f2802f8b4ce5/html5/thumbnails/1.jpg)
LIGHT-FOLLOWING ROBOT
EGGN 383 Final ProjectJacob DubinskyTyler Scott
![Page 2: LIGHT-FOLLOWING ROBOT - Inside Minesinside.mines.edu/~whoff/courses/EENG383/projects/2012fall/Dubinsky... · LIGHT-FOLLOWING ROBOT EGGN 383 Final Project Jacob Dubinsky Tyler Scott.](https://reader030.fdocuments.in/reader030/viewer/2022021723/5c83c22c09d3f2802f8b4ce5/html5/thumbnails/2.jpg)
Overview• Mobile platform that determines and drives towards the
direction of strongest light• If an obstacle is in the way, redirects and then resumes
following the light
![Page 3: LIGHT-FOLLOWING ROBOT - Inside Minesinside.mines.edu/~whoff/courses/EENG383/projects/2012fall/Dubinsky... · LIGHT-FOLLOWING ROBOT EGGN 383 Final Project Jacob Dubinsky Tyler Scott.](https://reader030.fdocuments.in/reader030/viewer/2022021723/5c83c22c09d3f2802f8b4ce5/html5/thumbnails/3.jpg)
Hardware• Arduino Uno• 4 Photoresistors• 4 10kΩ resistors• Two wheels with attached DC Motors and Rotary
Encoders• H-Bridge• Proximity Sensor• Platform
![Page 4: LIGHT-FOLLOWING ROBOT - Inside Minesinside.mines.edu/~whoff/courses/EENG383/projects/2012fall/Dubinsky... · LIGHT-FOLLOWING ROBOT EGGN 383 Final Project Jacob Dubinsky Tyler Scott.](https://reader030.fdocuments.in/reader030/viewer/2022021723/5c83c22c09d3f2802f8b4ce5/html5/thumbnails/4.jpg)
Schematic
![Page 5: LIGHT-FOLLOWING ROBOT - Inside Minesinside.mines.edu/~whoff/courses/EENG383/projects/2012fall/Dubinsky... · LIGHT-FOLLOWING ROBOT EGGN 383 Final Project Jacob Dubinsky Tyler Scott.](https://reader030.fdocuments.in/reader030/viewer/2022021723/5c83c22c09d3f2802f8b4ce5/html5/thumbnails/5.jpg)
Software Overview• Arduino Uno – ATMega328P• Registers instead of built in functions (digitalWrite(),
analogRead(), etc)• Interrupts• Analog Read• PWM
• Subsumption Architecture• Avoid obstacles has highest priority (lowest layer)
![Page 6: LIGHT-FOLLOWING ROBOT - Inside Minesinside.mines.edu/~whoff/courses/EENG383/projects/2012fall/Dubinsky... · LIGHT-FOLLOWING ROBOT EGGN 383 Final Project Jacob Dubinsky Tyler Scott.](https://reader030.fdocuments.in/reader030/viewer/2022021723/5c83c22c09d3f2802f8b4ce5/html5/thumbnails/6.jpg)
Interrupt Registers
![Page 7: LIGHT-FOLLOWING ROBOT - Inside Minesinside.mines.edu/~whoff/courses/EENG383/projects/2012fall/Dubinsky... · LIGHT-FOLLOWING ROBOT EGGN 383 Final Project Jacob Dubinsky Tyler Scott.](https://reader030.fdocuments.in/reader030/viewer/2022021723/5c83c22c09d3f2802f8b4ce5/html5/thumbnails/7.jpg)
Interrupt Registers
• Set INT# bit to enable interrupts on pin INT#
• Set I bit to enable global interrupts
![Page 8: LIGHT-FOLLOWING ROBOT - Inside Minesinside.mines.edu/~whoff/courses/EENG383/projects/2012fall/Dubinsky... · LIGHT-FOLLOWING ROBOT EGGN 383 Final Project Jacob Dubinsky Tyler Scott.](https://reader030.fdocuments.in/reader030/viewer/2022021723/5c83c22c09d3f2802f8b4ce5/html5/thumbnails/8.jpg)
Analog Read Registers
![Page 9: LIGHT-FOLLOWING ROBOT - Inside Minesinside.mines.edu/~whoff/courses/EENG383/projects/2012fall/Dubinsky... · LIGHT-FOLLOWING ROBOT EGGN 383 Final Project Jacob Dubinsky Tyler Scott.](https://reader030.fdocuments.in/reader030/viewer/2022021723/5c83c22c09d3f2802f8b4ce5/html5/thumbnails/9.jpg)
Analog Read Registers
![Page 10: LIGHT-FOLLOWING ROBOT - Inside Minesinside.mines.edu/~whoff/courses/EENG383/projects/2012fall/Dubinsky... · LIGHT-FOLLOWING ROBOT EGGN 383 Final Project Jacob Dubinsky Tyler Scott.](https://reader030.fdocuments.in/reader030/viewer/2022021723/5c83c22c09d3f2802f8b4ce5/html5/thumbnails/10.jpg)
PWM Registers
![Page 11: LIGHT-FOLLOWING ROBOT - Inside Minesinside.mines.edu/~whoff/courses/EENG383/projects/2012fall/Dubinsky... · LIGHT-FOLLOWING ROBOT EGGN 383 Final Project Jacob Dubinsky Tyler Scott.](https://reader030.fdocuments.in/reader030/viewer/2022021723/5c83c22c09d3f2802f8b4ce5/html5/thumbnails/11.jpg)
PWM Registers
Source (Register Slides 6-11): http://www.atmel.com/Images/doc8161.pdf
![Page 12: LIGHT-FOLLOWING ROBOT - Inside Minesinside.mines.edu/~whoff/courses/EENG383/projects/2012fall/Dubinsky... · LIGHT-FOLLOWING ROBOT EGGN 383 Final Project Jacob Dubinsky Tyler Scott.](https://reader030.fdocuments.in/reader030/viewer/2022021723/5c83c22c09d3f2802f8b4ce5/html5/thumbnails/12.jpg)
Phase-Corrected PWM
Source: http://www.cs.washington.edu/education/courses/csep567/10wi/lectures/Lecture7.pdf
![Page 13: LIGHT-FOLLOWING ROBOT - Inside Minesinside.mines.edu/~whoff/courses/EENG383/projects/2012fall/Dubinsky... · LIGHT-FOLLOWING ROBOT EGGN 383 Final Project Jacob Dubinsky Tyler Scott.](https://reader030.fdocuments.in/reader030/viewer/2022021723/5c83c22c09d3f2802f8b4ce5/html5/thumbnails/13.jpg)
Pseudo Code – Light FollowingInitialize PWM to 1kHz on pins D5,D6,D9,D10Initialize A/D converters on A0-A3Input capture on D2,D3 with interruptsLoop:Check analog valuesDetermine new directionCheck the speed of wheelsChange speed of wheels with PWMD5 = PWM D6 = 0 for left wheel forwardD9 = PWM D10 = 0 for right wheel forward
Interrupt:Calculate speed of right wheel
Interrupt:Calculate speed of left wheel
![Page 14: LIGHT-FOLLOWING ROBOT - Inside Minesinside.mines.edu/~whoff/courses/EENG383/projects/2012fall/Dubinsky... · LIGHT-FOLLOWING ROBOT EGGN 383 Final Project Jacob Dubinsky Tyler Scott.](https://reader030.fdocuments.in/reader030/viewer/2022021723/5c83c22c09d3f2802f8b4ce5/html5/thumbnails/14.jpg)
Pseudo Code – Obstacle AvoidanceLoop: // same loop as previous; broken up for readability// Read proximity voltageVproximity = ReadAnalog(ProximityPin)// Check if closer than 15 cm (1.75 V) to an obstacleIf(Vproximity > 1.75 V)Allow vehicle to turn, do not allow it to move forward
elseFollow light // loop in last slide
![Page 15: LIGHT-FOLLOWING ROBOT - Inside Minesinside.mines.edu/~whoff/courses/EENG383/projects/2012fall/Dubinsky... · LIGHT-FOLLOWING ROBOT EGGN 383 Final Project Jacob Dubinsky Tyler Scott.](https://reader030.fdocuments.in/reader030/viewer/2022021723/5c83c22c09d3f2802f8b4ce5/html5/thumbnails/15.jpg)
Questions?