In a variable valve mechanism, a control shaft is associated with an advance oil passage such that the same passage is closed by the control shaft when a maximum valve lift amount of an intake valve is equal to or larger than a reference lift amount. The SOC is directed to wait until the output is within an expected range before moving to the next step in a start-up procedure. The resultant net force properly spaces the sensors from the web to ensure reliable and accurate sensing.