[Diy_efi] 60-2 Toothwheel - Kalman Filter or ( EKF ) usage

Mike niche
Tue Apr 3 16:37:29 UTC 2007

This is needlessly complex and a complete waste of time.

You can get the precise timing from the TDC from any optical/magnetic crank
sensor by simply counting the pulses....!  Used reliably by many systems.

If you are worried about noise, then use good hardware (ie. screened leads).

Case in point, the Crank Angle Sensor (CAS)  (optical) as used on the RB30ET
nissan engine. The CAS has 360 pulses per rev plus an index pulse when
each cylinder reaches TDC and to discriminate TDC for cyl one, the
pulses overlap with an extra pair of "per rev" pulses so the ECU can easily tell
that its TDC for cyl 1.  No need for any Kalman filter, no need for anything
except a bit of NAND/NOR logic and a flip flop. It counts up to 6 for a 6 cyl
engine and resets on the next cycle when the pulses overlap with the index,
it is sooooo simple, there is no need to take sucessive samples and look for
the derivative of a filter coefficient.

In other words, where a Kalman filter adjusts its filter coefficient by analysing
the rate of change of signal after noise reduction then an outcome is a numerical
value for the purpose of feedback/control - it is *not* a discrete trigger !!!

For any single chip micro it is computationally intensive and requires a history
or rather an 'array' of the data set - it is not designed for a discrete function.

In the situation of a crank sensor there is no data except an edge/pulse which
the ECU can count and determine by counting pulses when to issue a spark
down to 1deg or sometimes better of crank/cam resolution.

Me thinks the issue with Kalman filters is like the paradigm of trying to
recycle the energy of the back emf from an injector - I viewed the latter of
this on the MS group (of which I am a member) and its a complete nonsense,
in other words useless and all it does is upset the injector timing...

ie. If you try to collect the back emf of the injector coil when its de-energised 
then you affect the reliability of the closing time... By all means clamp it but
to a high enough voltage so it wont affect closing time and just let the few
mW of power be dissipated...

So calling the circuit for counting a pulse from the cranks sensor a
"Kalman Filter" is a complete nonsense... Its a discrete (edge) function
not a data value that needs any sort of Kalman algorithm or filter
coefficient adjustment or post processing.



At 09:36 PM 4/3/07, you wrote:
>In the MegaSquirt MS-II version, we have implemented a simple form of the kalman filter known as an "Alpha-Beta-Gamma Tracking Filter".
>Note that this is just another form of a predictor-corrector algorithm. In fact, originally we implemented a full-blown kalman filter, but quickly realized that since all of the sample datapoints had the exact same statistical error the a-b-g filter implementation would suffice. Full-up KF are used to determine the best answer for the next state from many different sources of measurements (with corresponding variances) and process model sources. 
>Tracking filters are used everywhere, from missle track determination, machine vision, to brushless commutation of DC motors. A side benefit is that they are extremely easy to implement and are not very computationally intensive - in fact they can be easily synthesized in programmable logic.
>- Bruce
>-----Original Message-----
>>From: Mike <niche at iinet.net.au>
>>Sent: Apr 3, 2007 8:58 AM
>>To: diy_efi at diy-efi.org
>>Subject: Re: [Diy_efi] 60-2 Toothwheel - Kalman Filter or ( EKF ) usage
>>At 08:15 PM 4/3/07, you wrote:
>>>I'm using a microcontroller with standard CAPTURE/COMPARE units in order to
>>>process a 60-2 crank wheel. I'm very concerned about noise and a single step
>>>Kalman Filter seems to be a very good tool for this application.
>>Not sure what u mean by a "60-2" though if you are not using it for synchronism
>>of fuel/ignition and only for a speed rpms derivation - albeit a good one then it might be ok.
>>>Does anybody have experience with that? Could you please point me to some
>>>articles or information on how that particular application of Kalman could
>>>be implemented? Is it really efficient as it sounds like?
>>Ive used a multistage kalman filter in a nucleonic ore flow gauge project where
>>two Co60 beams and counters measured mass flow rate of ore by absorption.
>>ie. Trying to data process two normal curves as they were affected by falling ore
>>and gravity was my first foray into 16 bit micros in 1980 or so. It was a bit over
>>my head but I struggled through it and we made the system work fine though we did
>>bring in a specialist mathematician from India's mining industry to lend a hand, his
>>command of english emabrrased us poor colloquial cohorts !
>>They were reasonably effective and the various coefficients and post processing supplied a total
>>flow rate that was within 1 to 3% *but* the short term accuracy was not better
>>than 20% or so as the various state variables took many cycles to clear or rather
>>'impose' their accumulations on the overall flow rate.
>>In other words I feel it not appropriate to use Kalman for speed measurements
>>and definitely nor for anything requiring any synchronicty at all under any circumstances.
>>>I'm still reading the basic literature about Kalman and Statistics.
>>it was tough for me 26 years ago,
>>I think you wont need it if you can address the h/w issue with respect to noise such
>>as cable routine, impedance of sensors, screening etc
>>Eg. The Crank signal for the EFI and ignition for an RB30 motor is passed in parallel more
>>or less with the spark wiring loom for a few cms, it might blow the odd sensor but doesnt seem to affect
>>noise on a cycle by cycle basis. ie The ignition is smooth and stable for working
>>sensors that dont get too hot...
>>>Much appreciated.
>>>Diy_efi mailing list
>>>Diy_efi at diy-efi.org
>>>Subscribe: http://lists.diy-efi.org/mailman/listinfo/diy_efi
>>>Main WWW page:  http://www.diy-efi.org/diy_efi
>>Regards from
>>Perth, Western Australia
>>VK/VL Commodore Fuse Rail panel that wont warp, twist or melt, guaranteed  !
>>Twin tyres for most sedans, trikes and motorcycle sidecars
>>Diy_efi mailing list
>>Diy_efi at diy-efi.org
>>Subscribe: http://lists.diy-efi.org/mailman/listinfo/diy_efi
>>Main WWW page:  http://www.diy-efi.org/diy_efi
>Diy_efi mailing list
>Diy_efi at diy-efi.org
>Subscribe: http://lists.diy-efi.org/mailman/listinfo/diy_efi
>Main WWW page:  http://www.diy-efi.org/diy_efi

Regards from

Perth, Western Australia
VK/VL Commodore Fuse Rail panel that wont warp, twist or melt, guaranteed  !
Twin tyres for most sedans, trikes and motorcycle sidecars

More information about the Diy_efi mailing list