The high compression ratio in Diesel engines leads to pronounced minima of the flywheel angular velocity at idle conditions. The minima coincide with the zero crossover of the torque acting on the crankshaft; that is when a piston is in the TDC position. The ring gear of the flywheel with one marked tooth is used as an angular scale. The ring gear is not precise enough to observe the minima of angular velocity directly, but the “center of gravity” of the peak below the mean angular velocity correlates with the TDC with an error less than 0.5° CA. A Software TDC Generator is proposed, that calibrates the angular position of the marked tooth at idle conditions, and generates continuously an output pulse (TDC-pulse) at a given angular position of the crankshaft.