1 / 18

Line Tracking

Line Tracking. Team Geek-- Team Leader – Earl Limbers Hardware Specialist – Jason Tompkins Software Specialist – Erin Beaver Team Assistant – George Copetas. Overview. Problem Statement Hardware Software Centroid Weighting Code Problems Summary References Q&A. Problem Statement.

crescent
Download Presentation

Line Tracking

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Line Tracking Team Geek-- Team Leader – Earl Limbers Hardware Specialist – Jason Tompkins Software Specialist – Erin Beaver Team Assistant – George Copetas

  2. Overview • Problem Statement • Hardware • Software • Centroid • Weighting • Code • Problems • Summary • References • Q&A

  3. Problem Statement • Line Tracking • Know where line is ahead of car • Control steering to be centered over line IR Data from Line Sensor MCU Power Steering Servo Motor

  4. Hardware • Pololu QTR-8RC Reflectance Sensor Array • Professor Sumey • Futaba FUTM0043 • Team TBD

  5. Centroid Center of mass Balancing point from any end Assuming uniform weighting at all points Used to find center of line

  6. Centroid • New global variable • int centroid = 0; • Ideal center • Sum of bit weights/# of bits on Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Centroid

  7. Weighting • How do we use these bits to find centroid? • Assign weights • Help determine in-between values Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Centroid

  8. Weighting • Not zero • Does not contribute any weight • Equal distances • Points in between bits will be uniform 80 70 60 50 40 30 20 10

  9. Function • Function Name intLineTracking(byte data) • Initialization BoolnoiseFlag = FALSE; int sum = 0; int count = 0; int weight = 0; inttempsum = 0; inttempcount = 0; int cent = 0;

  10. Error Checking • Lost line • Go back to how you were last turning • Intersection • Continue going straight

  11. Function • All black or white? if(data == 0xFF) return 45; // only in case of intersection, check if in air if(data == 0) return (centroid+45); 80 70 60 50 40 30 20 10 80 70 60 50 40 30 20 10

  12. Error Checking Speck of dust? Target 80 70 60 50 40 30 20 10

  13. Function for(int i = 0; i<=7; i++) { weight+=10; if(BITTST(i, data)) { if(noiseFlag) { tempcount= count; tempsum= sum; count = 0; sum = 0; noiseFlag= FALSE; } sum+=weight; count++; } else { noiseFlag= TRUE; } if(count > tempcount) cent = sum/count; else cent = tempsum/tempcount; }

  14. Main Code //calculate centroid for pulse width centroid = (LineTracking(irdata) - 45); //makes 0 center servopw= (1500 - ((80/7)*centroid));//get value between 1100 & 1900 Average of 40 & 50 1500 = middle pulse width

  15. Problems Faced • Binding to one direction • Delete or comment out servopw = (word)(1000 + constrain(ADCR, 100, 900)); • Located in main

  16. Summary • Problem Statement • Hardware • Software • Centroid • Weighting • Code • Problems

  17. References Sumey, Jeff. “CET Microprocessor Engineering.” California University of Pennsylvania. Web. 23 Mar 2014. http://aet.calu.edu/~jsumey. “QTR-8RC Reflectance Sensor Array." Pololu-N.p., n.d. Web. 23 Mar 2014. http://www.pololu.com/catalog/product/961. “Futaba Analog Servos.” Web. 23 Mar 2014. http://www.futaba-rc.com/servos/analog.html. Weisstein, Eric W. "Geometric Centroid." Mathworld. Web. 23 Mar 2014. http://mathworld.wolfram.com/GeometricCentroid.html

  18. Questions and Answers

More Related