Working Principle of a Four-stroke Gasoline Engine
The reason why a four-stroke gasoline engine can continuously provide power is that the four strokes within the cylinder - intake, compression, power generation, and exhaust - operate in an orderly manner in a cyclic process.

The working principle of a four-stroke gasoline engine
Intake Stroke: As the piston moves from the top dead center to the bottom dead center within the cylinder, the intake valve opens while the exhaust valve closes, and fresh air and gasoline mixture are drawn into the cylinder.
Compression stroke: The intake and exhaust valves are closed, and the piston moves from the bottom dead center to the top dead center, compressing the mixture gas to the top of the cylinder to raise its temperature and prepare for the power stroke.
Power stroke: The spark plug ignites the compressed gas, causing the mixture to undergo an "explosion" inside the cylinder and generating tremendous pressure. This pressure pushes the piston from the top dead center to the bottom dead center, and then the connecting rod drives the crankshaft to rotate.
Exhaust Stroke: As the piston moves from the bottom dead center to the top dead center, the intake valve closes and the exhaust valve opens. The exhaust gases produced by combustion are discharged from the cylinder through the exhaust manifold.

Working Principle of Four-Stroke Gasoline Engine (Animated Diagram)
Working Principle of Four-Stroke Diesel Engine
Like gasoline engines, each working cycle of a four-stroke diesel engine consists of the intake stroke, compression stroke, power stroke and exhaust stroke. Since diesel engines use diesel as fuel, compared with gasoline, diesel has a lower auto-ignition temperature, higher viscosity and is less prone to evaporation. Therefore, diesel engines adopt compression-ends self-ignition for ignition.

The working principle of a four-stroke diesel engine
Working Principle of Two-Stroke Gasoline Engine
There are three holes on the cylinder block of the engine, namely the intake hole, the exhaust hole and the scavenging hole. These three holes are respectively closed by the piston at certain moments.

The working principle of a two-stroke gasoline engine
First stroke: The piston moves upward from the bottom dead center. After the three air holes are simultaneously closed, the mixture entering the cylinder is compressed; when the intake hole is exposed, the combustible mixture flows into the crankcase.
The second stroke: When the piston compresses near the top dead center, the spark plug ignites the combustible mixture, and the expanding gas pushes the piston down to do work. At this time, the intake hole is closed, and the combustible mixture sealed in the crankcase is compressed; when the piston approaches the bottom dead center, the exhaust hole opens, and the exhaust gas is expelled; then the intake and exhaust valves open, and the compressed combustible mixture under pre-pressure is injected into the cylinder to expel the exhaust gas and complete the intake stroke.

Working Principle of Two-stroke Engine (Animated Diagram)
Working principle of a rotor engine

Working Principle of the Rotor Engine (Animated Diagram)
The internal space of the shell (or the spiral-wound chamber) is always divided into three working chambers. During the rotation of the rotor, the volumes of the three chambers keep changing. In the cycloidal cylinder, the four strokes of intake, compression, combustion and exhaust are successively completed in sequence at different positions within the cylinder. Each stroke is carried out at a different position within the cycloidal cylinder.

Working principle of a rotor engine
Engine Terminology
Top Dead Center and Bottom Dead Center

Top Dead Center (TDC) and Bottom Dead Center (BDC)
Top Dead Center (TDC) is the highest point of the piston's travel, or the position of the piston when the cylinder volume is at its minimum. On the other hand, Bottom Dead Center (BDC) is the lowest point of the piston's travel, or the position of the piston when the cylinder volume is at its maximum.
Combustion chamber volume

Combustion chamber volume
The combustion chamber volume refers to the volume between the top of the piston and the cylinder head when the piston is at the top dead center. It is called the combustion chamber volume and is generally denoted by Vc. The volume of the entire space above the piston top (the space enclosed by the top of the piston, the bottom surface of the cylinder head and the surface of the cylinder liner, and for the concave-top piston, including the volume of the concave part) is the combustion chamber volume.
Compression ratio

Compression ratio
When the piston reaches the top dead center, compared with when it reaches the bottom dead center, the volume ratio of the mixed gas in the cylinder is what we call "compression ratio". Taking the Volvo S60L T3 as an example, the compression ratio is 10.4, which means that when the piston is between the top and bottom dead centers, the volume ratio of the mixed gas in the cylinder is 1:10.4.
