auto-sync
This commit is contained in:
parent
1140ee7cb2
commit
b199f7a3df
|
@ -37,10 +37,7 @@ void setCitroenBerlingoTU3JPConfiguration(engine_configuration_s *engineConfigur
|
|||
* Cranking fuel setting
|
||||
* TODO: they recomend using something like -40C for low point and +80C for high point
|
||||
*/
|
||||
engineConfiguration->crankingSettings.coolantTempMaxC = 65;
|
||||
engineConfiguration->crankingSettings.fuelAtMaxTempMs = 2;
|
||||
engineConfiguration->crankingSettings.coolantTempMinC = 0;
|
||||
engineConfiguration->crankingSettings.fuelAtMinTempMs = 2;
|
||||
engineConfiguration->crankingSettings.baseCrankingFuel = 4;
|
||||
|
||||
/**
|
||||
* Algorithm Alpha-N setting
|
||||
|
|
|
@ -58,14 +58,8 @@ void setDodgeNeon1995EngineConfiguration(engine_configuration_s *engineConfigura
|
|||
// set_cranking_rpm 550
|
||||
engineConfiguration->crankingSettings.crankingRpm = 550;
|
||||
|
||||
// since CLT is not wired up yet let's just use same value for min and max
|
||||
// set_cranking_fuel_max 6 40
|
||||
engineConfiguration->crankingSettings.coolantTempMaxC = 37.7; // 6ms at 37.7C
|
||||
engineConfiguration->crankingSettings.fuelAtMaxTempMs = 6;
|
||||
|
||||
// set_cranking_fuel_min 6 -40
|
||||
engineConfiguration->crankingSettings.coolantTempMinC = -40; // 6ms at -40C
|
||||
engineConfiguration->crankingSettings.fuelAtMinTempMs = 6;
|
||||
// set_cranking_fuel 5
|
||||
engineConfiguration->crankingSettings.baseCrankingFuel = 5;
|
||||
|
||||
// set_whole_fuel_map 3
|
||||
setWholeFuelMap(engineConfiguration, 3);
|
||||
|
|
|
@ -100,11 +100,7 @@ void setFordAspireEngineConfiguration(engine_configuration_s *engineConfiguratio
|
|||
setThermistorConfiguration(&engineConfiguration->cltThermistorConf, -20, 18000, 23.8889, 2100, 48.8889, 1000);
|
||||
engineConfiguration->cltThermistorConf.bias_resistor = 3300; // that's my custom resistor value!
|
||||
|
||||
engineConfiguration->crankingSettings.coolantTempMaxC = 65; // 8ms at 65C
|
||||
engineConfiguration->crankingSettings.fuelAtMaxTempMs = 8;
|
||||
|
||||
engineConfiguration->crankingSettings.coolantTempMinC = 0; // 20ms at 0C
|
||||
engineConfiguration->crankingSettings.fuelAtMinTempMs = 15;
|
||||
engineConfiguration->crankingSettings.baseCrankingFuel = 3;
|
||||
|
||||
// engineConfiguration->ignitionPinMode = OM_INVERTED;
|
||||
|
||||
|
|
|
@ -51,12 +51,6 @@ static void setHondaAccordConfigurationCommon(engine_configuration_s *engineConf
|
|||
setFuelLoadBin(engineConfiguration, 0, 100);
|
||||
setTimingLoadBin(engineConfiguration, 0, 100);
|
||||
|
||||
engineConfiguration->crankingSettings.coolantTempMaxC = 65; // 8ms at 65C
|
||||
engineConfiguration->crankingSettings.fuelAtMaxTempMs = 8;
|
||||
|
||||
engineConfiguration->crankingSettings.coolantTempMinC = 0; // 20ms at 0C
|
||||
engineConfiguration->crankingSettings.fuelAtMinTempMs = 15;
|
||||
|
||||
/**
|
||||
* 18K Ohm @ -20C
|
||||
* 2.1K Ohm @ 24C
|
||||
|
|
|
@ -60,14 +60,8 @@ static float miata_maf_advance_table[16][16] = {
|
|||
static void setDefaultCrankingFuel(engine_configuration_s *engineConfiguration) {
|
||||
// todo: set cranking parameters method based on injectors and displacement?
|
||||
|
||||
// since CLT is not wired up yet let's just use same value for min and max
|
||||
// set_cranking_fuel_max 6 40
|
||||
engineConfiguration->crankingSettings.coolantTempMaxC = 80; // ms at 80C/176F
|
||||
engineConfiguration->crankingSettings.fuelAtMaxTempMs = 6;
|
||||
|
||||
// set_cranking_fuel_min 6 -40
|
||||
engineConfiguration->crankingSettings.coolantTempMinC = -40; // 6ms at -40C/-40F
|
||||
engineConfiguration->crankingSettings.fuelAtMinTempMs = 6;
|
||||
// set_cranking_fuel 5
|
||||
engineConfiguration->crankingSettings.baseCrankingFuel = 5;
|
||||
}
|
||||
|
||||
static void commonMiataNa(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
|
||||
|
|
|
@ -35,14 +35,8 @@ void setMitsubishiConfiguration(engine_configuration_s *engineConfiguration, boa
|
|||
// set_whole_fuel_map 3
|
||||
setWholeFuelMap(engineConfiguration, 3);
|
||||
|
||||
// since CLT is not wired up yet let's just use same value for min and max
|
||||
// set_cranking_fuel_max 6 40
|
||||
engineConfiguration->crankingSettings.coolantTempMaxC = 37.7; // 6ms at 37.7C
|
||||
engineConfiguration->crankingSettings.fuelAtMaxTempMs = 6;
|
||||
|
||||
// set_cranking_fuel_min 6 -40
|
||||
engineConfiguration->crankingSettings.coolantTempMinC = -40; // 6ms at -40C
|
||||
engineConfiguration->crankingSettings.fuelAtMinTempMs = 6;
|
||||
// set_cranking_fuel 4
|
||||
engineConfiguration->crankingSettings.baseCrankingFuel = 4;
|
||||
|
||||
// /**
|
||||
// * 29150 Ohm @ 40C
|
||||
|
|
|
@ -56,7 +56,6 @@
|
|||
#include "svnversion.h"
|
||||
#include "engine.h"
|
||||
#include "lcd_controller.h"
|
||||
#include "fuel_math.h"
|
||||
|
||||
#if EFI_PROD_CODE
|
||||
// todo: move this logic to algo folder!
|
||||
|
@ -173,7 +172,7 @@ void printState(Engine *engine, int currentCkpEventCounter) {
|
|||
// debugFloat(&logger, "fuel_iat", getIatCorrection(getIntakeAirTemperature()), 2);
|
||||
// debugFloat(&logger, "fuel_clt", getCltCorrection(getCoolantTemperature()), 2);
|
||||
debugFloat(&logger, "fuel_lag", getInjectorLag(engineConfiguration, getVBatt()), 2);
|
||||
debugFloat(&logger, "fuel", getRunningFuel(baseFuel, engine, rpm), 2);
|
||||
debugFloat(&logger, "fuel", getFuelMs(rpm, engine), 2);
|
||||
|
||||
debugFloat(&logger, "timing", getAdvance(rpm, engineLoad), 2);
|
||||
|
||||
|
|
|
@ -155,13 +155,42 @@ void setDefaultConfiguration(engine_configuration_s *engineConfiguration, board_
|
|||
engineConfiguration->rpmHardLimit = 7000;
|
||||
engineConfiguration->crankingSettings.crankingRpm = 550;
|
||||
|
||||
// set_cranking_fuel_max 8 80
|
||||
engineConfiguration->crankingSettings.coolantTempMaxC = 80; // 8ms at 80C
|
||||
engineConfiguration->crankingSettings.fuelAtMaxTempMs = 8;
|
||||
|
||||
// set_cranking_fuel_min 24 -40
|
||||
engineConfiguration->crankingSettings.coolantTempMinC = -40; // 6ms at -40C
|
||||
engineConfiguration->crankingSettings.fuelAtMinTempMs = 24;
|
||||
engineConfiguration->crankingFuelCoef[0] = 5; // base cranking fuel adjustment coefficient
|
||||
engineConfiguration->crankingFuelBins[0] = -20; // temperature in C
|
||||
engineConfiguration->crankingFuelCoef[1] = 3.7;
|
||||
engineConfiguration->crankingFuelBins[1] = -10;
|
||||
engineConfiguration->crankingFuelCoef[2] = 2.6;
|
||||
engineConfiguration->crankingFuelBins[2] = 5;
|
||||
engineConfiguration->crankingFuelCoef[3] = 2.4;
|
||||
engineConfiguration->crankingFuelBins[3] = 20;
|
||||
engineConfiguration->crankingFuelCoef[4] = 2.1;
|
||||
engineConfiguration->crankingFuelBins[4] = 35;
|
||||
engineConfiguration->crankingFuelCoef[5] = 1.8;
|
||||
engineConfiguration->crankingFuelBins[5] = 50;
|
||||
engineConfiguration->crankingFuelCoef[6] = 1.5;
|
||||
engineConfiguration->crankingFuelBins[6] = 65;
|
||||
engineConfiguration->crankingFuelCoef[7] = 1;
|
||||
engineConfiguration->crankingFuelBins[7] = 90;
|
||||
|
||||
engineConfiguration->crankingCycleCoef[0] = 2;
|
||||
engineConfiguration->crankingCycleBins[0] = 10;
|
||||
engineConfiguration->crankingCycleCoef[1] = 1;
|
||||
engineConfiguration->crankingCycleBins[1] = 31;
|
||||
engineConfiguration->crankingCycleCoef[2] = 1;
|
||||
engineConfiguration->crankingCycleBins[2] = 52;
|
||||
engineConfiguration->crankingCycleCoef[3] = 0.5;
|
||||
engineConfiguration->crankingCycleBins[3] = 73;
|
||||
engineConfiguration->crankingCycleCoef[4] = 0.5;
|
||||
engineConfiguration->crankingCycleBins[4] = 74;
|
||||
engineConfiguration->crankingCycleCoef[5] = 0.5;
|
||||
engineConfiguration->crankingCycleBins[5] = 75;
|
||||
engineConfiguration->crankingCycleCoef[6] = 0.5;
|
||||
engineConfiguration->crankingCycleBins[6] = 76;
|
||||
engineConfiguration->crankingCycleCoef[7] = 0.5;
|
||||
engineConfiguration->crankingCycleBins[7] = 77;
|
||||
|
||||
engineConfiguration->crankingSettings.baseCrankingFuel = 5;
|
||||
|
||||
engineConfiguration->analogInputDividerCoefficient = 2;
|
||||
|
||||
|
|
|
@ -19,10 +19,8 @@
|
|||
#define MOCK_UNDEFINED -1
|
||||
|
||||
typedef struct {
|
||||
float coolantTempMinC;
|
||||
float coolantTempMaxC;
|
||||
float fuelAtMinTempMs;
|
||||
float fuelAtMaxTempMs;
|
||||
float unused[3];
|
||||
float baseCrankingFuel;
|
||||
|
||||
/**
|
||||
* This value controls what RPM values we consider 'cranking' (any RPM below 'crankingRpm')
|
||||
|
|
|
@ -160,12 +160,9 @@ float getCrankingFuel(Engine *engine) {
|
|||
|
||||
float getStartingFuel(engine_configuration_s *engineConfiguration, float coolantTemperature) {
|
||||
// these magic constants are in Celsius
|
||||
if (cisnan(coolantTemperature) || coolantTemperature < engineConfiguration->crankingSettings.coolantTempMinC)
|
||||
return engineConfiguration->crankingSettings.fuelAtMinTempMs;
|
||||
if (coolantTemperature > engineConfiguration->crankingSettings.coolantTempMaxC)
|
||||
return engineConfiguration->crankingSettings.fuelAtMaxTempMs;
|
||||
return interpolate(engineConfiguration->crankingSettings.coolantTempMinC,
|
||||
engineConfiguration->crankingSettings.fuelAtMinTempMs,
|
||||
engineConfiguration->crankingSettings.coolantTempMaxC,
|
||||
engineConfiguration->crankingSettings.fuelAtMaxTempMs, coolantTemperature);
|
||||
float baseCrankingFuel = engineConfiguration->crankingSettings.baseCrankingFuel;
|
||||
if (cisnan(coolantTemperature))
|
||||
return baseCrankingFuel;
|
||||
return interpolate2d(coolantTemperature, engineConfiguration->crankingFuelBins,
|
||||
engineConfiguration->crankingFuelCoef, CRANKING_CURVE_SIZE) * baseCrankingFuel;
|
||||
}
|
||||
|
|
|
@ -320,24 +320,10 @@ static void printTemperatureInfo(void) {
|
|||
}
|
||||
|
||||
#if EFI_ANALOG_INPUTS
|
||||
scheduleMsg(&logger, "cranking fuel %fms @ %fC", engineConfiguration->crankingSettings.fuelAtMinTempMs,
|
||||
engineConfiguration->crankingSettings.coolantTempMinC);
|
||||
scheduleMsg(&logger, "cranking fuel %fms @ %fC", engineConfiguration->crankingSettings.fuelAtMaxTempMs,
|
||||
engineConfiguration->crankingSettings.coolantTempMaxC);
|
||||
scheduleMsg(&logger, "base cranking fuel %f", engineConfiguration->crankingSettings.baseCrankingFuel);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* For example
|
||||
* set_cranking_fuel_min 15 0
|
||||
* would be 15ms @ 0C
|
||||
*/
|
||||
static void setCrankingFuelMin(float timeMs, float tempC) {
|
||||
engineConfiguration->crankingSettings.coolantTempMinC = tempC;
|
||||
engineConfiguration->crankingSettings.fuelAtMinTempMs = timeMs;
|
||||
printTemperatureInfo();
|
||||
}
|
||||
|
||||
static void setCrankingRpm(int value) {
|
||||
engineConfiguration->crankingSettings.crankingRpm = value;
|
||||
doPrintConfiguration(&engine);
|
||||
|
@ -358,17 +344,8 @@ static void setRpmHardLimit(int value) {
|
|||
doPrintConfiguration(&engine);
|
||||
}
|
||||
|
||||
static void setCrankingFuelMax(float timeMs, float tempC) {
|
||||
engineConfiguration->crankingSettings.coolantTempMaxC = tempC;
|
||||
engineConfiguration->crankingSettings.fuelAtMaxTempMs = timeMs;
|
||||
printTemperatureInfo();
|
||||
}
|
||||
|
||||
static void setCrankingFuel(float timeMs) {
|
||||
engineConfiguration->crankingSettings.coolantTempMaxC = 0;
|
||||
engineConfiguration->crankingSettings.coolantTempMaxC = 80;
|
||||
engineConfiguration->crankingSettings.fuelAtMaxTempMs = timeMs;
|
||||
engineConfiguration->crankingSettings.fuelAtMinTempMs = timeMs;
|
||||
engineConfiguration->crankingSettings.baseCrankingFuel = timeMs;
|
||||
printTemperatureInfo();
|
||||
}
|
||||
|
||||
|
@ -782,8 +759,6 @@ void initSettings(engine_configuration_s *engineConfiguration) {
|
|||
addConsoleActionF("set_global_fuel_correction", setGlobalFuelCorrection);
|
||||
|
||||
addConsoleActionF("set_cranking_fuel", setCrankingFuel);
|
||||
addConsoleActionFF("set_cranking_fuel_min", setCrankingFuelMin);
|
||||
addConsoleActionFF("set_cranking_fuel_max", setCrankingFuelMax);
|
||||
addConsoleActionI("set_cranking_rpm", setCrankingRpm);
|
||||
addConsoleActionF("set_cranking_timing_angle", setCrankingTimingAngle);
|
||||
addConsoleActionF("set_cranking_charge_angle", setCrankingChargeAngle);
|
||||
|
|
|
@ -132,7 +132,7 @@ int main(void) {
|
|||
testFLStack();
|
||||
|
||||
// resizeMap();
|
||||
printf("Success 20131029\r\n");
|
||||
printf("Success 20131103\r\n");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -90,18 +90,14 @@ void testFuelMap(void) {
|
|||
|
||||
testMafValue = 0;
|
||||
|
||||
engineConfiguration->crankingSettings.coolantTempMaxC = 65; // 8ms at 65C
|
||||
engineConfiguration->crankingSettings.fuelAtMaxTempMs = 8;
|
||||
|
||||
engineConfiguration->crankingSettings.coolantTempMinC = 0; // 20ms at 0C
|
||||
engineConfiguration->crankingSettings.fuelAtMinTempMs = 20;
|
||||
engineConfiguration->crankingSettings.baseCrankingFuel = 4;
|
||||
|
||||
printf("*************************************************** getStartingFuel\r\n");
|
||||
// NAN in case we have issues with the CLT sensor
|
||||
// assertEquals(16, getStartingFuel(NAN));
|
||||
assertEquals(20, getStartingFuel(engineConfiguration, 0));
|
||||
assertEquals(18.5231, getStartingFuel(engineConfiguration, 8));
|
||||
assertEquals(8, getStartingFuel(engineConfiguration, 70));
|
||||
assertEqualsM("getStartingFuel nan", 4, getStartingFuel(engineConfiguration, NAN));
|
||||
assertEqualsM("getStartingFuel#1", 11.8667, getStartingFuel(engineConfiguration, 0));
|
||||
assertEqualsM("getStartingFuel#2", 10.2400, getStartingFuel(engineConfiguration, 8));
|
||||
assertEqualsM("getStartingFuel#3", 5.6000, getStartingFuel(engineConfiguration, 70));
|
||||
}
|
||||
|
||||
extern engine_configuration_s *engineConfiguration;
|
||||
|
|
Loading…
Reference in New Issue