A method of controlling cylinder valve switching between a first valve
condition and a second valve condition for transitioning between
combustion modes of an engine comprises adjusting timing of a signal to
switch between said valve conditions in response to information from a
combustion sensor, wherein said combustion modes include spark ignition
and homogeneous charge compression ignition.