A control apparatus which is capable of compensating for a control error
properly and quickly even under a condition where the control error is
temporarily increased e.g. by degradation of reliability of the detection
results of reference parameters other than controlled variables, thereby
making it possible to ensure a high accuracy of control. An air-fuel
ratio controller of the control apparatus calculates an air-fuel ratio
error estimated value and an error weight, calculates an modified error,
calculates a basic lift correction value such that the modified error
becomes equal to 0, calculates a lift correction value, calculates
corrected valve lift by adding the lift correction value to valve lift,
calculates a first estimated intake air amount for feedforward control of
an air-fuel ratio according to the corrected valve lift, calculates an
air-fuel ratio correction coefficient for feedback control of the
air-fuel ratio, and calculates a fuel injection amount according to
these.