parent
b0ff043286
commit
f53937ae87
|
@ -24,7 +24,7 @@ void setHondaK() {
|
||||||
engineConfiguration->vvtMode[0] = VVT_HONDA_K_INTAKE;
|
engineConfiguration->vvtMode[0] = VVT_HONDA_K_INTAKE;
|
||||||
// also known as 'CAM sync'? i am pretty confused at this point
|
// also known as 'CAM sync'? i am pretty confused at this point
|
||||||
engineConfiguration->vvtMode[1] = VVT_HONDA_K_EXHAUST;
|
engineConfiguration->vvtMode[1] = VVT_HONDA_K_EXHAUST;
|
||||||
engineConfiguration->vvtOffsets[0] = -41;
|
engineConfiguration->vvtOffsets[0] = -21;
|
||||||
engineConfiguration->vvtOffsets[1] = 171 + magic;
|
engineConfiguration->vvtOffsets[1] = 171 + magic;
|
||||||
|
|
||||||
// set cranking_fuel 15
|
// set cranking_fuel 15
|
||||||
|
|
|
@ -358,6 +358,17 @@ void hwHandleVvtCamSignal(TriggerValue front, efitick_t nowNt, int index) {
|
||||||
|
|
||||||
auto vvtPosition = engineConfiguration->vvtOffsets[bankIndex * CAMS_PER_BANK + camIndex] - currentPosition;
|
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.
|
// Only do engine sync using one cam, other cams just provide VVT position.
|
||||||
if (index == engineConfiguration->engineSyncCam) {
|
if (index == engineConfiguration->engineSyncCam) {
|
||||||
angle_t crankOffset = adjustCrankPhase(camIndex);
|
angle_t crankOffset = adjustCrankPhase(camIndex);
|
||||||
|
@ -366,17 +377,6 @@ void hwHandleVvtCamSignal(TriggerValue front, efitick_t nowNt, int index) {
|
||||||
vvtPosition -= crankOffset;
|
vvtPosition -= crankOffset;
|
||||||
vvtPosition = wrapVvt(vvtPosition, FOUR_STROKE_CYCLE_DURATION);
|
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) {
|
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
|
* 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()) {
|
while (reader.haveMore()) {
|
||||||
reader.processLine(ð);
|
reader.processLine(ð);
|
||||||
|
|
||||||
// TODO
|
float vvtI = engine->triggerCentral.getVVTPosition(/*bankIndex*/0, /*camIndex*/0);
|
||||||
// float vvtI = engine->triggerCentral.getVVTPosition(/*bankIndex*/0, /*camIndex*/0);
|
if (vvtI != 0) {
|
||||||
// if (vvtI != 0) {
|
EXPECT_TRUE(vvtI > -10 && vvtI < 10);
|
||||||
// EXPECT_TRUE(vvtI > -10 && vvtI < 10);
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
float vvtE = engine->triggerCentral.getVVTPosition(/*bankIndex*/0, /*camIndex*/1);
|
float vvtE = engine->triggerCentral.getVVTPosition(/*bankIndex*/0, /*camIndex*/1);
|
||||||
if (vvtE != 0) {
|
if (vvtE != 0) {
|
||||||
|
|
Loading…
Reference in New Issue