Book Image

Learning Lego Mindstorms EV3

By : Gary Garber
Book Image

Learning Lego Mindstorms EV3

By: Gary Garber

Overview of this book

Table of Contents (19 chapters)
Learning LEGO MINDSTORMS EV3
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
10
Other Programming Languages
Index

Setpoint for line tracking


We first need to determine the desired setpoint of the Light Sensor reading for the robot to track on. When using only one sensor, we don't want to track the middle of the line because small changes in position will not be sensed. If we track along the edge of a line, then a small change in position will substantially affect the size of the correction error in our algorithm. In this case, 50 percent of the circle of red light will have a high reflectivity and 50 percent will have a low reflectivity. Small deviations from the edge will result in huge changes in the measured intensity. Placing the middle of the circle of light exactly on the edge can be a challenge. Since we are trying to obtain a numerical value, it is easier to separately measure the high reflection intensity and low reflection intensity and find the average of those two values.

You will find that you will frequently determine a new setpoint value based on your environmental conditions. In addition...