
Ecu25kva
mohan4220/ecu25kva
Replacement engine control unit for a 25 kVA Kirloskar diesel genset — engine 3GK550ETA 4SR1, application code GK3.8703, 26.5 kW at 1500 rpm, 12 V system. Panel controller is a Deep Sea Electronics DSE4522 MKII AMF.

Replacement engine control unit for a 25 kVA Kirloskar diesel genset — engine 3GK550ETA 4SR1, application code GK3.8703, 26.5 kW at 1500 rpm, 12 V system. Panel controller is a Deep Sea Electronics DSE4522 MKII AMF.
Prototype is an open-source printed circuit board by mohan4220, from the mohan4220/ecu25kva repository on GitHub. It is a 4-layer board of 300 × 200 mm with 434 parts on 285 nets, routed with 5,769 tracks and 1,586 vias.
It is built around the TCAN1042HGVDRQ1, AUIRS2181STR and INA592ID, with the TPS7B4253QDDARQ1, BAV199-QR and 2N7002BK among its other parts. Its parts include 131 resistors, 111 capacitors, 45 diodes, 37 transistors and 25 ICs.
Replacement engine control unit for a 25 kVA Kirloskar diesel genset —
engine 3GK550ETA 4SR1, application code GK3.8703, 26.5 kW at 1500 rpm,
12 V system. Panel controller is a Deep Sea Electronics DSE4522 MKII AMF.
docs/pdf/ECU-Bible.pdf — everything, in reading
order, in one 328-page file. Cover, handoff, field handbook, sensor reference,
circuit reference, the specification, the decisions log, all twelve research
memos, the plan. Bookmarked, so the PDF reader's outline pane is the table of
contents.
Resuming work, or moving to another machine?
docs/HANDOFF.md — setup, what is verified, what is
open, and the traps that already cost a session each.
docs/decisions-log.md — every design fork put to
the owner, with the options and the reasoning.
Prefer the browser? Three of those are live HTML: the handbook, the circuit reference and the sensor reference.
| Path | What it is |
|---|---|
docs/pdf/ | Every document as PDF — one file each, plus the combined bible |
docs/handbook/index.html | The handbook: machine, 94-pin interface, the circuits in narrative, how a runaway gets stopped |
docs/handbook/circuits.html | Circuit reference — all 17 blocks, each with schematic, reasoning, simulated result and model limits |
docs/handbook/sensors.html | Sensor reference — every sensor, what it measures, how it's read, what the data drives |
docs/superpowers/specs/ | The reconciled specification — the binding source of truth |
refs/ | The OEM wiring diagram, the DSE4522 configuration, machine photographs, and the extracted pinout |
docs/research/ | Twelve research memos: engine ID, GCU, connector, injector, MCU, standards, BOM, inspection brief, sensor front-ends, injector turn-off, supervisor, driver architecture |
sim/ | Twenty-four SPICE circuits that run and check themselves |
hw/ | The ten schematic-sheet generators, the symbol/footprint generators and the netlist gate |
.venv/bin/python docs/build_pdf.pyMarkdown documents are converted and printed; the handbook pages are printed as they stand, from a temporary copy with the print rules injected — the source HTML is never edited, so a PDF cannot drift from the page it came from.
Needs Chrome or Chromium on PATH (it is the renderer — the only engine here
that handles the handbook's inline SVG schematics and CSS custom properties),
plus markdown and pypdf:
.venv/bin/pip install markdown pypdfPage rules live in docs/print.css.
.venv/bin/python sim/run_sim.py # every block
.venv/bin/python sim/run_sim.py injector # blocks matching "injector"Each check is a claim about the circuit, so a red line means the design is
wrong, not the simulator. All 26 blocks currently pass (on ngspice 42 — see
docs/HANDOFF.md §2).
The netlists are plain SPICE — they also open directly in KiCad's built-in
simulator (Tools → Simulator), LTspice, or standalone ngspice. See
sim/README.md.
If .venv is missing, rebuild it:
python3 -m venv .venv && .venv/bin/pip install PySpice numpy schemdraw markdown pypdfmake -C firmware/sim test # unit tests of the C core and the bootloader
.venv/bin/python firmware/sim/run_sil.py # the 16 engine scenarios
.venv/bin/python firmware/sim/run_sil.py runaway # scenarios matching "runaway"
.venv/bin/python firmware/sim/test_service.py # the service tool end to endThe service tool reads and writes the end-of-line record and flashes the
application, over USB, CAN channel 2 or the simulator (firmware guide §16).
key.bin holds the 16 bytes of SEC_SECRET:
T=firmware/tools/ecu_service.py
.venv/bin/python $T --link sim --secret key.bin info
.venv/bin/python $T --link usb:/dev/tty.usbmodem1 --secret key.bin eol-read
.venv/bin/python $T --link can:socketcan:can0 --secret key.bin flash app.bin \
--sw-ver 0x00010002 --hw-min 0x0100 --hw-max 0x01FFThe simulator runs the same firmware live or from scripts, traced in a browser, on Windows, macOS or Linux with nothing to install (guide simulator/README.md):
cd simulator && cargo run --release -p ecusim # the browser UI
cd simulator && cargo run --release -p ecusim -- run 'scenarios/sil/*.seq'The C core in firmware/core/ touches no hardware. The simulator drives it
with a model of the engine, generator and fuel rail. See decisions log §11,
and §12 for the fault memory, event log, counters and trip recorder.
The board is generated, then routed by hand in KiCad 10 (guide:
docs/layout-guide.md). KP is KiCad's own Python:
KP=/Applications/KiCad/KiCad.app/Contents/Frameworks/Python.framework/Versions/3.9/bin/python3
.venv/bin/python hw/test_schlib.py # schematic regeneration keeps its UUIDs
.venv/bin/python hw/test_pcb_rules.py # rules: widths, classes, regions, every power net classed
$KP hw/gen_pcb.py --selftest # the generator's own checks, on a temp copy
$KP hw/gen_pcb.py # build hw/ecu25kva.kicad_pcb; on a routed board, rules only
.venv/bin/python hw/check_pcb.py # footprints, nets, classes, widths, DRCThe outline, holes and J1001 are placeholders until the old ECU is
measured: HOUSING and REGIONS in hw/pcb_rules.py.
A bench board that can be built now: the full production circuit with an
STM32G474, screw terminals instead of the Bosch connector, 300 × 200 mm.
Everything is in prototype/ (decisions log §15; bring-up guide
prototype/docs/bring-up.md). Routing needs Java and Freerouting 2.4.1:
export PATH=/Applications/KiCad/KiCad.app/Contents/MacOS:$PATH
export KICAD_SYMBOL_DIR=~/opt/kicad7-libs/kicad-symbols-7.0.11 # the symbols hw/ was drawn with
.venv/bin/python prototype/gen_prototype.py # schematic: production sheets + mcu_stm32 + lab_io
.venv/bin/python prototype/check_prototype.py # netlist gate, no open items
$KP prototype/gen_board.py setup # fetch Freerouting, check its SHA-256
$KP prototype/gen_board.py route # place, power pours, Freerouting (about 2 h)
$KP prototype/gen_board.py finish # route what Freerouting left, rip-up, tidy
$KP prototype/gen_board.py sync # after a schematic change: rename, add new parts
$KP prototype/gen_board.py rip_thin # tracks too thin for TRACK_AMPS out; then finish
$KP prototype/gen_board.py widen # tracks up to 0.2 mm, TRACK_AMPS nets to their IPC width
$KP prototype/gen_board.py fab # prototype/fab/: Gerbers, drill, positions, BOM
.venv/bin/python prototype/test_prototype.py # every prototype checkPhase 1 is complete: twelve research memos, 25 verified circuit blocks covering the whole power chain, both sensor front-end topologies, the speed input, the injector boost rail and its reservoir, both actuator drivers and the CAN termination — and a specification carrying the corrections that simulation forced, including one front-end that could not have worked as originally specified.
Simulation has now caught a design error in roughly a third of the blocks written. The ones worth knowing about: the discrete input was impossible as a divider rather than merely mis-valued; the battery divider would have destroyed an ADC pin; the MCU decoupling peaked thirty times over target against the regulator's own output inductance; and the EMI filter handed back 12 dB at the exact frequency it most needed to hold.
Four unknowns closed on 18 September, from photographs of the machine and one
manufacturer's manual — and three of the four closed against an inference this
project had made. The engine is 3GK550ETA 4SR1, not the model memo 01 derived.
The panel controller is a DSE4522, not the KG640C the OEM diagram shows. The
connector is Bosch 1 928 405 192 / 194, code C. And the controller has no
speed pickup, which memo 02 got right about the wrong device.
That cost the project its safety argument. The DSE4522 takes engine speed from our ECU over CAN, so its overspeed trip is not independent of the thing it protects against. Spec §3 is rewritten and the standalone overspeed trip module reverts from recommended to mandatory.
U12 now stands alone as the load-bearing unknown. Every protective action the controller can take ends by de-energising one fuel relay; whether its contacts remove supply from the ECU and fuel system, or merely signal a hung ECU, decides whether any independent protection exists. Memo 08 is the printed checklist for that measurement.
Three things deserve reading before anything gets built. Memo 06 on the CPCB
IV+ position — and the machine's type approval is now a specific certificate,
ARAI/MoEF/DGTA/IGES4/KOEL-P25/2825/24. The single-source flag on the
MC33816 injector driver in Memo 07. And §3's closing note: no air-intake
shutoff exists anywhere in this design, which means nothing here can stop a
diesel running away on its own lubricating oil.
| Qty | Value | Footprint | References |
|---|---|---|---|
| 27 | 100nF | Capacitor_SMD:C_0603_1608Metric | C103, C105, C205, C212, C213, C215, C216, C218, C219, C406, C418, C419, C501, C503, C605, C607 +11 |
| 20 | 10k | Resistor_SMD:R_0603_1608Metric | R207, R301, R302, R307, R309, R403, R409, R509, R602, R605, R620, R803, R806, R809, R813, R817 +4 |
| 20 | 1k | Resistor_SMD:R_0603_1608Metric | R310, R311, R410, R411, R412, R413, R508, R603, R606, R609, R610, R611, R612, R613, R614, R615 +4 |
| 17 | BAV199-Q | Package_TO_SOT_SMD:SOT-23 | D104, D601, D602, D603, D604, D605, D606, D607, D608, D702, D703, D704, D801, D802, D803, D804 +1 |
| 14 | 1uF 25V | Capacitor_SMD:C_0805_2012Metric | C106, C409, C410, C411, C412, C413, C414, C415, C416, C502, C504, C505, C506, C507 |
| 12 | 22nF | Capacitor_SMD:C_0603_1608Metric | C208, C209, C601, C602, C603, C604, C606, C608, C610, C612, C615, C705 |
| 12 | 470R | Resistor_SMD:R_2010_5025Metric | R419, R420, R422, R423, R425, R426, R427, R502, R503, R504, R505, R506 |
| 10 | 2.2uF 100V | Capacitor_SMD:C_1210_3225Metric | C101, C102, C107, C108, C109, C110, C201, C202, C402, C403 |
| 10 | 2N7002BK | Package_TO_SOT_SMD:SOT-23 | Q301, Q402, Q403, Q404, Q405, Q413, Q415, Q417, Q502, Q507 |
| 10 | HHXC800ARA820MJC5G | Capacitor_SMD:CP_Elec_10x12.5 | C111, C112, C113, C114, C115, C116, C117, C118, C401, C420 |
| 9 | 100nF | Capacitor_SMD:C_0402_1005Metric | C303, C304, C305, C306, C307, C308, C315, C317, C320 |
| 9 | 10k | Resistor_SMD:R_0805_2012Metric | R607, R708, R801, R804, R807, R810, R811, R814, R815 |
| 9 | IPD90N10S4-06 | Package_TO_SOT_SMD:TO-252-2 | Q102, Q201, Q409, Q411, Q501, Q503, Q504, Q505, Q506 |
| 8 | VS-1EMH02HM3 | Diode_SMD:D_SMA | D403, D404, D405, D406, D502, D503, D807, D808 |
| 7 | 4.7k | Resistor_SMD:R_0603_1608Metric | R701, R702, R802, R805, R808, R812, R816 |
| 7 | PMBT3904-Q | Package_TO_SOT_SMD:SOT-23 | Q407, Q419, Q801, Q802, Q803, Q804, Q805 |
| 7 | VS-16EDH02HM3 | ecu25kva:Vishay_SMPD_TO-263AC_K1_A2 | D408, D409, D410, D411, D412, D413, D414 |
| 6 | 100k | Resistor_SMD:R_0603_1608Metric | R204, R212, R703, R704, R820, R822 |
| 6 | 4.7uF | Capacitor_SMD:C_0805_2012Metric | C309, C801, C802, C803, C804, C805 |
| 5 | 47k | Resistor_SMD:R_0805_2012Metric | R103, R108, R109, R305, R818 |
| 5 | AUIRS2181S | Package_SO:SOIC-8_3.9x4.9mm_P1.27mm | U402, U403, U404, U405, U502 |
| 5 | INA592 | Package_SO:SOIC-8_3.9x4.9mm_P1.27mm | U601, U602, U603, U604, U605 |
| 5 | SQM85N15-19 | Package_TO_SOT_SMD:TO-263-2 | Q408, Q410, Q412, Q414, Q416 |
| 4 | 0R68 1206 | Resistor_SMD:R_1206_3216Metric | R110, R111, R112, R113 |
| 4 | 3.3k 2512 | Resistor_SMD:R_2512_6332Metric | R416, R417, R432, R433 |
| 4 | 60R0 | Resistor_SMD:R_0603_1608Metric | R902, R903, R905, R906 |
| 4 | BZX84-C12-Q | ecu25kva:SOT-23_Zener_K1_A2 | D102, D106, D109, D301 |
| 4 | INA181A1 | Package_TO_SOT_SMD:SOT-23-6 | U406, U407, U501, U503 |
| 4 | SS20PH102HM3 | ecu25kva:TO-277A_K1_A2 | D103, D107, D110, D416 |
| 4 | TP GND | TestPoint:TestPoint_Keystone_5000-5004_Miniature | TP6, TP11, TP13, TP14 |
| 3 | 10nF | Capacitor_SMD:C_0603_1608Metric | C301, C302, C421 |
| 3 | 10uF 50V | Capacitor_SMD:C_2220_5750Metric | C214, C217, C220 |
| 3 | 1uF | Capacitor_SMD:C_0805_2012Metric | C206, C407, C704 |
| 3 | SMCJ43CA-HM3 | Diode_SMD:D_SMC | D101, D105, D108 |
| 3 | TPS7B4253 | ecu25kva:TI_DDA0008J_HSOIC-8_EP2.95x4.9_Mask2.6x3.2 | U204, U205, U206 |
| 2 | 0R | Resistor_SMD:R_0603_1608Metric | R303, R304 |
| 2 | 100k | Resistor_SMD:R_0805_2012Metric | R421, R424 |
| 2 | 11k 1W | Resistor_SMD:R_2512_6332Metric | R401, R435 |
| 2 | 120k | Resistor_SMD:R_0805_2012Metric | R601, R604 |
| 2 | 12pF | Capacitor_SMD:C_0402_1005Metric | C318, C319 |
| 2 | 16k | Resistor_SMD:R_0603_1608Metric | R608, R621 |
| 2 | 1nF | Capacitor_SMD:C_0603_1608Metric | C701, C702 |
| 2 | 1uF | Capacitor_SMD:C_1206_3216Metric | C104, C210 |
| 2 | 1uF | Capacitor_SMD:C_0603_1608Metric | C314, C316 |
| 2 | 2.2k | Resistor_SMD:R_0603_1608Metric | R706, R707 |
| 2 | 24.9k | Resistor_SMD:R_0603_1608Metric | R202, R438 |
| 2 | 4.7nF | Capacitor_SMD:C_0603_1608Metric | C903, C906 |
| 2 | 47k | Resistor_SMD:R_0603_1608Metric | R414, R415 |
| 2 | 499k | Resistor_SMD:R_1206_3216Metric | R436, R437 |
| 2 | 499k 1% | Resistor_SMD:R_0603_1608Metric | R105, R408 |
| 2 | 5.1k | Resistor_SMD:R_0603_1608Metric | R312, R313 |
| 2 | 56R | Resistor_SMD:R_0603_1608Metric | R418, R434 |
| 2 | 5mOhm 2W 1% | Resistor_SMD:R_2512_6332Metric | R428, R429 |
| 2 | 7.5k | Resistor_SMD:R_1210_3225Metric | R430, R431 |
| 2 | AUIRS2184S | Package_SO:SOIC-8_3.9x4.9mm_P1.27mm | U504, U505 |
| 2 | PMV280ENEA | Package_TO_SOT_SMD:SOT-23 | Q806, Q807 |
| 2 | PZTA42-Q | Package_TO_SOT_SMD:SOT-223-3_TabPin2 | Q406, Q418 |
| 2 | SN74AHCT1G125-Q1 | Package_TO_SOT_SMD:SOT-23-5 | U801, U802 |
| 2 | SQM120P10-10m1L | Package_TO_SOT_SMD:TO-263-2 | Q103, Q104 |
| 2 | TCAN1042HGV | Package_SO:SOIC-8_3.9x4.9mm_P1.27mm | U901, U902 |
| 2 | TLV3201 | Package_TO_SOT_SMD:SOT-353_SC-70-5 | U101, U701 |
| 2 | XAL1510-103MED | Inductor_SMD:L_Coilcraft_XAL1510-103 | L103, L104 |
| 2 | green | LED_SMD:LED_0603_1608Metric | D303, D304 |
| 1 | 0437005.WRA | Fuse:Fuse_1206_3216Metric | F101 |
| 1 | 100R | Resistor_SMD:R_0603_1608Metric | R209 |
| 1 | 10R | Resistor_SMD:R_0603_1608Metric | R213 |
| 1 | 10k 0.1% | Resistor_SMD:R_0603_1608Metric | R211 |
| 1 | 10k 1% | Resistor_SMD:R_0603_1608Metric | R107 |
| 1 | 10k 1% | Resistor_SMD:R_0805_2012Metric | R104 |
| 1 | 10uF | Capacitor_SMD:C_0805_2012Metric | C207 |
| 1 | 10uF 25V | Capacitor_SMD:C_1206_3216Metric | C417 |
| 1 | 12.1k | Resistor_SMD:R_0603_1608Metric | R206 |
| 1 | 120R | Resistor_SMD:R_0603_1608Metric | R101 |
| 1 | 120k | Resistor_SMD:R_0603_1608Metric | R308 |
| 1 | 15k | Resistor_SMD:R_0603_1608Metric | R208 |
| 1 | 16k | Resistor_SMD:R_0805_2012Metric | R709 |
| 1 | 180R 1W | Resistor_SMD:R_2512_6332Metric | R405 |
| 1 | 1k | Resistor_SMD:R_2512_6332Metric | R710 |
| 1 | 1uF 100V | Capacitor_SMD:C_1206_3216Metric | C404 |
| 1 | 2.2nF/50V X7R | Capacitor_SMD:C_0603_1608Metric | C203 |
The 356 most common of 434 parts.
It measures 300 × 200 mm and has 4 copper layers, 1.6 mm thick.
434 parts, built around the TCAN1042HGVDRQ1, AUIRS2181STR, INA592ID and TPS7B4253QDDARQ1. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the mohan4220/ecu25kva repository on GitHub, at the commit this page was made from: the board is prototype/prototype.kicad_pcb and its schematic hw/can.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository states no licence, so its author keeps all rights: ask mohan4220 before reusing the design.

mohan4220/ecu25kva
Replacement engine control unit for a 25 kVA Kirloskar diesel genset — engine 3GK550ETA 4SR1, application code GK3.8703, 26.5 kW at 1500 rpm, 12 V system. Panel controller is a Deep Sea Electronics DSE4522 MKII AMF.


Lafayette-FSAE/PacMan
A KiCad Schematic for PacMan, a Accumulator Management Board for the Lafayette FSAE Accumulator Management System


halbritt/fome-mc
FOME-MC integrated single-PCB motorcycle ECU (STM32H753 + 2x STM32F042 WBO)

christophmuellerorg/voron_I_CAN_has_carrot_board
An adapter board allowing to use the FYSETC ERB V1.0 or the SKR Pico via CAN

mrcha033/hw-codesign
Agentic hardware co-design: brief to KiCad, firmware, 3D review, and explicit fabrication blockers.

Matthew-Garcia/NASA-Lunabotics-UHCL-Lunar-Hawks
UHCL Lunar Hawks proof-of-concept excavation rover: ROS 2, micro-ROS, MicroPython, control PCB development, CAD, and research.

olexsu/inos-rev-a-robotics-controller
INOS Rev A — CAN-based robotic arm controller designed as a real-time motion-control node for NVIDIA Jetson robotics systems.