Skip to content

Add roadside and workshop flood clear modes - #785

Open
gdiciocco wants to merge 1 commit into
FOME-Tech:masterfrom
gdiciocco:agent/flood-clear-modes
Open

Add roadside and workshop flood clear modes#785
gdiciocco wants to merge 1 commit into
FOME-Tech:masterfrom
gdiciocco:agent/flood-clear-modes

Conversation

@gdiciocco

Copy link
Copy Markdown

Summary

  • add selectable Roadside and Service / Workshop flood-clear modes
  • keep the existing Roadside behavior, which restores fuel once running RPM is reached
  • latch the Workshop fuel cut through accidental combustion until the accelerator is released
  • skip the priming pulse using DriverThrottleIntent, including DBW applications
  • expose the mode in TunerStudio without changing the persistent configuration layout

Motivation

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 -j4 in unit_tests
  • ./build/fome_test '--gtest_filter=limp.*:priming.*'
  • 12/12 selected tests passed

@gdiciocco
gdiciocco marked this pull request as ready for review July 21, 2026 21:19
}

if (m_floodClearLatched) {
allowFuel.clear(ClearReason::FloodClear);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just something like

if (engineConfiguration->floodClearCutsIgn) {
    allowIgnition.clear(ClearReason::FloodClear);
}

so that the engine will never start if that's set?

@gdiciocco gdiciocco Jul 22, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants