Logging a wideband with TunerPro RT: Ford/QH

Introduction

Logging a wideband in TunerPro RT can be a little complicated because it requires simple algebra and a basic knowledge of how ADCs and widebands work.  While there are a few steps, it’s fairly straightforward.  The steps to do this are going to be virtually identical for all vehicles that TunerPro works with.  This article is going to examine the case of adding a Innovate wideband to a A9L computer but the steps could just as easily be (nearly) the same for using an O2 input on a TPI Camaro.  This article will NOT cover building a datalogging definition from scratch so you will need to start with an ADX that can already log the sensor you want to hook the wideband to, such as EGR or one of the factory O2 inputs.
First off – some “golden rules” to follow:

  • You should NOT touch the XDF.  All changes will be made on the ADX.
  • You will have to edit the bin/tune before starting this to disable the stock functions that use whatever input you are going to hook your wideband to.
  • Before starting, you should have the manual for your wideband handy with the voltage -> AFR data handy
  • Before starting, you will need to know how the ECU represents analog to digital (ADC) data.  (Most Ford = 10bits, most OBD1 GM = 8bits, Nissan varies by ECU in most cases 10bit)
  • Again, this guide will only cover adding wideband functions.  It will NOT cover creating a datalogging definition.

In our example, you will have to disable the EGR in the tune before hooking the wideband up or unpredictable things may result.  If you were using an O2 input instead of EGR, you would need to force the ECU into open loop permanently so the O2 sensors are never used for fuel feedback.

For the remainder of this guide, it will be assumed that you have your ducks in a row and you have the linear wideband voltage output of your wideband hooked to an available, compatible input on your ECU and that you have made any necessary changes to the bin/tune to ensure the ECU does not freak out.

TunerPro Datalogging Definition Internals

Before actually going through the steps involved, let’s look at how a value you can datalog happens.

Fire up TunerPro RT.  Go to the “Acquisition” menu and choose “Load Definition File” and pick a compatible ADX.

Then, “Acquisition… Edit Definition” and click the + next to “Values”

tprt adx wideband1
Next, choose the value that matches wherever you have the wideband hooked up (EGR, O2, etc.)  If the value isn’t yet defined, keep reading but understand that you’ll need to track down all the information that would be on the page.  (This generally involves talking to the person who wrote the definition or getting your hands dirty writing one)

tprt adx wideband pick a value
The crucial information on this page:

  • Title (not circled, at top of page) – this is the “name” of the item that you will see in datalogs
  • Unique ID (Blue) – this is a unique identifier for TunerPro.  It has no meaning other than being required to be UNIQUE among all Values you define.  NO DUPLICATES!!!
  • Packet Offset (Red) – this is where the value is located relative to the beginning of a data packet, or group of values retrieved at the same time
  • Source Data Size (Orange) – this is how many bytes TunerPro should look for in the packet at the Offset for this piece of data.  Note: this may be different from how the ECU represents the data unless the ECU is also using a byte or multiple of a byte sized chunk.

Signed/LSB (Green) – this is information about how the data is represented.  This needs to be correctly configured for the data item by whomever wrote the ADX.

After taking note of these values, click the “Conversion” tab (Circled in Yellow in above picture)

tprt adx wideband value conversion
The conversion tab controls how TunerPro gets from the “raw” value that you’ve specified on the “General” tab with the Offset, Size, Data type and changes it into the value you actually see.  At the top, the “Equation” visible defines the math relationship between the raw data and what you actually see.  You can click the ‘Set’ button to change the equation.

You can also specify a transfer function for further conversion of data by looking up raw data within the transfer function to get a result.  This is most often used for things like Air Temperature sensors which have an extremely non-linear output that is hard to fit with a formula.  We are NOT going to cover this further but you should be aware of this function should you have a wideband with non-linear output.

At this point, you’ve seen behind the scenes of how TunerPro handles data logging.

Configuring Wideband Logging

After having a brief tour of behind the scenes of TunerPro logging, you should still be really confused about how exactly to log a wideband.  There are several ways to get a wideband outputting a 0-5v signal to work with TunerPro:

  • Edit the existing item corresponding with where the wideband is physically hooked up to use a formula that matches the scale of the wideband.  This essentially “deletes” the original senor and permanently changes it to wideband readings.
  • Create a “duplicate” item with a new unique ID that uses the same Offset, Size, Data type as the value corresponding with where the wideband is physically hooked up.  Createa formula to match the output of the wideband.  The original sensor AND the new wideband value will both be available.
  • Create a new item with a unique ID that has nothing defined in the data packet but instead uses a linked input where the input is the existing channel data where the wideband is hooked up.  The original sensor AND the new wideband value will both be available.

There are advantages and disadvantages to each of these approaches.  There isn’t just one “right” way of doing things.  Instead of trying to cover everything, we are going to cover creating a “duplicate” item because this method allows us to work with the raw sensor data when building formulas.  Arguably, this is one of the better ways of handling things because you start with RAW data from the ECU, before it has been wrung through god only knows what other formulas.   In the interest of keeping things simpler, we are going to assume that the wideband is putting out a *linear* output.  The original sensor AND the new wideband value will both be available.

Now, it’s time to gather some information:

  • Raw datalogged ECU value at 0V input
  • Raw ECU value at maximum input voltage
  • ECU maximum input voltage
  • Number of steps in ECU’s ADC.
  • Wideband AFR value at 0v
  • Wideband AFR value at maximum output voltage
  • Wideband maximum output voltage

You should be able to consult documentation to find “theoretical” values for most of these.  (Note: reality is a bitch and you may need to further tweak “literature” values).  It is generally a good guess that a raw logged value of “0” corresponds with 0 volts.  It is a good guess that the largest number able to be represented by the ADC of your ECU corresponds with 5 volts.  i.e. for a 10 bit ADC, 2^10 = 1024 but we start counting at 0 not 1 so 1023 is the maximum value.  For a 8 bit ADC, 2^8 -1 = 255.  Almost all widebands specify their AFR output at 0V and 5V but you should still carefully pay attention to how these values are specified.

At this point, it’s simple algebra…  Y = mX + b

  1. Calculate Wideband AFR range. (Wideband AFR max – Wideband AFR min).  This gives you “rise”
  2. Calculate Wideband voltage range. (Wideband spec max volts – Wideband AFR min). This gives you “run” and is usually “5.0”
  3. Calculate the ADC voltage range.  (Subtract the max ADC voltage from the minimum ADC voltage)  This is usually “5.0”
  4. Calculate the change in AFR per raw ADC tick by dividing the result from #1 by the ADC value range that the ECU can generate (i.e. 1023, 255, 4095, etc.)
  5. Calculate the corrected AFR per tick, if necessary.  If the values from #2 and #3 are not the same (common on Nissan – 5.12v max not 5.0v), you will need to multiply the AFR per ADC tick (#4) by Wideband Voltage Range (#2) divided by ADC Voltage range (#5)
  6. The equation to plug in to TunerPro to convert raw data will be (X * Corrected AFR/tick) + (AFR at 0 volts)

Concrete Example: A9L with Innovate MTX-L

In this case, we’re going to pretend that we are using an Innovate wideband with a A9L ECU.  First off, we need to create a “clone” of the channel we are going to hook the wideband to, in this case EGR Valve Position.  Look at the original:

tprt adx evp and new

Next up, we need to click “Add New Item” (circled in Red) to make a new item and fill it out with the same information as the original EGR Valve Position but with a DIFFERENT unique name.  In this example, you can see I chose a meaningful title (i.e. the name of the item you’ll see in a list while logging) and a minimal description:

tprt adx wideband clone2

In order to figure out how to set up the ‘Conversions’ tab, we need to do math.  Going back to the previous section, our answers to the important questions are something like this (with an explanation of how we know in parentheses):

  • ECU value at 0v = 0 (good guess)
  • ECU value at maximum input voltage = 1023 (10 bit ADC maximum value, knowledge of ECU hardware)
  • ECU maximum input voltage = 5.0 V (good guess, knowledge of ECU hardware)
  • Wideband value at 0v = 7.35 AFR gasoline (page 4 of MTX-L manual)
  • Wideband value at maximum output voltage = 22.39 (page 4 of MTX-L manual)
  • Wideband maximum output voltage 5.0v

Armed with this information we can do math:

  1. Max AFR – Min AFR = AFR range.  22.39 – 7.35 = 15.04
  2. Wideband Max spec voltage – Min spec voltage = Wideband volt range.  5V – 0V = 5V
  3. ADC Max spec voltage – ADC min spec votlage = ADC volt range. 5V – 0V = 5V
  4. AFR/tick = 15.04 / 1023 = 0.0147018572825024
  5. Result #2 and result #3 are the same so no further correction is required
  6. Equation for TunerPro RT = (X * 0.0147018572825024) + 7.35

tprt adx conversions equation

Phew.  Save.  Go log your minty fresh wideband.

Reality Bites

As was mentioned earlier, reality can often differ considerably from how things “should” be.  So far, you’ve only managed to configure TunerPro for how things “should” be.  Analog to Digital Converters are plagued with issues that affect accuracy.  (Most of them can be solved/greatly improved in the analog realm by having the ECU and Wideband grounded at the same location.)  However even with the best of installs, it’s still very common for things to not end up quite as they are supposed to.  Fortunately, there are a few simple things that you can do to try and increase accuracy:

  1. The first step is going to be to make a data item for the ADC channel the wideband is connected to that displays the “raw” channel value – this can be done by changing the item’s formula to simply “X” with no further math.
  2. Next, try to get the wideband to display the LEANEST mixture (i.e. maximum AFR) that it possibly can.  This can usually be accomplished by letting the sensor hang in free air.  When the wideband is pegged lean at its maximum voltage output, observe the raw ADC reading for the channel it is hooked up to and the reported AFR of the wideband.  It is not uncommon for the voltage from the wideband to fall a few tenths of a volt (and corresponding ADC tick difference) short of the theoretical maximum voltage.
  3. Next, try to get the wideband to display the RICHEST mixture (i.e. minimum AFR) that it possibly can.  This can usually be accomplished by flooding the sensor tip with a torch (doesn’t have to be lit), CO2 / argon bottle, etc. to displace ALL oxygen.  When the wideband is pegged rich to its minimum voltage output, observe the raw ADC reading for the channel it is hooked up to and the reported AFR of the wideband.  It is NOT uncommon to see a couple tenths of a volt (and the corresponding ADC ticks) in the form of a ground offset.
  4. Compute the difference between the observed minimum and maximum ADC values.  It will likely be less than the “theoretical” maximum, i.e. 255, 1023, 4095, etc.  Re-calculate the slope based on (Displayed AFR Max – Displayed AFR min) / (observed ADC max – observed ADC min)
  5. This process boils down to the same thing as the “paper” version above but instead of making assumptions about how things “should” be you are taking measurements of how they really are.  Using “real” values versus theoretical values can often make the values you log match more closely with the values on the gauge.