Author Topic: Nominal operations Software State Flow Diagram.  (Read 1977 times)

Offline schrocketeer

  • ^ Proficient Motobricker
  • Posts: 196
Nominal operations Software State Flow Diagram.
« 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: Crank→Start successful

    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
  • North Alabama
  • 1985 K100RT very original
Ken  
Current: 85 K100RT, 09 DL650, 16 4RT260, 97 XR100, 70 CT70, 06 YFM400
Past Bikes: 86 K100RT, 85 K100RS, 07 SV1000S, 80 KL250, 99 GS1100, 85 K100RT, 86 VFR700, 91 XR250, 95 VLX600, 86 TRX250, 02 GZ250, 83 Z50R, 78 ATC90, 86 XR250, 79 XR500, 72 AT1, 75 YZ360, 78 DT400, 75 DT125, 73 Trail 70

Offline schrocketeer

  • ^ Proficient Motobricker
  • Posts: 196
Re: Nominal operations Software State Flow Diagram.
« Reply #1 on: October 03, 2025, 09:24:57 AM »
Here's another one for the Starting sequence:

stateDiagram-v2
   
  • --> KeyOn : Ignition ON

    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
  • North Alabama
  • 1985 K100RT very original
Ken  
Current: 85 K100RT, 09 DL650, 16 4RT260, 97 XR100, 70 CT70, 06 YFM400
Past Bikes: 86 K100RT, 85 K100RS, 07 SV1000S, 80 KL250, 99 GS1100, 85 K100RT, 86 VFR700, 91 XR250, 95 VLX600, 86 TRX250, 02 GZ250, 83 Z50R, 78 ATC90, 86 XR250, 79 XR500, 72 AT1, 75 YZ360, 78 DT400, 75 DT125, 73 Trail 70

Tags: