idle using ETB #783

This commit is contained in:
rusefi 2019-06-15 13:33:14 -04:00
parent a187e935b5
commit e1c0557f4d
13 changed files with 47 additions and 19 deletions

View File

@ -226,7 +226,7 @@ private:
}
percent_t targetPosition = getPedalPosition(PASS_ENGINE_PARAMETER_SIGNATURE);
percent_t targetPosition = getPedalPosition(PASS_ENGINE_PARAMETER_SIGNATURE) + engine->engineState.etbIdleAddition;
feedForward = interpolate2d("etbb", targetPosition, engineConfiguration->etbBiasBins, engineConfiguration->etbBiasValues, ETB_BIAS_CURVE_LENGTH);
@ -332,6 +332,8 @@ void setEtbOffset(int value) {
}
void setDefaultEtbParameters(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
CONFIG(etbIdleThrottleRange) = 5;
setLinearCurveAny<int8_t>(config->pedalToTpsPedalBins, PEDAL_TO_TPS_SIZE, /*from*/0, /*to*/100, 1);
setLinearCurveAny<uint8_t>(config->pedalToTpsRpmBins, PEDAL_TO_TPS_SIZE, /*from*/0, /*to*/8000 / RPM_1_BYTE_PACKING_MULT, 1);

View File

@ -113,7 +113,9 @@ void setIdleMode(idle_mode_e value) {
}
static void applyIACposition(percent_t position) {
if (CONFIGB(useStepperIdle)) {
if (CONFIGB(useETBforIdleControl)) {
engine->engineState.etbIdleAddition = position / 100 * CONFIG(etbIdleThrottleRange);
} if (CONFIGB(useStepperIdle)) {
iacMotor.setTargetPosition(position / 100 * engineConfiguration->idleStepperTotalSteps);
} else {
/**

View File

@ -1,4 +1,4 @@
// this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Thu Jun 13 14:55:38 EDT 2019
// this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Sat Jun 15 11:58:46 EDT 2019
// begin
#ifndef CONTROLLERS_ALGO_ENGINE_CONFIGURATION_GENERATED_STRUCTURES_H
#define CONTROLLERS_ALGO_ENGINE_CONFIGURATION_GENERATED_STRUCTURES_H
@ -2542,7 +2542,11 @@ struct engine_configuration_s {
/**
* offset 4036
*/
int mainUnusedEnd[591];
float etbIdleThrottleRange;
/**
* offset 4040
*/
int mainUnusedEnd[590];
/** total size 6400*/
};
@ -2805,4 +2809,4 @@ typedef struct persistent_config_s persistent_config_s;
#endif
// end
// this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Thu Jun 13 14:55:38 EDT 2019
// this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Sat Jun 15 11:58:46 EDT 2019

View File

@ -22,6 +22,11 @@ public:
FuelConsumptionState fuelConsumption;
/**
* ETB position adjustment related to idle RPM control
*/
float etbIdleAddition = 0;
efitick_t crankingTime = 0;
efitick_t timeSinceCranking = 0;

View File

@ -527,6 +527,8 @@
#define etbFreq_offset_hex 9ea
#define etbIdleRange_offset 972
#define etbIdleRange_offset_hex 3cc
#define etbIdleThrottleRange_offset 4036
#define etbIdleThrottleRange_offset_hex fc4
#define externalKnockSenseAdc_offset 3127
#define externalKnockSenseAdc_offset_hex c37
#define extraInjectionOffset_offset 432
@ -1340,8 +1342,8 @@
#define mainRelayPin_offset_hex 2c2
#define mainRelayPinMode_offset 752
#define mainRelayPinMode_offset_hex 2f0
#define mainUnusedEnd_offset 4036
#define mainUnusedEnd_offset_hex fc4
#define mainUnusedEnd_offset 4040
#define mainUnusedEnd_offset_hex fc8
#define malfunctionIndicatorPin_offset 660
#define malfunctionIndicatorPin_offset_hex 294
#define malfunctionIndicatorPinMode_offset 661

View File

@ -810,6 +810,6 @@ int getRusEfiVersion(void) {
if (initBootloader() != 0)
return 123;
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
return 20190614;
return 20190615;
}
#endif /* EFI_UNIT_TEST */

View File

@ -1055,8 +1055,9 @@ tChargeMode_e tChargeMode;
uint8_t[3] unusedSpiPadding8;
float etbIdleThrottleRange
int[591] mainUnusedEnd;
int[590] mainUnusedEnd;
end_struct

View File

@ -82,7 +82,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Fri Jun 14 14:12:56 EDT 2019
; this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Sat Jun 15 11:58:46 EDT 2019
pageSize = 20000
page = 1
@ -886,7 +886,8 @@ page = 1
;no TS info - skipping unusedSpiPadding7 offset 4029
mc33972spiDevice = bits,U32, 4032, [0:2], "Off", "SPI1", "SPI2", "SPI3", "SPI4"
;no TS info - skipping unusedSpiPadding8 offset 4033
;no TS info - skipping mainUnusedEnd offset 4036
;no TS info - skipping etbIdleThrottleRange offset 4036
;no TS info - skipping mainUnusedEnd offset 4040
pedalToTpsTable = array, U08, 6400, [8x8],"deg", 1, 0, -720, 720, 2
pedalToTpsPedalBins = array, S08, 6464, [8], "%", 1, 0, 0.0, 120.0, 0
pedalToTpsRpmBins = array, U08, 6472, [8], "RPM", 50, 0, 0.0, 12000.0, 0
@ -2872,6 +2873,7 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00"
dialog = idleSettings, "", yAxis
field = "Idle IAC control mode", idleMode
field = "use ETB for idle", useETBforIdleControl
fiedl = "ETB Idle range", etbIdleThrottleRange, {useETBforIdleControl == 1}
field = "Use separate Ignition Table for idle", useSeparateAdvanceForIdle
field = "Use separate VE Table for idle", useSeparateVeForIdle
field = "Use separate IAC Table For Coasting", useIacTableForCoasting, {idleMode == 0}

View File

@ -1921,6 +1921,7 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00"
dialog = idleSettings, "", yAxis
field = "Idle IAC control mode", idleMode
field = "use ETB for idle", useETBforIdleControl
fiedl = "ETB Idle range", etbIdleThrottleRange, {useETBforIdleControl == 1}
field = "Use separate Ignition Table for idle", useSeparateAdvanceForIdle
field = "Use separate VE Table for idle", useSeparateVeForIdle
field = "Use separate IAC Table For Coasting", useIacTableForCoasting, {idleMode == 0}

View File

@ -82,7 +82,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Fri Jun 14 14:13:02 EDT 2019
; this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Sat Jun 15 11:58:52 EDT 2019
pageSize = 20000
page = 1
@ -886,7 +886,8 @@ page = 1
;no TS info - skipping unusedSpiPadding7 offset 4029
mc33972spiDevice = bits,U32, 4032, [0:2], "Off", "SPI1", "SPI2", "SPI3", "SPI4"
;no TS info - skipping unusedSpiPadding8 offset 4033
;no TS info - skipping mainUnusedEnd offset 4036
;no TS info - skipping etbIdleThrottleRange offset 4036
;no TS info - skipping mainUnusedEnd offset 4040
pedalToTpsTable = array, U08, 6400, [8x8],"deg", 1, 0, -720, 720, 2
pedalToTpsPedalBins = array, S08, 6464, [8], "%", 1, 0, 0.0, 120.0, 0
pedalToTpsRpmBins = array, U08, 6472, [8], "RPM", 50, 0, 0.0, 12000.0, 0
@ -2872,6 +2873,7 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00"
dialog = idleSettings, "", yAxis
field = "Idle IAC control mode", idleMode
field = "use ETB for idle", useETBforIdleControl
fiedl = "ETB Idle range", etbIdleThrottleRange, {useETBforIdleControl == 1}
field = "Use separate Ignition Table for idle", useSeparateAdvanceForIdle
field = "Use separate VE Table for idle", useSeparateVeForIdle
field = "Use separate IAC Table For Coasting", useIacTableForCoasting, {idleMode == 0}

View File

@ -82,7 +82,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Fri Jun 14 14:12:59 EDT 2019
; this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Sat Jun 15 11:58:49 EDT 2019
pageSize = 20000
page = 1
@ -886,7 +886,8 @@ page = 1
;no TS info - skipping unusedSpiPadding7 offset 4029
mc33972spiDevice = bits,U32, 4032, [0:2], "Off", "SPI1", "SPI2", "SPI3", "SPI4"
;no TS info - skipping unusedSpiPadding8 offset 4033
;no TS info - skipping mainUnusedEnd offset 4036
;no TS info - skipping etbIdleThrottleRange offset 4036
;no TS info - skipping mainUnusedEnd offset 4040
pedalToTpsTable = array, U08, 6400, [8x8],"deg", 1, 0, -720, 720, 2
pedalToTpsPedalBins = array, S08, 6464, [8], "%", 1, 0, 0.0, 120.0, 0
pedalToTpsRpmBins = array, U08, 6472, [8], "RPM", 50, 0, 0.0, 12000.0, 0
@ -2857,6 +2858,7 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00"
dialog = idleSettings, "", yAxis
field = "Idle IAC control mode", idleMode
field = "use ETB for idle", useETBforIdleControl
fiedl = "ETB Idle range", etbIdleThrottleRange, {useETBforIdleControl == 1}
field = "Use separate Ignition Table for idle", useSeparateAdvanceForIdle
field = "Use separate VE Table for idle", useSeparateVeForIdle
field = "Use separate IAC Table For Coasting", useIacTableForCoasting, {idleMode == 0}

View File

@ -82,7 +82,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Fri Jun 14 14:13:05 EDT 2019
; this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Sat Jun 15 11:58:54 EDT 2019
pageSize = 20000
page = 1
@ -886,7 +886,8 @@ page = 1
;no TS info - skipping unusedSpiPadding7 offset 4029
mc33972spiDevice = bits,U32, 4032, [0:2], "Off", "SPI1", "SPI2", "SPI3", "SPI4"
;no TS info - skipping unusedSpiPadding8 offset 4033
;no TS info - skipping mainUnusedEnd offset 4036
;no TS info - skipping etbIdleThrottleRange offset 4036
;no TS info - skipping mainUnusedEnd offset 4040
pedalToTpsTable = array, U08, 6400, [8x8],"deg", 1, 0, -720, 720, 2
pedalToTpsPedalBins = array, S08, 6464, [8], "%", 1, 0, 0.0, 120.0, 0
pedalToTpsRpmBins = array, U08, 6472, [8], "RPM", 50, 0, 0.0, 12000.0, 0
@ -2868,6 +2869,7 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00"
dialog = idleSettings, "", yAxis
field = "Idle IAC control mode", idleMode
field = "use ETB for idle", useETBforIdleControl
fiedl = "ETB Idle range", etbIdleThrottleRange, {useETBforIdleControl == 1}
field = "Use separate Ignition Table for idle", useSeparateAdvanceForIdle
field = "Use separate VE Table for idle", useSeparateVeForIdle
field = "Use separate IAC Table For Coasting", useIacTableForCoasting, {idleMode == 0}

View File

@ -1,6 +1,6 @@
package com.rusefi.config;
// this file was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Fri Jun 14 13:02:44 EDT 2019
// this file was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Sat Jun 15 11:58:46 EDT 2019
public class Fields {
public static final int accelerometerSpiDevice_offset = 2736;
public static final int acCutoffHighRpm_offset = 1498;
@ -326,6 +326,7 @@ public class Fields {
public static final int etbDeadband_offset = 3984;
public static final int etbFreq_offset = 2538;
public static final int etbIdleRange_offset = 972;
public static final int etbIdleThrottleRange_offset = 4036;
public static final int externalKnockSenseAdc_offset = 3127;
public static final int extraInjectionOffset_offset = 432;
public static final int fanOffTemperature_offset = 472;
@ -870,7 +871,7 @@ public class Fields {
public static final int mafSensorType_offset = 948;
public static final int mainRelayPin_offset = 706;
public static final int mainRelayPinMode_offset = 752;
public static final int mainUnusedEnd_offset = 4036;
public static final int mainUnusedEnd_offset = 4040;
public static final int malfunctionIndicatorPin_offset = 660;
public static final int malfunctionIndicatorPin_offset_hex = 294;
public static final int malfunctionIndicatorPinMode_offset = 661;
@ -2000,6 +2001,7 @@ public class Fields {
public static final Field MC33816SPIDEVICE = Field.create("MC33816SPIDEVICE", 4025, FieldType.INT8);
public static final Field TLE6240SPIDEVICE = Field.create("TLE6240SPIDEVICE", 4028, FieldType.INT8);
public static final Field MC33972SPIDEVICE = Field.create("MC33972SPIDEVICE", 4032, FieldType.INT8);
public static final Field ETBIDLETHROTTLERANGE = Field.create("ETBIDLETHROTTLERANGE", 4036, FieldType.FLOAT);
public static final Field PEDALTOTPSTABLE = Field.create("PEDALTOTPSTABLE", 6400, FieldType.INT);
public static final Field FSIOFORMULAS1 = Field.create("FSIOFORMULAS1", 6672, FieldType.INT);
public static final Field FSIOFORMULAS2 = Field.create("FSIOFORMULAS2", 6872, FieldType.INT);
@ -2768,6 +2770,7 @@ public class Fields {
MC33816SPIDEVICE,
TLE6240SPIDEVICE,
MC33972SPIDEVICE,
ETBIDLETHROTTLERANGE,
PEDALTOTPSTABLE,
FSIOFORMULAS1,
FSIOFORMULAS2,