crankshaft or cam sensor
The crankshaft and camshaft sensors back each other up. If one does not work it could still run with the other one. If only one is present it wouldn’t. This gives the ecu or pcm away to know the timing of the engine. In older non injected cars the only timing needed was for the distributer to supply the engine with spark at the correct time. This was done mechanically and was usually assisted by vacuum at lower rpm to advance the spark timing curve. Then throttle body injection came along and the ecu needed to know when in the rotation to open injectors and which ones to open. The throttle body injection used a pulse off of the distributor to fire the injectors each time the engine made a revolution. Early injection systems used bank fire systems which injected fuel into certain cylinders one revolution then into the others on the next revolution. Newer systems are much more complex and need more information. That is where the camshaft sensor comes in. It will rotate twice for every one rotation of the crankshaft. By doing this it knows when each cylinder is coming up to top dead center on the compression stroke. This way it won’t fire on the opposing stroke to waste any fuel that could drop out on the cylinder wall, wasting fuel. It also now controls the spark ignition timing to each cylinder. The ecu now distributes the spark instead of the distributor. The coil packs are now on top of the spark plugs instead of a single coil being inside the distributor.