How To: Make useful data logs

Original Source / Web Archive

Please read my introduction to tuning and logging if you have not done so already.

This how-to will teach you how to select parameters for logging, and how to drive when you’re logging. If you are just looking for instructions so that you can check the sanity of your tune, then feel free to focus on sections 1 through 3. Those are the critical ones. If you are doing your own tuning, and you want to know how to use logs to understand various aspects of your ECU’s behavior, then I hope you will enjoy the whole thing.

After you’ve made some data logs, check out my how-to about reading logs.

If you’re using Cobb’s tools, you may find these translations useful:
http://www.romraider.com/RomRaider/NameTranslations

Have fun, and stay safe!

1) General purpose logging profile

Usually, you just want to know that your motor is not knocking much, and that your actual boost and AFR are close to what they should be. Following are the parameters that I use for 90% of my logging sessions:

* Engine Load (Calculated)
* Engine Speed
* Ignition Total Timing
* Intake Air Temperature (see note 1 below)
* Knock Sum (see note 2 below)
* Fine Learning Knock Correction
* Feedback Knock Correction
* Ignition Advance Multiplier
* Boost (see note 3 below)
* Mass Airflow
* Final Fueling Base (see note 4 below)
* Primary Wastegate Duty Cycle
* Target Boost
* Throttle Opening Angle
* Wideband O2 (see note 5 below)

Some people prefer not to log target boost, Primary Open Loop Map Enrichment (aka Target AFR), or ignition timing, because they can be looked up from the tables in the tune. However I feel like I have enough logging resolution with this many parameters, and when it comes time to analyze the log I prefer to have the information right there in the log. It just makes log analysis quicker and easier.

The parameter list used to be somewhat shorter, but with the advent of “Fast Polling” I have added a few more parameters. Adding parameters does still slow the logger down, but not as much as in the past. The bigger issue now is that those extra parameters just give the rest of us more numbers to sort through when we’re looking for the stuff we want to see. 

 So, please add extra stuff sparingly. Also, take a look at the next post, which contains a list of parameters that generally are not useful, with some information about why they’re not useful (there’s quite a bit of stuff that you can log, but really shouldn’t, because it’s a waste of time).

Also note that if you add too many parameters, the logger just stops working completely. The limit depends on which parameters you add. Adding lots of “4-byte” parameters will cause you to reach that limit fairly quickly, so I generally prefer 2-byte parameters where possible.

Note 1: Intake air temperature is optional. You should log it during a few pulls to find out how much it moves around. If it’s predictable, you can just log it before and after each logging session, and don’t bother logging it during pulls (this may be the case if you have a good cold air intake). If your IAT moves around a lot, you should include it in most of your profiles (this may be the case if you have a short-ram intake).

Note 2: The Knock Sum parameter isn’t available for all ECUs. Some ECUs have one knock sum parameter, others have one parameter per cylinder. If you have all four, and if high-speed logging works for you, log all four.

Note 3: There are a few boost-related parameters to choose from.

For 32-bit ECUs, the best boost parameter is “Manifold Relative Sea Level Pressure (Direct) (2-byte).” This is actually just Manifold Absolute Pressure minus 14.7psi (sea level pressure). That might seem wrong at high altitude, but keep in mind that the ECU “thinks” in terms of absolute pressure, so you should too. This parameter can easily be compared against your target boost parameter, provided that target boost is also logged as relative to sea level pressure.

For 16-bit ECUs, I’m not sure what’s the best parameter to use for logging boost. I’ll ask around, and update this when I have a good answer for that.

Note 4: Final Fueling Base is basically the AFR that the ECU is trying to achieve. It won’t be exactly equal to what you put in your fuel table, because it includes compensations. Logging this parameter will help you recognize when your AFR is off due to something you did (like bad MAF scaling) or due to something the ECU did (like a compensation that you might not be aware of otherwise).

Note 5: If you do not have a wideband O2 sensor, you must be aware of the shortcomings of the stock sensors, so that you don’t read too much into the values they report. On Subarus with 16-bit ECUs, the stock O2 sensor is very inaccurate when it isn’t reading very close to 14.7. On Subraus with 32-bit ECUs, the stock O2 sensor is accurate over a wider range, but it won’t read lower than 11.1, and the exhaust backpressure in the up-pipe (where the sensor is located) skews the readings when you’re in boost. If you’re serious about logging, or even just casual about tuning, you really should get a wideband.

(It’s fairly common for a novice tuner to post a log showing a long series of 11.1 values in the AFR column, while saying something like, “my AFRs are perfect, but can anyone tell me about…” In fact, that fellow’s AFRs are completely unknown because they’re lower than what the stock sensor will ever report.)

2) Logging “pulls”

Most of the logs you’ll find on this site are “pulls.” We log pulls because they show us how the engine behaves when it’s making peak power, across a broad RPM range. Typically a pull looks like this:

* Putt along at 2000 RPM or so
* Start the logger.
* Go to 100% throttle
* Let the revs climb up, until they almost reach redline.
* Lift the throttle.
* Stop the logger.

Of course you can log multiple pulls without stopping the logger, and just look at the segment of the file you’re interested in later, but it’s often more convenient to create a short log file for each pull. And if you post a single log that includes 5 pulls and 20 minutes of driving, it’s going to be hard to have a useful conversation about that log since everybody will be simultaneously talking about different sections of it.

Pulls in 1st or 2nd gear tend to progress so rapidly that not much information can be gained from them. Also, you might not reach peak boost in these gears, especially with an upgraded turbo. By the time the turbo reaches full boost, you’ll be bouncing off the rev limiter.

So, pulls are typically done in third gear. Redline in 3rd gear will put you at illegal speeds in most juridictions, so these are best done off public roads. If you get into an accident while doing this, someone will die. We don’t want to read about your funeral, or (if you survive) your conviction.

Note that it’s also a good idea to do pulls starting from higher RPM – 3000, 4000, 5000, even 6000. Accelerate very gradually to the target RPM, maintain that speed as you turn on the logger, then go to full throttle until you approach redline. You will find that the turbocharger behaves differently in these circumstances, and you may find other quirks as well. Pay attention to your AFR, especially.

Note that it’s also a good idea to do some pulls at half-throttle, and three-quarters, and so on. Full throttle is great, but you want the engine to be happy in all conditions, so you should log a variety of scenarios to make sure there are no surprises waiting for you. Again, pay attention to your AFR in those pulls – you might be surprised at what you find.

3) Posting your logs

Go to Google Spreadsheets, upload your log files there, and make them visible to the public. Then post a link to your spreadsheet in the forum of your choice.

When you post your log, make an effort to read it yourself first – see How To Read Data Logs. I’m happy to help people learn. I’m not really interested in reading logs for people who aren’t even trying to learn – that just takes away from time I could be spending helping someone on the forum who does want to learn.

4) Context

Some parameters will not change much during a logging session, but may be useful to put log data in context later. I often log this batch before and/or after a logging session:

* AF Learning #1 A
* AF Learning #1 B
* AF Learning #1 C
* AF Learning #1 D (see notes below)
* AF Learning #1 E (see notes below)
* Atmospheric Pressure
* Coolant temperature
* Ignition advance multipler (see notes below)
* Intake air temperature

Most Subarus support only AF Learning A, B, C, and D. Some support E as well. The only one that really matters is the last one (D or E) because it affects your fueling in open loop. However, for logging ambient conditions, resolution isn’t important, so I log the whole set just out of curiosity. If they’re way off from their usual values, that may indicate a vacuum leak or other mechanical problem that should be sorted out before doing any pulls.

I always expect IAM to be at maximum (that’s 1.0, for cars with 32-bit ECUs, or 16, for cars with 16-bit ECUs). If it’s not maxed out, then I have a knock problem, and I will want to fix that before I do any hard driving. Logging usually means driving hard. (Not always, but usually.)

If coolant temperature is below 180, the car isn’t warmed up yet, so I don’t want to start logging yet. There are compensation tables that are based on coolant temperature and if it’s not yet up to the normal operating range, the data logs may not really be valid. That can happen after time on a road course, or after a lot of back-to-back passes down a drag strip. It can also happen after sitting still for a while, though in that case the car usually cools quickly once it’s had some air pushed through the radiator.

Make sure the car is moving when you log IAT – if you log it while parked, it will probably be unreasonably high. Again, if your IAT moves around a lot during a pull, you should log it during pulls rather than just here. For my car, it’s pretty stable during pulls so I just log it between pulls.

5) Special-purpose logging profiles

Sometimes it’s useful to log a different set of parameters, to investigate a specific aspect of your car’s performance. The first step of data logging is to decide what you want to accomplish. This goal will determine which parameters you log, and how you should drive to get the most useful information.

For boost, fueling, and timing, there are a handful of parameters that become interesting when you’re fine-tuning or investigating a problem. You don’t necessarily want those values crowding your logs every time, but you’ll probably want to look into them at one point or another.

5.1) Less is more

Our ECUs support logging dozens of parameters. But, the more parameters you log, the less information you end up with. The problem is that the current Subaru ECUs only deliver log data at only 4800 bits per second. This is adequate, but in general you’ll only be interested in a few parameters, and it’s usually more useful to have more rows-per-second than it is to have more parameters-per-row.

Another side effect of the low data rate is that even within a single row of information, not all of the parameters were logged at the same time. When logging 10 parameters, the last parameter in the row might have been sampled 200 milliseconds after the first parameter, which again is not too bad. But if you’re logging 50 parameters, one row of data might include information from before, during, and after a shift.

So, choose parameters with some care. It’s perfectly OK to log a dozen if you’re looking for a rough idea of how healthy all aspects of your tune are, but it might be useful to log only a handful of parameters if you’re very interested in one specific aspect of your tune.

If you’re not sure what to log, feel free to add a few dozen parameters that just seem like they might be interesting. That can help you find the parameters that are interesting, so that you can focus on them in your next log. But try not to post logs on the forums that have every parameter under the sun. If your 13-second drag race log has only 20 rows, you’re doing it wrong. 

:)

Many of the parameters are available in 1-byte, 2-byte, and 4-byte versions. I generally prefer the 2-byte versions. One byte doesn’t always provide enough precision, two provides plenty, and four is overkill (and there is a limit to how many bytes the ECU will let you log).

5.2) Fundamentals

In almost all cases, you’re going to want these three things in your log:

* Engine Speed (revolutions per minute)
* Load (grams per revolution)
* Throttle Plate Angle (degrees)

These three things will let you know which cells in the timing, fueling, or boost control maps need to be adjusted if you find issues with your timing, fueling, or boost control. You can often guess what you were doing with the throttle just by looking at load and RPM, but having the throttle logged will remove some of the guesswork, and also make it easier to re-create specific scenarios so that you can verify whether changes to your tune have had the intended effects.

5.3) Fueling

There is no need to include fuel injector duty cycle (aka IDC) or MAF voltage in every log, but you do want to log them at least once to make sure you’re not exceeding the limits of your MAF sensor and fuel injectors. Once you have proven that you’re well within the limits, you can stop logging them – at least until you make some changes that could potentially cause you to require more air flow, or more fuel flow. In other words, changes that make more power.

If your fuel injectors are not large enough, you risk leaning out when running at full power. The “fuel injector duty cycle” is approximately equal to the percentage of the injector’s total flow capacity that is being used, so you should find out how much of that capacity you’re using before you make any changes that would require more fuel (more power).

If your MAF sensor housing is not large enough, your ECU will not be able to adequately measure the incoming air flow, which means it will not be able to inject the correct amount of fuel, which means you’ll end up with lean AFRs, which means you’ll get knock, which means you’re engine is toast.

If you do reach these limits, you’ll probably want to know under what conditions you reached them, so you should log the fundamentals at the same time:

* Engine Speed
* Fuel Injector Duty Cycle
* Load
* Manifold Relative Sea Level Pressure (2-byte)**
* Mass Air Flow
* Mass Air Flow Sensor Voltage
* Throttle Plate Angle

Opinions differ about what values are acceptable for injector duty. Some people are satisfied with values at or slightly above 100% (the parameter isn’t perfectly accurate, so it can go above 100%). Other people (myself included) prefer to see it at 90% or lower, to provide a margin of safety.

The MAF sensor supplies a voltage signal that ranges from 0v (no air flow) to v5 (the maximum air flow it can measure). If you’re getting over 4.9v, it’s time to get a larger MAF housing.

Once you’re certain that your injectors and MAF housing are large enough for your setup, you can stop logging these parameters unless you have changed your setup (installed a larger turbo, for example), or if you are investigating strange AFRs.

5.4) Boost control

Perhaps you have done some sanity-check logging, and found that you’re overshooting (or undershooting) your boost targets. At this point you will want more insight into what’s going on with the ECU’s boost control system:

* Engine Load (2-byte)
* Engine Speed
* Manifold Relative Sea Level Pressure (2-byte)**
* Initial Wastegate Duty Cycle
* Primary Wastegate Duty Cycle
* Maximum Wastegate Duty Cycle
* Target Boost (2-byte)**
* Throttle Opening Angle
* Turbo Dynamics Proportional (2-byte)
* Turbo Dynamics Integral (2-byte)

Note that 16-bit ECUs have “bust” and “continuous” rather than “proportional” and “integral” turbo dynamics parameters.

5.5) Closed Loop Fueling

In closed loop fueling, the ECU will be constantly adjusting fuel delivery in an attempt to maintain a constant 14.7 AFR. This is generally going to be what’s happening when you’re idling and cruising around – not accelerating much, and definitely not in boost. When you’re in boost, the ECU switches to open loop fueling.

It’s essential to get your closed loop AFRs as close to 14.7 as possible with a minimal amount of compensation from the ECU. You can get a rough idea of how good your closed loop fueling is by looking at the AF Learning #1 A, B, C, and D parameters (also E, if your ECU supports it). (These parameters are also known as “fuel trims.”) If these are all within 5%, you’re in good shape. If they’re not, you need to adjust the MAF scaling and/or injector settings (latency and flow scaling) to solve that problem.

It is not sufficient to log your air-fuel ratio. It’s just as useful (perhaps more) to log AF Correction #1, because this tells you what the ECU is doing to try to hold 14.7:1 AFRs. You’ll notice that the AFR jumps around a lot in closed loops. Air flow measurement and fuel delivery are both rather noisy at low airflow and low fuel flow. Because all of this data is so noisy, you’ll need to log quite a bit of it, and use scatter plots in Excel to make sense of it.

* AF Correction #1
* AF Correction #3 (This will oscillate during cruise, but don’t worry about it, that’s normal)
* AFR (stock O2 sensor is sufficient for this, wideband is still a bit better)
* Engine Speed
* Throttle plate angle
* Load (2-byte)
* Mass Air Flow (grams per second)
* Mass Air Flow Sensor voltage
* OL / CL status (this value will be 8 or 10 depending on the fueling mode)
* Closed Loop Target AFR (if this is oscillating, look at AF Correction #3)

When logging closed loop fueling, do your best to maintain a constant speed. If your speed is increasing or decreasing a lot, this adds more noise to already-noisy data. Also note that if you accelerate too briskly, the ECU will switch to open loop, which is not what you want. Also, keep an eye on MAF and OL/CL; you will find that the ECU switches to open loop somewhere around 65 grams per second, no matter how gently you accelerate.

In order to get a lot of data in the 40 g/s to 65 g/s range, it really helps a lot to have a long steep hill to drive up. This allow you to drive at high airflow without accelerating into the open-loop mode after just a second or two, which is generally going to happen when you’re on level ground.

5.6) Open Loop Fueling

Open loop fueling is the mode the ECU uses when you’re in boost. In this mode, the ECU doesn’t look at the O2 sensor signal, it just looks at MAF and squirts the amount of fuel that it thinks will provide the desired AFR. Of course this only works if the MAF signal is accurate and the injector scaling is accurate (injector latency settings are almost irrelevant however).

* AFR (a wideband O2 sensor is required for this)
* Engine Speed
* Load (2-byte)
* Mass Air Flow
* Primary Open Loop Fuel Table (read as: target AFR)
* Final Fueling Base
* Throttle Plate Angle

When reviewing the logs, I find it helpful to create an “AFR Error” column in Excel, where the values are “measured AFR / target AFR.” When that’s off by more than a couple percent, I make changes to the fuel table (in the cell indicated by the RPM and load coordinates) or to the MAF scaling. MAF scaling is generally used when the same AFR error is present for all data rows at the same MAF. The fuel table is used when a wide range of AFR error values are seen for the same MAF value (which seems to be common when using bigger injectors).

When logging open loop fueling, you will generally need to do pulls (see below for more information about how to drive pulls). It’s pretty easy to do this at full throttle, however to ensure that your whole fuel table is accurate it’s wise to do part-throttle pulls as well. Also note that pulls in higher gears can be useful here – you’ll accelerate gradually, which is good for logging resolution, and you’ll hit high load cells, although not at high RPM.

5.7) Road Dyno

When logging data for later use with a road dyno spreadsheet, you want to log very few parameters so that you can get the most resolution possible:

* Engine speed (this is the primary input to most road-dyno software)
* Vehicle speed (this will help you determine what gear the pull was done in)
* Throttle plate angle (so you can easily see where the pull starts and stops.

Road dyno logs should be done as pulls – see above for instructions.