Knocking (also called pinking or pinging)—technically detonation— in internal combustion engines occurs when fuel in the cylinder is ignited by the firing of the spark plug but burns too quickly, combusting completely before the optimum moment during the compression phase of the four-stroke cycle. The resulting shockwave collides with the rising piston, creating a characteristic metallic "pinging" sound.
The fuel/air mixture is normally ignited slightly before the point of maximum compression to allow a small time for the flame-front of the burning fuel to expand throughout the mixture, so that maximum pressure occurs at the point of maximum compression. The flame-front moves at about 1100 feet/second during normal combustion. It is only when this flame front is disrupted, for whatever reason, that the knocking effect occurs. It is caused by an instantaneous ignition of the remaining fuel/air mixture in the form of an explosion. The cylinder pressure rises dramatically beyond design limits. If allowed to persist detonation will cause vibration and damage to engine parts.
Detonation can typically be prevented by:
1. the use of higher octane petrol
2. the addition of octane-increasing "lead", isooctane, or other fuel additives
3. reduction of cylinder pressure by increasing the engine revolutions or reducing the load on the engine, or both
4. reduction of in-cylinder temperatures (such as through cooling or compression ratio reduction), or
5. retardation of spark plug ignition.
Correct ignition timing is essential for optimum engine performance and fuel efficiency. Modern automotive and small-boat engines have sensors that can detect knock and delay the spark plug firing to prevent it, allowing engines to safely use petrol of lower octane ratings, with the consequence of reduced power and efficiency.
Detonation is a different phenomenon from pre-ignition, which occurs when the air/fuel mixture in the cylinder (or even just entering the cylinder) ignites before the spark plug fires. Pre-ignition is caused by heat build-up in engine intake or cylinder components due to improper design or maintenance, or overheating of the air/fuel mixture during compression, and can only be prevented by eliminating the overheating (through redesign) or the compression effects (by reducing the load). As such, if pre-ignition is allowed to continue for any length of time, power output reduces drastically and engine damage can result.