What a datalog is, and the three decisions behind a useful one
A datalog is a time-stamped recording of what the engine and car did: rpm, load, lambda, spark, boost, temperatures and the ECU's own corrections, sample by sample. To datalog well you decide three things: which channels, how fast, and what question the log has to answer.415
The question comes first. A log for fuel tuning needs target and measured lambda with load and trims; a boost log needs target, actual and duty; a reliability log needs oil pressure, fuel pressure and temperatures. Logging everything slowly answers none of them well.Medium154
The habit that matters most is comparing targets with actuals. A number on its own rarely tells you anything; the gap between what the ECU asked for and what the engine did tells you where to look.Medium15
Where the data comes from: ECU, CAN and OBD-II
An ECU's internal logger sees the values the ECU actually calculated, including corrections and limiters, at its own rate.
A CAN logger or dash records broadcast frames from the ECU and other modules; a DBC file tells software how to decode each signal.43
OBD-II is request and response. A tool asks for one parameter (PID) and the ECU answers, so every extra channel shares the same limited exchange. CSS Electronics suggests leaving 300-500 ms between requests, and notes most 2008-on cars support only 40-80 of the roughly 200 standard PIDs.12
In the US, CAN has been the required lower layer for OBD-II since 2008 (ISO 15765). OBD-II data is emissions-diagnostic data: useful for monitoring a factory-ECU car, too slow and too thin for calibration work.12
| Source | What it sees | Speed | Best for |
|---|---|---|---|
| ECU internal logger | Calculated values, corrections, limiters | Highest, even rates | Calibration |
| CAN logger or dash | Broadcast frames from ECU and other modules | High, depends on broadcast rates | Track data, multi-module cars |
| OBD-II (J1979 PIDs) | Standard emissions parameters | Slow; shared request bandwidth | Monitoring factory-ECU cars |
| GNSS / IMU logger | Position, speed, acceleration | Typically 10-25 Hz for GNSS | Lap analysis, speed cross-checks |
Which channels to log, by job
Group channels by the decision they support.
Every log should also carry the protection channels, because a falling oil or fuel pressure trend shows up in a log well before it trips an alarm.Medium154
| Job | Channels | How fast |
|---|---|---|
| ☐ Always (protection) | Oil pressure, fuel pressure, coolant temp, battery voltage, rpm | Medium (pressures) / slow (temps) |
| ☐ Fuel | Load or MAP, rpm, throttle, target lambda, measured lambda, short- and long-term trims, injector pulse width or duty | Fast for transients; medium for steady state |
| ☐ Ignition and knock | Commanded advance, knock retard per cylinder, knock level, intake air temp, coolant temp | Per-event inside the ECU; fast in the log |
| ☐ Boost | Target boost, MAP, barometric pressure, solenoid duty, gear, intake air temp | Fast |
| ☐ Driveline and traction | Driven and undriven wheel speeds, gear, throttle, longitudinal acceleration | Fast |
| ☐ Context | Fuel type or ethanol %, ambient temp, altitude, session notes | Slow or once per session |
Sample rate and aliasing
The sampling theorem says a signal must be sampled at more than twice its highest frequency to be captured at all.
A boost oscillation at 10 Hz needs more than 20 samples per second just to show up, and several times that to show its true peak.57
Sampling too slowly does not just lose detail; it lies. Fast changes fold into slow false patterns, called aliasing, so an oscillation can look like a gentle wave or vanish entirely.65
Spend rate where the signal moves. Temperatures change over seconds and need only a few samples per second; pressures, throttle, lambda in transients and wheel speeds change in tens of milliseconds. Note the rate in the session notes, because peaks from logs at different rates are not comparable.Medium45
Log so the data can answer the question
Make runs repeatable
Same gear, same start rpm, same fuel, a warmed-up engine, and the throttle held fully open or steady. A single clean pull you can repeat beats ten mixed ones.Medium1516
For steady-state fuel work, hold rpm and load long enough for lambda to settle; exhaust takes time to reach the sensor, so the first readings after a change belong to the previous operating point.Medium1617
Write down conditions
Fuel and ethanol content, ambient temperature, altitude, hardware changes and calibration version. Logs from different conditions should be compared only after correcting for them.Medium1513
Reading a log: what to look at, in order
Read in a fixed order so nothing is missed: protection first, then targets against actuals, then corrections and limiters, then knock. Only after that does it make sense to judge whether the calibration is right.Medium154
| # | Look at | What it tells you |
|---|---|---|
| ☐ 1 | Oil pressure, fuel pressure, coolant, battery voltage | Is the engine healthy? Stop here if not |
| ☐ 2 | Target vs measured lambda across the run | Where fuel is wrong, and in which cells |
| ☐ 3 | Fuel trims and their trend | Large or growing trims point to wrong base data or a leak |
| ☐ 4 | Injector duty at peak power | Above about 85%, little control margin left |
| ☐ 5 | Target vs actual boost, with solenoid duty | Spike, creep, oscillation or a leak |
| ☐ 6 | Commanded spark and knock retard per cylinder | Where the engine is knock-limited |
| ☐ 7 | Limiters and cuts active | Rev, boost or temperature protection acting |
| ☐ 8 | Intake air temperature through the run | Heat soak changes knock margin and power |
Math channels worth building
A math channel is a value the analysis software calculates from logged channels.
The useful ones turn raw numbers into the quantity you actually decide on, such as lambda error instead of two lambda traces.Medium415
Check units and constants against the calculators so math channels and tools agree. Example: a 15 ms pulse at 6,500 rpm is 81% injector duty, which is already near the limit for control margin.9
| Channel | Formula | Use |
|---|---|---|
| Injector duty (%) | pulse width (ms) × rpm ÷ 1200 (four-stroke, one injection per cycle) | Injector headroom |
| Lambda error (%) | (measured lambda ÷ target lambda − 1) × 100 | Fuel table correction |
| Boost (gauge) | MAP − barometric pressure | Compare with a gauge; boost targets |
| Pressure ratio | (MAP + charge-side losses) ÷ (barometric − inlet loss) | Compressor map operating point |
| Wheel slip (%) | (driven − undriven wheel speed) ÷ undriven × 100 | Traction and boost-by-gear tuning |
| Power (hp) | torque (lb·ft) × rpm ÷ 5252 | Dyno data in consistent units |
| Acceleration power (W) | vehicle mass × acceleration × speed, plus drag and rolling losses | Rough road-run comparisons |
Result
Planning estimate from the formula below, not a measurement.
Estimating power from road and strip data
Acceleration logs can estimate power
Power equals force times speed, and force equals mass times acceleration plus drag and rolling resistance. Without those losses the estimate reads low; with a guessed drag figure it is still only an estimate.Medium815
Drag-strip relations give another estimate. A 3,500 lb (1,588 kg) car trapping 115 mph suggests about 415 hp by Hale's relation and about 438 hp by Fox's; the spread between methods shows why these are labelled estimates, not measurements.11
Use these to compare runs of the same car under similar conditions, not to quote a power figure. A load-holding dyno with SAE J1349 correction is the measurement.Medium1113
Result
Empirical estimate from published drag-racing relations, not a dyno measurement. Traction, gearing, aerodynamics, launch and weather all move the result.
Planning estimate from the formula below, not a measurement.
Comparing logs and spotting trends
Overlay runs aligned on the same event, such as the start of a pull at a fixed rpm, not on clock time.
Then compare like with like: same gear, same fuel, similar intake temperature.Medium415
Trends catch failures early. A fuel pressure that sags a little more each session, a long-term trim that keeps growing or an oil pressure that drops at the same corner are all visible in logs long before a part fails.Medium15
Datalogging checklist
Use this before every logging session.Medium155
| # | Check |
|---|---|
| ☐ 1 | Question written down: what decision will this log support? |
| ☐ 2 | Protection channels included |
| ☐ 3 | Fast channels at a rate several times their fastest change |
| ☐ 4 | Targets logged alongside actuals |
| ☐ 5 | Conditions noted: fuel, ethanol %, ambient temp, altitude, calibration version |
| ☐ 6 | Repeatable run plan: gear, start rpm, throttle |
| ☐ 7 | Full-load runs only on a dyno or closed course |
Do it with GAINS (separate product module, pre-release)
GAINS: the ECU2 concept includes 512 MB of onboard logging at 1 kHz, and the PDM2 concept adds 10 Hz GNSS, an IMU and microSD logging. Both are pre-release designs; nothing has been built or tested.1814
In the GAINS method, the knowledge engine reads logs the same way this guide does, gating on steady state and comparing targets with actuals. On third-party ECUs it works in advisor mode from logs you export; you apply any change in the maker's software.1719
Frequently asked
What should I log when tuning?
Log the channels that answer your question plus protection channels. For fuel: rpm, load or MAP, throttle, target and measured lambda, trims and injector duty. For ignition: commanded advance, knock retard and intake temperature. For boost: target, MAP, barometric pressure and solenoid duty. Always add oil and fuel pressure, coolant and battery voltage.Medium154
What sample rate do I need?
Faster than twice the highest frequency in the signal, and in practice several times that. Temperatures need only a few samples per second; pressures, throttle, lambda in transients and wheel speeds change within tens of milliseconds and need much higher rates. Too slow a rate aliases fast events into false slow patterns.Medium56
Can I datalog through OBD-II?
Yes, for monitoring, with limits. OBD-II is request and response, so channels share bandwidth: CSS Electronics suggests 300-500 ms between requests, and most 2008-on cars support 40-80 standard PIDs. That is enough to watch a factory-ECU car, but too slow and too limited for calibration.12
How do I read a datalog?
In a fixed order. Check engine health first (oil and fuel pressure, coolant, voltage), then target against measured lambda and boost, then fuel trims and injector duty, then knock retard and any active limiters, then intake temperature. Judge the calibration only once you know the engine and data are sound.Medium154
What is a math channel?
A value the analysis software calculates from logged channels. Common ones are injector duty (pulse width × rpm ÷ 1200), lambda error (measured ÷ target − 1), gauge boost (MAP − barometric pressure) and wheel slip. They turn raw traces into the quantity you actually make decisions on.Medium9104
Related
Sources
Numbered as cited above. Hover or tap a citation chip to preview it.
19 sources
- OBD2 Explained: A Simple Intro (request/response, CAN since 2008 per ISO 15765, PID support, request spacing) · CSS Electronics · vendor-doc · retrieved 2026-10-27
- SAE J1979: E/E Diagnostic Test Modes · SAE International · standard · retrieved 2026-10-27
- CAN DBC File Explained: A Simple Intro · CSS Electronics · vendor-doc · retrieved 2026-10-27
- Data logger · Wikipedia · reference · retrieved 2026-10-27
- Nyquist-Shannon sampling theorem · Wikipedia · reference · retrieved 2026-10-27
- Aliasing · Wikipedia · reference · retrieved 2026-10-27
- High-speed, analog-to-digital converter basics (SLAA510) · Texas Instruments · vendor-doc · retrieved 2026-10-27
- Power (physics) · Wikipedia · reference · retrieved 2026-10-27
- internal GAINS internal: Injector duty cycle calculator (@aitune/calc injector-duty-cycle): duty % = pulse width (ms) × rpm ÷ 1200
- internal GAINS internal: Boost pressure converter (@aitune/calc boost-pressure-units): gauge = absolute − barometric
- internal GAINS internal: 1/4 mile calculator (@aitune/calc trap-speed-horsepower): Hale and Fox relations, labelled estimates; example computed 2026-10-27
- internal GAINS internal: Horsepower and torque calculator (@aitune/calc hp-torque): hp = torque (lb·ft) × rpm ÷ 5252
- internal GAINS internal: Dyno correction factor calculator (@aitune/calc dyno-correction, SAE J1349 method)
- internal GAINS internal: PDM2 v0 design spec (hardware/mini-pdm/SPEC.md): GNSS, IMU, microSD logging estimate
- Automotive Handbook, 10th ed. · Robert Bosch GmbH / Wiley, 2018 · book · retrieved 2026-10-27
- Internal Combustion Engine Fundamentals, 2nd ed. (combustion, knock, spark timing) · J. B. Heywood, McGraw-Hill, 2018 · book · retrieved 2026-10-27
- internal GAINS architecture decision record: ADR-0008: Tuning Knowledge Engine (closed loop on GAINS ECUs, advisor mode on third-party ECUs)
- internal GAINS internal: ECU2 v0 concept (hardware/mini-ecu/CONCEPT.md): pin map v0.3, logging, assignment rules
- internal GAINS internal: Architecture Review #1 (docs/architecture/ARCHITECTURE_REVIEW.md): strategy status table

