1. Welcome to Tacoma World!

    You are currently viewing as a guest! To get full-access, you need to register for a FREE account.

    As a registered member, you’ll be able to:
    • Participate in all Tacoma discussion topics
    • Communicate privately with other Tacoma owners from around the world
    • Post your own photos in our Members Gallery
    • Access all special features of the site

Interpreting ignition timing results

Discussion in 'Performance and Tuning' started by soggyBottom, Jun 25, 2023.

  1. Jun 25, 2023 at 10:56 AM
    #1
    soggyBottom

    soggyBottom [OP] Well-Known Member

    Joined:
    Sep 19, 2018
    Member:
    #266818
    Messages:
    1,937
    I just did a recording using VFtune that gave me some data I was not expecting. My current tune is the stock 87 octane tune. I'm currently at 6600 ft of elevation and have 85 octane in the tank. It's 21c (70f), 50% humidity. I expected the 85 to be roughly equivalent to about 88 or 89 at sea level.

    Comparing VFtune ignition timing of regular vs 91, at 82% load and 4200rpm. Note that I was flooring it, I think the 82% is due to lower pressure since I'm at 6600ft.
    • Regular: 16.00 deg
    • 91: 17.03 deg

    I'm currently seeing 23 degrees, and it's roughly the same across the entire RPM band. Am I reading this wrong or is the elevation making a larger impact than I was expecting? What could I be missing?

    :::EDIT:::
    here is some of the data. I don't see any difference between the 91 and stock tune when running 85 at 6600 feet. There is quite a difference between 85 and 91 with almost no time at all for the ecu to "learn" the new fuel. Finally, the 4th column. I reflashed the ECU 1 more time after filling up with 91 trying to give the ECU the best chance at "learning" the new fuel. The changes here seem like they are within the margin of error.

    Conclusion, 91 does make a difference at 6600ft. How much real world? idk, I don't have a dyno.

    upload_2023-6-25_13-38-19.png
     
    Last edited: Jun 25, 2023
    Jon64l and Sunsetsearider like this.
  2. Jun 25, 2023 at 11:14 AM
    #2
    JustDSM

    JustDSM Oderint Dum Metuant

    Joined:
    Jan 16, 2015
    Member:
    #146525
    Messages:
    3,207
    Gender:
    Male
    First Name:
    Justin
    Ogden, UT
    Vehicle:
    2023 Ford Raptor
    Some good discussion could come from this! Kudo's to you for taking a dig into this.

    Post up your log so we can get a better picture of what you're referring too.
     
  3. Jun 25, 2023 at 11:16 AM
    #3
    soggyBottom

    soggyBottom [OP] Well-Known Member

    Joined:
    Sep 19, 2018
    Member:
    #266818
    Messages:
    1,937
    I'm going to get a little more data, then post logs. in the mean time, I just flashed it to 91, ran it again and I'm seeing 21 deg at the same point.
     
  4. Jun 25, 2023 at 11:17 AM
    #4
    TnShooter

    TnShooter The TacomaWorld Stray

    Joined:
    Sep 2, 2010
    Member:
    #42625
    Messages:
    20,851
    Gender:
    Male
    First Name:
    Deogee
    Vehicle:
    07' TRD Off-Road, Auto
    STOCK
    It’s not all about octane.
    Atmospheric pressure, Air density and more affects the total timing.
    Ignition happens “slower” at high altitude, which means you can start ignition (timing) sooner.
     
  5. Jun 25, 2023 at 12:43 PM
    #5
    soggyBottom

    soggyBottom [OP] Well-Known Member

    Joined:
    Sep 19, 2018
    Member:
    #266818
    Messages:
    1,937
    I added logs.
     
  6. Jul 2, 2023 at 4:42 AM
    #6
    Tech708CC

    Tech708CC Well-Known Member

    Joined:
    May 23, 2020
    Member:
    #329038
    Messages:
    75
    Gender:
    Male
    Vehicle:
    2020 trd off-road
    Ignition timing on these engines is very critical in getting them to perform like they should.
    You need to look at kclv and knock feedback when observing total Ignition timing.
    Kclv and knock feedback will give you a glimpse as to what is going on overall.
     
  7. Jul 2, 2023 at 6:51 AM
    #7
    soggyBottom

    soggyBottom [OP] Well-Known Member

    Joined:
    Sep 19, 2018
    Member:
    #266818
    Messages:
    1,937
    I don't fully understand kclv or knock feedback. The way I think it works is that there is the base timing which is modified by kclv and knock feedback to get to the final "ignition timing cylinder 1".

    One more question about kclv and kfbv. To simplify my question, let pretend we have a 2d base map for a given load e.g. 100%. Let also assume our base map was perfectly tuned across the entire rpm range except for 5000rpms where the base timing was advanced 5 deg too much. Knock would be detected and through knock f/b and kclv, the actual timing would be reduced by 5 deg. Does this mean that for the rest of the rpm range, the timing is now 5 deg retarded from what is optimal?
     
  8. Jul 2, 2023 at 8:19 AM
    #8
    ktbell444

    ktbell444 One who throws exceptions

    Joined:
    Aug 8, 2017
    Member:
    #226306
    Messages:
    2,969
    Gender:
    Male
    ᚺᛖᛚᚺᛖᛁᛗ
    You're basically correct for your ignition timing calculation.

    Ignition timing = Most retarded base value (from the maps that tunes edit) + KCLV + KFB

    So if we use the following example:
    Base map = 20°
    KCLV = 17°
    KFB = -3° (normal, no knock & no advancement)

    Ignition timing = 20 + 17 - 3
    Ignition timing = 34°


    For your 2nd question, it is possible. KFB immediately adjusts for current knock conditions. If KFB is < -4, KCLV will slowly decrease, and if KFB is > -2, KCLV will slowly increase. KCLV is always added to ignition timing, but KFB in certain parts will affect that KCLV value that is used everywhere.

    In your example, 5° too much would likely put the truck into a -8 KFB, which will start to drop KCLV, thus retarding timing overall. But if there's an area (using your example let's say 1200 RPM's) where KFB is 0, then you will see KCLV start climb again.

    So, basically put, yes, KCLV will drop and stay at a smaller value if there are no other areas where KFB says KCLV can climb back up. And since KCLV affects the final ignition timing value, it can affect the entire range.
     
    PhoS and soggyBottom[QUOTED][OP] like this.
  9. Jul 2, 2023 at 9:36 AM
    #9
    soggyBottom

    soggyBottom [OP] Well-Known Member

    Joined:
    Sep 19, 2018
    Member:
    #266818
    Messages:
    1,937
    Thanks for the great explanation. I have a couple more questions.

    What is the typical tuning process? Do you just use the actual ignition timing or do you use kclv and kfb to see where knock is occuring and just adjust those cells?

    When looking at the vftune maps, why do the base maps have so much timing e.g. 69 at low loads? I don't remember the exact RPM why do the vftune maps no change timing under about 2000 rpms?

    Where is a good place to go for questions like these.i know there is some good info on TW but is there somewhere else you would recommend?
     
  10. Jul 2, 2023 at 10:58 AM
    #10
    ktbell444

    ktbell444 One who throws exceptions

    Joined:
    Aug 8, 2017
    Member:
    #226306
    Messages:
    2,969
    Gender:
    Male
    ᚺᛖᛚᚺᛖᛁᛗ
    Use everything to your ability, but KFB will be a great indicator of when something needs adjustment. Keep in mind, there are a lot of variables that affect knock. AFR and compression ratio (which is/can be affected by valve timing) for example. There are also multiple ignition timing maps, as I'm sure you have seen. Some maps are for lower octane, some for higher octane, some for the "base" ignition, some for port injection, and some for direct injection. So it would be good to monitor those other parameters as well to know which map(s) need adjustment. If your AFR is off, you obviously shouldn't be adjusting your ignition timing, you should focus on the issue at hand.

    There are a lot of variables that affect what you see. Temp and airflow play some major roles.

    There are a lot of resources online. You can use the wayback machine to reference the vf tuner forums (linked the most recent snapshot) as well as here for some of the logic that Toyota used. To understand how something like AFR affects knock and/or ignition timing, almost any training course on tuning will be beneficial.
     
  11. Jul 2, 2023 at 4:10 PM
    #11
    soggyBottom

    soggyBottom [OP] Well-Known Member

    Joined:
    Sep 19, 2018
    Member:
    #266818
    Messages:
    1,937
    I decided to try something out today. I had to make a 2 hour drive so I data logged the entire trip. I wrote a short python script to try and auto generate a new base map, based on the 2hour drive. I haven't tried the new map yet.

    upload_2023-7-2_17-4-2.png

    Basically I took my data logs and binned them by the load and RPM +/- 15%. got rid of outliers, then used the mean of the remaining values to create a new table. @ktbell444, as you pointed out in your last post, it's more complicated than this, but I wanted to try this as a proof of concept. My hope here is that kfb will stay as close to -3 as possible.

    Here is the code.
    If anyone wants to run it, install anaconda python from https://www.anaconda.com/download. You'll need to change the "working_dir" to the path where your csv files are along with the names of the files in "FILES". Once run, it'll output "out.csv" which contains the new base map.

    Code:
    import os
    import pandas as pd
    from scipy import stats
    from mpl_toolkits.mplot3d import Axes3D  # noqa: F401 unused import
    # Define the file path to the csv files
    working_dir = "c:/Users/<user>/Documents/vf_tuner/"
    FILES = [
        os.path.join(working_dir, '111.csv'),
        os.path.join(working_dir, '112.csv'),  
        os.path.join(working_dir, '113.csv'),  
        os.path.join(working_dir, '114.csv'),  
        os.path.join(working_dir, '115.csv'),  
    ]
    # Merge 111, 112, and 114
    df1 = pd.read_csv(FILES[0])[['Engine Speed', 'Vehicle Load', 'Ignition Timing Cylinder #1']]
    df2 = pd.read_csv(FILES[1])[['Engine Speed', 'Vehicle Load', 'Ignition Timing Cylinder #1']]
    df4 = pd.read_csv(FILES[3])[['Engine Speed', 'Vehicle Load', 'Ignition Timing Cylinder #1']]
    df = pd.concat([df1, df2, df4])
    print(df)
    def remove_outliers(df):
        z_scores = stats.zscore(df['Ignition Timing Cylinder #1'])
        # Define a threshold for outliers (e.g., Z-score greater than 3 or -3)
        threshold = 3
        # Filter out the rows where the Z-score exceeds the threshold
        filtered_df = df[(z_scores < threshold) & (z_scores > -threshold)]
        print(filtered_df)
        return filtered_df
    def filter_set(df, min_speed, max_speed, min_load, max_load):
        return df[
            (df['Engine Speed'] >= min_speed) &
            (df['Engine Speed'] <= max_speed) &
            (df['Vehicle Load'] >= min_load) &
            (df['Vehicle Load'] <= max_load)
        ]
    rpm_list = [500, 550, 570.312, 600, 650, 800, 1000, 1200, 1400, 1600, 2000, 2400, 2800, 3200, 3600, 4000, 4400, 4600, 4800, 5200, 5600, 6000, 6400, 6600]
    load_list = [4.58333, 9.1666, 13.7499, 18.3333, 22.9166, 27.4999, 32.0833, 41.2499, 45.8333, 54.9999, 64.1666, 73.3333, 82.4999, 91.6666, 100.8333, 109.999]
    out = open(os.path.join(working_dir, 'out.csv'), 'w')
    for rpm in rpm_list:
        for load in load_list:
            min_rpm = rpm - rpm * .15
            max_rpm = rpm + rpm * .15
            min_load = load - 5 #load * .25
            max_load = load + 5 #load * .25
            mean = filter_set(df, min_rpm, max_rpm, min_load, max_load)['Ignition Timing Cylinder #1'].mean()
            rounded_mean = round(mean, 2)
            print(f"{rpm},{load} --> {rounded_mean}")
            out.write(str(rounded_mean))
            out.write(',')
        out.write('\n')
    out.close()
    
     
    PhoS and ktbell444 like this.
  12. Jul 2, 2023 at 4:17 PM
    #12
    ktbell444

    ktbell444 One who throws exceptions

    Joined:
    Aug 8, 2017
    Member:
    #226306
    Messages:
    2,969
    Gender:
    Male
    ᚺᛖᛚᚺᛖᛁᛗ
    Code looks pretty good, but I'd add some error handling, in the event someone does attempt and it breaks on them.
    Also, I believe there is a difference between "engine load" and "vehicle load" parameters. It has been a while for me, so you may want to check before applying your new map.

    Edit:
    I also don't see any adjustments for KCLV or KFB in there when building your final map. Trying to play it out in my head and I think that should be taken into account. Shouldn't be too challenging to add those as well.
     
    Last edited: Jul 2, 2023
  13. Jul 2, 2023 at 7:32 PM
    #13
    soggyBottom

    soggyBottom [OP] Well-Known Member

    Joined:
    Sep 19, 2018
    Member:
    #266818
    Messages:
    1,937

    Just went for a ~10min drive and the tune seems to work. Around 1600 rpms there is a spot that could use some improvement but everything else seems dead on. I suspect I didn't have enough data for ~1600 rpms when I created the model with the code above.

    upload_2023-7-2_20-28-51.png
     
    PhoS and ktbell444[QUOTED] like this.
  14. Jul 2, 2023 at 7:39 PM
    #14
    ktbell444

    ktbell444 One who throws exceptions

    Joined:
    Aug 8, 2017
    Member:
    #226306
    Messages:
    2,969
    Gender:
    Male
    ᚺᛖᛚᚺᛖᛁᛗ
    If your worst is -5, that's not bad at all. It is complicated to fill in all the data necessary.
     
  15. Jul 6, 2023 at 12:38 PM
    #15
    soggyBottom

    soggyBottom [OP] Well-Known Member

    Joined:
    Sep 19, 2018
    Member:
    #266818
    Messages:
    1,937
    I got some new data. The data below is just filtering out the data logs by load, rpm, and injector cylinder #1 port.

    In my previous post, there were a couple dips down to about -5 on the KFB. I did some more logging and found that whenever the KFB drops, the "Injector Cylinder #1 port" also spikes. With values greater than 4000uS, KFB is good, otherwise the KFB drops. Both the Injector cylinder port and (D4) are measued in micro-seconds. I think this means that the port injector is reducing flow and the d4 which im assuming is the direct injection is increasing flow. I suspect this is a symptom, not a cause. thoughts?

    upload_2023-7-6_13-27-19.pngupload_2023-7-6_13-33-42.png
    upload_2023-7-6_13-32-21.pngupload_2023-7-6_13-35-59.png
     

    Attached Files:

  16. Jul 6, 2023 at 3:49 PM
    #16
    ktbell444

    ktbell444 One who throws exceptions

    Joined:
    Aug 8, 2017
    Member:
    #226306
    Messages:
    2,969
    Gender:
    Male
    ᚺᛖᛚᚺᛖᛁᛗ
    Not sure if you can log port or direct injection within vF, but there is a parameter that exists which would tell you what injectors are being used (Port, DI, or both).
     

Products Discussed in

To Top