وقتی گاز رو تخته کردیم تو آخرین مپ ویلیام یه کوچولو طول کشید afr بره رو ۱۱٫۹ یعنی وقتی از close loop سوییچ کردیم به open loop کمی تاخیر داشتیم.
این ادم میگه میشه تیونر کاری کنه همیشه عدد delay محاسبه نشه و صفر بمونه.
[Updated and corrected 5/5/2013]
Greetings,First off, Those of you who are familiar with late model subaru ecu tuning won’t be surprised by anything i found or have to say.. so may bee a quick “hey post some numbers” in the innovate supercharger thread would be a better use of your time than this thread will be
For those who are still with me….
Let me start with what lead me down the path i am about to explain. After working with BRZedit for a week or so i made my first trip to the dyno and did my initial all stock tune… Results were not bad.. I posted about it here
.After driving on the new tune for a couple of days I noticed that my WOT AFR’s were not consistent… high 12’s would become low 12’s .. sometimes for a portion of the rpm range, sometimes all the way through redline. I would make some adjustments, flash it, drive it, felt great, next day back to nasty rich again wot.So, I took a closer look at my logs and noticed my fuel trims looked horrible. Keep in mind this is a completely stock car with less than 1,000 miles on it at the time. Also, long term fuel trims DO apply under WOT. The ECU seems to have 4 trim zones, each can have a different value. The zones are broken down by grams/sec as measured from the maf.Here is one of my logs displaying average short term fuel trims over the entire log (about 20 minutes of mixed driving from fully warm):
and from the same log, the average long term fuel trims:
Yep, that’s nasty. Add 10% fuel when your AFR is tuned for 12.8:1 and you get richer than 12.1:1.. NICE As I did some more logging i noticed that I could induce big long term trims very easily by holding part throttle about 4,000 rpm… like i was waiting for a break in traffic to shove the go pedal through the floor.. not that i have ever done that. So, I cam to two conclusions:
۱٫ The stock ecu, like many other late model subaru ECU’s like to hold Closed loop way longer than i want it to.
۲٫ The stock maf scaling does not work worth a crap for my car. (I had already checked for post maf leaks, filter issues, maf housing issues etc etc)
* A quick side note, there may be some variations in the stock maf housings causing some cars to like the stock maf scaling more than others, or maybe the sensors themselves have some wide tolerances form the factory.. I don’t know. But I do think the issue with my car is why some people have horrible luck with after market intakes. It would probably only take a day for me to throw a CEL if i put an intake on that leaned out the car any more without re scaling the maf.
Closed to Open loop transition:
Here is an excellent write up of how subaru handles the closed to open loop transition on late model WRX’s. I used this as the basis for the changes i made after I read it several times and matched up the tables talked about to the ones in BRZedit. Since we all love pictures.. here are most of the tables in the stock rom that control transition out of closed loop an into open loop:
||This image has been resized. Click this bar to view the full image. The original image is sized 1024×662.
A few important things to note:
- It is reported that the closed loop delay interval units are 10 milliseconds each (so a delay of 100 is about 1 second)
- The LAST thing checked before dropping into open loop is the requested AFR from the fule map
Long story short, you can bypass all the timers and force the transition to be based completely on your fuel map by setting the delay timers to 0, since the last thing the ecu checks when deciding to transition from closed to open loop is the requested AFR. If the requested AFR is richer than the Minimum Open Loop AFR the ecu drops into open loop mode.
[New info 5/5/2013]
With continued logging, testing, and tuning.. I noticed that many times the target AFR in closed loop mode was not 14.7:1 but actually a bit richer like 14.3 or 14.5 for example. It appears the ecu uses the Closed Loop AFR A & B tables to determine the closed loop target AFR. Here they are next to the stock fuel map.
||This image has been resized. Click this bar to view the full image. The original image is sized 941×582.
Interestingly, it does not seem to target the exact value in either table (I assume one table is cold, the other is hot) but rather some where in the middle between the 14.7 and the values in these tables. It’s possible that what i was seeing was interpolation between the two tables based on coolant temp and the target value does 100% come from these two tables.
If you set the Closed Loop Target A & B table values to 14.7:1 you end up turning off long term fuel trims all together. I only did this AFTER setting the transition timers to zero. In my case, i can set the entire closed loop target maps to 14.7 without worry because my transition to open loop is only based on the fuel map target afr. In other words, I will never be in closed loop with a target AFR lower than the Minimum Open Loop AFR value. If you want to keep your timers in place but still want to turn off long term trims, i would suggest you make the Closed Loop Target A & B tables mirror your fuel map. You will need to change some of the x and y axis values to do so.
When i started testing, i had hopes that the Long Fuel Trim Minimum and Maximum would actually allow you to set the max and min values for the long term trims. In theory this would allow you to use enough long term trim to compensate for changes in ethanol content, supplier to supplier variation etc, without destroying your tuned WOT AFR. Sadly, these two values do not seem to have ANY effect, at least with my rom. The stock value for the factory rom from my car was +/- .40 which i assumed was +/- 40%. To date, regardless of what value i use in these tables, if the long term trims are enabled, they get set without regard to the max and min values.
[End New info]
here is how i currently have my transition tables setup (anywhere the fuel map is leaner than 14.5 I’m in closed loop, anywhere it is richer than 14.5 i am in open loop:
Re Scale the Maf:
I still find it hard to believe i had to do this on a stock car but i did. I’m going to reserve the second post for a how to on maf scaling because i think may people would benefit from a re scale.
I would like to than @epifan for making a few changes per my request so that we can now log maf voltage directly. This makes re scaling the maf very simple to do… but I will save the how to for another day. For now the results:
current map’s average short term fuel trims from a 30 minute log:
Long term from same log:
As an added bonus, my fuel map is now very close to the actual logged AFR.. I’m typically within 2.5% of the target AFR at WOT now. There are still a few places that need cleaning up and i think the few places you still see trims over +5% are due to needing a little bit more acceleration enrichment… it seems the trims are kicking in to provide the enrichment with smallish throttle changes.
The basic steps for determining the transition from closed loop to open loop are as follows:
- If the current ‘CL to OL Delay’ value is zero, skip to the last step. Some tables (‘CL Delay Maximum…”,”CL Delay Minimum…”) will clear the delay if any one of those table’s thresholds are met having the same effect.
- If the current delay is non-zero, the ‘CL to OL Transition with Delay (Throttle)’ and ‘CL to OL Transition with Delay (Base Pulse Width)’ will be involved in determining the potential transition, in addition to the last step.
- A counter is incremented when either the throttle or base pulse width (BPW) thresholds for the tables above are continuously exceeded, otherwise the counter is reset to zero.
- If the counter reaches the current delay value, then the transition from CL to OL will potentially occur depending on the last step.
- The last step is always dependent on the primary open loop fuel enrichment. If the ‘Primary Open Loop Fueling’ desired AFR is richer than the “Minimum Active Primary Open Loop Enrichment” value AND this value calls for enrichment after the ‘Minimum Primary Open Loop Enrichment (Throttle)’ and ‘Primary Open Loop Fueling Compensation (Coolant Temp)’ are applied, then the transition from closed loop to open loop will occur.
‘CL to OL Transition with Delay (Throttle)’ and ‘CL to OL Transition with Delay (Base Pulse Width)’ tables
۱۶-bit and 32-bit ECUs
If the current delay is greater than zero (any non-zero value -> even 1), these tables will be used to potentially determine the closed loop to open loop transition (and vice versa). If either (or both) table’s thresholds are exceeded, then a counter is incremented from zero. As long as either (or both) thresholds are continuously exceeded, the counter will be incremented by 1, otherwise it will be reset to zero. When this counter’s value is equal to or exceeds the current delay value, then fueling will potentially switch to open loop depending on the primary enrichment value (see last section). When throttle and BPW are both below the tables’ thresholds (hysteresis) then the counter is reset to zero and you potentially enter closed loop, again, depending on the primary fuel enrichment. You can briefly exceed the thresholds in either table and if the delay is high enough, you might not switch to open loop (the counter would be reset to zero).
However, if the current delay is zero, these tables are effectively disabled and not used. In this case, the primary fuel enrichment alone is used to determine the transition (see last section).
‘CL to OL Delay’ table
The ECU selects one of the delay values from the ‘CL to OL Delay’ table at any given time. The basis for which value is chosen can vary widely among ECUs. The higher the delay, the longer the “CL to OL Transition with Delay” throttle OR base pulse width thresholds will have to be exceeded before a potential transition from closed loop to open loop can occur.
The ‘CL to OL Delay’ data consists of 16 values, in 4 groups of 4 (A1-A4, B1-B4, C1-C4, D1-D4 in RomRaider). When a delay is called for, only 1 of the 4 groups is used and then one value from that group is selected for the delay per execution. Groups are chosen as shown below for these specific ECUs:
example USDM 02/03 WRX (factory values):
Group A Delays – 366, 2075, 1098, 122 – Automatic transmission and atmospheric pressure < 13.38 psi
Group B Delays – 122, 976, 488, 366 – Manual transmission and atmospheric pressure < 13.38 psi
Group C Delays – 366, 2075, 1098, 366 – Automatic transmission and atmospheric pressure >= 13.54 psi
Group D Delays – 122, 732, 366, 3662 – Manual transmission and atmospheric pressure >= 13.54 psi
Note: The atmospheric pressure thresholds are determined by the ‘CL Delay Throttle Atmospheric Pressure Thresholds’ table which also is the deciding factor for the atmospheric pressure related max throttle table for automatic transmissions. 13.38-13.54 psi is the hysteresis range.
example USDM 04/05 WRX (factory values):
Group A Delays – 366, 2075, 732, 732 – Automatic transmission
Group B Delays – 366, 732, 366, 366 – Manual transmission
Group C Delays – 366, 2075, 732, 732 – Effectively disabled from the factory (based on coolant temp threshold that would never be reached)
Group D Delays – 366, 732, 366, 366 – Effectively disabled from the factory (based on coolant temp threshold that would never be reached)
So, essentially, the ECU is only dealing with 1 group of 4 of the 16 values. When this part of the code is executed, only one value is chosen for the delay. Which one of the 4 depends on how long since the engine was started. A counter counts off about 1 per second. Starting at the first value, every 2 minutes or so, it skips to the next value until it uses the last (4th) value from then on.
A lot more variation among different ECUs as far as which delay is used by the ECU. As with the 16-bit ECUs, only one of the delay values is factored in at any one time.
‘CL Delay Maximum…’ and ‘CL Delay Minimum…’ tables
۱۶-bit and 32-bit ECUs
The following tables have only one function. If any of these individual table’s high value is exceeded (or below the threshold for the coolant temp table), the current delay becomes zero, regardless of the ‘CL to OL Delay’ table. These can be thought of as extremes where you do NOT want the transition influenced by the ‘CL to OL Transition with Delay’ throttle and base pulse width tables, but instead solely by primary fuel enrichment. Note: If the ‘CL to OL Delay’ values in your tune are all zero, then these tables will effectively do nothing.
- ‘CL Delay Minimum Coolant Temp’
- ‘CL Delay Maximum Engine Speed’
- ‘CL Delay Maximum Vehicle Speed’
- ‘CL Delay Maximum EGT’
- ‘CL Delay Maximum Throttle (MT)’ – some 16-bit ECUs have 4 values for this table. Which is chosen is based on the counter that starts on engine start.
- ‘CL Delay Maximum Engine Load’ – Select 32-bit ECUs. This parameter also has its own delay threshold which much be satisfied before the primary delay is cleared.
The ATs (16-bit) have slightly different logic.
Primary Open Loop Enrichment – the final determination in the transition
The primary open loop enrichment value, which is always the last step in determining the CL to OL and OL to CL transition, is determined as follows:
- The ‘Primary Open Loop Fueling’ table determines the initial enrichment.
- If this desired enrichment is less (i.e leaner) than the ‘Minimum Active Primary Open Loop Enrichment’, then the enrichment is zero (i.e. an effective 14:7:1 AFR) regardless of the fuel map.
- The ‘Minimum Primary Open Loop Enrichment (Throttle)’ is then applied to this value. This table (ex. 16-bit ECU) has an effective AFR of 12.97:1 at about 89% throttle and above (due to interpolation it would ramp richer than stoich from above 70% throttle opening). This is the minimum enrichment. Therefore, even if the fuel map called for no enrichment (i.e. 14.7:1 AFR), if throttle position was greater than 89%, for example, the enrichment would be an effective 12:97:1 AFR. Note: this table is not currently defined for the 16-bit ECU, but will be added in the next ECU definition update.
- Finally, the ‘Primary Open Loop Fueling Compensation (Coolant Temp)’ is applied.
- This final enrichment value determines if the transition takes place. If it calls for no enrichment (i.e. 14.7:1 AFR), you will remain in closed loop (or switch to closed loop). Any non-zero enrichment (i.e. anything richer than 14.7:1 AFR at this point), will result in the transition to open loop in this last step in the decision process.
To simplify things, if the ‘Minimum Primary Open Loop Enrichment (Throttle)’ and ‘Primary Open Loop Fueling Compensation (Coolant Temp)’ are NOT impacting the enrichment at a given time, you can determine the transition by looking at your primary open loop fuel map. If the desired AFR in the current cell is leaner than the ‘Minimum Active Primary Open Loop Enrichment’, then you will remain in closed loop. If the desired AFR is richer than this threshold, you will switch to open loop when you reach this last step in the process.
With more recent logger definitions, you can log the primary open loop enrichment value that is involved in this last step if your ECU is supported for extended parameters. This will include the compensations mentioned above. The parameter is ‘Primary Open Loop Map Enrichment’.
Q: What happens when the closed loop delay is zero? Are you always in open loop?
As described above, the primary open loop enrichment is always the final determination in the transition. A delay of zero effectively skips all other steps with the primary fuel enrichment being the final determination.
Q: What is cause of the well-known problematic delay with the USDM 04/05 WRX from the factory? Are the delay values too high? Why doesn’t the USDM 02/03 WRX have the same issue?
Note: The following examples apply to the USDM ECUs.
High delay values are not the issue with 04/05 WRX. Depending on which delay value is being used, the 04/05 WRX may actually have the same or lower delay values than the 02/03 WRX. For example, looking at the delay examples above, for a manual transmission around sea level, the selected delay groups would be the following:
USDM 02/03 WRX – 122/732/366/3662
USDM 04/05 WRX – 366/732/366/366
The delay value chosen depends on the time since engine start. So, after about 8 minutes, the last delay value is chosen for both ECUs, which is going to be the delay value used most of the time when we are driving (unless you are taking extremely short trips). As you can see, the delay value is much higher in the 02/03 WRX (3662) than the 04/05 WRX (366)
So what causes the known issues? The problem is how the 04/05 WRX has the ‘CL to OL Transition with Delay (Base Pulse Width)’ and ‘CL to OL Transition with Delay (Throttle)’ setup from the factory. For the 02/03 WRX (and all other 16-bit ECUs besides the USDM 04/05 WRX), the BPW and throttle thresholds are referenced against rpm in a 2D table. For example, with the 02/03 WRX, the base pulse width threshold is 5.63 ms from 0-3600 rpm and zero at 4000+ rpm. It is similar for the throttle thresholds (69.4% from 0-3600 rpm and zero from 4000+ rpm). This means that above 3600 rpm, the threshold for BPW and throttle will begin to drop (due to interpolation) and will have zero threshold at and above 4000 rpm. However, with the 04/05 WRX there is only a single threshold for BPW and throttle. Although the single threshold matches the lower rpm thresholds in the 02/03 WRX (5.63 ms MT, 69.4% throttle), there is no drop off above 3600 rpm since they are just single value thresholds and are not referenced by rpm. That means that, even above 3600 rpm, the 04/05 WRX will maintain the same thresholds for BPW and throttle until one of the “misc.” tables clears the delay (rpm, veh. speed, etc.). The ‘CL Delay Maximum Engine Speed’ table in the 04/05s also has higher thresholds (5100/5200 rpm) as compared to the 02/03s (4200/4300).
So, in the 04/05 WRX, this can result in remaining in closed loop longer from over 3600-5200 rpm, whereas with the 02/03 WRX, the transition with delay would occur much sooner (lower or zero BPW/throttle thresholds) or there would be no delay at all (above 4300 rpm due to the ‘CL Delay Maximum Engine Speed’ table).
Q: Why do some of the misc. closed loop tables have unobtainable values from the factory? For example, the USDM 04-05 WRX ‘CL Delay Maximum Engine Speed’ table in AT ECUs is 8000/8200 rpm. Or the 32-bit ECUs have a throttle threshold over 100%?
This is likely Subaru/Denso’s method of removing a trigger from the decision process. Rather than having to recode the entire routine, it would be much easier to simply set a table’s values in a range that will never be achieved so that it will be effectively disabled. An individual ‘CL Delay Maximum/Minimum’ table essentially does nothing if the high threshold is never exceeded. So, setting the maximum engine speed table to 8000/8200 rpm means that this table is removed from the decision process.
Q: What exactly is the base pulse width value as used in the ‘CL to OL Transition with Delay (Base Pulse Width)’ table?
It is the base pulse width in ms for stoich fueling at a given engine load. You can determine the equivalent engine load (g/rev) for your ROM by the following calculation (these are assuming you using the latest RomRaider ECU definitions):
engine load g/rev = base pulse width table value / (2707.090 / Injector Flow Scaling)
base pulse width table value = 6.0 ms
injector flow scaling = 550 cc/min
engine load g/rev = 6.0 / (2707.090 / 550)
engine load = 1.22 g/rev
در ادامه …………………………………………………………………………………………………………………………………..
This has been tested on 32-bit ECUs, but I do not know if it will work on 16-bit ECUs.
The factory ECU has two methods of determining how much fuel to inject, known as closed-loop and open-loop fueling. Both methods start with the ECU calculating in the amount of incoming air, either with the MAF sensor, or via engine speed and the MAP sensor (speed-density). Given the amount of air coming into the cylinders, the ECU can calculate the required amount of fuel to achieve the desired air-fuel ratio. In open-loop fueling, the ECU simply injects whatever amount of fuel these calculations indicate. In closed-loop fueling, the ECU takes into account two additional factors.
First, it considers difference between the current AFR and the desired AFR, and it adjusts the fuel injection by an amount that proportional to the difference. You can log this parameter, it is called “AF Correction #1.” Second, the ECU considers how much correction has been needed in the past to achieve the desired AFR at the current MAF rate. There are four or five stored values which correspond to the different MAF rates, and you can view these with a logger, they are called AF Learning #1 A, B, C and D, and some ROMs also have AF Learning #1 E. The learned value currently being applied can be logged as well, it is called “AF Learning #1” (with no letter after the #1).
The AF Correction value is also sometimes called “short-term fuel trim” because it is adjusted rapidly (many times per second), and the AF Learning values are sometimes called “long term fuel trims” because they are adjusted slowly.
Some ROMs also have AF Correction #2, and AF Learning #2, since they have an O2 sensor for each bank of cylinders. To the best of my knowledge, only the H6 motors have this second O2 sensor and second set of parameters.
Closed-loop fueling allows the ECU to achieve the desired AFR in spite of differences in fuel and other variables. The target AFR is chosen for a compromise between best fuel mileage and lowest emissions. Also note that in cruise, the target AFR will fluctuate slightly rich and lean of 14.7, to facilitate two different chemical processes in the catalytic converter.
The drawback to closed-loop fueling is that the fuel trims (both short and long term) can hide sub-optimal values in your MAF scaling and tip-in settings. It’s generally beneficial to have the ECU applying these trims while you drive, however if you are tuning tables related to fueling – especially transient fueling issues like tip-in and load-change enrichment – the trims just make your job more difficult by obscuring the AFR that your settings would achieve on their own.
So, I typically disable closed-loop fueling while tinkering with such tables, and re-enable it when I’m done. Some people prefer to run open-loop 24/7 @ 365, but I am not one of them – being a bit of a tree-hugger, I like to give my catalytic converter a bit of help.
Contrary to popular belief, closed-loop mode does not necessarily need to target the stoichiometric ratio (14.7:1 with gasoline), and open-loop mode does not necessarily need to target the very rich values that are typically used in high boost (10:1 – 11:1). It is definition possible to have the ECU use open-loop mode with AFRs very near 14.7 in open-loop mode, as I will explain below. It might be possible to have the ECU target rich values in closed-loop mode, however this seems like a bad idea until the rich/lean fluctuation I described earlier can be tuned out. At the time of this writing, the tables that govern that fluctuation are not included in the ECU definitions.
To disable closed-loop operation:
Set all of the closed-loop / open-loop delay values to zero. This will cause the ECU to switch from closed-loop to open loop as soon as the open-loop conditions are reached. The open-loop condition that we’re most interested in is the one that tells the ECU to switch to open loop when the AFR specified in the Primary Open Loop Fueling table is richer than the “Minimum Active Primary Open Loop Enrichment” value, which is contained in a single-value table in the “Fueling – Primary Open Loop” section, which brings us to the next step…
Set the “Minimum Active Primary Open Loop Enrichment” to something quite close to stoich. I typically use 14.65. Now, whenever the AFR specified in the “Primary Open Loop Fueling” table is richer than 14.65, the ECU will use open-loop fueling rather than closed-loop fueling.
So, find all of the cells in the “Primary Open Loop Fueling” table which are leaner than (larger numbers than) 14.65. Typically this just means the set of cells in/near the top-left corner of the table, whose values are 14.7.
Save these changes to a file, flash that file to your ECU, and enjoy. In my experience, the difference between 14.6 and 14.7 is so small that there is no noticeable change in gas mileage. Also note that the target AFR used in closed-loop mode is typically slightly richer than 14.7 anyway (you can log that with the “Closed Loop Fueling Target” parameter) so this trick might even increase your gas mileage by an infinitesimal amount.
To re-enable closed-loop fueling, I simply change all of the 14.6 cells in the “Primary Open Loop Fueling” table back to 14.7. If you prefer to use non-zero CL-to-OL delays, you’ll want to revert the changes in that table as well.
(Pictures of these tables will be added later.)