Standalone Motorsports Open Source ECM - MykeHaunt/Standalone-Motorsports-Open-Source-ECM GitHub Wiki

πŸš— Standalone Motorsports Open Source ECM

A fully open-source, high-performance engine control module for motorsports and advanced automotive applications.


🏁 Key Features

  • Advanced Fuel Control: Batch/sequential injection (up to 12 injectors), multi-dimensional fuel/ignition maps, VE tables, overlay compensation, closed-loop AFR, acceleration enrichment, decel fuel cut.
  • Flexible Ignition Control: Wasted-spark/sequential, up to 12 cylinders, configurable advance tables, multi-spark, launch control, boost retard, dwell settings.
  • Sensors & Interfaces: Crank/cam (VR/Hall), MAP, TPS, CLT, IAT, oil/fuel pressure, flex-fuel, knock, wheel speed, ~10 analog inputs, logic/PWM outputs.
  • Communications: CAN bus (1β€―Mbit/s), USB (virtual COM), UART, SPI/IΒ²C, SD card logging, TunerStudio/FOME Console integration.
  • Configuration & Extensibility: Real-time tuning, sensor calibration, PID controllers, limiters, Lua scripting engine for custom logic.
  • Robustness & Protections: Rev/boost limiters, fuel/oil pressure shutdown, diagnostic flags, CRITICAL LED, debug streaming.
  • Development Support: Simulator, unit tests, Java FOME Console, open documentation, active community.

πŸ—οΈ System Architecture

  • Firmware: Real-time embedded control on ARM Cortex-M (STM32F4/F7), modular controllers, deterministic main loop.
  • Timing: Fixed timebase (onTick), hardware timers for injector/spark, interrupt-driven events, concurrent logging.
  • Extensibility: Lua scripts run each control cycle, can read/write firmware state and sensor values.

πŸ”Œ Hardware Interface

  • Microcontroller: ARM Cortex-M (STM32F4/F7), high-speed ADCs, timers, CAN, USB/UART.
  • Inputs/Sensors: Crank/cam (VR/Hall), analog (MAP, TPS, IAT, CLT, oil/fuel pressure), digital (switches, flex-fuel, wheel speed), thermistors.
  • Outputs/Actuators: Injector/coil drivers, PWM for fans/pumps/ETB, relay/logic outputs, throttle control, CAN gauge.
  • Communications: CAN, UART/USB, SPI/IΒ²C for expansion.

πŸ› οΈ Installation & Setup

  • Development Environment: gcc-arm-none-eabi, Make, CMake, Java JDK. Build with Make or STM32CubeIDE. Example:
git clone https://github.com/MykeHaunt/Standalone-Motorsports-Open-Source-ECM.git
cd Standalone-Motorsports-Open-Source-ECM/firmware
./setup_linux_environment.sh
make -j$(nproc)
  • Flashing Firmware:
    • STM32CubeProgrammer (GUI, DFU mode)
    • dfu-util (CLI, cross-platform)
    • FOME Console (recommended)

βš™οΈ Configuration & Calibration

  • Fuel Map: 3D table (load vs RPM), target AFR, injector dead-time, fuel pressure.
  • Ignition Map: Advance table (load vs RPM), cranking/idle tables, dwell, firing angles.
  • Sensor Scaling: ADC scaling, thermistor curves, MAP/TPS calibration.
  • Drivers: Injector flow rates, coil dwell, duty limits.
  • PID Tuning: Idle, ETB, VVT controllers, auto-tune helpers.
  • Closed-loop & Limiters: Enable Oβ‚‚ feedback, set rev/boost limits, baro/flex-fuel compensation.
  • Auxiliary Controls: Fans, fuel pump, relays, launch control.

🚦 Usage & Operation

  1. Bench Testing: Power ECM, connect via USB, verify I/O and sensors.
  2. First Start: Safe startup, monitor AFR/temp, follow "Safe First Start" guide.
  3. Live Tuning: Real-time logging, adjust tables, monitor gauges (RPM, AFR, knock).
  4. Data Logging: SD card or CAN/serial, configure channels, review logs post-run.
  5. Diagnostics: Fault checks, DTCs, limp mode, debug flags in console.
  6. Safety: Main relay/fuel pump under ECU control, CRITICAL LED for errors.

🧰 Troubleshooting & Debugging

  • No Start / Misfire: Check crank signal (Blue COMM LED), sensor alignment, trigger mode, spark outputs.
  • Fueling Issues: Check injector scaling, fuel pressure, pulse widths, AFR gauge, Oβ‚‚ sensor calibration.
  • Sensor Faults: Wiring polarity, ADC scaling, thermistor curves, use Status/Value Monitors.
  • Communication: Reset USB drivers, DFU bootloader, STM32 device in DFU mode.
  • Debug Mode: Enable in TunerStudio, view debug gauges for internal variables.
  • Status LEDs: Blue COMM (data), green RUN (engine), red CRITICAL (fatal error).
  • Grounding/Noise: Solid grounds, shielded cables, ferrites for VR sensors.

πŸ‘©β€πŸ’» Development & Contribution

  1. Toolchain: Install gcc-arm-none-eabi, Make, CMake, Java JDK.
  2. Clone Repo:
git clone https://github.com/MykeHaunt/Standalone-Motorsports-Open-Source-ECM.git
cd Standalone-Motorsports-Open-Source-ECM
git submodule update --init --recursive
  1. Code Standards: C/C++ for real-time, Lua for custom logic, unit tests for new features.
  2. Branching: Use feature/bugfix branches, focused PRs.
  3. Pull Requests: Atomic, well-documented, reference issues, split large changes.
  4. Testing: CI builds/tests, simulator/unit tests, fix warnings/errors.
  5. Code Review: Respond to feedback, maintain reliability.
  6. Documentation: Update docs for new features/changes.

πŸ“ License & Credits

  • License: GPLv3+ (all code, schematics, docs are free/open-source)
  • Credits:
    • Standalone Motorsports (MykeHaunt) – project lead
    • FOME (Team FOME) – original open ECU firmware
    • rusEFI team – inspiration/codebase
    • Community contributors

For detailed guides, see the FOME wiki and in-repo documentation.