According to another aspect of the invention, there is provided a controller for a internal combustion engine including a pressure sensor for sensing changes in the gas pressure within the combustion chamber of the engine; a circuit for detecting the moment of maximum pressure from the output of the pressure sensor; a maximum-pressure crank angle detecting circuit receiving as one input thereto th