Quote:
Originally Posted by Ether
I've never used an Arduino so I'm curious: Does anyone know what is the interrupt latency (the elapsed time from the occurrence of an interrupting event until all the context switching has completed and the user-written code in that event's ISR starts to execute)
|
From the
sources I have been able to
find, the latency for interrupts on the Arduino is around 18-20 clock cycles. On an Amtel atmega168/328 running at 16MHz, that translates to 1.25us. Considering the resolution of the "micros" command is 4us, the worst case error using two interrupts to calculate the velocity is 11us.
Now, we are currently measuring Frisbee velocity over a 1 foot span and seeing maximum velocities in the 40ft/sec range. 40ft/sec is a measurement of approx 25,000us. Therefore, an error of 11us only yields a velocity error of .044%. In the FRC world, that is negligible.
I also have to believe that much of the latency in the interrupts is negated by the way we are triggering them. The majority of the error is introduced by the "micros" command resolution of 4us. In this case, the max error is in the neighborhood of 8us or .032%. Again, close enough for FRC.