Building an Engine Knock Analyzer with LabVIEW

Alfred Collins, Raeburn Technology

"Using the graphics capabilities of LabVIEW and the Sound and Vibration Toolset, we quickly and easily developed a display that communicated the necessary information."

- Alfred Collins, Raeburn Technology

The Challenge:

Designing an automotive engine knock analyzer that is inexpensive to build, accurate in indicating the presence and intensity of knock on any engine, easy to transport from engine to engine, operational in real time as well as capable of logging data, and intuitive in its operation so that a typical engine dynamometer technician can be quickly trained to interpret the results.

The Solution:

Use an FFT analysis from the Sound and Vibration Toolset running in LabVIEW and a National Instruments data acquisition card of sufficient bandwidth and number of channels to capture and analyze a knock signal.


Knocking in an internal combustion engine is the uncontrolled self-ignition of the air/fuel mixture occurring midway through the combustion cycle, causing extremely high combustion pressure spikes that destroy pistons and rings in the engine. Small amounts of knock (incipient knock) are acceptable in a highly tuned engine, such as might be used in a race car, but the possibility of incipient knock going into a run-away knock condition due to external stress applied to the engine must be thoroughly analyzed. The diameter of the cylinder bore determines the primary knock frequency. Secondary knock frequencies are controlled by the other dimensions of the combustion chamber, high level harmonics, and the downward motion of the piston.


The universally accepted system to detect engine knock is an engine combustion analyzer that measures the gas pressure in the combustion chamber in relation to the crankshaft rotational angle. By using a high pass filter on the pressure signal or its derivative during the period of combustion, we can accurately measure the intensity of knocking. Each cylinder must have an expensive, high temperature pressure transducer installed in the combustion chamber, optimized in location so that the sensor is not in a "dead" area as far as knock is concerned. Since 4 to 10 channels (one for each cylinder) are normally required and a very high speed data acquisition system must be used to perform the analysis in real time, the costs for a complete system typically exceeds $50,000 and the engine must be permanently modified to fit the sensors.

An alternative used by most automobile manufacturers in their production engines is to use one or more accelerometers mounted on the engine block that will sense the high frequency vibrations generated by knock. Unfortunately, the vibrations created in the valve train are typically in the same primary frequency range as the knock signal. The placement of the accelerometers is critical to avoid as much valve train noise as possible and to be as sensitive to the knock vibrations coming from all of the cylinders. The signal from the accelerometers is passed through a low and high pass filter. The low pass signal is integrated to make a threshold signal to represent overall vibrations coming from the engine which are proportional to engine speed. The high pass signal is compared with the threshold signal to determine when knock is occurring. The vibrations from the valve train cause a great deal of error in this system at high RPM, due to its inability to distinguish between valve noise and knock. Additionally, this type system can not detect incipient knock.



In order to have an accurate indication of engine knock from a block mounted accelerometer, the vibrations from the valve train and any other vibration causing system (crankshaft and pistons) must be separated from the knock signal. An IIR filter set from the Signal Processing Library could be used for this purpose, but each engine would have different frequency characteristics. By using a fast Fourier Transform those frequency characteristics may be determined and the appropriate cross over frequencies may be applied to the set of IIR filters. This system was fully implemented in LabVIEW and gives excellent results, but requires a great deal of skill and training on the part of the operator to interpret the FFT.


The operator’s determination of cross over frequencies for each engine could be substantially simplified by using an averaging fast Fourier Transform. The characteristics could quickly be identified by comparing an averaged FFT at the same RPM when the engine is audibly knocking to when it is not. The averaging FFT from the NI Sound and Vibration Toolkit was used to make these measurements, averaging over 400 combustion cycles per cylinder. From this information the operator can accurately determine what unique frequencies to use in the IIR filter set. Using the graphics capabilities of LabVIEW and the Sound and Vibration Toolkit, we quickly and easily developed a display that communicated the necessary information. The averaging FFT system reduced both the skill level of the operator and training time. However, the averaging FFT still depended on history to make the cross over frequency determination.


What we ultimately needed was a real time system that was intuitive to the operator. The Sound and Vibration Toolset again came to our aid with one of the most spectacular displays that is available for FFT analysis. We used the sliding window FFT to display the frequency and amplitude relative to time. By using a wide range of colors to indicate the intensity of the signal, we make the interpretation intuitive. By using appropriate examples, we can quickly train the operator to identify not only intense knock, but also incipient knock. The three dimensional view allows us to easily separate the valve train vibrations and any other engine vibrations from the knock signal. The best feature of the system is the ability to distinguish incipient knock from high intensity knock.. See Figure 4. Note that the combustion cycles with high intensity knock have tall, bright red, yellow and white "totem poles." The ones with incipient knock have dark blue and purple spots above the main combustion area



We modified a 400 horsepower four wheel drive Porsche Twin Turbo to achieve 600+ horsepower with all emissions systems operative and running on 93 octane street gas. It was capable of a quarter mile acceleration time of mid 10 seconds, top speed of 204 mph and weighed in at 3500 pounds. We entered the car, shown in Figure 5, in the One Lap of America race which included 8 road racing courses and one drag strip, winning 6 of these events. Unfortunately, the engine blew up at the event at Pikes Peak, while using 91 octane gas. Of course I blamed the stupid helper who put 91 octane gas in it. Little did I realize that it was the stupid engine builder (me) who was to blame.


The Engine Knock Analyzer revealed the truth! Even with 93 octane gas, the engine had significant amounts of knock, as we have shown in the screen shots below. We found that the air flow meter was improperly calibrated, causing the engine to knock at high boost levels.


By using LabVIEW with the Sound and Vibration Toolkit, we have been able to develop a real time knock analyzer that with the help of the striking visual display makes the determination of knock intuitive and accurate, and is low in cost.


Author Information:

Alfred Collins
Raeburn Technology
11247 Raeburn Lane
Rixeyville, VA 22737
United States
Tel: 540-937-5881
Fax: 540-937-5881

Figure 1. Two combustion cycles of severe knock.
Figure 2. A sliding window FFT showing seven combustion cycles, three with severe knock.