Yes, please do. I’m going somewhere with this…
Now that you’re making me rethink this, it may not make a lot of sense to be averaging every 12 samples. It looks like the default is actually 1. I’m not sure if this is an error or not… I will definitely investigate this tomorrow.
It works wonderfully right now, but this could be the path to making it better.
You probably don’t want the default of 1 with six pieces of tape, especially if it’s sampling both rising and falling edges.
Try this: one piece of tape with the default sample size of 1 and setup to sample rising edges only. That way, it’s always sampling the same edge of the same piece of tape, so the spacing is perfect… and with your 20ms update rate, you’ll be getting a fresh reading every execution or your controller loop at wheel speeds of 3000 RPM or higher.
I will give this a go tonight and let you know the results. Thanks for the recommendations.
Sorry, didn’t have any opportunity to do the tests this evening. I will send you a private message with the results when I do have a moment with the robot so as to not clutter up this thread any more.
The Banner photoeyes they used are retroreflective units - they have an emitter and detector in the same housing.