When controlled variable in a variable valve event and lift mechanism is
made to be a predetermined value, requested closing timing at which a
target air amount can be obtained and requested opening timing at which a
target residual gas rate can be obtained are calculated, and the
controlled variable is changed in stepwise until an absolute value of a
deviation between a requested operating angle at the requested closing
timing and the requested opening timing, and an operating angle
corresponding to the controlled variable, reaches a predetermined value
or less, so that the controlled variable of the time when the absolute
value of the deviation reaches the predetermined value or less is set to
a desired value.