Nick has RPM spikes and engine hiccups #3269

This commit is contained in:
rusefillc 2021-10-03 01:48:34 -04:00
parent b4884498cb
commit 308a798eaa
3 changed files with 15 additions and 5 deletions

View File

@ -1,6 +1,6 @@
#include "global.h"
#include "obd_error_codes.h"
// was generated automatically by rusEFI tool from obd_error_codes.h // by enum2string.jar tool on Sun Oct 03 01:28:41 EDT 2021
// was generated automatically by rusEFI tool from obd_error_codes.h // by enum2string.jar tool on Sun Oct 03 01:41:19 EDT 2021
// see also gen_config_and_enums.bat
@ -269,8 +269,6 @@ case CUSTOM_ERR_6669:
return "CUSTOM_ERR_6669";
case CUSTOM_ERR_6670:
return "CUSTOM_ERR_6670";
case CUSTOM_ERR_6675:
return "CUSTOM_ERR_6675";
case CUSTOM_ERR_6684:
return "CUSTOM_ERR_6684";
case CUSTOM_ERR_6685:
@ -749,6 +747,8 @@ case CUSTOM_UNKNOWN_FSIO:
return "CUSTOM_UNKNOWN_FSIO";
case CUSTOM_VVT_MODE_NOT_SELECTED:
return "CUSTOM_VVT_MODE_NOT_SELECTED";
case CUSTOM_VVT_SYNC_POSITION:
return "CUSTOM_VVT_SYNC_POSITION";
case CUSTOM_WRONG_ALGORITHM:
return "CUSTOM_WRONG_ALGORITHM";
case CUSTOM_ZERO_DWELL:

View File

@ -2032,7 +2032,7 @@ typedef enum {
CUSTOM_ICU_DRIVER = 6672,
CUSTOM_ICU_DRIVER_STATE = 6673,
CUSTOM_STACK_SPI = 6674,
CUSTOM_ERR_6675 = 6675,
CUSTOM_VVT_SYNC_POSITION = 6675,
CUSTOM_STACK_ADC = 6676,
CUSTOM_IH_STACK = 6677,
CUSTOM_EC_NULL = 6678,

View File

@ -328,7 +328,17 @@ void hwHandleVvtCamSignal(trigger_value_e front, efitick_t nowNt, int index DECL
// vvtPosition was calculated against wrong crank zero position. Now that we have adjusted crank position we
// shall adjust vvt position as well
vvtPosition -= crankOffset;
tc->vvtPosition[bankIndex][camIndex] = wrapVvt(vvtPosition);
vvtPosition = wrapVvt(vvtPosition);
if (absF(vvtPosition - tdcPosition()) < 7) {
/**
* we prefer not to have VVT sync right at trigger sync so that we do not have phase detection error if things happen a bit in
* wrong order due to belt flex or else
* https://github.com/rusefi/rusefi/issues/3269
*/
warning(CUSTOM_VVT_SYNC_POSITION, "VVT sync position too close to trigger sync");
}
tc->vvtPosition[bankIndex][camIndex] = vvtPosition;
}
int triggerReentraint = 0;