auto-sync
This commit is contained in:
parent
f8ee875c11
commit
7560895113
|
@ -113,7 +113,7 @@ static float dodge_map_advance_table[16][16] = {
|
|||
{/*15 engineLoad=4.3999950000000005*//*0 800.0*/-4.85, /*1 1213.0*/-12.24, /*2 1626.0*/-24.091, /*3 2040.0*/-25.394, /*4 2453.0*/-25.323, /*5 2866.0*/-25.544, /*6 3280.0*/-29.915, /*7 3693.0*/-33.104, /*8 4106.0*/-36.016, /*9 4520.0*/-37.933, /*10 4933.0*/-36.254, /*11 5346.0*/-29.712, /*12 5760.0*/-28.651, /*13 6173.0*/-28.045, /*14 6586.0*/-27.228, /*15 7000.0*/-27.784}
|
||||
};
|
||||
|
||||
static const fuel_table_t veDefaultTable = {
|
||||
static const fuel_table_t veDodgeNeon2003Table = {
|
||||
/* Generated by TS2C on Sat Dec 26 22:43:00 EST 2015*/
|
||||
{/* 0 10.000 *//* 0 800.0*/77.705, /* 1 1213.0*/79.677, /* 2 1626.0*/138.455, /* 3 2040.0*/200.727, /* 4 2453.0*/212.709, /* 5 2866.0*/183.096, /* 6 3280.0*/186.959, /* 7 3693.0*/195.666, /* 8 4106.0*/173.553, /* 9 4520.0*/122.331, /* 10 4933.0*/110.157, /* 11 5346.0*/102.938, /* 12 5760.0*/92.029, /* 13 6173.0*/81.913, /* 14 6586.0*/76.487, /* 15 7000.0*/68.971, },
|
||||
{/* 1 20.000 *//* 0 800.0*/78.503, /* 1 1213.0*/78.792, /* 2 1626.0*/85.287, /* 3 2040.0*/92.587, /* 4 2453.0*/91.010, /* 5 2866.0*/80.823, /* 6 3280.0*/91.492, /* 7 3693.0*/102.411, /* 8 4106.0*/104.244, /* 9 4520.0*/88.303, /* 10 4933.0*/93.040, /* 11 5346.0*/97.170, /* 12 5760.0*/96.855, /* 13 6173.0*/82.471, /* 14 6586.0*/71.803, /* 15 7000.0*/65.000, },
|
||||
|
@ -266,11 +266,12 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
* set_whole_fuel_map 12
|
||||
*/
|
||||
//setWholeFuelMap(12 PASS_ENGINE_PARAMETER);
|
||||
copyFuelTable(alphaNfuel, config->fuelTable);
|
||||
// copyFuelTable(alphaNfuel, config->fuelTable);
|
||||
//setWholeTimingTable(12 PASS_ENGINE_PARAMETER);
|
||||
copyTimingTable(fromODB, config->ignitionTable);
|
||||
|
||||
copyFuelTable(veDefaultTable, config->veTable);
|
||||
//copyFuelTable(veDodgeNeon2003Table, config->veTable);
|
||||
setMap(config->veTable, 50);
|
||||
|
||||
// set_cranking_charge_angle 70
|
||||
engineConfiguration->crankingChargeAngle = 70;
|
||||
|
@ -287,7 +288,7 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
//engineConfiguration->algorithm = LM_ALPHA_N;
|
||||
|
||||
setFuelLoadBin(0, 100 PASS_ENGINE_PARAMETER);
|
||||
setTimingLoadBin(20, 120 PASS_ENGINE_PARAMETER);
|
||||
setTableBin2(config->ignitionLoadBins, IGN_LOAD_COUNT, 20, 120, 1);
|
||||
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER);
|
||||
|
||||
|
|
|
@ -159,8 +159,12 @@ float getAdvanceForRpm(int rpm, float advanceMax) {
|
|||
#define round10(x) efiRound(x, 0.1)
|
||||
|
||||
float getInitialAdvance(int rpm, float map, float advanceMax) {
|
||||
map = minF(map, 100);
|
||||
float advance = getAdvanceForRpm(rpm, advanceMax);
|
||||
return round10(advance + 0.3 * (100 - map));
|
||||
|
||||
if (rpm >= 3000)
|
||||
return round10(advance + 0.1 * (100 - map));
|
||||
return round10(advance + 0.1 * (100 - map) * rpm / 3000);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -178,7 +182,7 @@ void buildTimingMap(float advanceMax DECLARE_ENGINE_PARAMETER_S) {
|
|||
for (int loadIndex = 0; loadIndex < IGN_LOAD_COUNT; loadIndex++) {
|
||||
float load = config->ignitionLoadBins[loadIndex];
|
||||
for (int rpmIndex = 0;rpmIndex<IGN_RPM_COUNT;rpmIndex++) {
|
||||
float rpm = config->ignitionLoadBins[loadIndex];
|
||||
float rpm = config->ignitionRpmBins[rpmIndex];
|
||||
config->ignitionTable[loadIndex][rpmIndex] = getInitialAdvance(rpm, load, advanceMax);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,10 +20,18 @@ void setTableBin2(float array[], int size, float l, float r, float precision) {
|
|||
}
|
||||
}
|
||||
|
||||
void setRpmBin(float array[], int size, float idleRpm, float topRpm) {
|
||||
array[0] = idleRpm - 150;
|
||||
int rpmStep = efiRound((topRpm - idleRpm) / (size - 2), 50) - 150;
|
||||
for (int i = 1; i < size - 1;i++)
|
||||
array[i] = idleRpm + rpmStep * (i - 1);
|
||||
array[size - 1] = topRpm;
|
||||
}
|
||||
|
||||
void setTableBin(float array[], int size, float from, float to) {
|
||||
setTableBin2(array, size, from, to, 0.01);
|
||||
}
|
||||
|
||||
void setRpmTableBin(float array[], int size) {
|
||||
setTableBin2(array, size, 800, 7000, 100);
|
||||
setRpmBin(array, size, 800, 7000);
|
||||
}
|
||||
|
|
|
@ -427,7 +427,7 @@ void setFuelLoadBin(float from, float to DECLARE_ENGINE_PARAMETER_S) {
|
|||
}
|
||||
|
||||
void setTimingRpmBin(float from, float to DECLARE_ENGINE_PARAMETER_S) {
|
||||
setTableBin(config->ignitionRpmBins, IGN_RPM_COUNT, from, to);
|
||||
setRpmBin(config->ignitionRpmBins, IGN_RPM_COUNT, from, to);
|
||||
}
|
||||
|
||||
void setTimingLoadBin(float from, float to DECLARE_ENGINE_PARAMETER_S) {
|
||||
|
@ -447,7 +447,7 @@ void setAlgorithm(engine_load_mode_e algo DECLARE_ENGINE_PARAMETER_S) {
|
|||
if (algo == LM_ALPHA_N) {
|
||||
setTimingLoadBin(20, 120 PASS_ENGINE_PARAMETER);
|
||||
} else if (algo == LM_SPEED_DENSITY) {
|
||||
setTimingLoadBin(20, 120 PASS_ENGINE_PARAMETER);
|
||||
setTableBin2(config->ignitionLoadBins, IGN_LOAD_COUNT, 20, 120, 3);
|
||||
buildTimingMap(35 PASS_ENGINE_PARAMETER);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,18 +13,18 @@
|
|||
<table type="3D" name="Ignition Advance"
|
||||
category="Ignition"
|
||||
storageaddress="@@ignitionTable_offset_hex@@"
|
||||
sizex="@@IGN_LOAD_COUNT@@" sizey="@@IGN_RPM_COUNT@@" storagetype="float" endian="big">
|
||||
sizex="@@IGN_RPM_COUNT@@" sizey="@@IGN_LOAD_COUNT@@" storagetype="float" endian="big">
|
||||
<scaling units="Engine Load" expression="x" to_byte="x" format="0.00" fineincrement=".1"
|
||||
coarseincrement="1"/>
|
||||
<table type="X Axis" storageaddress="@@ignitionLoadBins_offset_hex@@" storagetype="float" endian="big"
|
||||
<table type="X Axis" storageaddress="@@ignitionRpmBins_offset_hex@@" storagetype="float" endian="big"
|
||||
logparam="rpm">
|
||||
<scaling units="RPM" expression="x" to_byte="x" format="0.00" fineincrement=".1" coarseincrement="1"/>
|
||||
</table>
|
||||
<table type="Y Axis" storageaddress="@@ignitionLoadBins_offset_hex@@" storagetype="float" endian="big"
|
||||
logparam="engine_load">
|
||||
<scaling units="degree" expression="x" to_byte="x" format="0.00" fineincrement=".1"
|
||||
coarseincrement="1"/>
|
||||
</table>
|
||||
<table type="Y Axis" storageaddress="@@ignitionRpmBins_offset_hex@@" storagetype="float" endian="big"
|
||||
logparam="rpm">
|
||||
<scaling units="RPM" expression="x" to_byte="x" format="0.00" fineincrement=".1" coarseincrement="1"/>
|
||||
</table>
|
||||
</table>
|
||||
|
||||
<table type="3D" name="Ignition Advance IAT correction"
|
||||
|
@ -33,15 +33,15 @@
|
|||
sizex="@@IGN_LOAD_COUNT@@" sizey="@@IGN_RPM_COUNT@@" storagetype="float" endian="big">
|
||||
<scaling units="Engine Load" expression="x" to_byte="x" format="0.00" fineincrement=".1"
|
||||
coarseincrement="1"/>
|
||||
<table type="X Axis" storageaddress="@@ignitionIatCorrLoadBins_offset_hex@@" storagetype="float"
|
||||
<table type="X Axis" storageaddress="@@ignitionIatCorrRpmBins_offset_hex@@" storagetype="float" endian="big"
|
||||
logparam="rpm">
|
||||
<scaling units="RPM" expression="x" to_byte="x" format="0.00" fineincrement=".1" coarseincrement="1"/>
|
||||
</table>
|
||||
<table type="Y Axis" storageaddress="@@ignitionIatCorrLoadBins_offset_hex@@" storagetype="float"
|
||||
endian="big" logparam="engine_load">
|
||||
<scaling units="temperature, C" expression="x" to_byte="x" format="0.00" fineincrement=".1"
|
||||
coarseincrement="1"/>
|
||||
</table>
|
||||
<table type="Y Axis" storageaddress="@@ignitionIatCorrRpmBins_offset_hex@@" storagetype="float" endian="big"
|
||||
logparam="rpm">
|
||||
<scaling units="RPM" expression="x" to_byte="x" format="0.00" fineincrement=".1" coarseincrement="1"/>
|
||||
</table>
|
||||
</table>
|
||||
|
||||
<table type="3D" name="Volumetric Efficiency"
|
||||
|
@ -50,15 +50,15 @@
|
|||
sizex="@@FUEL_LOAD_COUNT@@" sizey="@@FUEL_RPM_COUNT@@" storagetype="float" endian="big">
|
||||
<scaling units="Engine Load" expression="x" to_byte="x" format="0.00" fineincrement=".1"
|
||||
coarseincrement="1"/>
|
||||
<table type="X Axis" storageaddress="@@veLoadBins_offset_hex@@" storagetype="float" endian="big"
|
||||
<table type="X Axis" storageaddress="@@veRpmBins_offset_hex@@" storagetype="float" endian="big"
|
||||
logparam="rpm">
|
||||
<scaling units="RPM" expression="x" to_byte="x" format="0.00" fineincrement=".1" coarseincrement="1"/>
|
||||
</table>
|
||||
<table type="Y Axis" storageaddress="@@veLoadBins_offset_hex@@" storagetype="float" endian="big"
|
||||
logparam="engine_load">
|
||||
<scaling units="degree" expression="x" to_byte="x" format="0.00" fineincrement=".1"
|
||||
coarseincrement="1"/>
|
||||
</table>
|
||||
<table type="Y Axis" storageaddress="@@veRpmBins_offset_hex@@" storagetype="float" endian="big"
|
||||
logparam="rpm">
|
||||
<scaling units="RPM" expression="x" to_byte="x" format="0.00" fineincrement=".1" coarseincrement="1"/>
|
||||
</table>
|
||||
</table>
|
||||
|
||||
<table type="3D" name="Fuel Table"
|
||||
|
|
|
@ -16,15 +16,15 @@
|
|||
sizex="16" sizey="16" storagetype="float" endian="big">
|
||||
<scaling units="Engine Load" expression="x" to_byte="x" format="0.00" fineincrement=".1"
|
||||
coarseincrement="1"/>
|
||||
<table type="X Axis" storageaddress="3558" storagetype="float" endian="big"
|
||||
<table type="X Axis" storageaddress="3598" storagetype="float" endian="big"
|
||||
logparam="rpm">
|
||||
<scaling units="RPM" expression="x" to_byte="x" format="0.00" fineincrement=".1" coarseincrement="1"/>
|
||||
</table>
|
||||
<table type="Y Axis" storageaddress="3558" storagetype="float" endian="big"
|
||||
logparam="engine_load">
|
||||
<scaling units="degree" expression="x" to_byte="x" format="0.00" fineincrement=".1"
|
||||
coarseincrement="1"/>
|
||||
</table>
|
||||
<table type="Y Axis" storageaddress="3598" storagetype="float" endian="big"
|
||||
logparam="rpm">
|
||||
<scaling units="RPM" expression="x" to_byte="x" format="0.00" fineincrement=".1" coarseincrement="1"/>
|
||||
</table>
|
||||
</table>
|
||||
|
||||
<table type="3D" name="Ignition Advance IAT correction"
|
||||
|
@ -33,15 +33,15 @@
|
|||
sizex="16" sizey="16" storagetype="float" endian="big">
|
||||
<scaling units="Engine Load" expression="x" to_byte="x" format="0.00" fineincrement=".1"
|
||||
coarseincrement="1"/>
|
||||
<table type="X Axis" storageaddress="27d8" storagetype="float"
|
||||
<table type="X Axis" storageaddress="2818" storagetype="float" endian="big"
|
||||
logparam="rpm">
|
||||
<scaling units="RPM" expression="x" to_byte="x" format="0.00" fineincrement=".1" coarseincrement="1"/>
|
||||
</table>
|
||||
<table type="Y Axis" storageaddress="27d8" storagetype="float"
|
||||
endian="big" logparam="engine_load">
|
||||
<scaling units="temperature, C" expression="x" to_byte="x" format="0.00" fineincrement=".1"
|
||||
coarseincrement="1"/>
|
||||
</table>
|
||||
<table type="Y Axis" storageaddress="2818" storagetype="float" endian="big"
|
||||
logparam="rpm">
|
||||
<scaling units="RPM" expression="x" to_byte="x" format="0.00" fineincrement=".1" coarseincrement="1"/>
|
||||
</table>
|
||||
</table>
|
||||
|
||||
<table type="3D" name="Volumetric Efficiency"
|
||||
|
@ -50,15 +50,15 @@
|
|||
sizex="16" sizey="16" storagetype="float" endian="big">
|
||||
<scaling units="Engine Load" expression="x" to_byte="x" format="0.00" fineincrement=".1"
|
||||
coarseincrement="1"/>
|
||||
<table type="X Axis" storageaddress="39d8" storagetype="float" endian="big"
|
||||
<table type="X Axis" storageaddress="3a18" storagetype="float" endian="big"
|
||||
logparam="rpm">
|
||||
<scaling units="RPM" expression="x" to_byte="x" format="0.00" fineincrement=".1" coarseincrement="1"/>
|
||||
</table>
|
||||
<table type="Y Axis" storageaddress="39d8" storagetype="float" endian="big"
|
||||
logparam="engine_load">
|
||||
<scaling units="degree" expression="x" to_byte="x" format="0.00" fineincrement=".1"
|
||||
coarseincrement="1"/>
|
||||
</table>
|
||||
<table type="Y Axis" storageaddress="3a18" storagetype="float" endian="big"
|
||||
logparam="rpm">
|
||||
<scaling units="RPM" expression="x" to_byte="x" format="0.00" fineincrement=".1" coarseincrement="1"/>
|
||||
</table>
|
||||
</table>
|
||||
|
||||
<table type="3D" name="Fuel Table"
|
||||
|
|
|
@ -52,11 +52,25 @@ void testIgnitionMapGenerator(void) {
|
|||
assertEquals(35, getTopAdvanceForBore(CS_OPEN, 98, 8, 101.6));
|
||||
assertEquals(33, getTopAdvanceForBore(CS_OPEN, 98, 11, 101.6));
|
||||
|
||||
float rpmBin[16];
|
||||
setRpmBin(rpmBin, 16, 800, 7000);
|
||||
assertEquals(650, rpmBin[0]);
|
||||
assertEqualsM("@1", 800, rpmBin[1]);
|
||||
assertEqualsM("@2", 1050, rpmBin[2]);
|
||||
assertEqualsM("@3", 1300, rpmBin[3]);
|
||||
assertEqualsM("@14", 4050, rpmBin[14]);
|
||||
assertEquals(7000, rpmBin[15]);
|
||||
|
||||
|
||||
assertEquals(22.0, getTopAdvanceForBore(CS_SWIRL_TUMBLE, 89, 9, 101.6));
|
||||
assertEquals(32.2, getTopAdvanceForBore(CS_SWIRL_TUMBLE, 89, 9, 145));
|
||||
|
||||
assertEqualsM2("2400", 47.4, getInitialAdvance(2400, 40, 36), 0.1);
|
||||
assertEqualsM2("4400", 53.9, getInitialAdvance(4400, 40, 36), 0.1);
|
||||
assertEqualsM2("100@6000", 36.0, getInitialAdvance(6000, 100, 36), 0.1);
|
||||
assertEqualsM2("100@600", 9.9, getInitialAdvance(600, 100, 36), 0.2);
|
||||
|
||||
assertEqualsM2("2400", 34.2, getInitialAdvance(2400, 40, 36), 0.1);
|
||||
assertEqualsM2("4400", 41.9, getInitialAdvance(4400, 40, 36), 0.1);
|
||||
assertEqualsM2("20@800", 14.2, getInitialAdvance(800, 20, 36), 0.2);
|
||||
}
|
||||
|
||||
void testMafLookup(void) {
|
||||
|
|
Loading…
Reference in New Issue