A current value of an intake valve phase calculated based on a sensor
output is smoothed along the direction of time axis in accordance with a
smoothing factor, whereby a phase detection value is detected. At the
time of reference position learning, the smoothing factor is set to a
value larger than at the time of normal control, so that the degree of
smoothing in the smoothing process of phase detection value becomes
smaller. Therefore, it is possible to detect more quickly that the intake
valve timing has reached the reference timing at the time of reference
position learning based on the phase detection value, than when a common
smoothing factor is set both for the normal control and for the reference
position learning.