fix #802
This commit is contained in:
parent
4158761704
commit
01e481db31
|
@ -320,7 +320,7 @@ private:
|
||||||
baseIdlePosition = iacPosition;
|
baseIdlePosition = iacPosition;
|
||||||
idleState = BLIP;
|
idleState = BLIP;
|
||||||
} else if (!isRunning) {
|
} else if (!isRunning) {
|
||||||
// during cranking it's always manual mode, PID would make no sence during cranking
|
// during cranking it's always manual mode, PID would make no sense during cranking
|
||||||
iacPosition = cltCorrection * engineConfiguration->crankingIACposition;
|
iacPosition = cltCorrection * engineConfiguration->crankingIACposition;
|
||||||
// save cranking position & cycles counter for taper transition
|
// save cranking position & cycles counter for taper transition
|
||||||
lastCrankingIacPosition = iacPosition;
|
lastCrankingIacPosition = iacPosition;
|
||||||
|
|
|
@ -225,7 +225,7 @@ angle_t getAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void setDefaultIatTimingCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
void setDefaultIatTimingCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
setLinearCurve(config->ignitionIatCorrLoadBins, IGN_LOAD_COUNT, -40, 110, 1);
|
setLinearCurve(config->ignitionIatCorrLoadBins, IGN_LOAD_COUNT, /*from*/CLT_CURVE_RANGE_FROM, 110, 1);
|
||||||
memcpy(config->ignitionIatCorrRpmBins, iatTimingRpmBins, sizeof(iatTimingRpmBins));
|
memcpy(config->ignitionIatCorrRpmBins, iatTimingRpmBins, sizeof(iatTimingRpmBins));
|
||||||
copyTimingTable(defaultIatTiming, config->ignitionIatCorrTable);
|
copyTimingTable(defaultIatTiming, config->ignitionIatCorrTable);
|
||||||
}
|
}
|
||||||
|
|
|
@ -569,9 +569,12 @@ static void setDefaultFuelCutParameters(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setDefaultCrankingSettings(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
static void setDefaultCrankingSettings(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
setLinearCurve(engineConfiguration->crankingTpsCoef, CRANKING_CURVE_SIZE, 1, 1, 1);
|
setLinearCurve(engineConfiguration->crankingTpsCoef, CRANKING_CURVE_SIZE, /*from*/1, /*to*/1, 1);
|
||||||
setLinearCurve(engineConfiguration->crankingTpsBins, CRANKING_CURVE_SIZE, 0, 100, 1);
|
setLinearCurve(engineConfiguration->crankingTpsBins, CRANKING_CURVE_SIZE, 0, 100, 1);
|
||||||
|
|
||||||
|
setLinearCurve(config->cltCrankingCorrBins, CLT_CRANKING_CURVE_SIZE, CLT_CURVE_RANGE_FROM, 100, 1);
|
||||||
|
setLinearCurve(config->cltCrankingCorr, CLT_CRANKING_CURVE_SIZE, 100, 100, 1);
|
||||||
|
|
||||||
config->crankingFuelCoef[0] = 28; // base cranking fuel adjustment coefficient
|
config->crankingFuelCoef[0] = 28; // base cranking fuel adjustment coefficient
|
||||||
config->crankingFuelBins[0] = -20; // temperature in C
|
config->crankingFuelBins[0] = -20; // temperature in C
|
||||||
config->crankingFuelCoef[1] = 22;
|
config->crankingFuelCoef[1] = 22;
|
||||||
|
@ -626,7 +629,7 @@ static void setDefaultCrankingSettings(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
* see also setTargetRpmCurve()
|
* see also setTargetRpmCurve()
|
||||||
*/
|
*/
|
||||||
static void setDefaultIdleSpeedTarget(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
static void setDefaultIdleSpeedTarget(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
setLinearCurve(engineConfiguration->cltIdleRpmBins, CLT_CURVE_SIZE, -40, 140, 10);
|
setLinearCurve(engineConfiguration->cltIdleRpmBins, CLT_CURVE_SIZE, CLT_CURVE_RANGE_FROM, 140, 10);
|
||||||
|
|
||||||
setCurveValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, -30, 1350);
|
setCurveValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, -30, 1350);
|
||||||
setCurveValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, -20, 1300);
|
setCurveValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, -20, 1300);
|
||||||
|
@ -669,7 +672,7 @@ static void setCanDefaults(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
* see also setDefaultIdleSpeedTarget()
|
* see also setDefaultIdleSpeedTarget()
|
||||||
*/
|
*/
|
||||||
void setTargetRpmCurve(int rpm DECLARE_CONFIG_PARAMETER_SUFFIX) {
|
void setTargetRpmCurve(int rpm DECLARE_CONFIG_PARAMETER_SUFFIX) {
|
||||||
setLinearCurve(engineConfiguration->cltIdleRpmBins, CLT_CURVE_SIZE, -40, 90, 10);
|
setLinearCurve(engineConfiguration->cltIdleRpmBins, CLT_CURVE_SIZE, CLT_CURVE_RANGE_FROM, 90, 10);
|
||||||
setLinearCurve(engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, rpm, rpm, 10);
|
setLinearCurve(engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, rpm, rpm, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -740,7 +743,7 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
engineConfiguration->alternatorControl.minValue = 10;
|
engineConfiguration->alternatorControl.minValue = 10;
|
||||||
engineConfiguration->alternatorControl.maxValue = 90;
|
engineConfiguration->alternatorControl.maxValue = 90;
|
||||||
|
|
||||||
setLinearCurve(engineConfiguration->cltTimingBins, CLT_TIMING_CURVE_SIZE, -40, 120, 1);
|
setLinearCurve(engineConfiguration->cltTimingBins, CLT_TIMING_CURVE_SIZE, CLT_CURVE_RANGE_FROM, 120, 1);
|
||||||
setLinearCurve(engineConfiguration->cltTimingExtra, CLT_TIMING_CURVE_SIZE, 0, 0, 1);
|
setLinearCurve(engineConfiguration->cltTimingExtra, CLT_TIMING_CURVE_SIZE, 0, 0, 1);
|
||||||
|
|
||||||
setLinearCurve(engineConfiguration->fsioCurve1Bins, FSIO_CURVE_16, 0, 100, 1);
|
setLinearCurve(engineConfiguration->fsioCurve1Bins, FSIO_CURVE_16, 0, 100, 1);
|
||||||
|
|
|
@ -72,7 +72,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 Sat May 11 13:38:32 EDT 2019
|
; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sat May 25 13:35:29 EDT 2019
|
||||||
|
|
||||||
pageSize = 20000
|
pageSize = 20000
|
||||||
page = 1
|
page = 1
|
||||||
|
@ -1430,14 +1430,14 @@ fileVersion = { 20171101 }
|
||||||
yBins = iacCoasting
|
yBins = iacCoasting
|
||||||
gauge = idleAirValvePositionGauge
|
gauge = idleAirValvePositionGauge
|
||||||
|
|
||||||
curve = cltCrankingCurve, "Cranking IAC multiplier"
|
curve = cltCrankingCurve, "Cranking Idle Air multiplier"
|
||||||
columnLabel = "Coolant", "Multiplier"
|
columnLabel = "Coolant", "Multiplier"
|
||||||
#if CELSIUS
|
#if CELSIUS
|
||||||
xAxis = -40, 120, 10
|
xAxis = -40, 120, 10
|
||||||
#else
|
#else
|
||||||
xAxis = -40, 250, 10
|
xAxis = -40, 250, 10
|
||||||
#endif
|
#endif
|
||||||
yAxis = 0, 50, 10
|
yAxis = 0, 300, 10
|
||||||
xBins = cltCrankingCorrBins, coolant
|
xBins = cltCrankingCorrBins, coolant
|
||||||
yBins = cltCrankingCorr
|
yBins = cltCrankingCorr
|
||||||
gauge = CLTGauge
|
gauge = CLTGauge
|
||||||
|
@ -3086,7 +3086,7 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00"
|
||||||
dialog = crankingIAC, "IAC"
|
dialog = crankingIAC, "IAC"
|
||||||
field = "Cranking IAC position", crankingIACposition
|
field = "Cranking IAC position", crankingIACposition
|
||||||
field = "After cranking IAC taper duration", afterCrankingIACtaperDuration
|
field = "After cranking IAC taper duration", afterCrankingIACtaperDuration
|
||||||
field = "Override IAC Multiplier for Cranking", overrideCrankingIacSetting
|
field = "Override Idle Air Multiplier for Cranking", overrideCrankingIacSetting
|
||||||
|
|
||||||
dialog = crankingIgnition, "Ignition"
|
dialog = crankingIgnition, "Ignition"
|
||||||
field = "Advance", crankingTimingAngle, {useSeparateAdvanceForCranking == 0}
|
field = "Advance", crankingTimingAngle, {useSeparateAdvanceForCranking == 0}
|
||||||
|
|
|
@ -499,14 +499,14 @@ fileVersion = { 20171101 }
|
||||||
yBins = iacCoasting
|
yBins = iacCoasting
|
||||||
gauge = idleAirValvePositionGauge
|
gauge = idleAirValvePositionGauge
|
||||||
|
|
||||||
curve = cltCrankingCurve, "Cranking IAC multiplier"
|
curve = cltCrankingCurve, "Cranking Idle Air multiplier"
|
||||||
columnLabel = "Coolant", "Multiplier"
|
columnLabel = "Coolant", "Multiplier"
|
||||||
#if CELSIUS
|
#if CELSIUS
|
||||||
xAxis = -40, 120, 10
|
xAxis = -40, 120, 10
|
||||||
#else
|
#else
|
||||||
xAxis = -40, 250, 10
|
xAxis = -40, 250, 10
|
||||||
#endif
|
#endif
|
||||||
yAxis = 0, 50, 10
|
yAxis = 0, 300, 10
|
||||||
xBins = cltCrankingCorrBins, coolant
|
xBins = cltCrankingCorrBins, coolant
|
||||||
yBins = cltCrankingCorr
|
yBins = cltCrankingCorr
|
||||||
gauge = CLTGauge
|
gauge = CLTGauge
|
||||||
|
@ -2155,7 +2155,7 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00"
|
||||||
dialog = crankingIAC, "IAC"
|
dialog = crankingIAC, "IAC"
|
||||||
field = "Cranking IAC position", crankingIACposition
|
field = "Cranking IAC position", crankingIACposition
|
||||||
field = "After cranking IAC taper duration", afterCrankingIACtaperDuration
|
field = "After cranking IAC taper duration", afterCrankingIACtaperDuration
|
||||||
field = "Override IAC Multiplier for Cranking", overrideCrankingIacSetting
|
field = "Override Idle Air Multiplier for Cranking", overrideCrankingIacSetting
|
||||||
|
|
||||||
dialog = crankingIgnition, "Ignition"
|
dialog = crankingIgnition, "Ignition"
|
||||||
field = "Advance", crankingTimingAngle, {useSeparateAdvanceForCranking == 0}
|
field = "Advance", crankingTimingAngle, {useSeparateAdvanceForCranking == 0}
|
||||||
|
|
|
@ -12,6 +12,9 @@
|
||||||
#include "interpolation.h"
|
#include "interpolation.h"
|
||||||
#include "efilib.h"
|
#include "efilib.h"
|
||||||
|
|
||||||
|
// popular left edge of CLT-based correction curvers
|
||||||
|
#define CLT_CURVE_RANGE_FROM -40
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* this helper class brings together 3D table with two 2D axis curves
|
* this helper class brings together 3D table with two 2D axis curves
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -237,6 +237,8 @@ int findIndex(const float array[], int size, float value) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief One-dimensional table lookup with linear interpolation
|
* @brief One-dimensional table lookup with linear interpolation
|
||||||
|
*
|
||||||
|
* @see setLinearCurve()
|
||||||
*/
|
*/
|
||||||
float interpolate2d(const char *msg, float value, const float bin[], const float values[], int size) {
|
float interpolate2d(const char *msg, float value, const float bin[], const float values[], int size) {
|
||||||
if (isnan(value)) {
|
if (isnan(value)) {
|
||||||
|
|
Loading…
Reference in New Issue