Dwell voltage correction (#3234)

* cfg + impl

* ui

* value_or

* changelog

* fix
This commit is contained in:
Matthew Kennedy 2021-09-15 05:07:33 -07:00 committed by GitHub
parent f8ff0c31fa
commit 3a8d92f879
4 changed files with 32 additions and 5 deletions

View File

@ -29,6 +29,7 @@ All notable user-facing or behavior-altering changes will be documented in this
### Added
- Ford PIP trigger decoder https://github.com/rusefi/rusefi/wiki/Images/triggers/trigger_65.png
- Dwell battery voltage correction table
## September 2021 Release - "Iguana Awareness Day"

View File

@ -81,7 +81,19 @@ floatms_t getSparkDwell(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
} else {
efiAssert(CUSTOM_ERR_ASSERT, !cisnan(rpm), "invalid rpm", NAN);
dwellMs = interpolate2d(rpm, engineConfiguration->sparkDwellRpmBins, engineConfiguration->sparkDwellValues);
auto base = interpolate2d(rpm, engineConfiguration->sparkDwellRpmBins, engineConfiguration->sparkDwellValues);
auto voltageMult = 0.02f *
interpolate2d(
10 * Sensor::get(SensorType::BatteryVoltage).value_or(0),
engineConfiguration->dwellVoltageCorrVoltBins,
engineConfiguration->dwellVoltageCorrValues);
// for compat (table full of zeroes)
if (voltageMult < 0.1f) {
voltageMult = 1;
}
dwellMs = base * voltageMult;
}
if (cisnan(dwellMs) || dwellMs <= 0) {

View File

@ -912,9 +912,14 @@ output_pin_e acFanPin;+Optional Radiator Fan used with A/C
pin_output_mode_e[FSIO_COMMAND_COUNT iterate] gpioPinModes;
uint8_t[10] unusedpinModesWhereHere;;"", 1, 0, 0, 255, 0
uint8_t[DWELL_CURVE_SIZE] dwellVoltageCorrVoltBins;;"volts", 0.1, 0, 0, 20, 1
uint8_t[2] unusedpinModesWhereHere;;"", 1, 0, 0, 255, 0
output_pin_e[FSIO_COMMAND_COUNT iterate] fsioOutputPins;todo: more comments
uint8_t[10] unusedOutputWhereHere;;"", 1, 0, 0, 255, 0
uint8_t[DWELL_CURVE_SIZE] dwellVoltageCorrValues;;"multiplier", 0.02, 0, 0, 5, 2
uint8_t[2] unusedOutputWhereHere;;"", 1, 0, 0, 255, 0
brain_pin_e[EGT_CHANNEL_COUNT iterate] max31855_cs;

View File

@ -597,13 +597,21 @@ enable2ndByteCanID = false
xBins = mapAccelTaperBins
yBins = mapAccelTaperMult
curve = dwellCorrection, "Dwell time RPM based"
curve = dwellCorrection, "Dwell time base"
columnLabel = "RPM", "Dwell"
xAxis = 0, 8000, 9
yAxis = 0, 8, 9
xBins = sparkDwellRpmBins, RPMValue
yBins = sparkDwellValues
gauge = RPMGauge
curve = dwellVoltageCorrection, "Dwell voltage correction"
columnLabel = "Battery Volts", "Multiplier"
xAxis = 6, 16, 5
yAxis = 0, 3, 7
xBins = dwellVoltageCorrVoltBins, VBatt
yBins = dwellVoltageCorrValues
gauge = VBattGauge
curve = map_samplingAngleCurve, "MAP Sampling Start Angle"
columnLabel = "RPM", "Angle"
@ -2064,7 +2072,8 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00"
panel = multisparkDwellParams
dialog = dwellSettings, "", yAxis
panel = dwellCorrection, Center
panel = dwellCorrection
panel = dwellVoltageCorrection
; Sensors->AUX1 Thermistor Sensor Setting
dialog = auxTempSensor1Sensor, "aux1 Thermistor Settings"