auto-sync

This commit is contained in:
rusEfi 2016-01-01 19:02:59 -05:00
parent 39a1b3383f
commit 25f9c01b5c
6 changed files with 55 additions and 32 deletions

View File

@ -392,6 +392,20 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
#if EFI_HIP_9011 || defined(__DOXYGEN__)
setHip9011FrankensoPinout();
#endif
boardConfiguration->hip9011Gain = 0.3;
float t = 0.5;
engineConfiguration->knockNoise[0] = 2.1 + t; // 800
engineConfiguration->knockNoise[1] = 2.1 + t; // 1700
engineConfiguration->knockNoise[2] = 2.2 + t; // 2600
engineConfiguration->knockNoise[3] = 2.2 + t; // 3400
engineConfiguration->knockNoise[4] = 2.3 + t; // 4300
engineConfiguration->knockNoise[5] = 2.7 + t; // 5200
engineConfiguration->knockNoise[6] = 3.1 + t; // 6100
engineConfiguration->knockNoise[7] = 3.3 + t; // 7000
engineConfiguration->cylinderBore = 87.5;
boardConfiguration->clutchDownPin = GPIOC_12;

View File

@ -18,6 +18,7 @@
#include "engine_math.h"
#include "advance_map.h"
#include "speed_density.h"
#include "advance_map.h"
#if EFI_PROD_CODE
#include "injector_central.h"
@ -28,6 +29,9 @@
static LoggingWithStorage logger("engine");
extern engine_pins_s enginePins;
extern fuel_Map3D_t veMap;
extern fuel_Map3D_t afrMap;
EXTERN_ENGINE
;
@ -108,6 +112,31 @@ void EngineState::periodicFastCallback(DECLARE_ENGINE_PARAMETER_F) {
iatFuelCorrection = getIatCorrection(iat PASS_ENGINE_PARAMETER);
cltFuelCorrection = getCltCorrection(clt PASS_ENGINE_PARAMETER);
engineNoiseHipLevel = interpolate2d(rpm, engineConfiguration->knockNoiseRpmBins,
engineConfiguration->knockNoise, ENGINE_NOISE_CURVE_SIZE);
baroCorrection = getBaroCorrection(PASS_ENGINE_PARAMETER_F);
injectionOffset = getinjectionOffset(rpm PASS_ENGINE_PARAMETER);
float engineLoad = getEngineLoadT(PASS_ENGINE_PARAMETER_F);
timingAdvance = getAdvance(rpm, engineLoad PASS_ENGINE_PARAMETER);
if (engineConfiguration->algorithm == LM_SPEED_DENSITY) {
float coolantC = ENGINE(engineState.clt);
float intakeC = ENGINE(engineState.iat);
float tps = getTPS(PASS_ENGINE_PARAMETER_F);
tChargeK = convertCelsiusToKelvin(getTCharge(rpm, tps, coolantC, intakeC));
float map = getMap();
/**
* *0.01 because of https://sourceforge.net/p/rusefi/tickets/153/
*/
currentVE = baroCorrection * veMap.getValue(map, rpm) * 0.01;
targerAFR = afrMap.getValue(map, rpm);
} else {
baseTableFuel = getBaseTableFuel(engineConfiguration, rpm, engineLoad);
}
}
@ -225,8 +254,6 @@ void Engine::watchdog() {
#endif
}
extern fuel_Map3D_t veMap;
extern fuel_Map3D_t afrMap;
/**
* The idea of this method is to execute all heavy calculations in a lower-priority thread,
@ -234,7 +261,6 @@ extern fuel_Map3D_t afrMap;
*/
void Engine::periodicFastCallback(DECLARE_ENGINE_PARAMETER_F) {
int rpm = rpmCalculator.rpmValue;
float engineLoad = getEngineLoadT(PASS_ENGINE_PARAMETER_F);
if (isValidRpm(rpm)) {
MAP_sensor_config_s * c = &engineConfiguration->map;
@ -257,30 +283,6 @@ void Engine::periodicFastCallback(DECLARE_ENGINE_PARAMETER_F) {
}
engineState.periodicFastCallback(PASS_ENGINE_PARAMETER_F);
//engineState.engineNoiseHipLevel = interpolate2d(rpm)
engine->engineState.baroCorrection = getBaroCorrection(PASS_ENGINE_PARAMETER_F);
engine->engineState.injectionOffset = getinjectionOffset(rpm PASS_ENGINE_PARAMETER);
engine->engineState.timingAdvance = getAdvance(rpm, engineLoad PASS_ENGINE_PARAMETER);
if (engineConfiguration->algorithm == LM_SPEED_DENSITY) {
float coolantC = ENGINE(engineState.clt);
float intakeC = ENGINE(engineState.iat);
float tps = getTPS(PASS_ENGINE_PARAMETER_F);
engine->engineState.tChargeK = convertCelsiusToKelvin(getTCharge(rpm, tps, coolantC, intakeC));
float map = getMap();
/**
* *0.01 because of https://sourceforge.net/p/rusefi/tickets/153/
*/
engine->engineState.currentVE = engine->engineState.baroCorrection * veMap.getValue(map, rpm) * 0.01;
engine->engineState.targerAFR = afrMap.getValue(map, rpm);
} else {
engine->engineState.baseTableFuel = getBaseTableFuel(engineConfiguration, rpm, engineLoad);
}
}
StartupFuelPumping::StartupFuelPumping() {

View File

@ -25,5 +25,5 @@ void setTableBin(float array[], int size, float from, float to) {
}
void setRpmTableBin(float array[], int size) {
setTableBin2(array, size, 800, 7000, 1);
setTableBin2(array, size, 800, 7000, 100);
}

View File

@ -86,6 +86,13 @@ EXTERN_ENGINE;
void initEngineNoiseTable(DECLARE_ENGINE_PARAMETER_F) {
setRpmTableBin(engineConfiguration->knockNoiseRpmBins, ENGINE_NOISE_CURVE_SIZE);
// engineConfiguration->knockNoiseBins[0]
engineConfiguration->knockNoise[0] = 2; // 800
engineConfiguration->knockNoise[1] = 2; // 1700
engineConfiguration->knockNoise[2] = 2; // 2600
engineConfiguration->knockNoise[3] = 2; // 3400
engineConfiguration->knockNoise[4] = 2; // 4300
engineConfiguration->knockNoise[5] = 2; // 5200
engineConfiguration->knockNoise[6] = 2; // 6100
engineConfiguration->knockNoise[7] = 2; // 7000
}

View File

@ -598,7 +598,7 @@ baro_corr_table_t baroCorrTable;
brain_pin_e binarySerialRxPin;
brain_pin_e consoleSerialTxPin;
brain_pin_e consoleSerialRxPin;
float[ENGINE_NOISE_CURVE_SIZE] knockNoise;Knock sensor output knock detection threshold depending on current RPM;;"v", 1, 0, 0.0, 10, 2
float[ENGINE_NOISE_CURVE_SIZE] knockNoise;Knock sensor output knock detection threshold depending on current RPM;"v", 1, 0, 0.0, 10, 2
float[ENGINE_NOISE_CURVE_SIZE] knockNoiseRpmBins;;"RPM", 1, 0, 0.0, 18000, 2
pid_s etb;

View File

@ -55,8 +55,8 @@ void testIgnitionMapGenerator(void) {
assertEquals(22.0, getTopAdvanceForBore(CS_SWIRL_TUMBLE, 89, 9, 101.6));
assertEquals(32.2, getTopAdvanceForBore(CS_SWIRL_TUMBLE, 89, 9, 145));
assertEquals(47.5, getInitialAdvance(2400, 40, 36));
assertEquals(54.0, getInitialAdvance(4400, 40, 36));
assertEqualsM2("2400", 47.4, getInitialAdvance(2400, 40, 36), 0.1);
assertEqualsM2("4400", 53.9, getInitialAdvance(4400, 40, 36), 0.1);
}
void testMafLookup(void) {