Skip to main content
added 751 characters in body
Source Link

I order for you to use a PID loop for line follow, you are going to need an error that is proportional to the distance you are from the line. That may not be possible with the sensors you are describing. The best you can do is when the light sensors are analog (their output is proportional the the amount of line they see and they have a beam width that is the same as the width of the line.

If that is the case, line the sensors up so they are spaced one beam width apart as follows:

L3-L2-L1-R1-R2-R3

Then error = 3L3+2L2+L1-R1-2R2-3R3

For more information and other techniques, here is an article on PID line following techniques with LEGO Mindstorm. Line follow is used a lot in FLL (First Lego League).


Follow-up: It looks like the sensor you are using (TCRT5000) can be used as an analog sensor. It is an active sensor so that will help with ambient light rejection. The algorithm described above for calculating error should work if you want to do PID control.

See the Application Note for the TCT5000 for more information on how to use the sensor. The section on 'Resolution' should help you set the sensor spacing. If possible, set the senor height so that the resolution is smaller then the line width; but, no so small that the line could fit within the "gap" between the sensors (ideal is no gap).

I order for you to use a PID loop for line follow, you are going to need an error that is proportional to the distance you are from the line. That may not be possible with the sensors you are describing. The best you can do is when the light sensors are analog (their output is proportional the the amount of line they see and they have a beam width that is the same as the width of the line.

If that is the case, line the sensors up so they are spaced one beam width apart as follows:

L3-L2-L1-R1-R2-R3

Then error = 3L3+2L2+L1-R1-2R2-3R3

For more information and other techniques, here is an article on PID line following techniques with LEGO Mindstorm. Line follow is used a lot in FLL (First Lego League).

I order for you to use a PID loop for line follow, you are going to need an error that is proportional to the distance you are from the line. That may not be possible with the sensors you are describing. The best you can do is when the light sensors are analog (their output is proportional the the amount of line they see and they have a beam width that is the same as the width of the line.

If that is the case, line the sensors up so they are spaced one beam width apart as follows:

L3-L2-L1-R1-R2-R3

Then error = 3L3+2L2+L1-R1-2R2-3R3

For more information and other techniques, here is an article on PID line following techniques with LEGO Mindstorm. Line follow is used a lot in FLL (First Lego League).


Follow-up: It looks like the sensor you are using (TCRT5000) can be used as an analog sensor. It is an active sensor so that will help with ambient light rejection. The algorithm described above for calculating error should work if you want to do PID control.

See the Application Note for the TCT5000 for more information on how to use the sensor. The section on 'Resolution' should help you set the sensor spacing. If possible, set the senor height so that the resolution is smaller then the line width; but, no so small that the line could fit within the "gap" between the sensors (ideal is no gap).

added 234 characters in body
Source Link

I order for you to use a PID loop for line follow, you are going to need an error that is proportional to the distance you are from the line. That may not be possible with the sensors you are describing. The best you can do is when the light sensors are analog (their output is proportional the the amount of line they see and they have a beam width that is the same as the width of the line.

If that is the case, line the sensors up so they are spaced one beam width apart as follows:

L3-L2-L1-R1-R2-R3

Then error = 3L3+2L2+L1-R1-2R2-3R3

For more information and other techniques, here is an article on PID line following techniques with LEGO Mindstorm. Line follow is used a lot in FLL (First Lego League).

I order for you to use a PID loop for line follow, you are going to need an error that is proportional to the distance you are from the line. That may not be possible with the sensors you are describing. The best you can do is when the light sensors are analog (their output is proportional the the amount of line they see and they have a beam width that is the same as the width of the line.

If that is the case, line the sensors up so they are spaced one beam width apart as follows:

L3-L2-L1-R1-R2-R3

Then error = 3L3+2L2+L1-R1-2R2-3R3

I order for you to use a PID loop for line follow, you are going to need an error that is proportional to the distance you are from the line. That may not be possible with the sensors you are describing. The best you can do is when the light sensors are analog (their output is proportional the the amount of line they see and they have a beam width that is the same as the width of the line.

If that is the case, line the sensors up so they are spaced one beam width apart as follows:

L3-L2-L1-R1-R2-R3

Then error = 3L3+2L2+L1-R1-2R2-3R3

For more information and other techniques, here is an article on PID line following techniques with LEGO Mindstorm. Line follow is used a lot in FLL (First Lego League).

Source Link

I order for you to use a PID loop for line follow, you are going to need an error that is proportional to the distance you are from the line. That may not be possible with the sensors you are describing. The best you can do is when the light sensors are analog (their output is proportional the the amount of line they see and they have a beam width that is the same as the width of the line.

If that is the case, line the sensors up so they are spaced one beam width apart as follows:

L3-L2-L1-R1-R2-R3

Then error = 3L3+2L2+L1-R1-2R2-3R3