Patent ID: 8205584

Claim:
A control device of a variable valve mechanism, the variable valve mechanism having a motor that varies an actuation parameter of a valve of an internal combustion engine, a rotational angle of the motor being restricted to a set angular range, the control device detecting a current value of the valve actuation parameter based on the motor rotational angle, the control device comprising: a position sensor that outputs a pulse signal when the motor rotates; a position counter that calculates a position counter value by counting edges of the pulse signal; a detecting portion, wherein when in a powered state, the detecting portion obtains a detection value of the motor rotational angle based on the counter value; a determining portion that detects an operating state of the engine and the powered state of the detecting portion, wherein when detecting that the engine is operating and the detecting portion is in a non-powered state, the determining portion determines that the detection value of the motor rotational angle is displaced from an actual value of the motor rotational angle; electric angle sensors; a plurality of electric angle counters each counting an electric angle counter value in accordance with which an energizing phase of a brushless motor is switched, the electric angle counter value being changed cyclically in correspondence with an output pattern of pulse signals output by the electric angle sensors, an interval between the edges of the pulse signals output by the position sensors being set to a value shorter than an interval between edges of the pulse signals output by the electric angle sensors; and a calculating portion provided in the detecting portion, the calculating portion calculating a change equivalent value based on a first counter value Eg and a second counter value Ei, the first counter value Eg being the electric angle counter value at a time when ignition is turned off, the second counter value being the electric angle counter value at a time when the ignition is turned on for a first time after the ignition is turned off, the change equivalent value being a value obtained by converting, to a counter value of the position counter, a change of the motor rotational angle that is caused in the time from when the ignition is turned off to when the ignition is turned on, and a determination period being set to a value longer than one cycle of each electric angle counter, wherein the motor is the brushless motor, and wherein the calculating portion further calculates a correction value, which is a difference between the change equivalent value the position counter value at the time when the ignition is turned off, the correction value being a value that is used for correcting the position counter value such that the position counter value corresponds to the actual value of the motor rotational angle.