auto-sync
This commit is contained in:
parent
da61d54e86
commit
5bf2efa197
|
@ -246,7 +246,7 @@ void setFordEscortGt(DECLARE_ENGINE_PARAMETER_F) {
|
|||
setFrankenso_01_LCD(boardConfiguration);
|
||||
setFrankenso0_1_joystick(engineConfiguration);
|
||||
|
||||
setDensoTODO(engineConfiguration);
|
||||
setDensoTODO(config);
|
||||
|
||||
engineConfiguration->globalFuelCorrection = 0.75;
|
||||
engineConfiguration->specs.displacement = 1.839;
|
||||
|
@ -493,7 +493,7 @@ void setMiata1994_s(DECLARE_ENGINE_PARAMETER_F) {
|
|||
boardConfiguration->malfunctionIndicatorPinMode = OM_DEFAULT;
|
||||
|
||||
engineConfiguration->algorithm = LM_REAL_MAF;
|
||||
setMazdaMiataNAMaf(engineConfiguration);
|
||||
setMazdaMiataNAMaf(config);
|
||||
engineConfiguration->injector.flow = 230;
|
||||
}
|
||||
|
||||
|
|
|
@ -97,8 +97,8 @@ void Engine::preCalculate() {
|
|||
*/
|
||||
for (int i = 0; i < MAF_DECODING_CACHE_SIZE; i++) {
|
||||
float volts = i / MAF_DECODING_CACHE_MULT;
|
||||
float maf = interpolate2d(volts, engineConfiguration->mafDecodingBins,
|
||||
engineConfiguration->mafDecoding, MAF_DECODING_COUNT);
|
||||
float maf = interpolate2d(volts, config->mafDecodingBins,
|
||||
config->mafDecoding, MAF_DECODING_COUNT);
|
||||
mafDecodingLookup[i] = maf;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -157,7 +157,7 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
#endif
|
||||
|
||||
boardConfiguration->mafSensorType = Bosch0280218037;
|
||||
setBosch0280218037(engineConfiguration);
|
||||
setBosch0280218037(config);
|
||||
|
||||
engineConfiguration->injector.lag = 1.0;
|
||||
|
||||
|
@ -167,22 +167,22 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
initTemperatureCurve(IAT_CURVE_SIZE, engineConfiguration->iatFuelCorrBins, engineConfiguration->iatFuelCorr);
|
||||
initTemperatureCurve(CLT_CURVE_SIZE, engineConfiguration->cltFuelCorrBins, engineConfiguration->cltFuelCorr);
|
||||
|
||||
initTemperatureCurve(IAT_CURVE_SIZE, engineConfiguration->iatIdleCorrBins, engineConfiguration->iatIdleCorr);
|
||||
initTemperatureCurve(IAT_CURVE_SIZE, config->iatIdleCorrBins, config->iatIdleCorr);
|
||||
// initTemperatureCurve(CLT_CURVE_SIZE, engineConfiguration->cltIdleCorrBins, engineConfiguration->cltIdleCorr);
|
||||
|
||||
|
||||
setTableValue(engineConfiguration->iatIdleCorrBins, engineConfiguration->iatIdleCorr, CLT_CURVE_SIZE, -40, 1.5);
|
||||
setTableValue(engineConfiguration->iatIdleCorrBins, engineConfiguration->iatIdleCorr, CLT_CURVE_SIZE, -30, 1.5);
|
||||
setTableValue(engineConfiguration->iatIdleCorrBins, engineConfiguration->iatIdleCorr, CLT_CURVE_SIZE, -20, 1.42);
|
||||
setTableValue(engineConfiguration->iatIdleCorrBins, engineConfiguration->iatIdleCorr, CLT_CURVE_SIZE, -10, 1.36);
|
||||
setTableValue(engineConfiguration->iatIdleCorrBins, engineConfiguration->iatIdleCorr, CLT_CURVE_SIZE, 0, 1.28);
|
||||
setTableValue(engineConfiguration->iatIdleCorrBins, engineConfiguration->iatIdleCorr, CLT_CURVE_SIZE, 10, 1.19);
|
||||
setTableValue(engineConfiguration->iatIdleCorrBins, engineConfiguration->iatIdleCorr, CLT_CURVE_SIZE, 20, 1.12);
|
||||
setTableValue(engineConfiguration->iatIdleCorrBins, engineConfiguration->iatIdleCorr, CLT_CURVE_SIZE, 30, 1.10);
|
||||
setTableValue(engineConfiguration->iatIdleCorrBins, engineConfiguration->iatIdleCorr, CLT_CURVE_SIZE, 40, 1.06);
|
||||
setTableValue(engineConfiguration->iatIdleCorrBins, engineConfiguration->iatIdleCorr, CLT_CURVE_SIZE, 50, 1.06);
|
||||
setTableValue(engineConfiguration->iatIdleCorrBins, engineConfiguration->iatIdleCorr, CLT_CURVE_SIZE, 60, 1.03);
|
||||
setTableValue(engineConfiguration->iatIdleCorrBins, engineConfiguration->iatIdleCorr, CLT_CURVE_SIZE, 70, 1.01);
|
||||
setTableValue(config->iatIdleCorrBins, config->iatIdleCorr, CLT_CURVE_SIZE, -40, 1.5);
|
||||
setTableValue(config->iatIdleCorrBins, config->iatIdleCorr, CLT_CURVE_SIZE, -30, 1.5);
|
||||
setTableValue(config->iatIdleCorrBins, config->iatIdleCorr, CLT_CURVE_SIZE, -20, 1.42);
|
||||
setTableValue(config->iatIdleCorrBins, config->iatIdleCorr, CLT_CURVE_SIZE, -10, 1.36);
|
||||
setTableValue(config->iatIdleCorrBins, config->iatIdleCorr, CLT_CURVE_SIZE, 0, 1.28);
|
||||
setTableValue(config->iatIdleCorrBins, config->iatIdleCorr, CLT_CURVE_SIZE, 10, 1.19);
|
||||
setTableValue(config->iatIdleCorrBins, config->iatIdleCorr, CLT_CURVE_SIZE, 20, 1.12);
|
||||
setTableValue(config->iatIdleCorrBins, config->iatIdleCorr, CLT_CURVE_SIZE, 30, 1.10);
|
||||
setTableValue(config->iatIdleCorrBins, config->iatIdleCorr, CLT_CURVE_SIZE, 40, 1.06);
|
||||
setTableValue(config->iatIdleCorrBins, config->iatIdleCorr, CLT_CURVE_SIZE, 50, 1.06);
|
||||
setTableValue(config->iatIdleCorrBins, config->iatIdleCorr, CLT_CURVE_SIZE, 60, 1.03);
|
||||
setTableValue(config->iatIdleCorrBins, config->iatIdleCorr, CLT_CURVE_SIZE, 70, 1.01);
|
||||
|
||||
|
||||
setTableValue(engineConfiguration->cltFuelCorrBins, engineConfiguration->cltFuelCorr, CLT_CURVE_SIZE, -40, 1.5);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// this section was generated by config_definition.jar on Sat Apr 04 23:34:22 EDT 2015
|
||||
// this section was generated by config_definition.jar on Sun Apr 05 10:16:43 EDT 2015
|
||||
// begin
|
||||
#include "rusefi_types.h"
|
||||
typedef struct {
|
||||
|
@ -1149,73 +1149,55 @@ typedef struct {
|
|||
*/
|
||||
le_formula_t timingAdditive;
|
||||
/**
|
||||
* kg/hour value.
|
||||
* By the way 2.081989116 kg/h = 1 ft³/m
|
||||
* offset 6200
|
||||
*/
|
||||
float mafDecoding[MAF_DECODING_COUNT];
|
||||
/**
|
||||
* offset 7224
|
||||
*/
|
||||
float mafDecodingBins[MAF_DECODING_COUNT];
|
||||
/**
|
||||
* offset 8248
|
||||
*/
|
||||
fuel_table_t fuelTable;
|
||||
/**
|
||||
* offset 9272
|
||||
* offset 7224
|
||||
*/
|
||||
float fuelLoadBins[FUEL_LOAD_COUNT];
|
||||
/**
|
||||
* RPM is float and not integer in order to use unified methods for interpolation
|
||||
* offset 9336
|
||||
* offset 7288
|
||||
*/
|
||||
float fuelRpmBins[FUEL_RPM_COUNT];
|
||||
/**
|
||||
* offset 9400
|
||||
* offset 7352
|
||||
*/
|
||||
ignition_table_t ignitionTable;
|
||||
/**
|
||||
* offset 10424
|
||||
* offset 8376
|
||||
*/
|
||||
float ignitionLoadBins[IGN_LOAD_COUNT];
|
||||
/**
|
||||
* offset 10488
|
||||
* offset 8440
|
||||
*/
|
||||
float ignitionRpmBins[IGN_RPM_COUNT];
|
||||
/**
|
||||
* offset 10552
|
||||
* offset 8504
|
||||
*/
|
||||
ve_table_t veTable;
|
||||
/**
|
||||
* offset 11576
|
||||
* offset 9528
|
||||
*/
|
||||
float veLoadBins[FUEL_LOAD_COUNT];
|
||||
/**
|
||||
* offset 11640
|
||||
* offset 9592
|
||||
*/
|
||||
float veRpmBins[FUEL_RPM_COUNT];
|
||||
/**
|
||||
* offset 11704
|
||||
* offset 9656
|
||||
*/
|
||||
afr_table_t afrTable;
|
||||
/**
|
||||
* offset 12728
|
||||
* offset 10680
|
||||
*/
|
||||
float afrLoadBins[FUEL_LOAD_COUNT];
|
||||
/**
|
||||
* offset 12792
|
||||
* offset 10744
|
||||
*/
|
||||
float afrRpmBins[FUEL_RPM_COUNT];
|
||||
/**
|
||||
* offset 12856
|
||||
*/
|
||||
float iatIdleCorrBins[IAT_CURVE_SIZE];
|
||||
/**
|
||||
* offset 12920
|
||||
*/
|
||||
float iatIdleCorr[IAT_CURVE_SIZE];
|
||||
/** total size 12984*/
|
||||
/** total size 10808*/
|
||||
} engine_configuration_s;
|
||||
|
||||
typedef struct {
|
||||
|
@ -1223,6 +1205,24 @@ typedef struct {
|
|||
* offset 0
|
||||
*/
|
||||
engine_configuration_s engineConfiguration;
|
||||
/**
|
||||
* offset 10808
|
||||
*/
|
||||
float iatIdleCorrBins[IAT_CURVE_SIZE];
|
||||
/**
|
||||
* offset 10872
|
||||
*/
|
||||
float iatIdleCorr[IAT_CURVE_SIZE];
|
||||
/**
|
||||
* kg/hour value.
|
||||
* By the way 2.081989116 kg/h = 1 ft³/m
|
||||
* offset 10936
|
||||
*/
|
||||
float mafDecoding[MAF_DECODING_COUNT];
|
||||
/**
|
||||
* offset 11960
|
||||
*/
|
||||
float mafDecodingBins[MAF_DECODING_COUNT];
|
||||
/**
|
||||
* offset 12984
|
||||
*/
|
||||
|
@ -1251,4 +1251,4 @@ typedef struct {
|
|||
} persistent_config_s;
|
||||
|
||||
// end
|
||||
// this section was generated by config_definition.jar on Sat Apr 04 23:34:22 EDT 2015
|
||||
// this section was generated by config_definition.jar on Sun Apr 05 10:16:43 EDT 2015
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "engine_configuration.h"
|
||||
#include "engine.h"
|
||||
|
||||
#define FLASH_DATA_VERSION 7613
|
||||
#define FLASH_DATA_VERSION 7615
|
||||
|
||||
void readFromFlash(void);
|
||||
void initFlash(Logging *sharedLogger, Engine *engine);
|
||||
|
|
|
@ -24,7 +24,7 @@ float getRealMaf(DECLARE_ENGINE_PARAMETER_F) {
|
|||
return engine->mafDecodingLookup[mafAdc >> 4];
|
||||
}
|
||||
|
||||
static void fillTheRest(engine_configuration_s *e, int i) {
|
||||
static void fillTheRest(persistent_config_s *e, int i) {
|
||||
/**
|
||||
* unrealistic values just to make binary search happy
|
||||
*/
|
||||
|
@ -35,7 +35,7 @@ static void fillTheRest(engine_configuration_s *e, int i) {
|
|||
}
|
||||
}
|
||||
|
||||
static int addMafPoint(engine_configuration_s *e, int i, float kgHrValue, float voltage) {
|
||||
static int addMafPoint(persistent_config_s *e, int i, float kgHrValue, float voltage) {
|
||||
e->mafDecoding[i] = kgHrValue;
|
||||
e->mafDecodingBins[i] = voltage;
|
||||
return i + 1;
|
||||
|
@ -44,7 +44,7 @@ static int addMafPoint(engine_configuration_s *e, int i, float kgHrValue, float
|
|||
/**
|
||||
* Hot-film air-mass meter, Type HFM 5
|
||||
*/
|
||||
void setBosch0280218037(engine_configuration_s *e) {
|
||||
void setBosch0280218037(persistent_config_s *e) {
|
||||
int i = 0;
|
||||
i = addMafPoint(e, i, -34.5, 0);
|
||||
i = addMafPoint(e, i, -6, 0.78125);
|
||||
|
@ -64,13 +64,13 @@ void setBosch0280218037(engine_configuration_s *e) {
|
|||
fillTheRest(e, i);
|
||||
}
|
||||
|
||||
void setBosch0280218004(engine_configuration_s *e) {
|
||||
void setBosch0280218004(persistent_config_s *e) {
|
||||
int i = 0;
|
||||
|
||||
fillTheRest(e, i);
|
||||
}
|
||||
|
||||
void setDensoTODO(engine_configuration_s *e) {
|
||||
void setDensoTODO(persistent_config_s *e) {
|
||||
int i = 0;
|
||||
|
||||
i = addMafPoint(e, i, 116.3, 0.8);
|
||||
|
@ -87,7 +87,7 @@ void setDensoTODO(engine_configuration_s *e) {
|
|||
}
|
||||
}
|
||||
|
||||
void setMazdaMiataNAMaf(engine_configuration_s *e) {
|
||||
void setMazdaMiataNAMaf(persistent_config_s *e) {
|
||||
int i = 0;
|
||||
i= addMafPoint(e, i, 0.000000, 0.000000);
|
||||
i= addMafPoint(e, i, 0.000028, 0.100000);
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
float getMaf(void);
|
||||
float getRealMaf(DECLARE_ENGINE_PARAMETER_F);
|
||||
|
||||
void setBosch0280218037(engine_configuration_s *engineConfiguration);
|
||||
void setBosch0280218004(engine_configuration_s *engineConfiguration);
|
||||
void setBosch0280218037(persistent_config_s *engineConfiguration);
|
||||
void setBosch0280218004(persistent_config_s *engineConfiguration);
|
||||
|
||||
void setDensoTODO(engine_configuration_s *engineConfiguration);
|
||||
void setMazdaMiataNAMaf(engine_configuration_s *e);
|
||||
void setDensoTODO(persistent_config_s *engineConfiguration);
|
||||
void setMazdaMiataNAMaf(persistent_config_s *e);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -506,9 +506,6 @@ custom pin_input_mode_e 4 scalar, F32, @OFFSET@, "ms", 1, 0, 0, 200, 1
|
|||
le_formula_t timingMultiplier;
|
||||
le_formula_t timingAdditive;
|
||||
|
||||
float[MAF_DECODING_COUNT] mafDecoding;kg/hour value.\nBy the way 2.081989116 kg/h = 1 ft³/m;"kg/hour", 1, 0, -500.0, 4000.0, 2
|
||||
float[MAF_DECODING_COUNT] mafDecodingBins;; "V", 1, 0, -5.0, 150.0, 2
|
||||
|
||||
|
||||
fuel_table_t fuelTable;
|
||||
float[FUEL_LOAD_COUNT] fuelLoadBins;;"V", 1, 0, 0.0, 300.0, 2
|
||||
|
@ -526,13 +523,16 @@ afr_table_t afrTable;
|
|||
float[FUEL_LOAD_COUNT] afrLoadBins;;"%", 1, 0.0, 0, 300.0, 2
|
||||
float[FUEL_RPM_COUNT] afrRpmBins;;"RPM", 1, 0.0, 0, 18000.0, 2
|
||||
|
||||
float[IAT_CURVE_SIZE] iatIdleCorrBins;;"C", 1, 0, -100.0, 250.0, 2
|
||||
float[IAT_CURVE_SIZE] iatIdleCorr;;"%", 1, 0, 0.0, 500.0, 2
|
||||
|
||||
end_struct
|
||||
|
||||
engine_configuration_s engineConfiguration;
|
||||
|
||||
float[IAT_CURVE_SIZE] iatIdleCorrBins;;"C", 1, 0, -100.0, 250.0, 2
|
||||
float[IAT_CURVE_SIZE] iatIdleCorr;;"%", 1, 0, 0.0, 500.0, 2
|
||||
|
||||
float[MAF_DECODING_COUNT] mafDecoding;kg/hour value.\nBy the way 2.081989116 kg/h = 1 ft³/m;"kg/hour", 1, 0, -500.0, 4000.0, 2
|
||||
float[MAF_DECODING_COUNT] mafDecodingBins;; "V", 1, 0, -5.0, 150.0, 2
|
||||
|
||||
ignition_table_t ignitionIatCorrTable;
|
||||
float[IGN_LOAD_COUNT] ignitionIatCorrLoadBins;;"Load", 1, 0.0, 0, 300.0, 2
|
||||
float[IGN_RPM_COUNT] ignitionIatCorrRpmBins;;"RPM", 1, 0.0, 0, 18000.0, 2
|
||||
|
|
|
@ -288,10 +288,10 @@ public class AutoTest {
|
|||
sendComplexCommand("set_global_trigger_offset_angle 175");
|
||||
chart = nextChart();
|
||||
|
||||
assertWaveFall(chart, WaveChart.INJECTOR_1, 0.555, 238.75);
|
||||
assertWaveFall(chart, WaveChart.INJECTOR_2, 0.555, 53.04);
|
||||
assertWaveFall(chart, WaveChart.INJECTOR_3, 0.555, 417.04);
|
||||
assertWaveFall(chart, WaveChart.INJECTOR_4, 0.555, 594.04);
|
||||
assertWaveFall(msg + " fuel", chart, WaveChart.INJECTOR_1, 0.555, 238.75);
|
||||
assertWaveFall(msg + " fuel", chart, WaveChart.INJECTOR_2, 0.555, 53.04);
|
||||
assertWaveFall(msg + " fuel", chart, WaveChart.INJECTOR_3, 0.555, 417.04);
|
||||
assertWaveFall(msg + " fuel", chart, WaveChart.INJECTOR_4, 0.555, 594.04);
|
||||
|
||||
x = 41;
|
||||
assertWave(chart, WaveChart.SPARK_1, 0.133, x, x + 180, x + 360, x + 540);
|
||||
|
@ -323,9 +323,9 @@ public class AutoTest {
|
|||
sendComplexCommand("set_algorithm 3");
|
||||
chart = nextChart();
|
||||
x = 8.88;
|
||||
assertWaveFall(msg, chart, WaveChart.INJECTOR_1, 0.329, x + 180);
|
||||
assertWaveFall(msg, chart, WaveChart.INJECTOR_2, 0.329, x);
|
||||
assertWaveFall(msg, chart, WaveChart.INJECTOR_4, 0.329, x + 540);
|
||||
assertWaveFall(msg + " fuel SD", chart, WaveChart.INJECTOR_1, 0.329, x + 180);
|
||||
assertWaveFall(msg + " fuel SD", chart, WaveChart.INJECTOR_2, 0.329, x);
|
||||
assertWaveFall(msg + " fuel SD", chart, WaveChart.INJECTOR_4, 0.329, x + 540);
|
||||
|
||||
// above hard limit
|
||||
IoUtil.changeRpm(10000);
|
||||
|
|
|
@ -49,9 +49,9 @@ void testMafLookup(void) {
|
|||
printf("*************************************************** testMafLookup\r\n");
|
||||
|
||||
EngineTestHelper eth(FORD_ESCORT_GT);
|
||||
Engine * engine = ð.engine;
|
||||
engine_configuration_s *engineConfiguration = engine->engineConfiguration;
|
||||
setBosch0280218037(engineConfiguration);
|
||||
EXPAND_EngineTestHelper;
|
||||
|
||||
setBosch0280218037(config);
|
||||
engine->preCalculate();
|
||||
|
||||
assertEqualsM("@0", -34.5000, engine->mafDecodingLookup[0]);
|
||||
|
|
Loading…
Reference in New Issue