FEATURE REQ: aux temperature inputs #332

This commit is contained in:
rusefi 2019-05-09 19:39:21 -04:00
parent 04ee37548b
commit 8c00f9ebe8
11 changed files with 40 additions and 10 deletions

View File

@ -752,6 +752,10 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
#endif /* EFI_HIP_9011 */
switch (engineConfiguration->debugMode) {
case DBG_AUX_TEMPERATURE:
tsOutputChannels->debugFloatField1 = engine->sensors.auxTemp1;
tsOutputChannels->debugFloatField2 = engine->sensors.auxTemp2;
break;
case DBG_STATUS:
tsOutputChannels->debugFloatField1 = timeSeconds;
tsOutputChannels->debugIntField1 = atoi(VCS_VERSION);

View File

@ -932,10 +932,14 @@ const char *getDebug_mode_e(debug_mode_e value){
switch(value) {
case DBG_DWELL_METRIC:
return "DBG_DWELL_METRIC";
case DBG_34:
return "DBG_34";
case DBG_AUX_TEMPERATURE:
return "DBG_AUX_TEMPERATURE";
case DBG_35:
return "DBG_35";
case DBG_36:
return "DBG_36";
case DBG_37:
return "DBG_37";
case DBG_ALTERNATOR_PID:
return "DBG_ALTERNATOR_PID";
case DBG_ANALOG_INPUTS:

View File

@ -99,6 +99,8 @@ public:
float mockClt = NAN;
#endif
float clt = NAN;
float auxTemp1 = NAN;
float auxTemp2 = NAN;
/**
* Oil pressure in kPa
@ -175,8 +177,11 @@ public:
float auxValveStart = 0;
float auxValveEnd = 0;
// too much copy-paste here, something should be improved :)
ThermistorMath iatCurve;
ThermistorMath cltCurve;
ThermistorMath auxTemp1Curve;
ThermistorMath auxTemp2Curve;
/**
* MAP averaging angle start, in relation to 'mapAveragingSchedulingAtIndex' trigger index index

View File

@ -113,6 +113,19 @@ EngineState::EngineState() {
void EngineState::updateSlowSensors(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
engine->sensors.iat = getIntakeAirTemperature(PASS_ENGINE_PARAMETER_SIGNATURE);
engine->sensors.clt = getCoolantTemperature(PASS_ENGINE_PARAMETER_SIGNATURE);
// todo: reduce code duplication with 'getCoolantTemperature'
if (engineConfiguration->auxTempSensor1.adcChannel != EFI_ADC_NONE) {
engine->sensors.auxTemp1 = getTemperatureC(&engineConfiguration->auxTempSensor1,
&engine->engineState.auxTemp1Curve,
false);
}
if (engineConfiguration->auxTempSensor2.adcChannel != EFI_ADC_NONE) {
engine->sensors.auxTemp2 = getTemperatureC(&engineConfiguration->auxTempSensor2,
&engine->engineState.auxTemp2Curve,
false);
}
#if EFI_UNIT_TEST
if (!cisnan(engine->sensors.mockClt)) {
engine->sensors.clt = engine->sensors.mockClt;

View File

@ -902,8 +902,10 @@ typedef enum {
*/
DBG_ANALOG_INPUTS2 = 32,
DBG_DWELL_METRIC = 33,
DBG_34 = 34,
DBG_AUX_TEMPERATURE = 34,
DBG_35 = 35,
DBG_36 = 36,
DBG_37 = 37,
Force_4_bytes_size_debug_mode_e = ENUM_32_BITS,
} debug_mode_e;

View File

@ -418,7 +418,7 @@
#define cylinderBore_offset_hex 198
#define cylindersCount_offset 400
#define cylindersCount_offset_hex 190
#define debug_mode_e_enum "Alternator PID", "TPS acceleration enrichment", "Warmup PID", "Idle Control", "Engine Load accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT input", "Cranking", "Timing", "Closed-loop fuel corr PID", "VSS", "SD card", "sr5", "Knock", "Trigger Sync", "Electronic Throttle", "Executor", "Bench Test / TS commands", "Aux Valves", "Analog inputs #1", "INSTANT_RPM", "FSIO_EXPRESSION", "Status", "CJ125", "CAN", "MAP", "Metrics", "ETB#2", "Ion Sense", "TLE8888", "Analog inputs #2", "Dwell Metric", "mode34", "mode35"
#define debug_mode_e_enum "Alternator PID", "TPS acceleration enrichment", "Warmup PID", "Idle Control", "Engine Load accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT input", "Cranking", "Timing", "Closed-loop fuel corr PID", "VSS", "SD card", "sr5", "Knock", "Trigger Sync", "Electronic Throttle", "Executor", "Bench Test / TS commands", "Aux Valves", "Analog inputs #1", "INSTANT_RPM", "FSIO_EXPRESSION", "Status", "CJ125", "CAN", "MAP", "Metrics", "ETB#2", "Ion Sense", "TLE8888", "Analog inputs #2", "Dwell Metric", "Aux Temperature", "mode35"
#define debugMode_offset 2112
#define debugMode_offset_hex 840
#define DIGIPOT_COUNT 4

View File

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

View File

@ -489,6 +489,8 @@ static void configureInputs(void) {
// not currently used addChannel("Vref", engineConfiguration->vRefAdcChannel, ADC_SLOW);
addChannel("CLT", engineConfiguration->clt.adcChannel, ADC_SLOW);
addChannel("IAT", engineConfiguration->iat.adcChannel, ADC_SLOW);
addChannel("AUX#1", engineConfiguration->auxTempSensor1.adcChannel, ADC_SLOW);
addChannel("AUX#2", engineConfiguration->auxTempSensor2.adcChannel, ADC_SLOW);
addChannel("AFR", engineConfiguration->afr.hwChannel, ADC_SLOW);
addChannel("OilP", engineConfiguration->oilPressure.hwChannel, ADC_SLOW);
addChannel("AC", engineConfiguration->acSwitchAdc, ADC_SLOW);

View File

@ -158,7 +158,7 @@ float baseFuel;+Fuel squirt duration while cranking\nA number of curves adjust t
int16_t rpm;+Cranking mode threshold. Special cranking logic controls fuel and spark while RPM is below this threshold\nset cranking_rpm X;"RPM", 1, 0, 0, 3000, 0
end_struct
#define debug_mode_e_enum "Alternator PID", "TPS acceleration enrichment", "Warmup PID", "Idle Control", "Engine Load accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT input", "Cranking", "Timing", "Closed-loop fuel corr PID", "VSS", "SD card", "sr5", "Knock", "Trigger Sync", "Electronic Throttle", "Executor", "Bench Test / TS commands", "Aux Valves", "Analog inputs #1", "INSTANT_RPM", "FSIO_EXPRESSION", "Status", "CJ125", "CAN", "MAP", "Metrics", "ETB#2", "Ion Sense", "TLE8888", "Analog inputs #2", "Dwell Metric", "mode34", "mode35"
#define debug_mode_e_enum "Alternator PID", "TPS acceleration enrichment", "Warmup PID", "Idle Control", "Engine Load accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT input", "Cranking", "Timing", "Closed-loop fuel corr PID", "VSS", "SD card", "sr5", "Knock", "Trigger Sync", "Electronic Throttle", "Executor", "Bench Test / TS commands", "Aux Valves", "Analog inputs #1", "INSTANT_RPM", "FSIO_EXPRESSION", "Status", "CJ125", "CAN", "MAP", "Metrics", "ETB#2", "Ion Sense", "TLE8888", "Analog inputs #2", "Dwell Metric", "Aux Temperature", "mode35"
custom debug_mode_e 4 bits, U32, @OFFSET@, [0:5], @@debug_mode_e_enum@@
#define vvt_mode_e_enum "First half", "Second half", "2GZ", "Miata NB2", "mode4", "mode5", "mode6", "mode7"

View File

@ -72,7 +72,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Wed May 08 09:50:40 EDT 2019
; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Thu May 09 19:31:34 EDT 2019
pageSize = 20000
page = 1
@ -651,7 +651,7 @@ page = 1
tpsDecelEnleanmentThreshold = scalar, F32, 2100, "roc", 1, 0, 0, 200, 3
tpsDecelEnleanmentMultiplier = scalar, F32, 2104, "coeff", 1, 0, 0, 200, 3
slowAdcAlpha = scalar, F32, 2108, "coeff", 1, 0, 0, 200, 3
debugMode = bits, U32, 2112, [0:5], "Alternator PID", "TPS acceleration enrichment", "Warmup PID", "Idle Control", "Engine Load accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT input", "Cranking", "Timing", "Closed-loop fuel corr PID", "VSS", "SD card", "sr5", "Knock", "Trigger Sync", "Electronic Throttle", "Executor", "Bench Test / TS commands", "Aux Valves", "Analog inputs #1", "INSTANT_RPM", "FSIO_EXPRESSION", "Status", "CJ125", "CAN", "MAP", "Metrics", "ETB#2", "Ion Sense", "TLE8888", "Analog inputs #2", "Dwell Metric", "mode34", "mode35"
debugMode = bits, U32, 2112, [0:5], "Alternator PID", "TPS acceleration enrichment", "Warmup PID", "Idle Control", "Engine Load accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT input", "Cranking", "Timing", "Closed-loop fuel corr PID", "VSS", "SD card", "sr5", "Knock", "Trigger Sync", "Electronic Throttle", "Executor", "Bench Test / TS commands", "Aux Valves", "Analog inputs #1", "INSTANT_RPM", "FSIO_EXPRESSION", "Status", "CJ125", "CAN", "MAP", "Metrics", "ETB#2", "Ion Sense", "TLE8888", "Analog inputs #2", "Dwell Metric", "Aux Temperature", "mode35"
warmupTargetAfrBins = array, F32, 2116, [4], "C", 1, 0, -100.0, 250.0, 2
warmupTargetAfr = array, F32, 2132, [4], "AFR", 1, 0, 0.0, 20.0, 2
warmupAfrThreshold = scalar, F32, 2148, "temperature", 1, 0, 0, 200, 3

View File

@ -1,6 +1,6 @@
package com.rusefi.config;
// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Tue May 07 18:36:15 EDT 2019
// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Thu May 09 19:31:34 EDT 2019
public class Fields {
public static final int accelerometerSpiDevice_offset = 2736;
public static final int acCutoffHighRpm_offset = 1498;
@ -1782,7 +1782,7 @@ public class Fields {
public static final Field TPSDECELENLEANMENTTHRESHOLD = Field.create("TPSDECELENLEANMENTTHRESHOLD", 2100, FieldType.FLOAT);
public static final Field TPSDECELENLEANMENTMULTIPLIER = Field.create("TPSDECELENLEANMENTMULTIPLIER", 2104, FieldType.FLOAT);
public static final Field SLOWADCALPHA = Field.create("SLOWADCALPHA", 2108, FieldType.FLOAT);
public static final String[] debug_mode_e = {"Alternator PID", "TPS acceleration enrichment", "Warmup PID", "Idle Control", "Engine Load accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT input", "Cranking", "Timing", "Closed-loop fuel corr PID", "VSS", "SD card", "sr5", "Knock", "Trigger Sync", "Electronic Throttle", "Executor", "Bench Test / TS commands", "Aux Valves", "Analog inputs #1", "INSTANT_RPM", "FSIO_EXPRESSION", "Status", "CJ125", "CAN", "MAP", "Metrics", "ETB#2", "Ion Sense", "TLE8888", "Analog inputs #2", "Dwell Metric", "mode34", "mode35"};
public static final String[] debug_mode_e = {"Alternator PID", "TPS acceleration enrichment", "Warmup PID", "Idle Control", "Engine Load accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT input", "Cranking", "Timing", "Closed-loop fuel corr PID", "VSS", "SD card", "sr5", "Knock", "Trigger Sync", "Electronic Throttle", "Executor", "Bench Test / TS commands", "Aux Valves", "Analog inputs #1", "INSTANT_RPM", "FSIO_EXPRESSION", "Status", "CJ125", "CAN", "MAP", "Metrics", "ETB#2", "Ion Sense", "TLE8888", "Analog inputs #2", "Dwell Metric", "Aux Temperature", "mode35"};
public static final Field DEBUGMODE = Field.create("DEBUGMODE", 2112, FieldType.INT, debug_mode_e);
public static final Field WARMUPAFRTHRESHOLD = Field.create("WARMUPAFRTHRESHOLD", 2148, FieldType.FLOAT);
public static final Field BOOSTCUTPRESSURE = Field.create("BOOSTCUTPRESSURE", 2152, FieldType.FLOAT);