auto-sync

This commit is contained in:
rusEfi 2016-01-01 19:02:59 -05:00
parent 22ff28adbc
commit 2b6e12bc32
7 changed files with 57 additions and 34 deletions

View File

@ -392,6 +392,20 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
#if EFI_HIP_9011 || defined(__DOXYGEN__) #if EFI_HIP_9011 || defined(__DOXYGEN__)
setHip9011FrankensoPinout(); setHip9011FrankensoPinout();
#endif #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; engineConfiguration->cylinderBore = 87.5;
boardConfiguration->clutchDownPin = GPIOC_12; boardConfiguration->clutchDownPin = GPIOC_12;

View File

@ -18,6 +18,7 @@
#include "engine_math.h" #include "engine_math.h"
#include "advance_map.h" #include "advance_map.h"
#include "speed_density.h" #include "speed_density.h"
#include "advance_map.h"
#if EFI_PROD_CODE #if EFI_PROD_CODE
#include "injector_central.h" #include "injector_central.h"
@ -28,6 +29,9 @@
static LoggingWithStorage logger("engine"); static LoggingWithStorage logger("engine");
extern engine_pins_s enginePins; extern engine_pins_s enginePins;
extern fuel_Map3D_t veMap;
extern fuel_Map3D_t afrMap;
EXTERN_ENGINE EXTERN_ENGINE
; ;
@ -108,6 +112,31 @@ void EngineState::periodicFastCallback(DECLARE_ENGINE_PARAMETER_F) {
iatFuelCorrection = getIatCorrection(iat PASS_ENGINE_PARAMETER); iatFuelCorrection = getIatCorrection(iat PASS_ENGINE_PARAMETER);
cltFuelCorrection = getCltCorrection(clt 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 #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, * 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) { void Engine::periodicFastCallback(DECLARE_ENGINE_PARAMETER_F) {
int rpm = rpmCalculator.rpmValue; int rpm = rpmCalculator.rpmValue;
float engineLoad = getEngineLoadT(PASS_ENGINE_PARAMETER_F);
if (isValidRpm(rpm)) { if (isValidRpm(rpm)) {
MAP_sensor_config_s * c = &engineConfiguration->map; 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.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() { StartupFuelPumping::StartupFuelPumping() {

View File

@ -25,5 +25,5 @@ void setTableBin(float array[], int size, float from, float to) {
} }
void setRpmTableBin(float array[], int size) { 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) { void initEngineNoiseTable(DECLARE_ENGINE_PARAMETER_F) {
setRpmTableBin(engineConfiguration->knockNoiseRpmBins, ENGINE_NOISE_CURVE_SIZE); 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 binarySerialRxPin;
brain_pin_e consoleSerialTxPin; brain_pin_e consoleSerialTxPin;
brain_pin_e consoleSerialRxPin; 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 float[ENGINE_NOISE_CURVE_SIZE] knockNoiseRpmBins;;"RPM", 1, 0, 0.0, 18000, 2
pid_s etb; pid_s etb;

View File

@ -41,7 +41,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code ; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START ; CONFIG_DEFINITION_START
; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Fri Jan 01 17:06:33 EST 2016 ; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Fri Jan 01 18:49:44 EST 2016
pageSize = 16088 pageSize = 16088
page = 1 page = 1
@ -489,7 +489,7 @@ page = 1
binarySerialRxPin = bits, U32, 1940, [0:6], "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6", "PE7", "PE8", "PE9", "PE10", "PE11", "PE12", "PE13", "PE14", "PE15", "NONE", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" binarySerialRxPin = bits, U32, 1940, [0:6], "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6", "PE7", "PE8", "PE9", "PE10", "PE11", "PE12", "PE13", "PE14", "PE15", "NONE", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
consoleSerialTxPin = bits, U32, 1944, [0:6], "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6", "PE7", "PE8", "PE9", "PE10", "PE11", "PE12", "PE13", "PE14", "PE15", "NONE", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" consoleSerialTxPin = bits, U32, 1944, [0:6], "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6", "PE7", "PE8", "PE9", "PE10", "PE11", "PE12", "PE13", "PE14", "PE15", "NONE", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
consoleSerialRxPin = bits, U32, 1948, [0:6], "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6", "PE7", "PE8", "PE9", "PE10", "PE11", "PE12", "PE13", "PE14", "PE15", "NONE", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" consoleSerialRxPin = bits, U32, 1948, [0:6], "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6", "PE7", "PE8", "PE9", "PE10", "PE11", "PE12", "PE13", "PE14", "PE15", "NONE", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
knockNoise = array, F32, 1952, [8], ;"v", 1, 0, 0.0, 10, 2 knockNoise = array, F32, 1952, [8], "v", 1, 0, 0.0, 10, 2
knockNoiseRpmBins = array, F32, 1984, [8], "RPM", 1, 0, 0.0, 18000, 2 knockNoiseRpmBins = array, F32, 1984, [8], "RPM", 1, 0, 0.0, 18000, 2
etb_pFactor = scalar, F32, 2016, "value", 1, 0, 0, 1000, 2 etb_pFactor = scalar, F32, 2016, "value", 1, 0, 0, 1000, 2
etb_iFactor = scalar, F32, 2020, "value", 1, 0, 0, 1000, 2 etb_iFactor = scalar, F32, 2020, "value", 1, 0, 0, 1000, 2

View File

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