Add roadside and workshop flood clear modes - #785
Conversation
| } | ||
|
|
||
| if (m_floodClearLatched) { | ||
| allowFuel.clear(ClearReason::FloodClear); |
There was a problem hiding this comment.
why not just something like
if (engineConfiguration->floodClearCutsIgn) {
allowIgnition.clear(ClearReason::FloodClear);
}so that the engine will never start if that's set?
There was a problem hiding this comment.
I agree that cutting ignition in the latched / Workshop mode is something I should have included in the original PR.
I also appreciate the reduced complexity of your proposal and the more technical framing provided by a setting such as floodClearCutsIgn.
My concern with removing the fuel latch entirely is that, in some workshop situations, the engine may exceed the configured cranking threshold without commanded ignition. Examples include cranking with the spark plugs removed, an externally driven engine on a test bench, hot-spot autoignition, a slightly higher starter speed because the coils are no longer being charged or because the engine is being powered from an external battery booster in a workshop oil priming scenario after engine reassembly.
Once the ECU classifies the engine as running, the existing !isRunning() condition becomes false and both flood-clear cuts are removed. Injection and ignition are therefore restored simultaneously while the throttle is still open. Since the running state remains latched until the engine is detected as stopped, even a transient threshold crossing can create a real opportunity for the engine to start.
The ignition cut prevents the usual spark-driven threshold crossing, but it does not preserve the Workshop invariant if the threshold is exceeded for another reason. For that reason, I see ignition cut as a necessary addition to Workshop mode, but not as a complete replacement for the fuel latch.
My preference would be:
Roadside: existing behaviour, allowing injection to resume at running RPM.
Workshop: latch both fuel and ignition cuts until the accelerator is released.
There is also the separate priming-pulse path. On DBW applications a prime could still occur unless the skip condition uses DriverThrottleIntent, so I think that part of the PR should remain.
That said, I understand the value of the simpler implementation and I am happy to adjust the PR based on which guarantee we want Workshop mode to provide.
Summary
DriverThrottleIntent, including DBW applicationsMotivation
Flood clear was conditioned directly on
!isRunning(). Residual fuel could therefore produce an accidental combustion event, push the engine over the cranking RPM threshold, and immediately re-enable injection.Roadside mode intentionally preserves that behavior so the engine may recover and start. Service / Workshop mode keeps injection disabled after it has been armed, allowing cylinders to be cleared or a racing engine to be cranked for oil pressure. Releasing the accelerator clears the latch, and the mode cannot arm on an already-running engine.
The new setting occupies the previously unused bit 31 at offset 1064, so no existing fields move and the configuration size is unchanged. Roadside remains the default.
Validation
make -j4inunit_tests./build/fome_test '--gtest_filter=limp.*:priming.*'