parent
064c1612e3
commit
1b174bd4b3
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include "engine_configuration.h"
|
||||
|
||||
#define NISSAN_VQ_VVT_OFFSET -604
|
||||
#define NISSAN_VQ_VVT_OFFSET -577.5
|
||||
#define NISSAN_VQ_CAM_OFFSET 360
|
||||
|
||||
void setHellen121nissan(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
||||
|
|
|
@ -206,11 +206,6 @@ void hwHandleVvtCamSignal(trigger_value_e front, efitick_t nowNt, int index DECL
|
|||
#endif /* EFI_TUNER_STUDIO */
|
||||
}
|
||||
|
||||
if (index != 0) {
|
||||
// at the moment we use only primary VVT to sync crank phase
|
||||
return;
|
||||
}
|
||||
|
||||
switch(engineConfiguration->vvtMode[camIndex]) {
|
||||
case VVT_2JZ:
|
||||
// we do not know if we are in sync or out of sync, so we have to be looking for both possibilities
|
||||
|
@ -249,6 +244,11 @@ void hwHandleVvtCamSignal(trigger_value_e front, efitick_t nowNt, int index DECL
|
|||
warning(CUSTOM_ERR_VVT_OUT_OF_RANGE, "Please adjust vvtOffset since position %f", tc->vvtPosition);
|
||||
}
|
||||
|
||||
if (index != 0) {
|
||||
// at the moment we use only primary VVT to sync crank phase
|
||||
return;
|
||||
}
|
||||
|
||||
switch (engineConfiguration->vvtMode[camIndex]) {
|
||||
case VVT_FIRST_HALF:
|
||||
{
|
||||
|
|
|
@ -70,7 +70,7 @@ TEST(nissan, vq_vvt) {
|
|||
engineConfiguration->isIgnitionEnabled = false;
|
||||
engineConfiguration->isInjectionEnabled = false;
|
||||
|
||||
int cyclesCount = 36;
|
||||
int cyclesCount = 48;
|
||||
|
||||
{
|
||||
static TriggerWaveform crank;
|
||||
|
@ -80,10 +80,9 @@ TEST(nissan, vq_vvt) {
|
|||
/* timeScale */ 1,
|
||||
cyclesCount, false, -1, 0 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
// crank being FOUR_STROKE_THREE_TIMES_CRANK_SENSOR means 120 degrees cycle duration which does not match cam shaft cycle duration
|
||||
float vvtTimeScale = 1 / 1.5;
|
||||
float vvtTimeScale = 1;
|
||||
|
||||
angle_t testVvtOffset = 2;
|
||||
angle_t testVvtOffset = 19;
|
||||
|
||||
{
|
||||
static TriggerWaveform vvt;
|
||||
|
@ -122,8 +121,8 @@ TEST(nissan, vq_vvt) {
|
|||
ASSERT_TRUE(tc->vvtState[0][0].getShaftSynchronized());
|
||||
ASSERT_TRUE(tc->vvtState[1][0].getShaftSynchronized());
|
||||
|
||||
ASSERT_NEAR(-testVvtOffset, tc->vvtPosition[0][0], EPS2D);
|
||||
ASSERT_NEAR(0/*-testVvtOffset*/, tc->vvtPosition[1][0], EPS2D);
|
||||
ASSERT_NEAR(-testVvtOffset * 1.5, tc->vvtPosition[0][0], EPS2D);
|
||||
// ASSERT_NEAR(-testVvtOffset * 1.5, tc->vvtPosition[1][0], EPS2D);
|
||||
|
||||
//todo EXPECT_EQ(0, eth.recentWarnings()->getCount());
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ TEST(trigger, testQuadCam) {
|
|||
// this third important front would give us first comparison between two real gaps
|
||||
hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), secondCamSecondBank PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
ASSERT_NEAR(0, engine->triggerCentral.getVVTPosition(secondBank, secondCam), EPS3D);
|
||||
ASSERT_NEAR(-2571.4, engine->triggerCentral.getVVTPosition(secondBank, secondCam), EPS3D);
|
||||
// actually position based on VVT!
|
||||
ASSERT_EQ(totalRevolutionCountBeforeVvtSync, engine->triggerCentral.triggerState.getTotalRevolutionCounter());
|
||||
|
||||
|
|
Loading…
Reference in New Issue