Oscilations in DWELL length after 40+ hours of uptime #6451

sadDwellRatioCounter
This commit is contained in:
rusefi 2024-05-07 12:04:36 -04:00
parent 348e659896
commit a49198709d
2 changed files with 11 additions and 6 deletions

View File

@ -383,12 +383,15 @@ float mapFast
uint8_t[MAX_CYLINDER_COUNT iterate] injectorDiagnostic
uint16_t autoscale actualLastInjectionStage2;@@GAUGE_NAME_FUEL_LAST_INJECTION_STAGE_2@@;"ms",{1/@@PACK_MULT_MS@@}, 0, 0, 0, 3
uint8_t autoscale injectorDutyCycleStage2;@@GAUGE_NAME_FUEL_INJ_DUTY_STAGE_2@@;"%",{1/2}, 0, 0, 0, 0
uint8_t autoscale injectorDutyCycleStage2;@@GAUGE_NAME_FUEL_INJ_DUTY_STAGE_2@@;"%",{1/2}, 0, 0, 0, 0
uint8_t adc13bitCounter
uint8_t fastAdcErrorsCount
uint8_t deviceUid
uint16_t unexpectedAdcSample
uint8_t[76 iterate] unusedAtTheEnd;;"",1, 0, 0, 0, 0
uint8_t sadDwellRatioCounter
uint8_t[72 iterate] unusedAtTheEnd;;"",1, 0, 0, 0, 0
end_struct

View File

@ -205,16 +205,18 @@ void fireSparkAndPrepareNextSchedule(IgnitionEvent *event) {
LogTriggerCoilState(nowNt, false);
#endif // EFI_TOOTH_LOGGER
#if !EFI_UNIT_TEST
if (engineConfiguration->debugMode == DBG_DWELL_METRIC) {
#if EFI_TUNER_STUDIO
float actualDwellMs = event->actualDwellTimer.getElapsedSeconds(nowNt) * 1e3;
/**
* ratio of desired dwell duration to actual dwell duration gives us some idea of how good is input trigger jitter
*/
float ratio = actualDwellMs / event->sparkDwell;
if (ratio < 0.8 || ratio > 1.2) {
engine->outputChannels.sadDwellRatioCounter++;
}
#if !EFI_UNIT_TEST
if (engineConfiguration->debugMode == DBG_DWELL_METRIC) {
#if EFI_TUNER_STUDIO
// todo: smarted solution for index to field mapping
switch (event->cylinderIndex) {
case 0: