Patent ID: 7017548

Claim:
An engine controller comprising: crankshaft phase detecting means for detecting a phase of a crankshaft; intake pressure detecting means for detecting an intake pressure of an intake passage of an engine; stroke detecting means for detecting a stroke of said engine on the basis of the phase of said crankshaft detected by said crankshaft phase detecting means, and the intake pressure detected by said intake pressure detecting means; and engine controlling means for controlling an operation state of said engine on the basis of the stroke of said engine detected by said stroke detecting means, wherein said engine controlling means comprising: engine speed detecting means for detecting a speed of said engine; idling detecting means for detecting an idling state of said engine; target engine speed setting means for, when the idling state of said engine is detected by said idling detecting means, setting a target engine speed; and idling ignition timing setting means for, when the idling state of said engine is detected by said idling detecting means, setting an ignition timing in accordance with a difference between the target engine speed set by said target engine speed setting means and the engine speed detected by said engine speed detecting means, wherein when the ignition timing is changed to one of an advancing side and a retarding side, said idling ignition timing setting means avoids continuation of a change of said ignition timing to a same side.