An arrangement, a computer-readable medium and a method for controlling an
HCCI (homogenous charge compression ignition) engine are disclosed. The
arrangement comprises a control unit for initiating closure and/or
opening of the inlet valve and/or the exhaust valve at a current
crankshaft angle in such a way that self-ignition of the fuel mixture
occurs when the crankshaft is at a target crankshaft angle. The
arrangement comprises cards for storing relevant values of the current
crankshaft angle as a function of at least one operation-related
parameter such as engine speed, temperature and pressure, and an
estimator estimating values of the operation-related parameter during
operation of the combustion engine. The control unit can adjust the inlet
valve and/or the exhaust valve depending on the stored value of the
current crankshaft angle.