idle coasting table is RPM, not clt (#4487)

* idle coasting table is RPM, not clt

* default

* autoscale

* changelog
This commit is contained in:
Matthew Kennedy 2022-08-29 05:15:04 -07:00 committed by GitHub
parent e89eff7370
commit 2926570747
7 changed files with 17 additions and 15 deletions

View File

@ -27,6 +27,7 @@ Release template (copy/paste this for new release):
### Added ### Added
- Time delay before DFCO #4292 - Time delay before DFCO #4292
- Idle coasting position table is now RPM-based, instead of CLT-based #4487
- Manual electronic throttle synchronization #3680 - Manual electronic throttle synchronization #3680
### Fixed ### Fixed

View File

@ -17,13 +17,13 @@ void miataNA_setCrankingFuelBins() {
copyArray(config->crankingFuelCoef, hardCodedcrankingFuelCoef); copyArray(config->crankingFuelCoef, hardCodedcrankingFuelCoef);
} }
static const float hardCodediacCoastingBins[16] = {-40.0, -30.0, -20.0, -10.0, 0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}; static const float hardCodediacCoastingRpmBins[16] = { 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000, 5500, 6000, 6500, 7000, 7500, 8000, 8500 };
static const float hardCodediacCoasting[16] = {40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0}; static const float hardCodediacCoasting[16] = {40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0};
/* Generated by TS2C on Fri Jul 31 14:02:18 EDT 2020*/ /* Generated by TS2C on Fri Jul 31 14:02:18 EDT 2020*/
void miataNA_setIacCoastingBins() { void miataNA_setIacCoastingBins() {
copyArray(config->iacCoastingBins, hardCodediacCoastingBins); copyArray(config->iacCoastingRpmBins, hardCodediacCoastingRpmBins);
copyArray(config->iacCoasting, hardCodediacCoasting); copyArray(config->iacCoasting, hardCodediacCoasting);
} }

View File

@ -133,10 +133,9 @@ percent_t IdleController::getOpenLoop(Phase phase, float rpm, float clt, SensorR
} }
// If coasting (and enabled), use the coasting position table instead of normal open loop // If coasting (and enabled), use the coasting position table instead of normal open loop
// TODO: this should be a table of open loop mult vs. RPM, not vs. clt
useIacTableForCoasting = engineConfiguration->useIacTableForCoasting && isIdleCoasting; useIacTableForCoasting = engineConfiguration->useIacTableForCoasting && isIdleCoasting;
if (useIacTableForCoasting) { if (useIacTableForCoasting) {
return interpolate2d(clt, config->iacCoastingBins, config->iacCoasting); return interpolate2d(rpm, config->iacCoastingRpmBins, config->iacCoasting);
} }
percent_t running = getRunningOpenLoop(rpm, clt, tps); percent_t running = getRunningOpenLoop(rpm, clt, tps);

View File

@ -576,6 +576,8 @@ static void setDefaultEngineConfiguration() {
engineConfiguration->useStepperIdle = false; engineConfiguration->useStepperIdle = false;
setLinearCurve(config->iacCoastingRpmBins, 0, 8000, 1);
setDefaultGppwmParameters(); setDefaultGppwmParameters();
#if !EFI_UNIT_TEST #if !EFI_UNIT_TEST

View File

@ -618,7 +618,7 @@ bool validateConfig() {
// Idle tables // Idle tables
ensureArrayIsAscending("Idle target RPM", config->cltIdleRpmBins); ensureArrayIsAscending("Idle target RPM", config->cltIdleRpmBins);
ensureArrayIsAscending("Idle warmup mult", config->cltIdleCorrBins); ensureArrayIsAscending("Idle warmup mult", config->cltIdleCorrBins);
ensureArrayIsAscendingOrDefault("Idle coasting position", config->iacCoastingBins); ensureArrayIsAscendingOrDefault("Idle coasting RPM", config->iacCoastingRpmBins);
ensureArrayIsAscendingOrDefault("Idle VE RPM", config->idleVeRpmBins); ensureArrayIsAscendingOrDefault("Idle VE RPM", config->idleVeRpmBins);
ensureArrayIsAscendingOrDefault("Idle VE Load", config->idleVeLoadBins); ensureArrayIsAscendingOrDefault("Idle VE Load", config->idleVeLoadBins);
ensureArrayIsAscendingOrDefault("Idle timing", config->idleAdvanceBins); ensureArrayIsAscendingOrDefault("Idle timing", config->idleAdvanceBins);

View File

@ -93,7 +93,7 @@
! Any time an incompatible change is made to the configuration format stored in flash, ! Any time an incompatible change is made to the configuration format stored in flash,
! update this string to the current date! It is required to also update TS_SIGNATURE above ! update this string to the current date! It is required to also update TS_SIGNATURE above
! when this happens. ! when this happens.
#define FLASH_DATA_VERSION 10013 #define FLASH_DATA_VERSION 10014
! this offset is part of console compatibility mechanism, please DO NOT change this offset ! this offset is part of console compatibility mechanism, please DO NOT change this offset
#define TS_FILE_VERSION_OFFSET 124 #define TS_FILE_VERSION_OFFSET 124
@ -768,7 +768,7 @@ bit is_enabled_spi_2
bit stepperForceParkingEveryRestart bit stepperForceParkingEveryRestart
bit isFasterEngineSpinUpEnabled;+If enabled, try to fire the engine before a full engine cycle has been completed using RPM estimated from the last 90 degrees of engine rotation. As soon as the trigger syncs plus 90 degrees rotation, fuel and ignition events will occur. If disabled, worst case may require up to 4 full crank rotations before any events are scheduled. bit isFasterEngineSpinUpEnabled;+If enabled, try to fire the engine before a full engine cycle has been completed using RPM estimated from the last 90 degrees of engine rotation. As soon as the trigger syncs plus 90 degrees rotation, fuel and ignition events will occur. If disabled, worst case may require up to 4 full crank rotations before any events are scheduled.
bit coastingFuelCutEnabled;+This setting disables fuel injection while the engine is in overrun, this is useful as a fuel saving measure and to prevent back firing. bit coastingFuelCutEnabled;+This setting disables fuel injection while the engine is in overrun, this is useful as a fuel saving measure and to prevent back firing.
bit useIacTableForCoasting;+This setting allows the ECU to open the IAC during overrun conditions to help reduce engine breaking, this can be helpful for large engines in light weight cars. Used in Auto-PID Idle mode. bit useIacTableForCoasting;+Override the IAC position during overrun conditions to help reduce engine breaking, this can be helpful for large engines in light weight cars or engines that have trouble returning to idle.
bit useNoiselessTriggerDecoder bit useNoiselessTriggerDecoder
bit useIdleTimingPidControl bit useIdleTimingPidControl
bit disableEtbWhenEngineStopped;+Allows disabling the ETB when the engine is stopped. You may not like the power draw or PWM noise from the motor, so this lets you turn it off until it's necessary. bit disableEtbWhenEngineStopped;+Allows disabling the ETB when the engine is stopped. You may not like the power draw or PWM noise from the motor, so this lets you turn it off until it's necessary.
@ -1560,8 +1560,8 @@ engine_configuration_s engineConfiguration;
uint16_t[CRANKING_ADVANCE_CURVE_SIZE] crankingAdvanceBins;Optional timing advance table for Cranking (see useSeparateAdvanceForCranking);"RPM", 1, 0, 0, 25000, 0 uint16_t[CRANKING_ADVANCE_CURVE_SIZE] crankingAdvanceBins;Optional timing advance table for Cranking (see useSeparateAdvanceForCranking);"RPM", 1, 0, 0, 25000, 0
int16_t[CRANKING_ADVANCE_CURVE_SIZE] autoscale crankingAdvance;Optional timing advance table for Cranking (see useSeparateAdvanceForCranking);"deg", 0.01, 0, -20, 90, 2 int16_t[CRANKING_ADVANCE_CURVE_SIZE] autoscale crankingAdvance;Optional timing advance table for Cranking (see useSeparateAdvanceForCranking);"deg", 0.01, 0, -20, 90, 2
float[CLT_CURVE_SIZE] iacCoastingBins;CLT-based idle position for coasting (used in Auto-PID Idle mode);"C", 1, 0, -100, 250, 2 uint8_t[CLT_CURVE_SIZE] autoscale iacCoastingRpmBins;RPM-based idle position for coasting;"RPM", 100, 0, 0, 25000, 0
float[CLT_CURVE_SIZE] iacCoasting; CLT-based idle position for coasting (used in Auto-PID Idle mode);"%", 1, 0, 0, 100, 2 uint8_t[CLT_CURVE_SIZE] autoscale iacCoasting; RPM-based idle position for coasting;"%", 0.5, 0, 0, 100, 1
error_message_t warning_message; error_message_t warning_message;

View File

@ -308,12 +308,12 @@ TEST(idle_v2, openLoopCoastingTable) {
// enable & configure feature // enable & configure feature
engineConfiguration->useIacTableForCoasting = true; engineConfiguration->useIacTableForCoasting = true;
for (size_t i = 0; i < CLT_CURVE_SIZE; i++) { for (size_t i = 0; i < CLT_CURVE_SIZE; i++) {
config->iacCoastingBins[i] = 10 * i; config->iacCoastingRpmBins[i] = 100 * i;
config->iacCoasting[i] = 5 * i; config->iacCoasting[i] = 5 * i;
} }
EXPECT_FLOAT_EQ(10, dut.getOpenLoop(ICP::Coasting, 0, 20, 0, 2)); EXPECT_FLOAT_EQ(40, dut.getOpenLoop(ICP::Coasting, 800, 0, 0, 2));
EXPECT_FLOAT_EQ(20, dut.getOpenLoop(ICP::Coasting, 0, 40, 0, 2)); EXPECT_FLOAT_EQ(75, dut.getOpenLoop(ICP::Coasting, 1500, 0, 0, 2));
} }
extern int timeNowUs; extern int timeNowUs;
@ -390,7 +390,7 @@ TEST(idle_v2, IntegrationManual) {
Sensor::setMockValue(SensorType::DriverThrottleIntent, expectedTps.Value); Sensor::setMockValue(SensorType::DriverThrottleIntent, expectedTps.Value);
Sensor::setMockValue(SensorType::Clt, expectedClt); Sensor::setMockValue(SensorType::Clt, expectedClt);
Sensor::setMockValue(SensorType::VehicleSpeed, 15.0); Sensor::setMockValue(SensorType::VehicleSpeed, 15.0);
Sensor::setMockValue(SensorType::Rpm, 950); Sensor::setMockValue(SensorType::Rpm, 950);
// Target of 1000 rpm // Target of 1000 rpm
EXPECT_CALL(dut, getTargetRpm(expectedClt)) EXPECT_CALL(dut, getTargetRpm(expectedClt))
@ -424,7 +424,7 @@ TEST(idle_v2, IntegrationAutomatic) {
Sensor::setMockValue(SensorType::DriverThrottleIntent, expectedTps.Value); Sensor::setMockValue(SensorType::DriverThrottleIntent, expectedTps.Value);
Sensor::setMockValue(SensorType::Clt, expectedClt); Sensor::setMockValue(SensorType::Clt, expectedClt);
Sensor::setMockValue(SensorType::VehicleSpeed, 15.0); Sensor::setMockValue(SensorType::VehicleSpeed, 15.0);
Sensor::setMockValue(SensorType::Rpm, 950); Sensor::setMockValue(SensorType::Rpm, 950);
// Target of 1000 rpm // Target of 1000 rpm
EXPECT_CALL(dut, getTargetRpm(expectedClt)) EXPECT_CALL(dut, getTargetRpm(expectedClt))
@ -461,7 +461,7 @@ TEST(idle_v2, IntegrationClamping) {
Sensor::setMockValue(SensorType::DriverThrottleIntent, expectedTps.Value); Sensor::setMockValue(SensorType::DriverThrottleIntent, expectedTps.Value);
Sensor::setMockValue(SensorType::Clt, expectedClt); Sensor::setMockValue(SensorType::Clt, expectedClt);
Sensor::setMockValue(SensorType::VehicleSpeed, 15.0); Sensor::setMockValue(SensorType::VehicleSpeed, 15.0);
Sensor::setMockValue(SensorType::Rpm, 950); Sensor::setMockValue(SensorType::Rpm, 950);
// Target of 1000 rpm // Target of 1000 rpm
EXPECT_CALL(dut, getTargetRpm(expectedClt)) EXPECT_CALL(dut, getTargetRpm(expectedClt))