Design and rapid prototyping of a closed-loop control strategy of the injected mass for the reduction of CO2, combustion noise and pollutant emissions in diesel engines