In a structure in which an opening-and-closing timing of an intake valve and/or
an exhaust valve is varied due to a rotational phase of a camshaft with respect
to a crankshaft of an internal combustion engine being varied, the rotational phase
is detected at each rotational period of the camshaft on the basis of a reference
rotational position of the crankshaft and a reference rotational position of the
camshaft which have been detected, and on the other hand, the rotational phase
is detected in an arbitrary timing regardless of the rotational period of the camshaft.
Further, a correction value for correcting the rotational phase detected in an
arbitrary timing is learned with the rotational phase detected at each rotational
period of the camshaft as a reference.