Tobmag,
If it *never* does it on the bench, it's unlikely to be a code issue. It suggests a hardware issue of some sort. Perhaps something is resonating in the VSS circuit or wiring. Have you tried a diode (a common 1N4001 or similar, for example) in series with the VSS input? That should help squelch resonance (by removing all signals below +0.7 Volts), but it may be too much.
What input mask values have you tried? If this was mine, I would be tempted to try VSS Input Masking values from 10 to 100 in 5% increments to see if there was a 'sweet spot' anywhere in that range. I would also experiment with the minimum speed in 0.5 kph increments from 0 to 10 kph, and the max speed in 10 kph increments from 200 to 300 kph.
I would also set the Max. Errors to Reset to 5000, and the Reset filter off to 25. (See:
http://www.msgpio.com/manuals/mshift/V41tune.html#gv)
It's certainly possible to set a limit in the code on the rate of change of the speed (i..e the first derivative of the VSS period). In fact, that's essentially what the input mask is, but the accel/decel would be averaged over a longer period instead of over a few dozen teeth.
I suspect that:
- the limit on the rate of accel and decel will need to be different (most cars can brake significantly faster than they can accelerate, and they ones that can't are scary to drive!),
- the rate should probably be speed dependent, i.e. most vehicles car accelerate much faster at low speed than high speeds (because of gearing and aero effects). This is sort of like the speed-dependent filtering you mentioned earlier, I suppose.
The question becomes, what do we do if the accel is outside that range. We could:
- limit the rate of change to the max (on the assumption that some, but not all, of the signals are false),
- limit the rate of change to zero (on the assumption that the signal are entirely false),
Then we would need to decide if the limit applies only to the speed calculation, or is also applied to the raw VSS input filtering (which can cause all sorts of troubles).
BTW, the code once had such a scheme (which was applied to the VSS filtering rather than the speedo calcs), and while it worked for some, it was a nightmare for others. So this would need to be implemented carefully.
If this gets implemented, it will be in the 5.00x series of beta code.
Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw