An internal combustion engine has a camshaft whose phase can be adjusted
with respect to a crankshaft by means of a setting mechanism. Also
provided are a crankshaft sensor which senses the crankshaft angle and a
camshaft sensor which senses the camshaft angle. The method comprises the
following steps: A reference value for the phase is adapted in a
predefined position of the setting mechanism when a predefined condition
is satisfied. A measurement value for the phase is determined depending
on the sensed crankshaft angle and camshaft angle. A corrected
measurement value for the phase is determined depending on the reference
value and the measurement value for the phase. A control signal for
controlling the internal combustion engine is determined depending on the
corrected measurement value.