Yamaha R1 Forum: YZF-R1 Forums banner

Software For Analyzing Air Fuel Ratio

1 reading
45K views 123 replies 25 participants last post by  sharan  
#1 ·
I have been looking for some Air/Fuel Ratio (AFR) software that are available as a standalone product and not only sold with a lambda sensor or logger. The reason is that I already have a datalogger and Wideband 2 commander on my bike. I log all AFR values into my datalogger, but lacked the possibility to analyze AFR data while on the track. Even if I have dyno’ed my bike there are always parameters that are different from dyno environment. Parameters like temperature, air humidity, air speed etc.

So I started the search to find software that could help me with the last 10% tuning of my bike on the track. :)

I downloaded quite a few products, but I didn’t find the features I was looking for. At the end my search resulted in two products that could work: Wego Log and EFI Analytics. First of all both lacked support for international decimal numbers in their import file formats and second they lacked the feature I was looking for.

To make this story short; The final result was that I sat down and made a Windows program myself, and my request to this forum is simple:

I have spent some hours making this program, and if there is any need on this forum for this software I can make it available at the forum free of charge and invest time to write a proper documentation.

Please let me know. If there is no interest I will not bother spending time on writing documentation. I know the software and it works perfect for my need. :)

Briefly about the software:
This software is for those who are either using an fuel adjustable ECU (YEC, FlashTune etc) or a piggyback device like PCV, Bazazz without Autotune

1) Define my target AFR for the whole RPM/Throttle range.
2) Import AFR logfiles and display the AFR data in a matrix
3) Calculate fuel adjustments based on target AFR
4) The import file is customizable and supports international decimal numbers.

Please take a look at the pictures, and give your respons.:)
 

Attachments

#2 ·
Very interesting software. Oddly enough I ran into similar trouble you did trying to find analyzing software capable of making automatic decisions regarding the fuel map. I developed a console based program that will import three fuel maps along with three data logs and use some math to estimate the next best fuel setting to try with the criteria for "best" being greatest acceleration. The output is a generated fuel map.

One trick I figured out with my program that may benefit your's was in generating the acceleration value table from the data log, or in your case the AFR table:

Let's say you RPM axis of the table increments by 250 RPM between rows. So you may have a row for 3000RPM and one for 3250RPM. Where should the AFR value at 3050RPM go? The answer is both rows. The majority of the value belongs in the 3000RPM row but some also belongs in the 3250RPM. You must use a sort of reverse linear interpolation to figure out what fraction of the value goes to each row and then also add that fraction to the number used in averaging the values in each cell. This is valid because the fuel map in your ECU or piggy-back will interpolation between cells to determine fuel setting. Therefore the fuel setting at 3000RPM and at 3250RPM both affect the fuel setting at 3050RPM. Perhaps you already have this implemented but I thought I would throw it out there.

I think you should make the program available to the forum. Once you get on the topic of data logging you are preaching to a smaller crowd but there are still some members on here that can make use of your program.
 
#3 · (Edited)
Very interesting software. Oddly enough I ran into similar trouble you did trying to find analyzing software capable of making automatic decisions regarding the fuel map. I developed a console based program that will import three fuel maps along with three data logs and use some math to estimate the next best fuel setting to try with the criteria for "best" being greatest acceleration. The output is a generated fuel map.

One trick I figured out with my program that may benefit your's was in generating the acceleration value table from the data log, or in your case the AFR table:

Let's say you RPM axis of the table increments by 250 RPM between rows. So you may have a row for 3000RPM and one for 3250RPM. Where should the AFR value at 3050RPM go? The answer is both rows. The majority of the value belongs in the 3000RPM row but some also belongs in the 3250RPM. You must use a sort of reverse linear interpolation to figure out what fraction of the value goes to each row and then also add that fraction to the number used in averaging the values in each cell. This is valid because the fuel map in your ECU or piggy-back will interpolation between cells to determine fuel setting. Therefore the fuel setting at 3000RPM and at 3250RPM both affect the fuel setting at 3050RPM. Perhaps you already have this implemented but I thought I would throw it out there.
Finally someone I can discuss these interesting things. :)

I agree that we probably are few that would like to analyze different sensor data collected into a datalogger, change bike settings based on the analyzed data and refine the riding style.

The problem you are raising do also apply for Throttle Position (TP). We also have to have a reasonable TP resolution. If you have TP between 20% and 30% where should you place the AFR data if the actual TP is 13%?

I solved the TP problem by defining a parameter ( %margin) a user can change themselves. If I set it to 10 that means that all TP values read from motorcycle within a range of 10% difference between actual and TP grid will be added to that row.

I totally agree that RPM values in between defined RPM-grid should be placed both sides of the actual RPM.

I will upload the software to the forum later today, and together with it some datafiles so those who are interested can play with.
 
#4 ·
:corn
 
#5 ·
In my program I did the same sort of reverse linear interpolation for the TPS as I did with the RPM. Your method is certainly better than relying on data points occurring exactly at your rows/columns, in fact it is basically the same way Innovate's LogWorks does it. However, for accurate results and maximum correlation between your data and generated maps, the method I use will give better results.

If there are few people interested in data logging, there are even fewer interested in making their own data loggers and analyzers. Glad to know i'm not the only one out there.
 
#7 ·
In my program I did the same sort of reverse linear interpolation for the TPS as I did with the RPM. Your method is certainly better than relying on data points occurring exactly at your rows/columns, in fact it is basically the same way Innovate's LogWorks does it. However, for accurate results and maximum correlation between your data and generated maps, the method I use will give better results.

If there are few people interested in data logging, there are even fewer interested in making their own data loggers and analyzers. Glad to know i'm not the only one out there.
Do you have any math formula you can share?

Maybe I should implement your formula and make the user select what calculation method to use.
 
#6 · (Edited)
Ok, here we go :)

Some instructions:
Attached is the ZIP file with setup program, unzip and run the setup.exe file. The setup program will install some additional files.

For regions that use "dot" as decimal separator use:
AFR Target Generic - US.csv - a afr target file made from the excel file with "dot" as decimal separtor.
DisplayLog00 US.csv - Log file from WB2 Commander with "dot" as decimal seperator.

For regions that use "comma" as decimal separator use:
AFR Target Generic.csv a afr target file made from the excel file with "comma" as decimal separtor.
DisplayLog01.csv - Log file from WB2 Commander with "dot" as decimal seperator.

In addition to above file there is also an Excel file:
AFR Target Generic.xls
The Excel file is a "master" for AFR Target. You can have whatever RPM/Throttle resolution you want. Change as needed and save it as a .CSV file from Excel. When you save the file Excel will save it with proper decimal separator based on your regional settings. The file you have saved can be read by the AFR Analyzer from the "Open Target AFR" button.

NB! All cells in your Excel matrix must contain data.

You can also modify your target AFR file within the program and save it with a new name.

Settings Tab:
If you are not able to read a file try to change field separator for import/target file.

"AFR Import field mapping"
You can read almost all type of text logfiles. The program needs minimum AFR, RPM and Throttle. I also added Time for future use.
Normally the fieldnames are in the first line of the logfile. Find the appropriate fieldname and type it in at "field mapping"

"Throttle"
Some lambda/O2 loggers do not give % on throttle position but 0-5volt. Here you can write 0-throttle voltage and max-throttle voltage and you can write your scaled value for % in min and max (scaled).

If you get % from lamba/O2 sensor then leave it as 0 and 100.

Throttle margin % is (+-) in order to add TP data into correct row. You can also see the hit-rate (records processed from the logfile) in the upper right corner based on this parameter.

Let me know if you find any bug or have suggestion for features.

Enjoy.
 

Attachments

#9 ·
Thank you Sharan for sharing something like this. A few years ago when I was tuning my PC3 with data-logs from my wideband commander I had to export the logs to a text file and change the PC3 map by hand. Very cool stuff. One question though. WB commander datalogs happen in 0.1 second increments. Has anybody figured the delay between the actual combustion and when the O2 sensor reads. I know there is a delay. Does the WB or your software take that into consideration?
 
#11 ·
Calculating the net rate of exhaust flow at the outlet of the exhaust manifold (by the O2 sensor) would be very complicated and affected by many variables. Also, the WB sensor does not instantaneously take readings so depending on conditions there is lag there too.

It does surprise me a little bit that the WB Commander only logs at 10Hz (0.1 second intervals). I guess if you think about it though, with that slow of a logging rate, the lag in the sensor WB sensor reading is minimal in comparison. So basically it wouldn't do any good to apply a correcting algorithm to the sensor readings to account for the lag as it's overall effect would be minimal at that logging rate.

While we're on the subject, if you are using a Power Commander to control fueling you really need to use a WB Commander for most the best correlation between data that is logged and cells in your fuel map. It is mostly due to the way the Power Commander measure engine RPM. It calculates it off of the injector pulses which do not start at a uniform crank angle so simply measuring the time between injector pulses does not necessarily give an accurate measure of engine RPM. Who knows what it any method they are applying in their software/hardware to combat this issue. For them it may not matter because regardless of how accurate their RPM measurement is, it always has 100% correlation with the cells in their fuel maps. Furthermore, most data logging devices will use a coil or tach wire which may or may not occur at a uniform crank position per pulse. The overall effect of this phenomenon may be minimal and not of concern in practical application, but it does exist and it is important to keep it in mind when tuning off of logged data.
 
#16 ·
I'm in. Been logging and tuning cars for years, and just now getting into doing my 09R1. I currently run a PCV with autotune. What software/hardware do you guys use to log?
I had Dynojet Autotune on my bike, but I removed it because it didn't provide analog 0-5volt signal for logging purpose.
Currently I'm using Dynojet Wideband Commander 2 for AFR, you can also use WB2 with PCV if you want to have autotune feature. It's strange that Dynojet don't provide this information on their website. It would be smarter for people to buy/use WB2 together with PCV than Autotune...

For datalogging I use Race Technology DL-1 (www.race-technology.com). I addition to AFR I also log:
RPM, Throttle, Brake pressure etc. with DL-1. DL-1 also have GPS so I can draw a map of the track with a lot of other features.
 
#15 · (Edited)
What is the point of this? You want something with real-time wide-band correction but dont like what's available?
Maybe the point is just to kill some spare time… :)

To give you some background:

When I started to dig into this I had PCV and Autotune on my bike. I wanted to get rid of the PCV because of two main hypotheses and two practical issue.

- ECU calculates fuel to injectors based on many parameters. Piggy-back products like PCV does not consider (some or all) engine parameters like the ECU. Piggy-back products like (PCV, Bazazz etc) manipulates the ECU signal at the end of a long process, which may not be right...
- Get rid of latency made by piggy-back products.

- The space on a bike is restricted, and I wanted to get rid of an extra box like PCV.
- A bike is not just about HP, but rideability.

I also flashed my OEM ECU to YEC so I could change fuel supply directly into the ECU.
Autotune did not provide analog (0-5volt) so I could log AFR values with a datalogger, but WB2 does. WB2 have exactly same functionality as Autotune.

On the track it’s important for me how the bike behaves – not only HP. By adjusting fueling you do change the behavior of the engine. In order to do that I needed AFR data. I could then analyze the data and make adjustments. If I can make the bike smoother into and out of corners I get much faster laptimes than just adjusting for top-end HP. The most important area for me to adjust for corner speed and smoothness is 1-25% throttle position, a area that we may not give so much attention on the street.

If my hypotheses are wrong I can always go back to WB2 and PCV and use the autotune features of PCV. Meanwhile it's fun & educating. :)

In other words - low budget practical research! :)
 
#20 ·
Thats why people create software. To cycle through logic they would otherwise cycle on their own. IMHO, a data analysis program is just about useless if the user must make individual changes manually. A good exercise to determine if what you are thinking in your head is valid is to try to make a program do it. Computers inevitably think only logically, we as humans do not always.?

Sent from my DROID4 using Motorcycle.com Free App
 
#21 ·
Nice Application.Although i have no experience with this kind of software and not much knowledge around tuning process i find it very useful.I'm searching for quite a while for a good but cheap wideband data logging system (i will only use it for myself,so i dont need any expensive equipment).I want to tune my bike for the mods i do (i already have a pc3).I found the wego 3.From what i understand this unit has no build in memory to save the data.What unit do i need to save all data logs that connect to the wego and is portable (as i will do the data logging on road)?

I'm sorry if i went off topic.Thanks
 
#22 ·
Nice Application.Although i have no experience with this kind of software and not much knowledge around tuning process i find it very useful.I'm searching for quite a while for a good but cheap wideband data logging system (i will only use it for myself,so i dont need any expensive equipment).I want to tune my bike for the mods i do (i already have a pc3).I found the wego 3.From what i understand this unit has no build in memory to save the data.What unit do i need to save all data logs that connect to the wego and is portable (as i will do the data logging on road)?

I'm sorry if i went off topic.Thanks
I went to Wego website and they have written that Wego III stores 2 hours of AFR, RPM and Throttle data.

Quote from their website:
"Versatile tuning aid for all carbureted and fuel injected engines displays air/fuel ratio (AFR) and logs over 2 hours data including AFR, engine RPM, and a spare 0-5V analog input for sensors such as throttle position or manifold pressure"
 
#24 ·
You also have option like:
Wideband Commander 2 with LCD-200. The LCD-200 have the option of storing the data on a memorycard. And you can use the software I uploaded to analyze the logfiles from LCD-200.

I believe that you can get a better price than retail price from Dynotjet. I bought my config from kyleusa.com, send a maile to dan(at)kyleusa.com and ask for a good price :)

If you don't need the storage on memorycard you can still use Wideband Command 2 with a gauge.

Take a look at the link for different options: http://www.dynojetwb2.com/wb2_complete_kits.aspx
 
#28 ·
hey Sharan, why don't you post the source code too so that I can convert it to Linux as I do not have Windows at home?
:jump
Damn, I have to start clean up my code before I ship it to you.:ncont:
Just a warning, this is my first coding in 15 years...

I have made the software in Visual Studio 2010, is it sufficient if I ZIP the complete VS 2010 project?
 
#35 ·
:corn to read through this, get the software running and bump an impressive effort by a forum member.:bow
 
#36 ·
For what it's worth I made a program that will also generate maps over any size based on logged data (RPM, TPS and AFR). Mine also incorporates statistical analysis to help increase the accuracy of the generated maps. The only downside is mine has no graphical user interface. But it gets the job done great.
 
#38 ·
I have recently purchased AEM Electronics 4 channel UEGO/Lambda controller.
With this controller I can log AFR values for each individual cylinder, this winter I will add individual cylinder support in the software.

This way I can analyze data from each individual cylinder and not only one lambda sensor mid/end of exhaust pipes.
 
#40 ·
Well, aside from the statistical analysis, my program does the same thing your's does as far as building fuel maps. It also do it based on what gear you are in and the fuel maps can have any number of rows and columns. I think one really important aspect is the way data is loaded up into each cell of the data table. It uses a weighted average when tps/rpm values fall between cells.

For the statistical analysis my program uses the 1.5iqr rule to eliminate obvious outliers and it also outputs a map of sample numbers, outliers eliminated and standard deviations.

Sent from Motorcycle.com Free App
 
#41 ·
My biggest pet peeve with the AT data is that it records everything. So it recorded engine breaking and fills it into the cells that are for just putting around or cruising. S you end up with whacked out cells. I think if I set up this data logger, I am going to see if I can set up a button so that I know which data was a "pull" rather than deceleration.

I bet that you could look at the log file and only use data where the RPMs are increasing or steady with each sample...or some logic like that.
 
#48 ·
Go to "Settings"
There you will see the section "Import file"

Select the correct decimal seperator "US" or "Euro".
US = . (dot)
Euro = , (comma)

You can also select correct field deliminator "Tab" or "Custom"
Type your correct field deliminator under "Custom"

If trouble upload a log file and I'll take a look :)

I don't know what version you are running. The latest version supports up to 4 lamba sensors and can also generate a PowerCommander V file with fuel changes.
 
#50 ·
I see why you are not able to make it work with your file.
The reason is that the logfile does not contain any "log time" data field.
The log file contains only: Throttle Position(TPS), RPM and AFR.

If you are able to save the AFR data with a log time that will solve it.
... or I can make a new version of the software to handle log files that does not contain log time...

I will also take a look at zeitronix website :)