1 / 15

Program Line Follower in Autonomous Mode

Program Line Follower in Autonomous Mode. Program Line Follower in Autonomous Mode. Performance Objective: Given the components of a VEX robotics design system program a line follower in autonomous mode to have the robot move forward and follow a white line on a gray mat .

Télécharger la présentation

Program Line Follower in Autonomous Mode

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. Program Line Follower in Autonomous Mode

  2. Program Line Follower in Autonomous Mode Performance Objective: Given the components of a VEX robotics design system program a line follower in autonomous mode to have the robot move forward and follow a white line on a gray mat. Enabling Objectives: explain the purpose of a line follower explain how a line follower operates draw a flow chart for using a line follower program a line follower

  3. Line follower A line tracker mostly consists of an infrared light sensor and an infrared LED The line follow functions by illuminating a surface with infrared light; the sensor then picks up the reflected infrared radiation and, based on its intensity, determines the reflectivity of the surface in question Lightly colored surfaces will reflect more light than dark surfaces; therefore, lightly colored surfaces will appear brighter to the sensor This allows the sensor to detect a dark line on a light surface, or a light line on a dark surface

  4. Line follower An efficient way to follow a line is using three sensors The three sensors are lined up beside each other The center line follower is designed to be on the line being followed, while the outside sensors are detecting the surface beside the line

  5. Line follower logic 1 2 3 The logic behind using three sensors is this: if sensors 1 and 3 are dark and sensor 2 is light, then go straight; if sensors 1 and 2 are dark while sensor 3 is light, turn right; if sensors 2 and 3 are dark, and sensor 1 is light, turn left

  6. Line follower logic Three sensors are best when there are crossing lines All three sensors will be reading the same color, you know to turn a direction when this happens Using this logic, two sensors will work to follow a line that does not cross another line

  7. Verify the sensor Plug the three sensors into analog ports Open easyC and download the line follower test code The test code is only written for one sensor, you can add the two additional get blocks to be able to read the other two sensors, you also need to define two new variables Place the robot on a gray mat and notice the value of the sensors (> 700) Place the robot on a white surface and notice the value of the sensors (< 500)

  8. Program the line follower Program a VEX robot equipped with a line following kit to move forward and follow a white line on a gray mat Draw the flow chart of a program that can complete the above task according to the logic explained earlier

  9. Program the line follower Open a new competition project and configure the microcontroller for the three line following sensors Add a variable for each line following sensor Insert an appropriate driving mode block into the operator tab

  10. Program the line follower Insert a while loop where 1==1 Insert the get analog input block for each line follower

  11. Program the line follower Insert an If statement to move the robot forward if both outside sensors are dark and the middle sensor is light NOTE: When using the line follower kit, you will want to move slower, therefore insert a user value of 60 or -60 when programming the motors

  12. Program the line follower Insert an Else-If statement to correct the robot if it starts to veer off the line towards the right

  13. Program the line follower For correction when the robot veers off of the line, insert an Else-If statement to correct the positioning

  14. Test your code Build and download your code Run the code with the Competition Switch Simulator The robot should slowly move forward following a line, correcting itself if it starts to veer to one side or the other

  15. Show it off! If your code works, show it to your instructor If the robot does not run correctly, go back through the lesson and double check your code For more technical data on the line follower visit: http://www.vexforum.com/wiki/index.php/Line_Follower

More Related