only:hellen-honda-k
This commit is contained in:
Andrey 2023-03-29 22:57:31 -04:00
parent b0ff043286
commit f53937ae87
3 changed files with 16 additions and 17 deletions

View File

@ -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

View File

@ -358,6 +358,17 @@ void hwHandleVvtCamSignal(TriggerValue front, efitick_t nowNt, int index) {
auto vvtPosition = engineConfiguration->vvtOffsets[bankIndex * CAMS_PER_BANK + camIndex] - currentPosition;
// this could be just an 'if' but let's have it expandable for future use :)
switch(engineConfiguration->vvtMode[camIndex]) {
case VVT_HONDA_K_INTAKE:
// honda K has four tooth in VVT intake trigger, so we just wrap each of those to 720 / 4
vvtPosition = wrapVvt(vvtPosition, 180);
break;
default:
// else, do nothing
break;
}
// Only do engine sync using one cam, other cams just provide VVT position.
if (index == engineConfiguration->engineSyncCam) {
angle_t crankOffset = adjustCrankPhase(camIndex);
@ -366,17 +377,6 @@ void hwHandleVvtCamSignal(TriggerValue front, efitick_t nowNt, int index) {
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:
// honda K has four tooth in VVT intake trigger, so we just wrap each of those to 720 / 4
vvtPosition = wrapVvt(vvtPosition, 180);
break;
default:
// else, do nothing
break;
}
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

View File

@ -17,11 +17,10 @@ TEST(realk20, cranking) {
while (reader.haveMore()) {
reader.processLine(&eth);
// 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) {