MOTOBRICK.COM

TECHNICAL MOTOBRICK WRENCHING In Remembrance of Inge K. => The Motobrick Workshop => Topic started by: schrocketeer on September 16, 2025, 07:46:46 PM

Title: Nominal operations Software State Flow Diagram.
Post by: schrocketeer on September 16, 2025, 07:46:46 PM
Thought those of you with a Software Bent may appreciate a State Flow I asked ChatGPT to generate from this prompt, "Based on the attached schematic, and other schematics available on www.motobrick.com and k100-forum.com, combined with publicly available Bosch LE-Jetronic Technical Instructions, draw a potential software state diagram for 4000 RPM on a warmed up engine."

Understand looking at it now, this is for a 16V, due to the reference to O2 sensor.

stateDiagram-v2
   
    EngineRunning --> Warmed: CoolantTemp >= warm_threshold
    Warmed --> Steady4000RPM: TargetRPM=4000, throttle stable
    Steady4000RPM {
        state AFM_Readings
        state Base_PW_Calc
        state ClosedLoop_Lambda
        state Injector_Pulse
        state Ignition_Sync
    }

    Warmed --> TransientAccel: throttle_increase
    Warmed --> TransientDecel: throttle_decrease
    Steady4000RPM --> TransientAccel: throttle_increase
    Steady4000RPM --> TransientDecel: throttle_decrease

    AFM_Readings --> Base_PW_Calc: air_mass_signal
    Base_PW_Calc --> Injector_Pulse: calculate_pw
    Injector_Pulse --> ClosedLoop_Lambda: lambda_feedback
    ClosedLoop_Lambda --> Base_PW_Calc: trim_correction

    TransientAccel --> Base_PW_Calc : accel_enrichment + TPS_event
    TransientDecel --> DecelCut: rpm_above_threshold & throttle_closed
    DecelCut --> Injector_Pulse: throttle_open or rpm_drop_below_resume
    TransientAccel --> Steady4000RPM: stabilization_timeout / lambda_trim_applied
    TransientDecel --> Steady4000RPM: stabilization_timeout

    Steady4000RPM --> OverrunCutoff: rev_limit_or_safety
    OverrunCutoff --> Steady4000RPM: clear_rev_limit

    note right of AFM_Readings
      AFM = air flow meter (air flap)
      measured air mass -> main input.
    end note

    note left of ClosedLoop_Lambda
      Warm engine -> lambda closed-loop active (ECU adjusts PW via O2 sensor).
    end note
Title: Re: Nominal operations Software State Flow Diagram.
Post by: schrocketeer on October 03, 2025, 09:24:57 AM
Here's another one for the Starting sequence:

stateDiagram-v2
   
    KeyOn --> PrimePump : ECU energizes pump relay (~1s prime)
    PrimePump --> WaitForCrank : Pump off, waiting for Hall pulses
    KeyOn --> Kill/Off : Ignition OFF

    WaitForCrank --> Cranking : Starter pressed + Hall pulses detected
    Cranking --> NoHall : if no pulses -> no injection, no run
    NoHall --> WaitForCrank : retry if starter engaged

    Cranking --> InjectorPulse : ECU computes PW from AFM + temp
    InjectorPulse --> SparkSync : Spark occurs via Ignition Control Unit (ICU)
    SparkSync --> FireCycle : Air+Fuel+Spark event

    FireCycle --> Run_Idle : Engine catches (>500 rpm)
    FireCycle --> Cranking : if insufficient rpm, keep cranking

    Run_Idle --> Run_Normal : >~1100 rpm, stable idle
    Run_Normal --> SteadyCruise : Throttle opened, engine warmed
    Run_Normal --> Kill/Off : Ignition OFF