parent
b0ff043286
commit
f53937ae87
|
@ -24,7 +24,7 @@ void setHondaK() {
|
|||
engineConfiguration->vvtMode[0] = VVT_HONDA_K_INTAKE;
|
||||
// also known as 'CAM sync'? i am pretty confused at this point
|
||||
engineConfiguration->vvtMode[1] = VVT_HONDA_K_EXHAUST;
|
||||
engineConfiguration->vvtOffsets[0] = -41;
|
||||
engineConfiguration->vvtOffsets[0] = -21;
|
||||
engineConfiguration->vvtOffsets[1] = 171 + magic;
|
||||
|
||||
// set cranking_fuel 15
|
||||
|
|
|
@ -358,14 +358,6 @@ void hwHandleVvtCamSignal(TriggerValue front, efitick_t nowNt, int index) {
|
|||
|
||||
auto vvtPosition = engineConfiguration->vvtOffsets[bankIndex * CAMS_PER_BANK + camIndex] - currentPosition;
|
||||
|
||||
// Only do engine sync using one cam, other cams just provide VVT position.
|
||||
if (index == engineConfiguration->engineSyncCam) {
|
||||
angle_t crankOffset = adjustCrankPhase(camIndex);
|
||||
// vvtPosition was calculated against wrong crank zero position. Now that we have adjusted crank position we
|
||||
// shall adjust vvt position as well
|
||||
vvtPosition -= crankOffset;
|
||||
vvtPosition = wrapVvt(vvtPosition, FOUR_STROKE_CYCLE_DURATION);
|
||||
|
||||
// this could be just an 'if' but let's have it expandable for future use :)
|
||||
switch(engineConfiguration->vvtMode[camIndex]) {
|
||||
case VVT_HONDA_K_INTAKE:
|
||||
|
@ -377,6 +369,14 @@ void hwHandleVvtCamSignal(TriggerValue front, efitick_t nowNt, int index) {
|
|||
break;
|
||||
}
|
||||
|
||||
// Only do engine sync using one cam, other cams just provide VVT position.
|
||||
if (index == engineConfiguration->engineSyncCam) {
|
||||
angle_t crankOffset = adjustCrankPhase(camIndex);
|
||||
// vvtPosition was calculated against wrong crank zero position. Now that we have adjusted crank position we
|
||||
// shall adjust vvt position as well
|
||||
vvtPosition -= crankOffset;
|
||||
vvtPosition = wrapVvt(vvtPosition, FOUR_STROKE_CYCLE_DURATION);
|
||||
|
||||
if (absF(angleFromPrimarySyncPoint) < 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
|
||||
|
|
|
@ -17,11 +17,10 @@ TEST(realk20, cranking) {
|
|||
while (reader.haveMore()) {
|
||||
reader.processLine(ð);
|
||||
|
||||
// TODO
|
||||
// float vvtI = engine->triggerCentral.getVVTPosition(/*bankIndex*/0, /*camIndex*/0);
|
||||
// if (vvtI != 0) {
|
||||
// EXPECT_TRUE(vvtI > -10 && vvtI < 10);
|
||||
// }
|
||||
float vvtI = engine->triggerCentral.getVVTPosition(/*bankIndex*/0, /*camIndex*/0);
|
||||
if (vvtI != 0) {
|
||||
EXPECT_TRUE(vvtI > -10 && vvtI < 10);
|
||||
}
|
||||
|
||||
float vvtE = engine->triggerCentral.getVVTPosition(/*bankIndex*/0, /*camIndex*/1);
|
||||
if (vvtE != 0) {
|
||||
|
|
Loading…
Reference in New Issue