Refresh rate on optical sensors

My team has been working on our skills auton for awhile and we are at the stage where we are trying to cut down on time. We use the optical sensor as kind of a line sensor and it has worked really well in the past. But now as we are trying to speed up our run, the sensor will sometimes miss the line it it messes up big time. My programmer was trying to see if there was a way to increase the refresh rate on the sensor but he didn’t far. I figured that I would ask here and see if there was anything we could do short of going slower as we approach the line.

You can try moving the optical sensor downward to account for the overshoot due to the refresh rate, or simply just reduce the roller speed so it’s less likely to overshoot. Another method can be using 2 distance sensors, and use them to control the roller until they get equal readings (ball in the center) to have accurate indexing. See illustration below


I think there was a miss understanding with my explanation the optical sensor is being used to detect the white lines on the field not the balls as they come into the robot. We are not using the distance sensors for it it we are using the optical sensor.

Based on this, most sensors refresh around 20ms

The distance sensor may be more like 30Hz based on this:


Sorry about that, I actually didn’t see anything about using optical sensor to control drive in the post so I just automatically thought its for indexing. You can try adding a second optical sensor toward the front of the robot, and slow the robot down if the front optical sensor stops reading the line (getting near the target / end of line). Then, it can be more accurate as your other line tracker reaches setpoint.

1 Like

We were already trying something like that but it sounds like we would have to slow it down anyways. Is there any reason to use the old line sensors instead of the newer optical sensors or is it not worth it?