speed_density.c - aalesv/2boost GitHub Wiki

This file contains all 2Boost maps and map pointer structures for Speed Density, and all Speed Density functions.

Maps and map pointer structures are created and populated manually because they are the same for all targets.

float massAirflow_hooked(float mafVoltage, const table_2d_noconv_t *tablePointerMAF)

This function replaces original calculate mass airflow table function. It takes in a float value representing the MAF sensor voltage value and a pointer to a structure that describes MAF table. Function first calculates airflow basd on MAF sensor readings. Then it calculates mass airflow by Speed Density algorithm, taking into account the corrections from Volumetric Efficiency and Volumetric Efficiency Tip-in tables. Finally, it blends Speed Density calculated mass airflow and MAF sensor calculated mass airflow by formula Airflow = MAF*(1-Blend_Value) + SD*Blend_Value and returns this value. All calculated values are stored to memory for logging purposes.