How to datalog an engine and read the logs: channels, rates and math channels

A datalog is a time-stamped record of what the engine did, and a useful one starts with a question. Log the channels that answer it plus protection channels, at rates several times faster than the signals change, from the ECU's own logger or CAN rather than slow OBD-II requests. Then read in order: health, targets against actuals, corrections, knock. Math channels such as lambda error and injector duty turn traces into decisions.451

Key takeaways

  • Decide the question first; it sets the channels and the rate.
  • Always log protection channels: oil pressure, fuel pressure, coolant and battery voltage.
  • Sample above twice a signal's highest frequency, and in practice several times; slow logs alias fast events into false patterns.
  • OBD-II is request and response: CSS Electronics suggests 300-500 ms between requests, and most 2008-on cars support 40-80 PIDs. Use the ECU logger or CAN for calibration.
  • Read logs in order: health, target vs actual, corrections, limiters, knock.
  • Road and drag-strip power figures are estimates; compare runs with them, measure power on a dyno.

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

Log sources comparedMedium413
SourceWhat it seesSpeedBest for
ECU internal loggerCalculated values, corrections, limitersHighest, even ratesCalibration
CAN logger or dashBroadcast frames from ECU and other modulesHigh, depends on broadcast ratesTrack data, multi-module cars
OBD-II (J1979 PIDs)Standard emissions parametersSlow; shared request bandwidthMonitoring factory-ECU cars
GNSS / IMU loggerPosition, speed, accelerationTypically 10-25 Hz for GNSSLap 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

Channel setsMedium154
JobChannelsHow fast
☐ Always (protection)Oil pressure, fuel pressure, coolant temp, battery voltage, rpmMedium (pressures) / slow (temps)
☐ FuelLoad or MAP, rpm, throttle, target lambda, measured lambda, short- and long-term trims, injector pulse width or dutyFast for transients; medium for steady state
☐ Ignition and knockCommanded advance, knock retard per cylinder, knock level, intake air temp, coolant tempPer-event inside the ECU; fast in the log
☐ BoostTarget boost, MAP, barometric pressure, solenoid duty, gear, intake air tempFast
☐ Driveline and tractionDriven and undriven wheel speeds, gear, throttle, longitudinal accelerationFast
☐ ContextFuel type or ethanol %, ambient temp, altitude, session notesSlow 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

Log review orderMedium1594
#Look atWhat it tells you
☐ 1Oil pressure, fuel pressure, coolant, battery voltageIs the engine healthy? Stop here if not
☐ 2Target vs measured lambda across the runWhere fuel is wrong, and in which cells
☐ 3Fuel trims and their trendLarge or growing trims point to wrong base data or a leak
☐ 4Injector duty at peak powerAbove about 85%, little control margin left
☐ 5Target vs actual boost, with solenoid dutySpike, creep, oscillation or a leak
☐ 6Commanded spark and knock retard per cylinderWhere the engine is knock-limited
☐ 7Limiters and cuts activeRev, boost or temperature protection acting
☐ 8Intake air temperature through the runHeat 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

Useful math channelsMedium91012815
ChannelFormulaUse
Injector duty (%)pulse width (ms) × rpm ÷ 1200 (four-stroke, one injection per cycle)Injector headroom
Lambda error (%)(measured lambda ÷ target lambda − 1) × 100Fuel table correction
Boost (gauge)MAP − barometric pressureCompare 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 × 100Traction and boost-by-gear tuning
Power (hp)torque (lb·ft) × rpm ÷ 5252Dyno data in consistent units
Acceleration power (W)vehicle mass × acceleration × speed, plus drag and rolling lossesRough road-run comparisons
Injector duty from a logged pulse width
ms
rpm

Result

Duty cycle81.3 %
Time per engine cycle18.46 ms

Planning estimate from the formula below, not a measurement.

Open the injector duty cycle calculator →

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

Power estimate from trap speed
lb
mph
hp

Engine (crank) power. Leave at 0 to estimate power from the time slip instead.

Result

Estimated power from trap speed (Hale)415 hp
Estimated power from ET (Hale)400 hp
Estimated power from trap speed (Fox)438 hp
Estimated power from ET (Fox)499 hp
ET a clean pass at this trap speed suggests11.85 seconds, Hale

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.

Open the 1/4 mile calculator: et, trap speed and horsepower (estimates) →

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

Before you logMedium1554
#Check
☐ 1Question written down: what decision will this log support?
☐ 2Protection channels included
☐ 3Fast channels at a rate several times their fastest change
☐ 4Targets logged alongside actuals
☐ 5Conditions noted: fuel, ethanol %, ambient temp, altitude, calibration version
☐ 6Repeatable run plan: gear, start rpm, throttle
☐ 7Full-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
  1. 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
  2. SAE J1979: E/E Diagnostic Test Modes · SAE International · standard · retrieved 2026-10-27
  3. CAN DBC File Explained: A Simple Intro · CSS Electronics · vendor-doc · retrieved 2026-10-27
  4. Data logger · Wikipedia · reference · retrieved 2026-10-27
  5. Nyquist-Shannon sampling theorem · Wikipedia · reference · retrieved 2026-10-27
  6. Aliasing · Wikipedia · reference · retrieved 2026-10-27
  7. High-speed, analog-to-digital converter basics (SLAA510) · Texas Instruments · vendor-doc · retrieved 2026-10-27
  8. Power (physics) · Wikipedia · reference · retrieved 2026-10-27
  9. internal GAINS internal: Injector duty cycle calculator (@aitune/calc injector-duty-cycle): duty % = pulse width (ms) × rpm ÷ 1200
  10. internal GAINS internal: Boost pressure converter (@aitune/calc boost-pressure-units): gauge = absolute − barometric
  11. internal GAINS internal: 1/4 mile calculator (@aitune/calc trap-speed-horsepower): Hale and Fox relations, labelled estimates; example computed 2026-10-27
  12. internal GAINS internal: Horsepower and torque calculator (@aitune/calc hp-torque): hp = torque (lb·ft) × rpm ÷ 5252
  13. internal GAINS internal: Dyno correction factor calculator (@aitune/calc dyno-correction, SAE J1349 method)
  14. internal GAINS internal: PDM2 v0 design spec (hardware/mini-pdm/SPEC.md): GNSS, IMU, microSD logging estimate
  15. Automotive Handbook, 10th ed. · Robert Bosch GmbH / Wiley, 2018 · book · retrieved 2026-10-27
  16. Internal Combustion Engine Fundamentals, 2nd ed. (combustion, knock, spark timing) · J. B. Heywood, McGraw-Hill, 2018 · book · retrieved 2026-10-27
  17. internal GAINS architecture decision record: ADR-0008: Tuning Knowledge Engine (closed loop on GAINS ECUs, advisor mode on third-party ECUs)
  18. internal GAINS internal: ECU2 v0 concept (hardware/mini-ecu/CONCEPT.md): pin map v0.3, logging, assignment rules
  19. internal GAINS internal: Architecture Review #1 (docs/architecture/ARCHITECTURE_REVIEW.md): strategy status table