Function of crankshaft position sensor