# NEO Vortex / Spark Flex Question

I’m sure this has been answered elsewhere, but I’d like an arithmetic check. If I don’t make changes to the Flex’s default average depth and measurement period the measurement delay for the moving filter would be the following:

Default Average Depth for Flex: 64
Default Measurement Period for Flex: 100 ms

So a 64-tap moving average with 100 ms between samples.
(64 - 1) / 2 * 100 ms = 3150 ms !!!

Is this sound?

I know for Max the following:

Default Average Depth for MAX: 8
Default Measurement Period for MAX: 32 ms

So an 8-tap moving average with 32 ms between samples.
(8 - 1) / 2 * 32 ms = 112 ms

I think Rev handles velocity estimation from the quadrature encoder in the Vortex differently than from the hall effect encoder in the Neo.

My understanding is that the effective delay for Vortex/Flex should be:

((averageDepth - 1) / 2 * 1 ms) + (measurementPeriod(ms) / 2)

For the default filter settings for the Flex, this would yield

((64 - 1) / 2 * 1) + (100 / 2) = 81.5 ms

If this is wrong, I’m sure someone will chime in to provide a correction.

I’ve seen this before in the code for sysId, but wasn’t sure if it applied to all quad encoders used by REV or just the ones plugged into the data port. Do you have a reference for this?

No specific reference…just what I’ve accumulated through the various CD

threads on the topic. I suppose if you could view the RevLib source code for the filtering, you’d have your definitive answer.

Only correction is the sample period is 0.5ms instead of 1ms, so if you’re using that same formula

((64 - 1) / 2 * 0.5) + (100 / 2) = 65.75 ms

1 Like