Knocking (also called knock, detonation or spark knock, pinking in UK English or pinging in US English) in spark-ignition internal combustion engines occurs when combustion of the air/fuel mixture in the cylinder starts off correctly in response to ignition by the spark plug, but one or more pockets of air/fuel mixture explode outside the envelope of the normal combustion front. The fuel-air charge is meant to be ignited by the spark plug only, and at a precise time in the piston's stroke cycle. The peak of the combustion process no longer occurs at the optimum moment for the four-stroke cycle. The shock wave creates the characteristic metallic "pinging" sound, and cylinder pressure increases dramatically. Effects of engine knocking range from inconsequential to completely destructive. It should not be confused with pre-ignition (or preignition), as they are two separate events.
Under ideal conditions the common internal combustion engine burns the fuel/air mixture in the cylinder in an orderly and controlled fashion. The combustion is started by the spark plug some 5 to 40 crankshaft degrees prior to top dead center (TDC), depending on engine speed and load. This ignition advance allows time for the combustion process to develop peak pressure at the ideal time for maximum recovery of work from the expanding gases.
The spark across the spark plug's electrodes forms a small kernel of flame approximately the size of the spark plug gap. As it grows in size its heat output increases allowing it to grow at an accelerating rate, expanding rapidly through the combustion chamber. This growth is due to the travel of the flame front through the combustible fuel air mix itself and due to turbulence rapidly stretching the burning zone into a complex of fingers of burning gas that have a much greater surface area than a simple spherical ball of flame would have. In normal combustion, this flame front moves throughout the fuel/air mixture at a rate characteristic for the fuel/air mixture. Pressure rises smoothly to a peak, as nearly all the available fuel is consumed, then pressure falls as the piston descends. Maximum cylinder pressure is achieved a few crankshaft degrees after the piston passes TDC, so that the increasing pressure can give the piston a hard push when its speed and mechanical advantage on the crank shaft gives the best recovery of force from the expanding gases.
Detonation can be prevented by the use of a fuel with high octane rating, which increases the combustion temperature of the fuel and reduces the proclivity to detonate; enriching the fuel/air ratio, which adds extra fuel to the mixture and increases the cooling effect when the fuel vaporizes in the cylinder; reducing peak cylinder pressure by increasing the engine revolutions (e.g., shifting to a lower gear); decreasing the manifold pressure by reducing the throttle opening; or reducing the load on the engine. Because pressure and temperature are strongly linked, knock can also be attenuated by controlling peak combustion chamber temperatures at the engineering level by compression ratio reduction, exhaust gas recirculation, appropriate calibration of the engine's ignition timing schedule, and careful design of the engine's combustion chambers and cooling system. As an aftermarket solution, a water injection system can be employed to reduce combustion chamber peak temperatures and thus suppress detonation.
Knocking is unavoidable to a greater or lesser extent in diesel engines, where fuel is injected into highly compressed air towards the end of the compression stroke. There is a short lag between the fuel being injected and combustion starting. By this time there is already a quantity of fuel in the combustion chamber which will ignite first in areas of greater oxygen density prior to the combustion of the complete charge. This sudden increase in pressure and temperature causes the distinctive diesel 'knock' or 'clatter', some of which must be allowed for in the engine design. Careful design of the injector pump, fuel injector, combustion chamber, piston crown and cylinder head can reduce knocking greatly, and modern engines using electronic common rail injection have very low levels of knock. Engines using indirect injection generally have lower levels of knock than direct injection engine, due to the greater dispersal of oxygen in the combustion chamber and lower injection pressures providing a more complete mixing of fuel and air.
An unconventional engine that makes use of detonation to improve efficiency and decrease pollutants is the Bourke engine.
The phenomenon is also referred to as after-run, or run-on when it causes the engine to carry on running after the ignition is shut off, or sometimes dieseling, in reference to the fact that a heated diesel engine may, by design, run without an external ignition trigger so long as a suitable fuel/air mixture is supplied to the cylinders. This effect is more readily achieved on carbureted gasoline engines, as the fuel supply to the carburetor is typically regulated by a mechanical float valve and fuel delivery can feasibly continue until fuel line pressure has been relieved, provided the fuel can be somehow drawn past the throttle plate. The occurrence is rare in modern engines with throttle-body or electronic fuel injection, as the injectors will not be permitted to continue delivering fuel after the engine is shut off, and any occurrence may indicate the presence of a leaking (failed) injector.
Preignition and engine knock both sharply increase combustion chamber temperatures. Consequently, either effect increases the likelihood of the other effect occurring, and both can produce similar effects from the operator's perspective, such as rough engine operation or loss of performance due to operational intervention by a powertrain-management computer. For reasons like these, a person not familiarized with the distinction might describe one by the name of the other. Given proper combustion chamber design, preignition can generally be eliminated by proper spark plug selection, proper fuel/air mixture adjustment, and periodic cleaning of the combustion chambers.