A two-stroke engine is a type of internal combustion engine with a simple mechanism. There is a cycle of intake, compression, power and exhaust strokes with each movement of the piston. It is different from the four-stroke engine because the different stages are not so clearly defined: intake and exhaust happen at the same time, for example. One stroke of the engine is the movement of the piston from bottom dead centre to top dead centre. The first stroke is therefore for compression and intake, and the second for exhaust and heat transfer.

The Otto Cycle is a thermodynamic cycle which describes the functions of spark ignition internal combustion engines. It was developed by Beau de Rochas and successfully applied by the German engineer Nikolaus Otto in 1876 and later by Étienne Lenoir and Rudolf Diesel. Motors based on the cycle are currently used in most passenger cars. When used, it is possible to build four-stroke motors which are more efficient and less polluting than two-stroke motors, in spite of the greater number of moving parts, greater complexity, weight and size, when comparing motors with the same power.

Four-stroke cycle
The thermodynamic cycles in real machines are different from theoretical cycles because the processes are only close to the ideal model, since motors undergo several irreversible processes, such as friction.

Mechanical cycle First, we consider the use of only two valves which are activated by the movement of the camshaft. One is the intake valve, which lets a mixture of air and fuel into the cylinder, and the other is the exhaust valve which allows the used gases to escape. The cycle of a four-stroke engine works in the following way:

1. With the piston in the TDC (top dead centre) position, the intake valve is opened, while the exhaust valve remains closed. The amount of fuel mixture which enters the cylinder is regulated by a fuel supply system, which can be a carburettor or an electronic fuel injection system, which replaces the mechanical commands of mechanical systems with an electronic one to get better performance, especially when rapid response is required of the motor. The piston is pushed downwards by the crankshaft, and moves to the BDC (bottom dead centre) position. This movement is called the first stroke, or intake stroke.

2. The intake valve is closed, with the cylinder full of the fuel-air mixture, which is then compressed by the piston, pushed upwards towards the head of the motor by the crankshaft until reaching TDC again. In the animation we can see that both valves remain closed throughout this movement. This second movement is known as the second stroke, or compression stroke.

3. When the piston reaches TDC, the fuel-air mixture which is compressed in the space between the upper end of the piston and the cylinder head, known as the combustion chamber, is ignited by the spark plug and "explodes". The rise in pressure caused by the expansion of gases pushes the piston down to BDC, transferring the energy through the crankshaft and producing the rotational force necessary to rotate the motor axis which will later be transferred to the drive wheel. This third movement is known as the third stroke, or power stroke, since it is the stroke which actually produces power, and the other strokes only use the rotational energy built up in the flywheel ("inertia"), which allows it to continue turning via the cranks while the other three strokes take place.

4. The cylinder is now full of spent gases. This is when the piston is pushed by the cranks to the top position again and the exhaust valve opens. As the piston rises, it expels the spent gases from the cylinder, and when it reaches TDC the exhaust valve closes again. This fourth stage is called the fourth stroke, or exhaust stroke.

. After the gases have been expelled, the motor returns to its starting conditions and the cycle begins again.

Multivalve motors These motors are merely perfected versions of the Otto cycle or four-stroke engines and the only difference is that they have at least two valves to carry out one function at the same time. In a conventional motor, there is one valve for intake and another for exhaust. There are currently 3 configurations for multivalve engines, which are models with 3, 4 or 5 valves per cylinder. For a motor with 3 valves per cylinder, 2 are for intake and only one for exhaust, a 4-valve motor has 2 for intake and 2 for exhaust and a 5-valve motor has 3 for intake and 2 for exhaust. The main function of multivalve engines is maximising the flow of gases which enters (more oxygen comes in) and exits (more gases are released with less force), allowing for greater efficiency in the combustion process.