MS2-Extra

Tach Noise filtering

Only for use with the MS2-Extra code (HC9S12C64 based microprocessor - MS2 Daughter Board)

 

Please Note:

All of these instructions / diagrams are to be used at your own risk, like most things there is more than one way to do the same thing, what we have tried to do is to offer a method that we have tested or that others have tested for us. No warranty expressed or implied.

Use at your own risk.

 


Introduction

All ECUs use sensors on the engine to determine engine position and speed. In a fuel only install this could be a connection to the coil negative, or a distributor install this may be a hall, VR or optical sensor within the distributor. On more complicated installs both crank and cam sensors may be used on multi-toothed wheels. In all of these versions of tach input, there is a possibility for noise to get onto the signal wires.

What does the noise do?

In the simplest form of a fuel-only controller with a tach signal from the coil negative, the 'ringing' of the coil may cause apparent rpm spikes. This will cause additional fuel to be injected on each of these noise pulses and show up as a falsely high rpm. It will likely be irritating, but no major problems are likely.

On an install controlling ignition it is a different matter. In the simple distributor install with a simple trigger arrangement (1 pulse per ignition event like in a normal distributor) the noise will cause a misfire probably on that one event. On a multi-toothed wheel, the noise is likely to cause a loss of synchronisation with the wheel and spark will be lost for 360 or even 720 degrees of engine rotation before the re-synchronisation occurs.

So, the tach input is critical to ECU operation, it is important to reduce or eliminate that noise.

Noise reduction methods

a. Hardware

The first place to start with cleaning up your signals and reducing the noise is on the hardware.

This section needs writing to include - shielding, grounding, LM1815 circuit mods, caps on inputs, load resistors, V3 changes etc. etc.

b. Software

Once the hardware is optimised there are options within the software to assess and filter out spurious input pulses. As the ECU may be taking crank and cam signals from the engine, both of these inputs will need filtering.

NOTE! Some of the custom wheel decoders for engines with hall sensor or optical CASes are written to use both edges of the input signal, the diagrams shown here are not totally relevant for that method and the noise filter in particular cannot presently be used with 'double edged' signals.

First off, let us look at a typical input signal (image from the Megamanual)




The Megasquirt needs to be configured for rising edge in this instance as that matches the 'sharp' well defined zero crossing of the input signal. We can now look at what the Megasquirt code will see.


This shows how the rising edge configuration results in what we'll call a 'single edged' signal. The Megasquirt is only aware of that rising edge and pays no attention to the length or the high or low periods or the falling edge.

Now, insert some noise.




The noise pulse creates a false trigger to the Megasquirt, this could cause an rpm blip on the fuel only install, a misfire or a total loss of sync on the more advanced installs.

Having established what the noise signal might look like, how to get rid of it? There are three main methods in the code to improve situations - noise filter ; tach masking ; polarity check

b1. Noise filter

The noise filter works on the principle that the noise is likely to be of short duration, far shorter than a genuine tooth. If all inputs conditioners are setup correctly, we should be able to detect this condition by measuring the width of the input pulse. A 'long' pulse is real, a 'short' pulse is noise.




[ Need to add section on how to enable it ]

b2. Tach interrupt masking

This approach is slightly different. It does not calculate the pulse width, but looks at where it is within the period. If we have suddenly received an early pulse (within 30% of the expected time) then it must be noise and is rejected. The code disables the hardware interrupt for this calculated mask period and any inputs that happen while the interrupts are off are " invisible." There is a drawback though, on the uneven wheels the code calculates this time based on the smallest tooth. A pattern such as 420A has widely varying tooth sizes, so the benefit is reduced. (Additionally, but less importantly, the tooth logger cannot record the noise inputs as they are not captured.)




Note also that there were some code issues with this method in 2.0.0, 2.0.1 and early pre2.1.0 codes!

b3. Tach period rejection

This is similar to the concept behind interrupt masking, but the interrupt is still enabled. The code compares the times and rejects it if it falls within the rejection period.


b4. Polarity Check

This method should weed out extremely short noise pulses. If the input signal changes state very quickly, the pulse will already have completed before the Megasquirt has had time to react. By polling the input pin to the CPU the code checks to see if the polarity is the expected one, if not it must be noise and the input is ignored.






If you have a question, comment, or suggestion for this FAQ please post it on the forum.
Last Updated: 05/25/2007 16:43:04

No part of this manual may be reproduced or changed without written permission from James Murray, Ken Culver and Philip Ringwood.