using an air cleaner 15 and an intake flow rate of the air to be a base for calculating a fuel injection rate is measured using an air flow sensor 16 a control unit 63 for controlling the engine 1 comprises an operating condition detecting means 66 for detecting an operating condition of the engine 1 based on signals from various kinds of sensors a variable valve control means 64 for controlling operation of the variable valve mechanisms 30 40 attached onto the engine 1 and a fuel injection control means 65 for controlling for controlling an amount of fuel to be injected from the fuel injector 12 and the injection timing an operating amount of an acceleration pedal 61 operated by a driver 60 of a vehicle mounting the engine 1 is converted into an electric signal using a potentiometer 62 and input to the operating condition detecting means 66 in the control unit 63 other signals to be input to the operating condition detecting means are for example signals from crank sensors 6 7 attached to the crank shaft 5 from the air flow sensor 16 described above from an intake pipe pressure sensor 14 from an air to fuel ratio sensor 24 attached to the.