Camshafts (often shortened to "cams") are rotating rods with lobes on them that control the valves and their timing, and are only found on piston engines.
A typical camshaft will spin at half of the engine's speed (Revolutions Per Minute), because the valves they control don't open for every crankshaft rotation; they open every other rotation, due to the four-stroke engine's combustion cycle (intake, compression, combustion, and exhaust strokes).
The cam lobe length determines how far the valves open, and the shape determines how soon they open, as well as how quickly. The angle degree difference between the intake and exhaust valves is called a separation angle. This angle is usually between 107° and 117°.
Cams with smaller angles are easier to advance the timing of without having it become an immediate trade-off/gain and loss between the intake and exhaust valve timing.
Camshaft Position Sensor
The camshaft position sensor is found on some engines. The sensor is usually used to determine engine speed, either instead of or along with a crankshaft position sensor. In some variable valve timing engines, it also lets the computer know the cam adjustment is working. Most rotation-based sensors like this work by counting how often a magnet on the shaft passes by.
If the sensor goes bad, some timing-based functions may suffer as a result, and the check engine light may come on.
The lobes are the parts of the camshaft which have a slight egg-shape to them. The shape affects how the valves (both exhaust and intake) open. The further away the surface is from the cam's rotation center, the further the lobe is pushing the valvetrain components, which ultimately leads to the valves being pushed further open. Valves that open more allow air to flow in and out more freely, reducing resistance which robs the engine of power.
Cam Lobe Duration by Engineering Explained
A circular cam lobe would have no duration, so the distance between the point where the lobe begins extending the valvetrain to the point where it ends is considered the cam lobe duration. A longer duration allows the air more time to pass through the opening the lifted valve reveals.
Variable Cam Timing
A newer development for camshafts is the addition of a cam phaser that allows for movement of the cam shaft relative to the timing gear/belt. The phaser allows for some degree of adjustment that an ECU.
The camshaft phaser is a component that allows the camshaft to rotate some number of degrees relative to the cam gear mounted on it. The inner workings, typically hydraulic, allow electronic controls to alter the advance of the camshaft based on factors like RPM and engine load. In hydraulic phasers, the engine oil pump pushing oil into the tight tolerances of the engine internals creates oil pressure that is either allowed in, to alter the position of the cam, or kept out, to keep it in the original/basic position.