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 (Rotations 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
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.