Control for minimising NOx emissions