defaults cleanup: base engine & fuel (#2790)
* build * fuel and base * fix build * cleanup * extern * tps/tps * alternator * tps * iat timing * cranking RPM Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
parent
fbbb99f50c
commit
981e8f5047
|
@ -86,22 +86,6 @@ static const uint8_t fsio_table_vvt_target[FSIO_TABLE_8][FSIO_TABLE_8] = {
|
||||||
{/* 7 85 *//* 0 700.0*/17, /* 1 1000.0*/28, /* 2 2000.0*/33, /* 3 3000.0*/28, /* 4 3500.0*/30, /* 5 4500.0*/28, /* 6 5500.0*/11, /* 7 6500.0*/5, },
|
{/* 7 85 *//* 0 700.0*/17, /* 1 1000.0*/28, /* 2 2000.0*/33, /* 3 3000.0*/28, /* 4 3500.0*/30, /* 5 4500.0*/28, /* 6 5500.0*/11, /* 7 6500.0*/5, },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const float tpsTspSame[TPS_TPS_ACCEL_TABLE] =
|
|
||||||
{0.0, 10.0, 20.0, 35.0, 50.0, 65.0, 80.0, 100.0};
|
|
||||||
|
|
||||||
static const uint8_t tpsTpsTable[TPS_TPS_ACCEL_TABLE][TPS_TPS_ACCEL_TABLE] = {
|
|
||||||
/* Generated by TS2C on Tue Apr 18 21:29:16 EDT 2017*/
|
|
||||||
{/* 0 0 *//* 0 0.0*/0, /* 1 10.0*/0, /* 2 20.0*/0, /* 3 35.0*/0, /* 4 50.0*/0, /* 5 65.0*/0, /* 6 80.0*/0, /* 7 100.0*/0, },
|
|
||||||
{/* 1 10 *//* 0 0.0*/10, /* 1 10.0*/0, /* 2 20.0*/0, /* 3 35.0*/0, /* 4 50.0*/0, /* 5 65.0*/0, /* 6 80.0*/0, /* 7 100.0*/0, },
|
|
||||||
{/* 2 20 *//* 0 0.0*/17, /* 1 10.0*/10, /* 2 20.0*/0, /* 3 35.0*/0, /* 4 50.0*/0, /* 5 65.0*/0, /* 6 80.0*/0, /* 7 100.0*/0, },
|
|
||||||
{/* 3 35 *//* 0 0.0*/23, /* 1 10.0*/17, /* 2 20.0*/10, /* 3 35.0*/0, /* 4 50.0*/0, /* 5 65.0*/0, /* 6 80.0*/0, /* 7 100.0*/0, },
|
|
||||||
{/* 4 50 *//* 0 0.0*/28, /* 1 10.0*/23, /* 2 20.0*/17, /* 3 35.0*/10, /* 4 50.0*/0, /* 5 65.0*/0, /* 6 80.0*/0, /* 7 100.0*/0, },
|
|
||||||
{/* 5 65 *//* 0 0.0*/32, /* 1 10.0*/28, /* 2 20.0*/23, /* 3 35.0*/17, /* 4 50.0*/10, /* 5 65.0*/0, /* 6 80.0*/0, /* 7 100.0*/0, },
|
|
||||||
{/* 6 80 *//* 0 0.0*/35, /* 1 10.0*/32, /* 2 20.0*/28, /* 3 35.0*/23, /* 4 50.0*/17, /* 5 65.0*/10, /* 6 80.0*/0, /* 7 100.0*/0, },
|
|
||||||
{/* 7 100 *//* 0 0.0*/37, /* 1 10.0*/35, /* 2 20.0*/32, /* 3 35.0*/28, /* 4 50.0*/23, /* 5 65.0*/17, /* 6 80.0*/10, /* 7 100.0*/0, },
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
const float mazda_miata_nb2_RpmBins[FUEL_RPM_COUNT] = {700.0, 820.0, 950.0, 1100.0,
|
const float mazda_miata_nb2_RpmBins[FUEL_RPM_COUNT] = {700.0, 820.0, 950.0, 1100.0,
|
||||||
1300.0, 1550.0, 1800.0, 2150.0,
|
1300.0, 1550.0, 1800.0, 2150.0,
|
||||||
2500.0, 3000.0, 3500.0, 4150.0,
|
2500.0, 3000.0, 3500.0, 4150.0,
|
||||||
|
@ -240,12 +224,6 @@ static void setMAFTransferFunction(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setMazdaMiataNbTpsTps(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
|
||||||
copyArray(config->tpsTpsAccelFromRpmBins, tpsTspSame);
|
|
||||||
copyArray(config->tpsTpsAccelFromRpmBins, tpsTspSame);
|
|
||||||
copyTable(config->tpsTpsAccelTable, tpsTpsTable);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setMazdaMiataNbInjectorLag(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
void setMazdaMiataNbInjectorLag(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
||||||
copyArray(engineConfiguration->injector.battLagCorr, injectorLagCorrection);
|
copyArray(engineConfiguration->injector.battLagCorr, injectorLagCorrection);
|
||||||
copyArray(engineConfiguration->injector.battLagCorrBins, injectorLagBins);
|
copyArray(engineConfiguration->injector.battLagCorrBins, injectorLagBins);
|
||||||
|
@ -352,8 +330,6 @@ static void setMazdaMiataEngineNB2Defaults(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
||||||
// enable cylinder_cleanup
|
// enable cylinder_cleanup
|
||||||
engineConfiguration->isCylinderCleanupEnabled = true;
|
engineConfiguration->isCylinderCleanupEnabled = true;
|
||||||
|
|
||||||
setMazdaMiataNbTpsTps(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
||||||
|
|
||||||
// set_whole_ve_map 80
|
// set_whole_ve_map 80
|
||||||
setMazdaMiataNbInjectorLag(PASS_CONFIG_PARAMETER_SIGNATURE);
|
setMazdaMiataNbInjectorLag(PASS_CONFIG_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
#include "engine_configuration.h"
|
#include "engine_configuration.h"
|
||||||
|
|
||||||
void setMazdaMiataNbInjectorLag(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
void setMazdaMiataNbInjectorLag(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
||||||
void setMazdaMiataNbTpsTps(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
|
||||||
void setMazdaNB2VVTSettings(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
void setMazdaNB2VVTSettings(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -138,16 +138,6 @@ void setAltPFactor(float p) {
|
||||||
showAltInfo();
|
showAltInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setDefaultAlternatorParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
|
||||||
engineConfiguration->alternatorOffAboveTps = 120;
|
|
||||||
|
|
||||||
engineConfiguration->targetVBatt = 14;
|
|
||||||
|
|
||||||
engineConfiguration->alternatorControl.offset = 0;
|
|
||||||
engineConfiguration->alternatorControl.pFactor = 30;
|
|
||||||
engineConfiguration->alternatorControl.periodMs = 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
void onConfigurationChangeAlternatorCallback(engine_configuration_s *previousConfiguration) {
|
void onConfigurationChangeAlternatorCallback(engine_configuration_s *previousConfiguration) {
|
||||||
shouldResetPid = !alternatorPid.isSame(&previousConfiguration->alternatorControl);
|
shouldResetPid = !alternatorPid.isSame(&previousConfiguration->alternatorControl);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,5 @@ void setAltPFactor(float p);
|
||||||
void setAltIFactor(float p);
|
void setAltIFactor(float p);
|
||||||
void setAltDFactor(float p);
|
void setAltDFactor(float p);
|
||||||
void showAltInfo(void);
|
void showAltInfo(void);
|
||||||
void setDefaultAlternatorParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
|
||||||
|
|
||||||
void onConfigurationChangeAlternatorCallback(engine_configuration_s *previousConfiguration);
|
void onConfigurationChangeAlternatorCallback(engine_configuration_s *previousConfiguration);
|
||||||
|
|
|
@ -21,3 +21,5 @@ CONTROLLERS_ALGO_SRC_CPP = $(PROJECT_DIR)/controllers/algo/advance_map.cpp \
|
||||||
$(PROJECT_DIR)/controllers/algo/fuel/fuel_computer.cpp \
|
$(PROJECT_DIR)/controllers/algo/fuel/fuel_computer.cpp \
|
||||||
$(PROJECT_DIR)/controllers/algo/fuel/injector_model.cpp \
|
$(PROJECT_DIR)/controllers/algo/fuel/injector_model.cpp \
|
||||||
$(PROJECT_DIR)/controllers/algo/nmea.cpp \
|
$(PROJECT_DIR)/controllers/algo/nmea.cpp \
|
||||||
|
$(PROJECT_DIR)/controllers/algo/defaults/default_base_engine.cpp \
|
||||||
|
$(PROJECT_DIR)/controllers/algo/defaults/default_fuel.cpp \
|
||||||
|
|
|
@ -0,0 +1,70 @@
|
||||||
|
#include "defaults.h"
|
||||||
|
#include "engine_configuration.h"
|
||||||
|
|
||||||
|
EXTERN_CONFIG;
|
||||||
|
|
||||||
|
static void setDefaultAlternatorParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
||||||
|
engineConfiguration->alternatorOffAboveTps = 120;
|
||||||
|
|
||||||
|
engineConfiguration->targetVBatt = 14;
|
||||||
|
|
||||||
|
engineConfiguration->alternatorControl.offset = 0;
|
||||||
|
engineConfiguration->alternatorControl.pFactor = 30;
|
||||||
|
engineConfiguration->alternatorControl.periodMs = 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setDefaultBaseEngine(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
||||||
|
// Base Engine Settings
|
||||||
|
engineConfiguration->specs.cylindersCount = 4;
|
||||||
|
engineConfiguration->specs.displacement = 2;
|
||||||
|
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
||||||
|
|
||||||
|
CONFIG(compressionRatio) = 9;
|
||||||
|
|
||||||
|
// Limits and Fallbacks
|
||||||
|
engineConfiguration->rpmHardLimit = 7000;
|
||||||
|
engineConfiguration->cutFuelOnHardLimit = true;
|
||||||
|
engineConfiguration->cutSparkOnHardLimit = true;
|
||||||
|
|
||||||
|
engineConfiguration->failedMapFallback = 60;
|
||||||
|
engineConfiguration->enableMapEstimationTableFallback = false;
|
||||||
|
|
||||||
|
// Trigger
|
||||||
|
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||||
|
setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR);
|
||||||
|
engineConfiguration->useOnlyRisingEdgeForTrigger = false;
|
||||||
|
|
||||||
|
engineConfiguration->globalTriggerAngleOffset = 0;
|
||||||
|
|
||||||
|
// Default this to on - if you want to diagnose, turn it off.
|
||||||
|
engineConfiguration->silentTriggerError = true;
|
||||||
|
|
||||||
|
// Advanced Trigger
|
||||||
|
|
||||||
|
// Battery and alternator
|
||||||
|
engineConfiguration->vbattDividerCoeff = ((float) (15 + 65)) / 15;
|
||||||
|
|
||||||
|
#if EFI_ALTERNATOR_CONTROL
|
||||||
|
setDefaultAlternatorParameters(PASS_CONFIG_PARAMETER_SIGNATURE);
|
||||||
|
#endif /* EFI_ALTERNATOR_CONTROL */
|
||||||
|
|
||||||
|
// Fuel pump
|
||||||
|
engineConfiguration->startUpFuelPumpDuration = 4;
|
||||||
|
|
||||||
|
// Fan
|
||||||
|
engineConfiguration->fanOnTemperature = 95;
|
||||||
|
engineConfiguration->fanOffTemperature = 91;
|
||||||
|
|
||||||
|
// Tachometer
|
||||||
|
// 50% duty cycle is the default for tach signal
|
||||||
|
CONFIG(tachPulseDurationAsDutyCycle) = true;
|
||||||
|
CONFIG(tachPulseDuractionMs) = 0.5;
|
||||||
|
CONFIG(tachPulsePerRev) = 1;
|
||||||
|
|
||||||
|
// Check engine light
|
||||||
|
#if EFI_PROD_CODE
|
||||||
|
engineConfiguration->warningPeriod = 10;
|
||||||
|
#else
|
||||||
|
engineConfiguration->warningPeriod = 0;
|
||||||
|
#endif /* EFI_PROD_CODE */
|
||||||
|
}
|
|
@ -0,0 +1,234 @@
|
||||||
|
#include "defaults.h"
|
||||||
|
#include "engine_configuration.h"
|
||||||
|
#include "table_helper.h"
|
||||||
|
#include "mazda_miata_vvt.h"
|
||||||
|
|
||||||
|
EXTERN_CONFIG;
|
||||||
|
|
||||||
|
static void setBosch02880155868(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
||||||
|
// http://www.boschdealer.com/specsheets/0280155868cs.jpg
|
||||||
|
engineConfiguration->injector.battLagCorrBins[0] = 6;
|
||||||
|
engineConfiguration->injector.battLagCorr[0] = 3.371;
|
||||||
|
|
||||||
|
engineConfiguration->injector.battLagCorrBins[1] = 8;
|
||||||
|
engineConfiguration->injector.battLagCorr[1] = 1.974;
|
||||||
|
|
||||||
|
engineConfiguration->injector.battLagCorrBins[2] = 10;
|
||||||
|
engineConfiguration->injector.battLagCorr[2] = 1.383;
|
||||||
|
|
||||||
|
engineConfiguration->injector.battLagCorrBins[3] = 11;
|
||||||
|
engineConfiguration->injector.battLagCorr[3] = 1.194;
|
||||||
|
|
||||||
|
engineConfiguration->injector.battLagCorrBins[4] = 12;
|
||||||
|
engineConfiguration->injector.battLagCorr[4] = 1.04;
|
||||||
|
|
||||||
|
engineConfiguration->injector.battLagCorrBins[5] = 13;
|
||||||
|
engineConfiguration->injector.battLagCorr[5] = 0.914;
|
||||||
|
|
||||||
|
engineConfiguration->injector.battLagCorrBins[6] = 14;
|
||||||
|
engineConfiguration->injector.battLagCorr[6] = 0.797;
|
||||||
|
|
||||||
|
engineConfiguration->injector.battLagCorrBins[7] = 15;
|
||||||
|
engineConfiguration->injector.battLagCorr[7] = 0.726;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void setDefaultWarmupFuelEnrichment(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
||||||
|
static const float bins[] =
|
||||||
|
{
|
||||||
|
-40,
|
||||||
|
-30,
|
||||||
|
-20,
|
||||||
|
-10,
|
||||||
|
0,
|
||||||
|
10,
|
||||||
|
20,
|
||||||
|
30,
|
||||||
|
40,
|
||||||
|
50,
|
||||||
|
60,
|
||||||
|
70,
|
||||||
|
80,
|
||||||
|
90,
|
||||||
|
100,
|
||||||
|
110
|
||||||
|
};
|
||||||
|
|
||||||
|
copyArray(config->cltFuelCorrBins, bins);
|
||||||
|
|
||||||
|
static const float values[] =
|
||||||
|
{
|
||||||
|
1.50,
|
||||||
|
1.50,
|
||||||
|
1.42,
|
||||||
|
1.36,
|
||||||
|
1.28,
|
||||||
|
1.19,
|
||||||
|
1.12,
|
||||||
|
1.10,
|
||||||
|
1.06,
|
||||||
|
1.06,
|
||||||
|
1.03,
|
||||||
|
1.01,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
1
|
||||||
|
};
|
||||||
|
|
||||||
|
copyArray(config->cltFuelCorr, values);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void setDefaultVETable(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
||||||
|
setRpmTableBin(config->veRpmBins, FUEL_RPM_COUNT);
|
||||||
|
setTable(config->veTable, 80);
|
||||||
|
|
||||||
|
// setRpmTableBin(engineConfiguration->ve2RpmBins, FUEL_RPM_COUNT);
|
||||||
|
// setLinearCurve(engineConfiguration->ve2LoadBins, 10, 300, 1);
|
||||||
|
// ve2Map.setAll(0.81);
|
||||||
|
|
||||||
|
setRpmTableBin(config->lambdaRpmBins, FUEL_RPM_COUNT);
|
||||||
|
setTable(config->lambdaTable, 1);
|
||||||
|
|
||||||
|
setRpmTableBin(engineConfiguration->baroCorrRpmBins, BARO_CORR_SIZE);
|
||||||
|
setLinearCurve(engineConfiguration->baroCorrPressureBins, 75, 105, 1);
|
||||||
|
for (int i = 0; i < BARO_CORR_SIZE;i++) {
|
||||||
|
for (int j = 0; j < BARO_CORR_SIZE;j++) {
|
||||||
|
// Default baro table is all 1.0, we can't recommend a reasonable default here
|
||||||
|
engineConfiguration->baroCorrTable[i][j] = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void setDefaultFuelCutParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
||||||
|
engineConfiguration->coastingFuelCutEnabled = false;
|
||||||
|
engineConfiguration->coastingFuelCutRpmLow = 1300;
|
||||||
|
engineConfiguration->coastingFuelCutRpmHigh = 1500;
|
||||||
|
engineConfiguration->coastingFuelCutTps = 2;
|
||||||
|
engineConfiguration->coastingFuelCutMap = 30;
|
||||||
|
engineConfiguration->coastingFuelCutClt = 30;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void setDefaultStftSettings(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
||||||
|
auto& cfg = CONFIG(stft);
|
||||||
|
|
||||||
|
// Default to disabled
|
||||||
|
CONFIG(fuelClosedLoopCorrectionEnabled) = false;
|
||||||
|
|
||||||
|
// Default to proportional mode (for wideband sensors)
|
||||||
|
CONFIG(stftIgnoreErrorMagnitude) = false;
|
||||||
|
|
||||||
|
// 60 second startup delay - some O2 sensors are slow to warm up.
|
||||||
|
cfg.startupDelay = 60;
|
||||||
|
|
||||||
|
// Only correct in [12.0, 17.0]
|
||||||
|
cfg.minAfr = 120;
|
||||||
|
cfg.maxAfr = 170;
|
||||||
|
|
||||||
|
// Above 60 deg C
|
||||||
|
cfg.minClt = 60;
|
||||||
|
|
||||||
|
// 0.5% deadband
|
||||||
|
cfg.deadband = 5;
|
||||||
|
|
||||||
|
// Sensible region defaults
|
||||||
|
cfg.maxIdleRegionRpm = 1000 / RPM_1_BYTE_PACKING_MULT;
|
||||||
|
cfg.maxOverrunLoad = 35;
|
||||||
|
cfg.minPowerLoad = 85;
|
||||||
|
|
||||||
|
// Sensible cell defaults
|
||||||
|
for (size_t i = 0; i < efi::size(cfg.cellCfgs); i++) {
|
||||||
|
// 30 second time constant - nice and slow
|
||||||
|
cfg.cellCfgs[i].timeConstant = 30 * 10;
|
||||||
|
|
||||||
|
/// Allow +-5%
|
||||||
|
cfg.cellCfgs[i].maxAdd = 5;
|
||||||
|
cfg.cellCfgs[i].maxRemove = -5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static const uint8_t tpsTpsTable[TPS_TPS_ACCEL_TABLE][TPS_TPS_ACCEL_TABLE] = {
|
||||||
|
/* Generated by TS2C on Tue Apr 18 21:29:16 EDT 2017*/
|
||||||
|
{/* 0 0 *//* 0 0.0*/0, /* 1 10.0*/0, /* 2 20.0*/0, /* 3 35.0*/0, /* 4 50.0*/0, /* 5 65.0*/0, /* 6 80.0*/0, /* 7 100.0*/0, },
|
||||||
|
{/* 1 10 *//* 0 0.0*/10, /* 1 10.0*/0, /* 2 20.0*/0, /* 3 35.0*/0, /* 4 50.0*/0, /* 5 65.0*/0, /* 6 80.0*/0, /* 7 100.0*/0, },
|
||||||
|
{/* 2 20 *//* 0 0.0*/17, /* 1 10.0*/10, /* 2 20.0*/0, /* 3 35.0*/0, /* 4 50.0*/0, /* 5 65.0*/0, /* 6 80.0*/0, /* 7 100.0*/0, },
|
||||||
|
{/* 3 35 *//* 0 0.0*/23, /* 1 10.0*/17, /* 2 20.0*/10, /* 3 35.0*/0, /* 4 50.0*/0, /* 5 65.0*/0, /* 6 80.0*/0, /* 7 100.0*/0, },
|
||||||
|
{/* 4 50 *//* 0 0.0*/28, /* 1 10.0*/23, /* 2 20.0*/17, /* 3 35.0*/10, /* 4 50.0*/0, /* 5 65.0*/0, /* 6 80.0*/0, /* 7 100.0*/0, },
|
||||||
|
{/* 5 65 *//* 0 0.0*/32, /* 1 10.0*/28, /* 2 20.0*/23, /* 3 35.0*/17, /* 4 50.0*/10, /* 5 65.0*/0, /* 6 80.0*/0, /* 7 100.0*/0, },
|
||||||
|
{/* 6 80 *//* 0 0.0*/35, /* 1 10.0*/32, /* 2 20.0*/28, /* 3 35.0*/23, /* 4 50.0*/17, /* 5 65.0*/10, /* 6 80.0*/0, /* 7 100.0*/0, },
|
||||||
|
{/* 7 100 *//* 0 0.0*/37, /* 1 10.0*/35, /* 2 20.0*/32, /* 3 35.0*/28, /* 4 50.0*/23, /* 5 65.0*/17, /* 6 80.0*/10, /* 7 100.0*/0, },
|
||||||
|
};
|
||||||
|
|
||||||
|
static void setMazdaMiataNbTpsTps(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
||||||
|
setLinearCurve(config->tpsTpsAccelFromRpmBins, 0, 100, 10);
|
||||||
|
setLinearCurve(config->tpsTpsAccelToRpmBins, 0, 100, 10);
|
||||||
|
copyTable(config->tpsTpsAccelTable, tpsTpsTable);
|
||||||
|
}
|
||||||
|
|
||||||
|
void setDefaultFuel(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
||||||
|
// Base injection configuration
|
||||||
|
engineConfiguration->isInjectionEnabled = true;
|
||||||
|
engineConfiguration->injectionMode = IM_SEQUENTIAL;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* By the way http://users.erols.com/srweiss/tableifc.htm has a LOT of data
|
||||||
|
*/
|
||||||
|
engineConfiguration->injector.flow = 200;
|
||||||
|
engineConfiguration->stoichRatioPrimary = STOICH_RATIO * PACK_MULT_AFR_CFG;
|
||||||
|
|
||||||
|
// 9.0 = E100 pure ethanol
|
||||||
|
engineConfiguration->stoichRatioSecondary = 9.0f * PACK_MULT_AFR_CFG;
|
||||||
|
|
||||||
|
// Injector deadtime
|
||||||
|
setBosch02880155868(PASS_CONFIG_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
|
// Tables
|
||||||
|
setFuelTablesLoadBin(10, 160 PASS_CONFIG_PARAMETER_SUFFIX);
|
||||||
|
setRpmTableBin(config->injPhaseRpmBins, FUEL_RPM_COUNT);
|
||||||
|
setDefaultVETable(PASS_CONFIG_PARAMETER_SIGNATURE);
|
||||||
|
setTable(config->injectionPhase, -180.0f);
|
||||||
|
|
||||||
|
// Charge temperature estimation
|
||||||
|
engineConfiguration->tChargeMinRpmMinTps = 0.25;
|
||||||
|
engineConfiguration->tChargeMinRpmMaxTps = 0.25;
|
||||||
|
engineConfiguration->tChargeMaxRpmMinTps = 0.25;
|
||||||
|
engineConfiguration->tChargeMaxRpmMaxTps = 0.9;
|
||||||
|
engineConfiguration->tChargeMode = TCHARGE_MODE_RPM_TPS;
|
||||||
|
engineConfiguration->tChargeAirCoefMin = 0.098f;
|
||||||
|
engineConfiguration->tChargeAirCoefMax = 0.902f;
|
||||||
|
engineConfiguration->tChargeAirFlowMax = 153.6f;
|
||||||
|
engineConfiguration->tChargeAirIncrLimit = 1.0f;
|
||||||
|
engineConfiguration->tChargeAirDecrLimit = 12.5f;
|
||||||
|
|
||||||
|
// CLT correction table
|
||||||
|
setDefaultWarmupFuelEnrichment(PASS_CONFIG_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
|
// IAT correction table
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
// Closed loop fuel correction
|
||||||
|
setDefaultStftSettings(PASS_CONFIG_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
|
// Decel fuel cut
|
||||||
|
setDefaultFuelCutParameters(PASS_CONFIG_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
|
// Accel Enrich
|
||||||
|
engineConfiguration->engineLoadAccelLength = 6;
|
||||||
|
engineConfiguration->engineLoadAccelEnrichmentThreshold = 5; // kPa
|
||||||
|
engineConfiguration->engineLoadAccelEnrichmentMultiplier = 0; // todo: improve implementation and re-enable by default
|
||||||
|
|
||||||
|
engineConfiguration->tpsAccelLength = 12;
|
||||||
|
engineConfiguration->tpsAccelEnrichmentThreshold = 40; // TPS % change, per engine cycle
|
||||||
|
|
||||||
|
#if !EFI_UNIT_TEST
|
||||||
|
// todo: this is a reasonable default for what kinds of engines exactly?
|
||||||
|
engineConfiguration->wwaeTau = 0.3;
|
||||||
|
engineConfiguration->wwaeBeta = 0.3;
|
||||||
|
#endif // EFI_UNIT_TEST
|
||||||
|
|
||||||
|
// TPS/TPS AE curve
|
||||||
|
setMazdaMiataNbTpsTps(PASS_CONFIG_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
|
// AE load taper
|
||||||
|
setLinearCurve(engineConfiguration->mapAccelTaperBins, 0, 32, 4);
|
||||||
|
setArrayValues(engineConfiguration->mapAccelTaperMult, 1.0f);
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
#include "engine_ptr.h"
|
||||||
|
|
||||||
|
void setDefaultBaseEngine(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
||||||
|
void setDefaultFuel(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
|
@ -38,6 +38,7 @@
|
||||||
#include "accelerometer.h"
|
#include "accelerometer.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "defaults.h"
|
||||||
#include "custom_engine.h"
|
#include "custom_engine.h"
|
||||||
#include "engine_template.h"
|
#include "engine_template.h"
|
||||||
#include "bmw_m73.h"
|
#include "bmw_m73.h"
|
||||||
|
@ -219,7 +220,6 @@ void setConstantDwell(floatms_t dwellMs DECLARE_CONFIG_PARAMETER_SUFFIX) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void setWholeIgnitionIatCorr(float value DECLARE_CONFIG_PARAMETER_SUFFIX) {
|
void setWholeIgnitionIatCorr(float value DECLARE_CONFIG_PARAMETER_SUFFIX) {
|
||||||
// todo: make setMap a template
|
|
||||||
setTable(config->ignitionIatCorrTable, value);
|
setTable(config->ignitionIatCorrTable, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -309,36 +309,6 @@ void setDefaultSdCardParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_PROD_CODE */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// todo: move injector calibration somewhere else?
|
|
||||||
// todo: add a enum? if we have enough data?
|
|
||||||
static void setBosch02880155868(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|
||||||
// http://www.boschdealer.com/specsheets/0280155868cs.jpg
|
|
||||||
engineConfiguration->injector.battLagCorrBins[0] = 6;
|
|
||||||
engineConfiguration->injector.battLagCorr[0] = 3.371;
|
|
||||||
|
|
||||||
engineConfiguration->injector.battLagCorrBins[1] = 8;
|
|
||||||
engineConfiguration->injector.battLagCorr[1] = 1.974;
|
|
||||||
|
|
||||||
engineConfiguration->injector.battLagCorrBins[2] = 10;
|
|
||||||
engineConfiguration->injector.battLagCorr[2] = 1.383;
|
|
||||||
|
|
||||||
engineConfiguration->injector.battLagCorrBins[3] = 11;
|
|
||||||
engineConfiguration->injector.battLagCorr[3] = 1.194;
|
|
||||||
|
|
||||||
engineConfiguration->injector.battLagCorrBins[4] = 12;
|
|
||||||
engineConfiguration->injector.battLagCorr[4] = 1.04;
|
|
||||||
|
|
||||||
engineConfiguration->injector.battLagCorrBins[5] = 13;
|
|
||||||
engineConfiguration->injector.battLagCorr[5] = 0.914;
|
|
||||||
|
|
||||||
engineConfiguration->injector.battLagCorrBins[6] = 14;
|
|
||||||
engineConfiguration->injector.battLagCorr[6] = 0.797;
|
|
||||||
|
|
||||||
engineConfiguration->injector.battLagCorrBins[7] = 15;
|
|
||||||
engineConfiguration->injector.battLagCorr[7] = 0.726;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void setDefaultWarmupIdleCorrection(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
static void setDefaultWarmupIdleCorrection(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
||||||
initTemperatureCurve(CLT_MANUAL_IDLE_CORRECTION, 1.0);
|
initTemperatureCurve(CLT_MANUAL_IDLE_CORRECTION, 1.0);
|
||||||
|
|
||||||
|
@ -358,61 +328,6 @@ static void setDefaultWarmupIdleCorrection(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
||||||
setCurveValue(CLT_MANUAL_IDLE_CORRECTION, 70, 33.0 / baseIdle);
|
setCurveValue(CLT_MANUAL_IDLE_CORRECTION, 70, 33.0 / baseIdle);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setDefaultWarmupFuelEnrichment(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|
||||||
static const float bins[] =
|
|
||||||
{
|
|
||||||
-40,
|
|
||||||
-30,
|
|
||||||
-20,
|
|
||||||
-10,
|
|
||||||
0,
|
|
||||||
10,
|
|
||||||
20,
|
|
||||||
30,
|
|
||||||
40,
|
|
||||||
50,
|
|
||||||
60,
|
|
||||||
70,
|
|
||||||
80,
|
|
||||||
90,
|
|
||||||
100,
|
|
||||||
110
|
|
||||||
};
|
|
||||||
|
|
||||||
copyArray(config->cltFuelCorrBins, bins);
|
|
||||||
|
|
||||||
static const float values[] =
|
|
||||||
{
|
|
||||||
1.50,
|
|
||||||
1.50,
|
|
||||||
1.42,
|
|
||||||
1.36,
|
|
||||||
1.28,
|
|
||||||
1.19,
|
|
||||||
1.12,
|
|
||||||
1.10,
|
|
||||||
1.06,
|
|
||||||
1.06,
|
|
||||||
1.03,
|
|
||||||
1.01,
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
1
|
|
||||||
};
|
|
||||||
|
|
||||||
copyArray(config->cltFuelCorr, values);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void setDefaultFuelCutParameters(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|
||||||
engineConfiguration->coastingFuelCutEnabled = false;
|
|
||||||
engineConfiguration->coastingFuelCutRpmLow = 1300;
|
|
||||||
engineConfiguration->coastingFuelCutRpmHigh = 1500;
|
|
||||||
engineConfiguration->coastingFuelCutTps = 2;
|
|
||||||
engineConfiguration->coastingFuelCutMap = 30;
|
|
||||||
engineConfiguration->coastingFuelCutClt = 30;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void setDefaultCrankingSettings(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
static void setDefaultCrankingSettings(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
CONFIG(useTLE8888_cranking_hack) = true;
|
CONFIG(useTLE8888_cranking_hack) = true;
|
||||||
|
|
||||||
|
@ -521,7 +436,7 @@ void setTargetRpmCurve(int rpm DECLARE_CONFIG_PARAMETER_SUFFIX) {
|
||||||
setLinearCurve(engineConfiguration->cltIdleRpm, rpm, rpm, 10);
|
setLinearCurve(engineConfiguration->cltIdleRpm, rpm, rpm, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setDefaultMultisparkParameters(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
static void setDefaultMultisparkParameters(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
// 1ms spark + 2ms dwell
|
// 1ms spark + 2ms dwell
|
||||||
engineConfiguration->multisparkSparkDuration = 1000;
|
engineConfiguration->multisparkSparkDuration = 1000;
|
||||||
engineConfiguration->multisparkDwell = 2000;
|
engineConfiguration->multisparkDwell = 2000;
|
||||||
|
@ -532,44 +447,6 @@ void setDefaultMultisparkParameters(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
engineConfiguration->multisparkMaxSparkingAngle = 30;
|
engineConfiguration->multisparkMaxSparkingAngle = 30;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setDefaultStftSettings(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|
||||||
auto& cfg = CONFIG(stft);
|
|
||||||
|
|
||||||
// Default to disabled
|
|
||||||
CONFIG(fuelClosedLoopCorrectionEnabled) = false;
|
|
||||||
|
|
||||||
// Default to proportional mode (for wideband sensors)
|
|
||||||
CONFIG(stftIgnoreErrorMagnitude) = false;
|
|
||||||
|
|
||||||
// 60 second startup delay - some O2 sensors are slow to warm up.
|
|
||||||
cfg.startupDelay = 60;
|
|
||||||
|
|
||||||
// Only correct in [12.0, 17.0]
|
|
||||||
cfg.minAfr = 120;
|
|
||||||
cfg.maxAfr = 170;
|
|
||||||
|
|
||||||
// Above 60 deg C
|
|
||||||
cfg.minClt = 60;
|
|
||||||
|
|
||||||
// 0.5% deadband
|
|
||||||
cfg.deadband = 5;
|
|
||||||
|
|
||||||
// Sensible region defaults
|
|
||||||
cfg.maxIdleRegionRpm = 1000 / RPM_1_BYTE_PACKING_MULT;
|
|
||||||
cfg.maxOverrunLoad = 35;
|
|
||||||
cfg.minPowerLoad = 85;
|
|
||||||
|
|
||||||
// Sensible cell defaults
|
|
||||||
for (size_t i = 0; i < efi::size(cfg.cellCfgs); i++) {
|
|
||||||
// 30 second time constant - nice and slow
|
|
||||||
cfg.cellCfgs[i].timeConstant = 30 * 10;
|
|
||||||
|
|
||||||
/// Allow +-5%
|
|
||||||
cfg.cellCfgs[i].maxAdd = 5;
|
|
||||||
cfg.cellCfgs[i].maxRemove = -5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void setDefaultGppwmParameters(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
void setDefaultGppwmParameters(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
// Same config for all channels
|
// Same config for all channels
|
||||||
for (size_t i = 0; i < efi::size(CONFIG(gppwm)); i++) {
|
for (size_t i = 0; i < efi::size(CONFIG(gppwm)); i++) {
|
||||||
|
@ -669,20 +546,13 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
#endif
|
#endif
|
||||||
prepareVoidConfiguration(engineConfiguration);
|
prepareVoidConfiguration(engineConfiguration);
|
||||||
|
|
||||||
#if EFI_ALTERNATOR_CONTROL
|
setDefaultBaseEngine(PASS_CONFIG_PARAMETER_SIGNATURE);
|
||||||
setDefaultAlternatorParameters(PASS_CONFIG_PARAMETER_SIGNATURE);
|
setDefaultFuel(PASS_CONFIG_PARAMETER_SIGNATURE);
|
||||||
#endif /* EFI_ALTERNATOR_CONTROL */
|
|
||||||
|
|
||||||
#if EFI_IDLE_CONTROL
|
#if EFI_IDLE_CONTROL
|
||||||
setDefaultIdleParameters(PASS_CONFIG_PARAMETER_SIGNATURE);
|
setDefaultIdleParameters(PASS_CONFIG_PARAMETER_SIGNATURE);
|
||||||
#endif /* EFI_IDLE_CONTROL */
|
#endif /* EFI_IDLE_CONTROL */
|
||||||
|
|
||||||
#if !EFI_UNIT_TEST
|
|
||||||
// todo: this is a reasonable default for what kinds of engines exactly?
|
|
||||||
engineConfiguration->wwaeTau = 0.3;
|
|
||||||
engineConfiguration->wwaeBeta = 0.3;
|
|
||||||
#endif // EFI_UNIT_TEST
|
|
||||||
|
|
||||||
#if EFI_ELECTRONIC_THROTTLE_BODY
|
#if EFI_ELECTRONIC_THROTTLE_BODY
|
||||||
setDefaultEtbParameters(PASS_CONFIG_PARAMETER_SIGNATURE);
|
setDefaultEtbParameters(PASS_CONFIG_PARAMETER_SIGNATURE);
|
||||||
setDefaultEtbBiasCurve(PASS_CONFIG_PARAMETER_SIGNATURE);
|
setDefaultEtbBiasCurve(PASS_CONFIG_PARAMETER_SIGNATURE);
|
||||||
|
@ -693,16 +563,12 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
|
|
||||||
engineConfiguration->afterCrankingIACtaperDuration = 35;
|
engineConfiguration->afterCrankingIACtaperDuration = 35;
|
||||||
|
|
||||||
CONFIG(tachPulsePerRev) = 1;
|
|
||||||
|
|
||||||
// OBD-II default rate is 500kbps
|
// OBD-II default rate is 500kbps
|
||||||
CONFIG(canBaudRate) = B500KBPS;
|
CONFIG(canBaudRate) = B500KBPS;
|
||||||
|
|
||||||
CONFIG(mafSensorType) = Bosch0280218037;
|
CONFIG(mafSensorType) = Bosch0280218037;
|
||||||
setBosch0280218037(config);
|
setBosch0280218037(config);
|
||||||
|
|
||||||
setBosch02880155868(PASS_ENGINE_PARAMETER_SIGNATURE);
|
|
||||||
|
|
||||||
engineConfiguration->canSleepPeriodMs = 50;
|
engineConfiguration->canSleepPeriodMs = 50;
|
||||||
engineConfiguration->canReadEnabled = true;
|
engineConfiguration->canReadEnabled = true;
|
||||||
engineConfiguration->canWriteEnabled = true;
|
engineConfiguration->canWriteEnabled = true;
|
||||||
|
@ -719,22 +585,14 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
|
|
||||||
CONFIG(mapMinBufferLength) = 1;
|
CONFIG(mapMinBufferLength) = 1;
|
||||||
|
|
||||||
// 50% duty cycle is the default for tach signal
|
|
||||||
CONFIG(tachPulseDurationAsDutyCycle) = true;
|
|
||||||
CONFIG(tachPulseDuractionMs) = 0.5;
|
|
||||||
|
|
||||||
CONFIG(startCrankingDuration) = 3;
|
CONFIG(startCrankingDuration) = 3;
|
||||||
|
|
||||||
CONFIG(compressionRatio) = 9;
|
|
||||||
|
|
||||||
engineConfiguration->idlePidRpmDeadZone = 50;
|
engineConfiguration->idlePidRpmDeadZone = 50;
|
||||||
engineConfiguration->startOfCrankingPrimingPulse = 0;
|
engineConfiguration->startOfCrankingPrimingPulse = 0;
|
||||||
|
|
||||||
engineConfiguration->acCutoffLowRpm = 700;
|
engineConfiguration->acCutoffLowRpm = 700;
|
||||||
engineConfiguration->acCutoffHighRpm = 5000;
|
engineConfiguration->acCutoffHighRpm = 5000;
|
||||||
|
|
||||||
engineConfiguration->postCrankingDurationSec = 2;
|
|
||||||
|
|
||||||
initTemperatureCurve(IAT_FUEL_CORRECTION_CURVE, 1);
|
initTemperatureCurve(IAT_FUEL_CORRECTION_CURVE, 1);
|
||||||
|
|
||||||
engineConfiguration->auxPid[0].minValue = 10;
|
engineConfiguration->auxPid[0].minValue = 10;
|
||||||
|
@ -758,12 +616,6 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
#if EFI_ENGINE_CONTROL
|
#if EFI_ENGINE_CONTROL
|
||||||
setDefaultWarmupIdleCorrection(PASS_CONFIG_PARAMETER_SIGNATURE);
|
setDefaultWarmupIdleCorrection(PASS_CONFIG_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
setDefaultWarmupFuelEnrichment(PASS_ENGINE_PARAMETER_SIGNATURE);
|
|
||||||
|
|
||||||
setDefaultFuelCutParameters(PASS_ENGINE_PARAMETER_SIGNATURE);
|
|
||||||
|
|
||||||
setMazdaMiataNbTpsTps(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 4ms is global default dwell for the whole RPM range
|
* 4ms is global default dwell for the whole RPM range
|
||||||
* if you only have one coil and many cylinders or high RPM you would need lower value at higher RPM
|
* if you only have one coil and many cylinders or high RPM you would need lower value at higher RPM
|
||||||
|
@ -784,24 +636,8 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
setLinearCurve(engineConfiguration->map.samplingWindowBins, 800, 7000, 1);
|
setLinearCurve(engineConfiguration->map.samplingWindowBins, 800, 7000, 1);
|
||||||
setLinearCurve(engineConfiguration->map.samplingWindow, 50, 50, 1);
|
setLinearCurve(engineConfiguration->map.samplingWindow, 50, 50, 1);
|
||||||
|
|
||||||
setTable(config->lambdaTable, 1.0f);
|
|
||||||
engineConfiguration->stoichRatioPrimary = STOICH_RATIO * PACK_MULT_AFR_CFG;
|
|
||||||
engineConfiguration->stoichRatioSecondary = 9.0f * PACK_MULT_AFR_CFG;
|
|
||||||
|
|
||||||
setDefaultVETable(PASS_ENGINE_PARAMETER_SIGNATURE);
|
|
||||||
|
|
||||||
setTable(config->injectionPhase, -180.0f);
|
|
||||||
|
|
||||||
setRpmTableBin(config->injPhaseRpmBins, FUEL_RPM_COUNT);
|
|
||||||
setFuelTablesLoadBin(10, 160 PASS_CONFIG_PARAMETER_SUFFIX);
|
|
||||||
setDefaultIatTimingCorrection(PASS_ENGINE_PARAMETER_SIGNATURE);
|
setDefaultIatTimingCorrection(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
setLinearCurve(engineConfiguration->mapAccelTaperBins, 0, 32, 4);
|
|
||||||
setLinearCurve(engineConfiguration->mapAccelTaperMult, 1, 1, 1);
|
|
||||||
|
|
||||||
setLinearCurve(config->tpsTpsAccelFromRpmBins, 0, 100, 10);
|
|
||||||
setLinearCurve(config->tpsTpsAccelToRpmBins, 0, 100, 10);
|
|
||||||
|
|
||||||
setLinearCurve(config->vvtTable1LoadBins, 20, 120, 10);
|
setLinearCurve(config->vvtTable1LoadBins, 20, 120, 10);
|
||||||
setRpmTableBin(config->vvtTable1RpmBins, FSIO_TABLE_8);
|
setRpmTableBin(config->vvtTable1RpmBins, FSIO_TABLE_8);
|
||||||
setLinearCurve(config->vvtTable2LoadBins, 20, 120, 10);
|
setLinearCurve(config->vvtTable2LoadBins, 20, 120, 10);
|
||||||
|
@ -822,12 +658,6 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
// todo: this value is way off! I am pretty sure temp coeffs are off also
|
// todo: this value is way off! I am pretty sure temp coeffs are off also
|
||||||
engineConfiguration->iat.config = {32, 75, 120, 9500, 2100, 1000, 2700};
|
engineConfiguration->iat.config = {32, 75, 120, 9500, 2100, 1000, 2700};
|
||||||
|
|
||||||
#if EFI_PROD_CODE
|
|
||||||
engineConfiguration->warningPeriod = 10;
|
|
||||||
#else
|
|
||||||
engineConfiguration->warningPeriod = 0;
|
|
||||||
#endif /* EFI_PROD_CODE */
|
|
||||||
|
|
||||||
engineConfiguration->launchRpm = 3000;
|
engineConfiguration->launchRpm = 3000;
|
||||||
engineConfiguration->launchTimingRetard = 10;
|
engineConfiguration->launchTimingRetard = 10;
|
||||||
engineConfiguration->launchTimingRpmRange = 500;
|
engineConfiguration->launchTimingRpmRange = 500;
|
||||||
|
@ -838,29 +668,12 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
engineConfiguration->slowAdcAlpha = 0.33333;
|
engineConfiguration->slowAdcAlpha = 0.33333;
|
||||||
engineConfiguration->engineSnifferRpmThreshold = 2500;
|
engineConfiguration->engineSnifferRpmThreshold = 2500;
|
||||||
engineConfiguration->sensorSnifferRpmThreshold = 2500;
|
engineConfiguration->sensorSnifferRpmThreshold = 2500;
|
||||||
engineConfiguration->rpmHardLimit = 7000;
|
|
||||||
engineConfiguration->cranking.rpm = 550;
|
engineConfiguration->cranking.rpm = 550;
|
||||||
engineConfiguration->cutFuelOnHardLimit = true;
|
|
||||||
engineConfiguration->cutSparkOnHardLimit = true;
|
|
||||||
engineConfiguration->failedMapFallback = 60;
|
|
||||||
|
|
||||||
engineConfiguration->tChargeMinRpmMinTps = 0.25;
|
|
||||||
engineConfiguration->tChargeMinRpmMaxTps = 0.25;
|
|
||||||
engineConfiguration->tChargeMaxRpmMinTps = 0.25;
|
|
||||||
engineConfiguration->tChargeMaxRpmMaxTps = 0.9;
|
|
||||||
engineConfiguration->tChargeMode = TCHARGE_MODE_RPM_TPS;
|
|
||||||
engineConfiguration->tChargeAirCoefMin = 0.098f;
|
|
||||||
engineConfiguration->tChargeAirCoefMax = 0.902f;
|
|
||||||
engineConfiguration->tChargeAirFlowMax = 153.6f;
|
|
||||||
engineConfiguration->tChargeAirIncrLimit = 1.0f;
|
|
||||||
engineConfiguration->tChargeAirDecrLimit = 12.5f;
|
|
||||||
|
|
||||||
engineConfiguration->noAccelAfterHardLimitPeriodSecs = 3;
|
engineConfiguration->noAccelAfterHardLimitPeriodSecs = 3;
|
||||||
|
|
||||||
setDefaultCrankingSettings(PASS_ENGINE_PARAMETER_SIGNATURE);
|
setDefaultCrankingSettings(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
setDefaultStftSettings(PASS_ENGINE_PARAMETER_SIGNATURE);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Idle control defaults
|
* Idle control defaults
|
||||||
*/
|
*/
|
||||||
|
@ -888,7 +701,6 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
/**
|
/**
|
||||||
* Cranking defaults
|
* Cranking defaults
|
||||||
*/
|
*/
|
||||||
engineConfiguration->startUpFuelPumpDuration = 4;
|
|
||||||
engineConfiguration->cranking.baseFuel = 27;
|
engineConfiguration->cranking.baseFuel = 27;
|
||||||
engineConfiguration->crankingChargeAngle = 70;
|
engineConfiguration->crankingChargeAngle = 70;
|
||||||
|
|
||||||
|
@ -907,21 +719,11 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
// performance optimization
|
// performance optimization
|
||||||
engineConfiguration->sensorChartMode = SC_OFF;
|
engineConfiguration->sensorChartMode = SC_OFF;
|
||||||
|
|
||||||
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
|
||||||
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
|
|
||||||
engineConfiguration->injectionMode = IM_SEQUENTIAL;
|
|
||||||
|
|
||||||
engineConfiguration->ignitionMode = IM_ONE_COIL;
|
|
||||||
engineConfiguration->globalTriggerAngleOffset = 0;
|
|
||||||
engineConfiguration->extraInjectionOffset = 0;
|
engineConfiguration->extraInjectionOffset = 0;
|
||||||
|
|
||||||
engineConfiguration->fuelAlgorithm = LM_SPEED_DENSITY;
|
engineConfiguration->fuelAlgorithm = LM_SPEED_DENSITY;
|
||||||
|
|
||||||
engineConfiguration->vbattDividerCoeff = ((float) (15 + 65)) / 15;
|
|
||||||
|
|
||||||
engineConfiguration->fanOnTemperature = 95;
|
|
||||||
engineConfiguration->fanOffTemperature = 91;
|
|
||||||
|
|
||||||
engineConfiguration->tpsMin = convertVoltageTo10bitADC(0);
|
engineConfiguration->tpsMin = convertVoltageTo10bitADC(0);
|
||||||
engineConfiguration->tpsMax = convertVoltageTo10bitADC(5);
|
engineConfiguration->tpsMax = convertVoltageTo10bitADC(5);
|
||||||
engineConfiguration->tps1SecondaryMin = convertVoltageTo10bitADC(0);
|
engineConfiguration->tps1SecondaryMin = convertVoltageTo10bitADC(0);
|
||||||
|
@ -942,22 +744,12 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
engineConfiguration->oilPressure.value1 = 0;
|
engineConfiguration->oilPressure.value1 = 0;
|
||||||
engineConfiguration->oilPressure.value2 = 689.476f; // 100psi = 689.476kPa
|
engineConfiguration->oilPressure.value2 = 689.476f; // 100psi = 689.476kPa
|
||||||
|
|
||||||
setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR);
|
|
||||||
engineConfiguration->specs.cylindersCount = 4;
|
|
||||||
engineConfiguration->specs.displacement = 2;
|
|
||||||
/**
|
|
||||||
* By the way http://users.erols.com/srweiss/tableifc.htm has a LOT of data
|
|
||||||
*/
|
|
||||||
engineConfiguration->injector.flow = 200;
|
|
||||||
|
|
||||||
engineConfiguration->mapLowValueVoltage = 0;
|
engineConfiguration->mapLowValueVoltage = 0;
|
||||||
// todo: start using this for custom MAP
|
// todo: start using this for custom MAP
|
||||||
engineConfiguration->mapHighValueVoltage = 5;
|
engineConfiguration->mapHighValueVoltage = 5;
|
||||||
|
|
||||||
engineConfiguration->logFormat = LF_NATIVE;
|
engineConfiguration->logFormat = LF_NATIVE;
|
||||||
|
|
||||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
|
||||||
|
|
||||||
engineConfiguration->HD44780width = 20;
|
engineConfiguration->HD44780width = 20;
|
||||||
engineConfiguration->HD44780height = 4;
|
engineConfiguration->HD44780height = 4;
|
||||||
|
|
||||||
|
@ -976,10 +768,6 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
|
|
||||||
engineConfiguration->isEngineChartEnabled = true;
|
engineConfiguration->isEngineChartEnabled = true;
|
||||||
|
|
||||||
engineConfiguration->useOnlyRisingEdgeForTrigger = false;
|
|
||||||
// Default this to on - if you want to diagnose, turn it off.
|
|
||||||
engineConfiguration->silentTriggerError = true;
|
|
||||||
|
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
engineConfiguration->engineChartSize = 300;
|
engineConfiguration->engineChartSize = 300;
|
||||||
#else
|
#else
|
||||||
|
@ -989,9 +777,7 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
|
|
||||||
engineConfiguration->primingSquirtDurationMs = 5;
|
engineConfiguration->primingSquirtDurationMs = 5;
|
||||||
|
|
||||||
engineConfiguration->isInjectionEnabled = true;
|
|
||||||
engineConfiguration->isIgnitionEnabled = true;
|
engineConfiguration->isIgnitionEnabled = true;
|
||||||
engineConfiguration->isCylinderCleanupEnabled = false; // this feature is evil if one does not have TPS, better turn off by default
|
|
||||||
|
|
||||||
engineConfiguration->isMapAveragingEnabled = true;
|
engineConfiguration->isMapAveragingEnabled = true;
|
||||||
engineConfiguration->isWaveAnalyzerEnabled = true;
|
engineConfiguration->isWaveAnalyzerEnabled = true;
|
||||||
|
@ -1031,13 +817,6 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
engineConfiguration->hip9011Gain = 1;
|
engineConfiguration->hip9011Gain = 1;
|
||||||
|
|
||||||
engineConfiguration->isEngineControlEnabled = true;
|
engineConfiguration->isEngineControlEnabled = true;
|
||||||
|
|
||||||
engineConfiguration->engineLoadAccelLength = 6;
|
|
||||||
engineConfiguration->engineLoadAccelEnrichmentThreshold = 5; // kPa
|
|
||||||
engineConfiguration->engineLoadAccelEnrichmentMultiplier = 0; // todo: improve implementation and re-enable by default
|
|
||||||
|
|
||||||
engineConfiguration->tpsAccelLength = 12;
|
|
||||||
engineConfiguration->tpsAccelEnrichmentThreshold = 40; // TPS % change, per engine cycle
|
|
||||||
#endif // EFI_ENGINE_CONTROL
|
#endif // EFI_ENGINE_CONTROL
|
||||||
#if EFI_FSIO
|
#if EFI_FSIO
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -65,6 +65,7 @@ CONTROLLERS_INC=\
|
||||||
$(CONTROLLERS_DIR)/system/timer \
|
$(CONTROLLERS_DIR)/system/timer \
|
||||||
$(CONTROLLERS_DIR)/algo \
|
$(CONTROLLERS_DIR)/algo \
|
||||||
$(CONTROLLERS_DIR)/algo/airmass \
|
$(CONTROLLERS_DIR)/algo/airmass \
|
||||||
|
$(CONTROLLERS_DIR)/algo/defaults \
|
||||||
$(CONTROLLERS_DIR)/algo/fuel \
|
$(CONTROLLERS_DIR)/algo/fuel \
|
||||||
$(CONTROLLERS_DIR)/engine_cycle \
|
$(CONTROLLERS_DIR)/engine_cycle \
|
||||||
$(CONTROLLERS_DIR)/trigger/decoders \
|
$(CONTROLLERS_DIR)/trigger/decoders \
|
||||||
|
|
|
@ -112,27 +112,6 @@ temperature_t getTCharge(int rpm, float tps DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
return Tcharge;
|
return Tcharge;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setDefaultVETable(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|
||||||
setRpmTableBin(config->veRpmBins, FUEL_RPM_COUNT);
|
|
||||||
setTable(config->veTable, 80);
|
|
||||||
|
|
||||||
// setRpmTableBin(engineConfiguration->ve2RpmBins, FUEL_RPM_COUNT);
|
|
||||||
// setLinearCurve(engineConfiguration->ve2LoadBins, 10, 300, 1);
|
|
||||||
// ve2Map.setAll(0.81);
|
|
||||||
|
|
||||||
setRpmTableBin(config->lambdaRpmBins, FUEL_RPM_COUNT);
|
|
||||||
setTable(config->lambdaTable, 1);
|
|
||||||
|
|
||||||
setRpmTableBin(engineConfiguration->baroCorrRpmBins, BARO_CORR_SIZE);
|
|
||||||
setLinearCurve(engineConfiguration->baroCorrPressureBins, 75, 105, 1);
|
|
||||||
for (int i = 0; i < BARO_CORR_SIZE;i++) {
|
|
||||||
for (int j = 0; j < BARO_CORR_SIZE;j++) {
|
|
||||||
// Default baro table is all 1.0, we can't recommend a reasonable default here
|
|
||||||
engineConfiguration->baroCorrTable[i][j] = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void initSpeedDensity(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
void initSpeedDensity(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
veMap.init(config->veTable, config->veLoadBins, config->veRpmBins);
|
veMap.init(config->veTable, config->veLoadBins, config->veRpmBins);
|
||||||
// ve2Map.init(engineConfiguration->ve2Table, engineConfiguration->ve2LoadBins, engineConfiguration->ve2RpmBins);
|
// ve2Map.init(engineConfiguration->ve2Table, engineConfiguration->ve2LoadBins, engineConfiguration->ve2RpmBins);
|
||||||
|
|
|
@ -16,5 +16,4 @@
|
||||||
|
|
||||||
temperature_t getTCharge(int rpm, float tps DECLARE_ENGINE_PARAMETER_SUFFIX);
|
temperature_t getTCharge(int rpm, float tps DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
|
||||||
void setDefaultVETable(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
|
||||||
void initSpeedDensity(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
void initSpeedDensity(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
|
|
Loading…
Reference in New Issue