diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index 25490a8aea..d064ae6da7 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -151,7 +151,7 @@ void hwHandleVvtCamSignal(trigger_value_e front, efitick_t nowNt DECLARE_ENGINE_ angle_t currentPosition = NT2US(offsetNt) / oneDegreeUs; // convert engine cycle angle into trigger cycle angle currentPosition -= tdcPosition(); - fixAngle(currentPosition, "currentPosition", CUSTOM_ERR_6558); + // https://github.com/rusefi/rusefi/issues/1713 currentPosition could be negative that's expected tc->currentVVTEventPosition = currentPosition; if (engineConfiguration->debugMode == DBG_VVT) { diff --git a/unit_tests/tests/trigger/test_2jz_vvt.cpp b/unit_tests/tests/trigger/test_2jz_vvt.cpp index 323da9346e..fb789a10b9 100644 --- a/unit_tests/tests/trigger/test_2jz_vvt.cpp +++ b/unit_tests/tests/trigger/test_2jz_vvt.cpp @@ -32,5 +32,5 @@ TEST(sensors, test2jz) { hwHandleVvtCamSignal(TV_RISE, getTimeNowNt() PASS_ENGINE_PARAMETER_SUFFIX); // currentPosition - ASSERT_NEAR(608.2, engine->triggerCentral.currentVVTEventPosition, EPS3D); + ASSERT_NEAR(608.2 - 720, engine->triggerCentral.currentVVTEventPosition, EPS3D); } diff --git a/unit_tests/tests/trigger/test_cam_vvt_input.cpp b/unit_tests/tests/trigger/test_cam_vvt_input.cpp index dec3da07e2..5a82af524c 100644 --- a/unit_tests/tests/trigger/test_cam_vvt_input.cpp +++ b/unit_tests/tests/trigger/test_cam_vvt_input.cpp @@ -159,7 +159,7 @@ TEST(sensors, testNB2CamInput) { // this third important front would give us first comparison between two real gaps hwHandleVvtCamSignal(TV_RISE, getTimeNowNt() PASS_ENGINE_PARAMETER_SUFFIX); - ASSERT_NEAR(-67.6, engine->triggerCentral.getVVTPosition(), EPS3D); + ASSERT_NEAR(-67.6 - 720 - 720, engine->triggerCentral.getVVTPosition(), EPS3D); // actually position based on VVT! ASSERT_EQ(totalRevolutionCountBeforeVvtSync + 2, engine->triggerCentral.triggerState.getTotalRevolutionCounter()); }