diff --git a/firmware/controllers/trigger/aux_valves.cpp b/firmware/controllers/trigger/aux_valves.cpp index 6d4b4e6c0e..023fc8619d 100644 --- a/firmware/controllers/trigger/aux_valves.cpp +++ b/firmware/controllers/trigger/aux_valves.cpp @@ -51,12 +51,16 @@ static void auxValveTriggerCallback(trigger_event_e ckpSignalType, NamedOutputPin *output = &enginePins.auxValve[valveIndex]; for (int phaseIndex = 0; phaseIndex < 2; phaseIndex++) { +/* I believe a more correct implementation is the following: + * here we properly account for trigger angle position in engine cycle coordinates // todo: at the moment this logic is assuming four-stroke 720-degree engine cycle angle_t extra = phaseIndex * 360 // cycle opens twice per 720 engine cycle + valveIndex * 180 // 2nd valve is operating at 180 offset to first + tdcPosition() // engine cycle position to trigger cycle position conversion - ENGINE(triggerCentral.triggerShape.eventAngles[SCHEDULING_TRIGGER_INDEX]) ; +*/ + angle_t extra = phaseIndex * 360 + valveIndex * 180; angle_t onTime = extra + engine->engineState.auxValveStart; fixAngle(onTime, "onTime"); scheduleByAngle(rpm, &turnOnEvent[valveIndex][phaseIndex],