Better Line Following with PID

Slides:



Advertisements
Similar presentations
Proportional, Integral, Derivative Line Following October 5, 2013.
Advertisements

Potential Dividers You will be familiar with the use of a variable resistor to vary current.
Follow The Guidelines Introductory Presentation. Opening Activity Make a prediction about how light sensors will use thresholds. Keep in mind: We used.
Using the NXT Light Sensor. 2 Connect One Light Sensor – 1 From My Files use Left / Right NXT buttons and get to View menu and push Orange button. From.
BEGINNER PROGRAMMING Lesson
Available at: Lesson 3.6 – Program Line Follower in Autonomous Mode Program Line Follower in Autonomous Mode.
Reactive robots UPNA The Public University of Navarra Material for pupils & students.
Human Vision Robot (Light Sensor) Vision White/Light: 100 Black/Dark: 0 Colors:
By Droids Robotics Line Followers: Basic to Proportional ADVANCED EV3 PROGRAMMING LESSON © 2015 EV3Lessons.com, Last edit 4/5/
How to make a Line Follow program Using EV3 software and an NXT light sensor.
Casne.ncl.ac.uk Taking care of the CrumbleBot Please do NOT stress the robot's motors 1.Do NOT push the robot 2.Do NOT hold the.
BASIC GRAPHS Physics with Technology. Scatter Plot  When doing a lab, we often graph a series of points. This is called a scatter plot. Scatter plot.
ROBOTC for CORTEX Teacher Training © 2011 Project Lead The Way, Inc. Automation and Robotics VEX.
Mr Barton’s Maths Notes
Robotics Training For The Riverside Robotics Society
Making a Scientific Graph
An Introduction to VEX IQ Programming with Modkit
Solve Absolute Value Inequalities
Follow The Guidelines.
By Sanjay and Arvind Seshan
Mr F’s Maths Notes Number 7. Percentages.
Functions Algebra
Functions & Relations.
Solving Linear Inequalities
Using cartoons to draw similar figures
Beginner Programming Lesson
BEGINNER PROGRAMMING Lesson
6.3 Solving Systems of Linear Equations in Three Variables
So how do we know what type of re-expression to use?
Solving and Graphing Linear Inequalities
Follow The Guidelines Light Sensor
An Introduction to VEX IQ Programming with Modkit
Beginner Programming Lesson
Bell work/Cronnelly Calculate the area and perimeter of each shape below.
Line Following Behavior
Introductory Presentation
Beginner Programming Lesson
By Sanjay and Arvind Seshan
Line Followers: Basic to Proportional
An Introduction to VEX IQ Programming with Modkit
Introductory Presentation
Robotics and EVT - line follower -
Solving Linear Equations
BEGINNER PROGRAMMING Lesson
Introduction Solving inequalities is similar to solving equations. To find the solution to an inequality, use methods similar to those used in solving.
Using cartoons to draw similar figures
Line Following Behavior
Line Followers: Basic to Proportional
4x = 49 – 3x Sticky Note Math Do NOT put your name on the sticky
CHAPTER 3 Describing Relationships
Arduino Part 4 Let there be more light.
By Sanjay and Arvind Seshan
Mr Barton’s Maths Notes
The Fundamental Theorem of Calculus
CHAPTER 3 Describing Relationships
CHAPTER 3 Describing Relationships
Lecture 6 Re-expressing Data: It’s Easier Than You Think
By Sanjay and Arvind Seshan
Chapter 10 Section 2.
CHAPTER 3 Describing Relationships
CHAPTER 3 Describing Relationships
CHAPTER 3 Describing Relationships
you get to solve puzzles!
Obstacle Detection.
9.1 Solving Systems of Linear Equations in Three Variables
1.3:Solving and Graphing Linear Inequalities
PID Line Follower.
Proportional Line Follower
Linear Inequalities (simple)
Presentation transcript:

Better Line Following with PID

Simple Line Following You are used to getting the dark and light readings on the board, and calculating the threshold:

You use this information to write a basic Line Follow program

We aren’t following the line, but the EDGE of the line. When the light sensor sees black, the robot will turn towards the right. When the light sensor sees white, the robot will turn towards the left. We are following the right edge of the line. If the robot turned in opposite directions, we would follow the left side of the line.

How do we know what power level to use? So far, we have used a Guess and Check strategy. Gentle turns (not much difference between the speeds, such as 50% and 20 %) work well for a fairly straight line A curvy line usually needs sharper turns, with big differences between the power for the two motors, such as 30% and 0%. You have noticed that this type of line follower is rather wiggly, and never drives really straight, even on a perfectly straight line.

So, we could make it drive straight when the line is straight. We can do this by dividing our possible inputs into three sections instead of two. So now if the light level is less than 43, we want the robot to turn left. If the light value is between 44 and 47, we want it to go straight. If the light level is greater than 47, we want to turn right. You can program this with a switch within a switch.

This will work a little better, though you will still see quite a bit of wiggle. So consider this: If three light ranges are better than two than what about adding even more? What starts us thinking about PID.

Proportional Integral Derivative What is PID? It is a Closed Loop control method that is used in temperature control, and cruise control in a car.

Proportional We are going to make a Proportional Line Follower. In our first program, the robot could do only two things, turn left or right in exactly the same way. In the second, it used exactly similar turns, but added a third straight mode. In the Proportional Line Follower, the turns vary smoothly between two limits. Here, the turns are NOT identical, and the powers are extremely variable.

You have studied proportions in Math class You have studied proportions in Math class. Proportion means that there is a linear relationship between two variables – when you graph them, you get a straight line. You can see a straight line in the graph on the right. This shows that if the light sensor reading says we are close to the line then we do a small turn. If we are far from the line then we do a big turn.

Another way of saying this.. If we want to improve it even more we could add even more states, far left, left, a bit left, straight, a bit right, right, far right, and so on... So how can we calculate the power that must go to each motor on each different turn? Why not make the turn proportional to the error, which is the difference between the midpoint of your light readings and the value read by the light sensor.

SOURCE

Look at this, but don’t panic SOURCE

We are going to watch two different ways of programming a smoother line follow. While you watch them, try to remember what we have learned, so that you understand what is happening,

The math involves calculus, which none of you have learned. If you want to go deeper into the math, you can read this, which explains it without explaining the calculus. Or this one, which explains how the calculus works in a very understandable way. This is another good source.