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
- Bench Testing: Power ECM, connect via USB, verify I/O and sensors.
- First Start: Safe startup, monitor AFR/temp, follow "Safe First Start" guide.
- Live Tuning: Real-time logging, adjust tables, monitor gauges (RPM, AFR, knock).
- Data Logging: SD card or CAN/serial, configure channels, review logs post-run.
- Diagnostics: Fault checks, DTCs, limp mode, debug flags in console.
- 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
- Toolchain: Install
gcc-arm-none-eabi
, Make, CMake, Java JDK. - 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
- Code Standards: C/C++ for real-time, Lua for custom logic, unit tests for new features.
- Branching: Use feature/bugfix branches, focused PRs.
- Pull Requests: Atomic, well-documented, reference issues, split large changes.
- Testing: CI builds/tests, simulator/unit tests, fix warnings/errors.
- Code Review: Respond to feedback, maintain reliability.
- 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.