A method of controlling a variable valve timing system comprising
calculating, by a sliding mode control, a first control amount based on a
deviation between a target value and an actually measured value of the
position of the displacing member of the variable valve timing system,
calculating a second control amount by integrating the deviation as an
input when the deviation falls within a predetermined numeric value range
containing a zero value, or by integrating the zero value as the input
when the deviation falls outside the predetermined numeric value range;
and adding the first control amount and the second control amount to set
a compensation control amount for compensating the position of the
displacing member.