PDA

View Full Version : O2 kicks / lean cruise



Swart
01-26-2012, 12:54 AM
Can anyone explain how to tune the O2 kicks to get leaner adaptives?

Goal is a leaner cruise and a leaner AFR during idle. Currently at about 14:1, would like 14.7 at idle and during cruise (or leaner during cruise if possible).

Related tables in MPTune are PrimaryRamp and SecondaryRamp; under Fuel - O2 Controller Ramps.

Thanks in advance!

ShelGame
01-26-2012, 04:34 PM
This is from the Turbonator source listing. Originally by Geoff Allan, updated by me.


; *****************************************
; O2 Controller Ramp Calibration
; *****************************************
; How it works:
; The O2 sensor is monitored but ONLY for "rich/lean". Even though
; the O2 sensor value is from 0 to 15, the only thing that counts
; for this system is whether it is "rich" or "lean". A change from one
; to the other is a "toggle". The system constantly toggles between
; rich and lean so that the overall average is around stoichiometric.
;
; Background information (from the net:)
; An "ideal" fuel/air mixture in which both the fuel and the oxygen in the air are
; completely consumed is called the "stoichiometric" mixture. The stoichiometric mixture
; is usually specified as the ratio of the mass of air to the mass of a particular fuel.
; For example, if a fuel required 10 kg of air to precisely burn 1 kg of the fuel (that is,
; all the fuel burned and there was no oxygen left in the air afterwards) then the
; stoichiometric ratio for that fuel would be 10:1.
;
; Chevron give the stoichiometric ratio of air mass to fuel mass for gasoline as 14.7:1,
; but don't specify the composition of this hypothetical gasoline.
;
; From http://www.faqs;.org/faqs/autos/gasoline-faq/part2/ comes the following table
; of typical stoichiometric air-fuel ratios:
;
; Fuel | Stoichiometric air-fuel ratio
; -----------+------------------------------
; methanol | 6.4
; ethanol | 9.0
; MTBE | 11.7
; ETBE, TAME | 12.1
; gasoline | 14.6
;
; An oxygenated gasoline with 89% gasoline and 11% MTBE would then have a stoichiometric
; ratio of 14.281 (note that this would require a Wide Band O2 sensor to adjust, since the
; O2 sensor in our cars is designed for gasoline only, and is a very narrow range. In case
; you were wondering, this is one reason some people are interested in Wide Band O2 sensors.)
;
; *****************************************
; This system divides a range of RPMs and MAP readings into "cells". The number of
; "kicks", or increases/decreases in fuel required to toggle the O2 reading, is different
; for each of these cells. This allows some fairly powerful flexibility in tuning. The
; only time you might want to adjust these values is for different injector flow rates,
; or to speed or slow the adjustment being performed.
; *****************************************
; Note to tuners: DO NOT AIM FOR STOICHIOMETRY! Although it might be fine for idle or
; low speed operation, at higher RPMs and under boost you DEFINITELY want a RICH mixture.
; This is because stoichiometric combustion generates the most heat. No current engine
; would survive very long with the temperatures this would generate, hot enough to melt
; the engine.
; *****************************************
; Each cell has a kick value. This is the amount of change applied to the running fuel
; every eleven millisec until a rich/lean toggle occurs. The net result is the
; familiar rich/lean flashing that your O2 sensor gauge shows you.
; *****************************************
;
; (one kick per 11ms)
; Fudge factor: if an O2 toggle occurs before the primary ramp
; finishes, then the "first" step in the new direction is limited
; to the accumulated steps before the toggle.
;
; Cells:
;
; HIRPM +-----+-----+-----+
; | 2 | 5 | 8 |
; RPM#2 +-----+-----+-----+
; | 1 | 4 | 7 |
; RPM#1 +-----+-----+-----+
; | 0 | 3 | 6 | Idle Cell: 9
; +-----+-----+-----+
; Map#1 MAP#2 HIMAP
;
; *****************************************
; Primary Ramp -
;
; For each cell, the first number is "rich", the second is "lean".
; If the O2 sensor is returning a lean value, "rich" kicks are added.
; If the O2 sensor is returning a rich value, "lean" kicks are added.
;
; KICK = (factor * 512) - 512 (unsigned number)
; eg 5% -> 1.05 * 512 - 512 = 0x19
; each bit is ~ 0.2%
; *****************************************
; The Limits are the maximum number of kicks that may be applied to each
; cell. If the O2 sensor fails to toggle after reaching the limit for more
; than a few sec, the AutoCal cell gets changed.
; *****************************************
;
;
; *****************************************
; Secondary Ramp -
;
; For each cell, the first number is "rich", the second is "lean".
; If the O2 sensor is returning a lean value, "rich" kicks are added.
; If the O2 sensor is returning a rich value, "lean" kicks are added.
;
; STEP - (factor * 512) - 512 (signed number)
; eg: %0.4 -> (1.004 * 512) - 512 = 2.048 (dec) = 0x02
; each bit is ~ 0.2%
; *****************************************

GLHNSLHT2
01-28-2012, 01:33 AM
still don't understand anything in that.

Swart
02-02-2012, 12:59 AM
Thanks for the info Rob.

Let me chew on this for a few days and see if I can both further understand it and come up with a simpler explanation to help out.

Chuck

ShelGame
02-02-2012, 10:09 AM
I'm actually still not 100% clear how these 'kicks' translate to injector PW adjustments to cause the O2 sweeping that we see. I can see how these affect the long-term adaptives, and I see how the adaptives are incorporated into the final PW, but I still don't see (in the code) how the ramps cause the O2 cycling. I'm still looking...

ShelGame
02-02-2012, 11:11 AM
The ramps/kicks above will for sure set the adatived and can be used to set the long-term correction leaner. I think if you reduce the 'rich' kicks, it will result in a leaner condition. The 'rich' kicks is just the amount of time (number of program loops, 11ms per loop) before the counter is reversed to lean the mixture. You will also have to work on the limits. But, this is really for the long-term adaptives.

Also, there are 2 values - O2LIMH_O2RangeLimitHigh and O2LIML_O2RangeLimitLow that appear to be the extreme limits for the ramp counters. If/when the counter goes over one of the limits, the limit is sued instead. So, I think adjusting those limits will affect the near-term fuel. They are signed values. So, the stock Hi limit is 0x7F, which is the max, and the Lo limit is 0xB3, which is actually -0x33. I think, if you want to lean things out, you can raise the low limit from 0xB3 to 0xC3 for example. Though, I may have that backwards. It may be the Hi number that needs to be reduced. The later cals use 0x7F and 0x80 - which are basically equal on either side.

Basically, these are all just an amount of time that the system allows the O2 to read lean or rich before it tries to toggle the O2 the other way. But, I still don't see where the fuel is actually added/removed from the final PW.

turbovanmanČ
02-02-2012, 02:55 PM
Subcribed.

5DIGITS
02-02-2012, 02:57 PM
... But, I still don't see where the fuel is actually added/removed from the final PW.

Rob,
I have a new computer and I have not transferred everything over - I'll look into the exact location.

Original issue:
With regards to the original question, it should be determined if the based fuel tables have 'railed' or maxed the adaptive before adjusting the kick table.
In this case, the adaptive has gone as far as it can and you are getting the A/F ratio based on the adaptive limit and there is no room left to adjust.
This would be fixed by adjusting the closed or open throttle fuel table until the adaptive becomes useful again.
If wanted, a very slight reduction in primary kick size can be made when using larger injectors but the original secondary kicks are capable of accurately trimming larger injectors.

If it helps..
Kicks are broken into four categories.
Primary Rich
Primary Lean
Secondary Rich
Secondary Lean

Primary kicks adjust for large error in fueling while secondary are the finer adjustment.

Each of these are associated to a specifically defined adaptive cell within the array and each cell has a counter based on cylinder events, for RPM compensation.
For example, the counter is shorter in the idle cell so adjustments are not prolonged, due to low RPM/slower event triggers, and larger in higher RPM cells.
The adaptive arrays are broken into RPM and MAP based breakpoints and should only be adjusted to eliminate cell instability based on cam and intake tuning, for any given application.
For example, when these are improperly positioned a slight change in MAP or RPM will cause the adaptive to increase and decrease (in a given cell) which indicates that the breakpoint is poorly located.

This over-simplified but might help.

ShelGame
02-02-2012, 03:06 PM
Thanks, that's a good explanation. I think I had a pretty good understanding of what it was doing, but it's harder to explain it.

The kicks only affect the adaptives, right? I can see where the adaptive value is pulled from the appropriate cell and applied to the injector PW. And, I can see how the kicks/limits update the adaptive value for a given cell. But, I cannot find anywhere that causes the short term fuel adjustments that lead to the O2 toggling. It obviously has to be there somewhere, but I can't seem to follow it to the PW.

If I understand the original question right (and it's been asked many times before), what he really wants to know is how do you get the car to cruise leaner than the stock code tends to cruise? For example, if you have a WB, you can bias the NB output to the ECU and force the engine to run leaner by telling it (in effect) that it's running richer. This should also be possible to do in the code.

You can 'cheat' it with calibration and force the base fuel tables extremely lean and max (rail) the adaptives, but that seems like a hack. There should be a way to simply tell the computer to toggle a little more to the lean side...

5DIGITS
02-03-2012, 09:58 AM
Thanks, that's a good explanation. I think I had a pretty good understanding of what it was doing, but it's harder to explain it. .

No problem.



The kicks only affect the adaptives, right? I can see where the adaptive value is pulled from the appropriate cell and applied to the injector PW. And, I can see how the kicks/limits update the adaptive value for a given cell. But, I cannot find anywhere that causes the short term fuel adjustments that lead to the O2 toggling. It obviously has to be there somewhere, but I can't seem to follow it to the PW.

Strictly by memory...
I can't remember if the short term (+/-) adaptive is added to the long term adaptive, then long term is used in PW, and if it results in a toggle the long term is adjusted
OR
If the short term (+/-) adaptive is added to directly to PW and if it results in a toggle the long term is adjusted.
OR
.. . .

I'll have time to look this weekend.




If I understand the original question right (and it's been asked many times before), what he really wants to know is how do you get the car to cruise leaner than the stock code tends to cruise? For example, if you have a WB, you can bias the NB output to the ECU and force the engine to run leaner by telling it (in effect) that it's running richer. This should also be possible to do in the code. You can 'cheat' it with calibration and force the base fuel tables extremely lean and max (rail) the adaptives, but that seems like a hack. There should be a way to simply tell the computer to toggle a little more to the lean side...

I agree - railing the adaptives is an extremely poor approach !!
I wanted to make sure it wasn't already the case.

ShelGame
02-03-2012, 10:30 AM
Strictly by memory...
I can't remember if the short term (+/-) adaptive is added to the long term adaptive, then long term is used in PW, and if it results in a toggle the long term is adjusted
OR
If the short term (+/-) adaptive is added to directly to PW and if it results in a toggle the long term is adjusted.
OR
.. . .

Ahh, the first one actually does make some sense to me. My assumption was that the individual cell was just the long-term adaptive. But, if the short term adjustments are in there also, then I could see that being the mechanism to cause the toggling. Now I'm trying to wrap my head around how the long-term value isn't lost if both are stored in the same cell. I'll wait for your update...


I agree - railing the adaptives is an extremely poor approach !!
I wanted to make sure it wasn't already the case.

Right, if you're going to do that, it's better IMO to simply turn closed loop control off and run off the fuel tables.

GLHNSLHT2
02-03-2012, 11:40 AM
You can 'cheat' it with calibration and force the base fuel tables extremely lean and max (rail) the adaptives, but that seems like a hack. There should be a way to simply tell the computer to toggle a little more to the lean side...

My car ran like crap when it maxed out the adaptives. I went from a stock head to a ported head/intake/header. Didn't do anything to the fuel tables at 1st because I didn't know how far to adjust them. Well once the adaptives started to kick in at idle the car would just get leaner and leaner and leaner until it stalled at 19:1. Reset the ECU and it'd run great again until the adaptives started coming back. Plugged in the scanner and noticed it was pegging the adaptives at idle. I had to increase the fuel 50% at idle then it was fine. Adaptives were +/- 5% of where the curve was and it would idle fine. I don't know if it would affect things at cruise as the adaptives just jumped from 10-15% of extracting fuel from the cal to 10-15% to adding fuel to the cal at cruise.

wowzer
02-04-2012, 01:03 PM
with my camaro ecu (in closed loop - part throttle), the ecu reads the o2 sensor, calculates the "error" to get it to stoich (which becomes the short term adaptive-non permanent), and adds that adjustment to the long term adaptive (permanent) to adjust the calculated pulsewidth. if the short term stays either positive/negative for around 450 mSecs before the o2 switches from lean/rich or rich/lean then the long term adaptive is adjusted up/down by a set amount, determined by just how far out of whack the short term adaptive is. the long term adaptive is stored based on a matrix of rpm/map.

so - in a (much too) simple way:
-calculate pulsewidth
-adjust by long term adaptive
-adjust by short term adaptive
-send pulsewidth to injectors
-adjust long term adaptive based on short term adaptive magnitude and amount of time in a rich or lean state.

on WOT, short term adaptives are ignored, so ecu only uses calculated PW and long term adaptive for the last cell used. long term adaptives max out at around 20% pulsewidth error.

i would assume the kicks are similar to the above short term fuel trims and the adaptives are the long term fuel trims and the kick size is how long the ecu will wait before adjusting the long term adaptives because the o2 sensor failed to switch in time.

don't know if this relates to our ecus but maybe it might help with the logic, or - maybe not!

Force Fed Mopar
02-04-2012, 01:29 PM
I think a better way to state the original question is: What sets the AFR that the computer will try to hold at cruise, idle etc?

From what I can tell, nothing in the O2 tables does this. the O2 only tells the computer what adjustments are needed to keep the engine at the specified AFR. Seems to me like you set the main fuel tables to what you want, and the adaptives will keep it there, assuming the main tables are not way off. If it gets richer or leaner at a certain rpm range, change the Pump Eff table. If it's rich/lean under boost, change the FuelFromMAP tables. If it's rich at idle, change the FuelBaseline table. And of course, at WOT there no adaptives.

---------- Post added at 12:29 PM ---------- Previous post was at 12:25 PM ----------




Kicks are broken into four categories.
Primary Rich
Primary Lean
Secondary Rich
Secondary Lean

Primary kicks adjust for large error in fueling while secondary are the finer adjustment.

Each of these are associated to a specifically defined adaptive cell within the array and each cell has a counter based on cylinder events, for RPM compensation.
For example, the counter is shorter in the idle cell so adjustments are not prolonged, due to low RPM/slower event triggers, and larger in higher RPM cells.
The adaptive arrays are broken into RPM and MAP based breakpoints and should only be adjusted to eliminate cell instability based on cam and intake tuning, for any given application.
For example, when these are improperly positioned a slight change in MAP or RPM will cause the adaptive to increase and decrease (in a given cell) which indicates that the breakpoint is poorly located.

This over-simplified but might help.

I wonder if this has to do with why it seems to go rich whenever I let off the gas when cruising, then come back up? Like, it'll be around stoich, then when I let off the gas a bit (say, go from 5 inHg to 10 inHg), it'll drop to 12-12.5, then go back to stoich in a couple seconds.

wowzer
02-04-2012, 08:30 PM
how do our ecus determine the lamda of 1? voltage? and if so what is that value (.5v?) and where is that coded in the code base?

***edit***
duh - too much superbowl juice pretasting!! .45v is stoich and read from ram value o2sensorvolts. i really did know this :nod:

5DIGITS
02-04-2012, 09:20 PM
I wonder if this has to do with why it seems to go rich whenever I let off the gas when cruising, then come back up? Like, it'll be around stoich, then when I let off the gas a bit (say, go from 5 inHg to 10 inHg), it'll drop to 12-12.5, then go back to stoich in a couple seconds.

This sounds like a transient fueling issue which is controlled by transient MAP and TPS.
O2 feedback is inhibited during these manuevers unless the MAP sensor or injectors have been changed and the cal values are set wrong for the hardware.

turbovanmanČ
02-07-2012, 02:22 PM
I think a better way to state the original question is: What sets the AFR that the computer will try to hold at cruise, idle etc?

From what I can tell, nothing in the O2 tables does this. the O2 only tells the computer what adjustments are needed to keep the engine at the specified AFR. Seems to me like you set the main fuel tables to what you want, and the adaptives will keep it there, assuming the main tables are not way off. If it gets richer or leaner at a certain rpm range, change the Pump Eff table. If it's rich/lean under boost, change the FuelFromMAP tables. If it's rich at idle, change the FuelBaseline table. And of course, at WOT there no adaptives.

---------- Post added at 12:29 PM ---------- Previous post was at 12:25 PM ----------



I wonder if this has to do with why it seems to go rich whenever I let off the gas when cruising, then come back up? Like, it'll be around stoich, then when I let off the gas a bit (say, go from 5 inHg to 10 inHg), it'll drop to 12-12.5, then go back to stoich in a couple seconds.

Mine does the same, hmmmmmm.

5DIGITS
02-19-2012, 10:28 PM
Ahh, the first one actually does make some sense to me. My assumption was that the individual cell was just the long-term adaptive. But, if the short term adjustments are in there also, then I could see that being the mechanism to cause the toggling. Now I'm trying to wrap my head around how the long-term value isn't lost if both are stored in the same cell. I'll wait for your update...

Rob,
I finally got everything saved in one location and had a chance to look into the adaptive fueling.
The short-term value is stored in up stream calculations and then combined with other PW multipliers including the long term adaptive.
Even though they all end up in the final pulse width, the adaptive fuel value is tracked separately and easily extracted from the string of multipliers.
Why?
The adaptive fuel offset (+/-) is the only value (or multiplier) that is not based on fixed calibration constants or tables.
Therefore any error in fueling, regardless if the calibration is incorrect, is reflected in a short-term adjustment (to achieve an O2 toggle) and excessive rich or lean adjustments result in a long-term adjustment.