Quote:
Originally Posted by propionate
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.