A method of controlling a variable valve actuation system for an engine is provided.
A cam assembly is operated to move an intake valve between a first position and
a second position. A parameter indicative of an altitude at which the engine is
operating is sensed. A first lookup map is accessed to determine a desired air-to-fuel
ratio when the sensed parameter indicates that the engine is operating at an altitude
below a first predetermined value. A second lookup map is accessed to determine
a desired air-to-fuel ratio when the sensed parameter indicates that the engine
is operating at an altitude above the first predetermined value. A desired valve
actuation period is determined based on the determined air-to-fuel ratio. The intake
valve is prevented from returning to the first position until the end of the determined
valve actuation period.