Four-stroke engine
Four-stroke cycle used in gasoline engines. The right blue side is the intake and the left yellow side is the exhaust. The cylinder wall is a thin sleeve surrounded by cooling water.

Today, internal combustion engines in cars, trucks, motorcycles, aircraft, construction machinery and many others, most commonly use a four-stroke cycle. The four strokes refer to intake, compression, combustion (power), and exhaust strokes that occur during two crankshaft rotations per working cycle of the gasoline engine and diesel engine.

The cycle begins at top dead center (TDC), when the piston is farthest away from the axis of the crankshaft. On the intake or induction stroke of the piston, the piston descends from the top of the cylinder, reducing the pressure inside the cylinder. A mixture of fuel and air is forced (by atmospheric or greater pressure) into the cylinder through the intake (inlet) port. The intake (inlet) valve (or valves) then close(s), and the compression stroke compresses the fuel–air mixture.

The air–fuel mixture is then ignited near the end of the compression stroke, usually by a spark plug (for a gasoline or Otto cycle engine) or by the heat and pressure of compression (for a Diesel cycle or compression ignition engine). The resulting pressure of burning gases pushes the piston through the power stroke. In the exhaust stroke, the piston pushes the products of combustion from the cylinder through an exhaust valve or valves. The largest and intermediate size diesel engines are usually two stroke diesel engines, requiring scavenging air pumps or blowers.

History
The four-stroke engine was first patented by Eugenio Barsanti and Felice Matteucci in 1854, followed by a first prototype in 1860. It was also conceptualized by French engineer, Alphonse Beau de Rochas in 1862.

However, the German engineer Nicolaus Otto was the first to develop a functioning four-stroke engine, which is why the four-stroke principle today is commonly known as the Otto cycle and four-stroke engines using spark plugs often are called Otto engines. The Otto Cycle consists of adiabatic compression, heat addition at constant volume, adiabatic expansion and rejection of heat at constant volume.

Design and engineering principles
Internal combustion engine power primarily originates from the expansion of gases in the power stroke. Compressing the fuel and air into a very small space increases the efficiency of the power stroke, but increasing the cylinder compression ratio also increases the heating of the fuel as the mixture is compressed (following Charles's law).

A highly flammable fuel with a low self-ignition temperature can combust before the cylinder reaches top-dead-center (TDC), potentially forcing the piston backwards against rotation. Alternately, a fuel which self-ignites at TDC but before the cylinder has started downwards can damage the piston and cylinder due to the extreme thermal energy concentrated into a very small space with no relief. This damage is often referred to as engine knocking and can lead to permanent engine damage if it occurs frequently.

The octane rating is a measure of the fuel's resistance to self-ignition, by increasing the temperature at which it will self-ignite. A fuel with a greater octane rating allows for a much higher compression ratio without the risk of damage due to self-ignition.

Diesel engines rely on self-ignition for the engine to function. They solve the engine damage problem by separately injecting high-pressure fuel into the cylinder shortly before the piston has reached TDC. Air without fuel can be compressed to a very high degree without concern for self-ignition, and the highly pressurized fuel in the fuel injection system cannot ignite without the presence of air.

Power output limit
The maximum amount of power generated by an engine is determined by the maximum amount of air ingested. The amount of power generated by a piston engine is related to its size (cylinder volume), whether it is two stroke or four stroke, volumetric efficiency, losses, air to fuel ratio, the calorific value of the fuel, oxygen content of the air and speed (RPM). The speed is ultimately limited by material strength and lubrication. Valves, pistons and connecting rods suffer severe acceleration forces. At high engine speed, physical breakage and piston ring flutter can occur, resulting in power loss or even engine destruction. Piston ring flutter occurs when the rings oscillate vertically within the piston grooves they reside in. Ring flutter compromises the seal between the ring and the cylinder wall which results in a loss of cylinder pressure and power. If an engine spins too quickly, valve springs cannot act quickly enough to close the valves. This is commonly referred to as 'valve float', and it can result in piston to valve contact, severely damaging the engine. At high speeds the lubrication of piston cylinder wall interface tends to break down. This limits the piston speed for industrial engines to about 10 m/sec.

Intake/exhaust port flow
The output power of an engine is dependent on the ability of intake (air–fuel mixture) and exhaust matter to move quickly through valve ports, typically located in the cylinder head. To increase an engine’s output power, irregularities in the intake and exhaust paths, such as casting flaws, can be removed, and, with the aid of an air flow bench, the radii of valve port turns and valve seat configuration can be modified to reduce resistance. This process is called porting, and it can be done by hand or with a CNC machine.

Valvetrain
The valves are typically operated by a camshaft rotating at half the speed of the crankshaft. It has a series of cams along its length, each designed to open a valve during the appropriate part of an intake or exhaust stroke. A tappet between valve and cam is a contact surface on which the cam slides to open the valve. Many engines use one or more camshafts “above” a row (or each row) of cylinders, as in the illustration, in which each cam directly actuates a valve through a flat tappet. In other engine designs the camshaft is in the crankcase, in which case each cam contacts a push rod, which contacts a rocker arm which opens a valve. The overhead cam design typically allows higher engine speeds because it provides the most direct path between cam and valve.

Valve clearance
Valve clearance refers to the small gap between a valve lifter and a valve stem that ensures that the valve completely closes. On engines with mechanical valve adjustment excessive clearance will cause noise from the valve train. Typically the clearance has to be readjusted each 20,000 miles with a feeler gage.

Most modern production engines use hydraulic lifters to automatically compensate for valve train component wear. Dirty engine oil may cause lifter failure.

See also
* Poppet valve
* Atkinson cycle
* Desmodromic valve
* Six stroke engine
* Two-stroke engine
* History of the internal combustion engine