![]() |
MatLab log analysis
I've been using MatLab to crunch my logfiles for a while now. Please post script examples that you find useful on this thread if you use MatLab.
Benefits: Fast, I mean properly fast. I can combine multiple scripts for analysis all at once (just loaded 112MB in 20 log files over 24.5 seconds). Drawbacks: Expensive, unless you work/study in an institution that you access the software through. Basic information including .csv loading and data filtering and binning scripts shared by nil5 on the Romraider forum. The scripts that I use are based on these and you'll need these scripts in the same folder that you run other scripts from if you want to use examples that I post: http://www.romraider.com/forum/viewtopic.php?t=7233 Tips: 1. Please note that you will need to make sure that the scripts match your logging parameter names which are case sensitive. 2. Use a revision number at the end of each logfile - it will make it easy to batch analyze a lot of logfiles together. Starting off: The load_csv.m script that I use (I think I found it somewhere on the Romraider forums, I am not smart enough to have written it). Put in the appropriate revision number for the files that you want to analyze before running it: Code:
clear I'll post examples later on in the thread. |
please continue
I love matlab, i think will be so helpful for tuners |
Trims for MAF scaling in CL example
1 Attachment(s)
Simple example: closed loop trims for scaling MAF
Load data using load_csv.m script Data needed for analysis: time, STFT, LTFT, MAF_V Data needed for filtering: ECT(Coolant temp), CL_OL status Code:
data = data0;Example trim plot: |
Have you seen VGI,s maf scaling utility ?
|
Knock analysis - quick and dirty
1 Attachment(s)
Script for high level log analysis - display IAM, FLKC, and FBKC in one place over however many logfiles you've loaded:
Code:
figure(1);Time to load files: 5.2 sec, plot processed in under a second: |
Selecting part of a datalog stack
To isolate a part of a log for more detailed analysis, you can use the data filter script that nil5 provided.
For example, to look at the FLKC data in the above example, you could set an index and then filter the data appropriately: Code:
%set index to the frames that you want |
Analyzing knock events - FLKC
2 Attachment(s)
Example code is for analyzing FLKC decrements.
FLKC as well as FLKC_Offset cell need to be logged with other parameters. The script identifies areas where FLKC has dropped without the offset cell changing, parses the data stack for samples pre and post FLKC decrement and plots whatever data that you want related to the knock event. Average FLKC at each decrement is returned in a matrix that is load and RPM binned appropriately (FLKC_mean in this example). Scripts for analyzing FBKC and IAM are similar but not as complex. Code:
% find discrete decreases in FLKC |
This makes me want to learn matlab some more
|
Quote:
|
Quote:
My logfiles are quite big and if you string a few drives together, you might need to be crunching many, many MB all together. |
Examining trims and DI flow
1 Attachment(s)
This example looks at adjustment of DI fuelling using the GDI flow table. Other tables can be used including GDI pressure target and GDI pressure multiplier.
When looking at the ROM disassimbly, a lot is indirectly referenced and quite difficult to pick apart. For the GDI flow table in the A01G ROM: X-axis is Fuel Pressure, FFF8936C is the RAM address for data used in the GDI Flow table Y-axis looks like a Direct Injector Pulse Width value, FFF887E8 is the RAM address for data used in the GDI Flow table (I log this as Direct_IPW_0). The return from the GDI flow lookup gets stored in FFF887EC and logs very closely with FFF887F0 (I believe this is Direct IPW). This script can be run in 2 states, I've only shown the first: 1. Combined PI : DI operation 2. Full DI Similar to MAF scaling with trims, this script only looks at closed loop operation. An error between the two can be calculated to see if PI activation skews anything, but I have not found that particularly useful. Code:
%reset dataset |
Calculating Volumetric Efficiency
1 Attachment(s)
This is a script to calculate your volumetric efficiency. Can be used to tune AVCS if you have a lot of time on your hands to maximize the amount of air running through your engine at a given rpm/load point.
Based on the romraider derivation at http://www.romraider.com/forum/viewtopic.php?t=8054 but using metric units that I log with. Code:
data = data0;Attached is stock intake and exhaust with Shiv's AVCS timing, you can see the torque dip in the VE plot. You can also see at low RPM when the throttle is cracked open, the MAF sensor reads air coming into the intake, but the engine speed hasn't responded by the time the line is logged leading to a falsely high VE. |
Port and DI duty cycles
2 Attachment(s)
There are a few assumptions made here.
See Kodename47's PI : DI thread for the assumptions I have made and formula derivations. Port injector duty cycle: Code:
%calculate Port IDCCode:
%calculate DI IDCFigures are Port and DI duty using stock Port injectors and stock PI : DI map (23% port duty, 65% DI duty at redline and 1.2-1.3 g/rev load): |
| All times are GMT -4. The time now is 11:49 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
User Alert System provided by
Advanced User Tagging v3.3.0 (Lite) -
vBulletin Mods & Addons Copyright © 2026 DragonByte Technologies Ltd.