A method to calculate valve timing commands for an engine with variable
valve timing is hereby disclosed. The method includes determining a valve
feedforward term based on an engine performance command and an
environmental conditions signal, calculating a valve feedback term based
on the engine performance command and an engine performance feedback, and
calculating a valve timing command based on the valve feedforward term and
the valve feedback term.