parent
1bac61caa3
commit
9b54088dbe
|
@ -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],
|
||||
|
|
Loading…
Reference in New Issue