auto-sync

This commit is contained in:
rusEfi 2016-03-11 15:01:58 -05:00
parent 09a2a885bc
commit 85ab91e540
7 changed files with 21 additions and 20 deletions

View File

@ -580,8 +580,8 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
tsOutputChannels->massAirFlowVoltage = hasMafSensor() ? getMaf() : 0;
tsOutputChannels->massAirFlow = hasMafSensor() ? getRealMaf() : 0;
tsOutputChannels->veValue = veMap.getValue(getMap(), rpm);
tsOutputChannels->currentTargetAfr = afrMap.getValue(getMap(), rpm);
tsOutputChannels->veValue = veMap.getValue(rpm, getMap());
tsOutputChannels->currentTargetAfr = afrMap.getValue(rpm, getMap());
tsOutputChannels->airFuelRatio = getAfr(PASS_ENGINE_PARAMETER_F);
if (hasVBatt(PASS_ENGINE_PARAMETER_F)) {
tsOutputChannels->vBatt = getVBatt(PASS_ENGINE_PARAMETER_F);

View File

@ -74,9 +74,9 @@ static angle_t getRunningAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAME
return engineConfiguration->step1timing;
}
float iatCorrection = iatAdvanceCorrectionMap.getValue(engine->engineState.iat, (float) rpm);
float iatCorrection = iatAdvanceCorrectionMap.getValue((float) rpm, engine->engineState.iat);
float result = advanceMap.getValue(engineLoad, (float) rpm) + iatCorrection
float result = advanceMap.getValue((float) rpm, engineLoad) + iatCorrection
// todo: uncomment once we get useable knock - engine->knockCount
;
engine->m.advanceLookupTime = GET_TIMESTAMP() - engine->m.beforeAdvance;

View File

@ -187,8 +187,8 @@ void EngineState::periodicFastCallback(DECLARE_ENGINE_PARAMETER_F) {
/**
* *0.01 because of https://sourceforge.net/p/rusefi/tickets/153/
*/
currentVE = baroCorrection * veMap.getValue(map, rpm) * 0.01;
targerAFR = afrMap.getValue(map, rpm);
currentVE = baroCorrection * veMap.getValue(rpm, map) * 0.01;
targerAFR = afrMap.getValue(rpm, map);
} else {
baseTableFuel = getBaseTableFuel(engineConfiguration, rpm, engineLoad);
}

View File

@ -64,7 +64,7 @@ float getRealMafFuel(float airSpeed, int rpm DECLARE_ENGINE_PARAMETER_S) {
*/
float injectorFlowRate = cc_minute_to_gramm_second(engineConfiguration->injector.flow);
float afr = afrMap.getValue(airSpeed, rpm);
float afr = afrMap.getValue(rpm, airSpeed);
float fuelMassGramm = airMassKg / afr * 1000;
return 1000 * fuelMassGramm / injectorFlowRate;
@ -88,7 +88,7 @@ floatms_t getBaseFuel(int rpm DECLARE_ENGINE_PARAMETER_S) {
float getinjectionOffset(int rpm DECLARE_ENGINE_PARAMETER_S) {
float engineLoad = getEngineLoadT(PASS_ENGINE_PARAMETER_F);
return fuelPhaseMap.getValue(engineLoad, rpm);
return fuelPhaseMap.getValue(rpm, engineLoad);
}
/**
@ -188,12 +188,12 @@ floatms_t getBaseTableFuel(engine_configuration_s *engineConfiguration, int rpm,
warning(OBD_PCM_Processor_Fault, "NaN engine load");
return NAN;
}
return fuelMap.getValue(engineLoad, rpm);
return fuelMap.getValue(rpm, engineLoad);
}
float getBaroCorrection(DECLARE_ENGINE_PARAMETER_F) {
if (hasBaroSensor(PASS_ENGINE_PARAMETER_F)) {
return baroCorrMap.getValue(getBaroPressure(PASS_ENGINE_PARAMETER_F), getRpmE(engine));
return baroCorrMap.getValue(getRpmE(engine), getBaroPressure(PASS_ENGINE_PARAMETER_F));
} else {
return 1;
}

View File

@ -20,7 +20,7 @@ class Map3D {
public:
Map3D(const char*name);
void init(float table[RPM_BIN_SIZE][LOAD_BIN_SIZE], float loadBins[LOAD_BIN_SIZE], float rpmBins[RPM_BIN_SIZE]);
float getValue(float x, float rpm);
float getValue(float xRpm, float y);
void setAll(float value);
private:
float *pointers[LOAD_BIN_SIZE];
@ -79,13 +79,14 @@ void Map3D<RPM_BIN_SIZE, LOAD_BIN_SIZE>::init(float table[RPM_BIN_SIZE][LOAD_BIN
}
template<int RPM_BIN_SIZE, int LOAD_BIN_SIZE>
float Map3D<RPM_BIN_SIZE, LOAD_BIN_SIZE>::getValue(float x, float rpm) {
float Map3D<RPM_BIN_SIZE, LOAD_BIN_SIZE>::getValue(float xRpm, float y) {
efiAssert(initialized, "map not initialized", NAN);
if (cisnan(x)) {
warning(OBD_PCM_Processor_Fault, "%s: x is NaN", name);
if (cisnan(y)) {
warning(OBD_PCM_Processor_Fault, "%s: y is NaN", name);
return NAN;
}
return interpolate3d(x, loadBins, LOAD_BIN_SIZE, rpm, rpmBins, RPM_BIN_SIZE, pointers);
// todo: we have a bit of a mess: in TunerStudio, RPM is X-axis
return interpolate3d(y, loadBins, LOAD_BIN_SIZE, xRpm, rpmBins, RPM_BIN_SIZE, pointers);
}
template<int RPM_BIN_SIZE, int LOAD_BIN_SIZE>

View File

@ -717,8 +717,8 @@ float[FUEL_RPM_COUNT] afrRpmBins;;"RPM", 1, 0.0, 0, 18000.0, 2
! float[FUEL_RPM_COUNT] ve2RpmBins;;"RPM", 1, 0.0, 0, 18000.0, 2
tps_tps_table_t tpsTpsAccelTable;
float[TPS_TPS_ACCEL_TABLE] tpsTpsAccelFromRpmBins;;"L", 1, 0, 0.0, 30000.0, 2
float[TPS_TPS_ACCEL_TABLE] tpsTpsAccelToRpmBins;RPM is float and not integer in order to use unified methods for interpolation;"RPM", 1, 0, 0.0, 25500.0, 2
float[TPS_TPS_ACCEL_TABLE] tpsTpsAccelFromRpmBins;;"from", 1, 0, 0.0, 30000.0, 2
float[TPS_TPS_ACCEL_TABLE] tpsTpsAccelToRpmBins;RPM is float and not integer in order to use unified methods for interpolation;"to", 1, 0, 0.0, 25500.0, 2
fsio_table_8x8_t fsioTable1;
float[FSIO_TABLE_8] fsioTable1LoadBins;;"L", 1, 0, 0.0, 30000.0, 2

View File

@ -41,7 +41,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Wed Mar 09 14:59:13 EST 2016
; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Fri Mar 11 13:51:34 EST 2016
pageSize = 17080
page = 1
@ -583,8 +583,8 @@ page = 1
afrLoadBins = array, F32, 15992, [16], "%", 1, 0.0, 0, 300.0, 2
afrRpmBins = array, F32, 16056, [16], "RPM", 1, 0.0, 0, 18000.0, 2
tpsTpsAccelTable = array, F32, 16120, [8x8],"value", 1, 0, 0.0, 30000.0, 2
tpsTpsAccelFromRpmBins = array, F32, 16376, [8], "L", 1, 0, 0.0, 30000.0, 2
tpsTpsAccelToRpmBins = array, F32, 16408, [8], "RPM", 1, 0, 0.0, 25500.0, 2
tpsTpsAccelFromRpmBins = array, F32, 16376, [8], "from", 1, 0, 0.0, 30000.0, 2
tpsTpsAccelToRpmBins = array, F32, 16408, [8], "to", 1, 0, 0.0, 25500.0, 2
fsioTable1 = array, F32, 16440, [8x8],"value", 1, 0, 0.0, 30000.0, 2
fsioTable1LoadBins = array, F32, 16696, [8], "L", 1, 0, 0.0, 30000.0, 2
fsioTable1RpmBins = array, F32, 16728, [8], "RPM", 1, 0, 0.0, 25500.0, 2