Seems that gdi pump angle changes at 2x the rate of cam movement, possible multiplication/division problem? #6245

This commit is contained in:
rusefi 2024-03-17 20:36:14 -04:00
parent 8bbcfcac33
commit 7b9726a154
3 changed files with 5 additions and 1 deletions

View File

@ -61,11 +61,13 @@ angle_t HpfpLobe::findNextLobe() {
// Calculate impact of VVT
angle_t vvt = 0;
if (engineConfiguration->hpfpCam != HPFP_CAM_NONE) {
// pump operates in cam-angle domain which is different speed from crank-angle domain on 4 stroke engines
int mult = (int)getEngineCycle(getEngineRotationState()->getOperationMode()) / 360;
int camIndex = engineConfiguration->hpfpCam - 1;
// TODO: Is the sign correct here? + means ATDC?
vvt = engine->triggerCentral.getVVTPosition(
BANK_BY_INDEX(camIndex),
CAM_BY_INDEX(camIndex);
CAM_BY_INDEX(camIndex)) / mult * engineConfiguration->magicNumberAvailableForDevTricks;
}
return engineConfiguration->hpfpPeakPos + vvt + next_index * 720 / lobes;

View File

@ -185,6 +185,7 @@ void refreshMapAveragingPreCalc() {
efiAssertVoid(ObdCode::CUSTOM_ERR_MAP_AVG_OFFSET, !cisnan(offsetAngle), "offsetAngle");
for (size_t i = 0; i < engineConfiguration->cylindersCount; i++) {
// todo: potential micro-optimization to reuse getEngineState()->engineCycle?
angle_t cylinderOffset = getEngineCycle(getEngineRotationState()->getOperationMode()) * i / engineConfiguration->cylindersCount;
efiAssertVoid(ObdCode::CUSTOM_ERR_MAP_CYL_OFFSET, !cisnan(cylinderOffset), "cylinderOffset");
// part of this formula related to specific cylinder offset is never changing - we can

View File

@ -287,6 +287,7 @@ void rpmShaftPositionCallback(trigger_event_e ckpSignalType,
rpmState->setRpmValue(NOISY_RPM);
rpmState->rpmRate = 0;
} else {
// todo: extract utility method? see duplication with high_pressure_pump.cpp
int mult = (int)getEngineCycle(getEngineRotationState()->getOperationMode()) / 360;
float rpm = 60 * mult / periodSeconds;