One thing to note is
if IPW = {B9021}(minimum transient pulsewidth)
IBPW = {B9021} + {B3701}(voltage,manvac offset)
Small pulse adjust at this time doesnt appear to be added to {B9021} when it is active. More testing to be done.
Printable View
One thing to note is
if IPW = {B9021}(minimum transient pulsewidth)
IBPW = {B9021} + {B3701}(voltage,manvac offset)
Small pulse adjust at this time doesnt appear to be added to {B9021} when it is active. More testing to be done.
When which is active...? :) (I'm trying to be precise so I can write a line of pseudo-code for it)
So would this fit in here (is this the right place):
Is there another if that I need to put in front of it...?Code:IFR = lookup(B4001)(injector flow rate);
IPW = airmass / AFR / IFR * 1000;
if IPW <= B9021(minimum transient pulsewidth) then
IPW = B9021;
else
if IPW < B4003(minimum pulsewidth) then
IPW = B4004(default pulsewidth);
if IPW < B4006(small pulse threshold) then
IPW = IPW + B4005(small pulse adder);
end
IPW = IPW + B3701(voltage/manvac offset) + TF(transient fueling modifiers);
IBPW = IPW;
(Note how I separated out the last step, this makes it easier to edit later when other details are discovered)
Very interesting algorithm... GM obviously went to great length to get the injectors modelled correctly, we're learning from this. :)
BTW: just wrap the pseudo-code in [code] [/code] tags to get the indents preserved.
So are both the if's involving B9021 in the correct places...?
I have trouble following code like that. That is what is making it all confusing.lol.
All I can tell you is that if the calculated fuelling portion of the pulsewidth or IPW is equal to or lesser than B9021, then the value of B9021 + the offsets is the final or IBPW. If the B9021 limit is not hit, then all the min, default pulsewidth, SPA tables etc come into play. Small pulse adjust didnt appear to be active in my tests of B9021 earlier this year.
Ok, I want to make less confusing...
How about this:
The block between else and end happens when IPW > B9021.Code:IFR = lookup(B4001)(injector flow rate);
IPW = airmass / AFR / IFR * 1000;
if IPW <= B9021(minimum transient pulsewidth) then
IPW = B9021;
else
if IPW < B4003(minimum pulsewidth) then
IPW = B4004(default pulsewidth);
if IPW < B4006(small pulse threshold) then
IPW = IPW + B4005(small pulse adder);
end
IPW = IPW + B3701(voltage/manvac offset) + TF(transient fueling modifiers);
IBPW = IPW;
Ok, I get it... is this how it works:
if IPW is less than or equal to B9021, then the final value is B9021+B3701+TF;
otherwise B9021 is not used, and instead, B4004 and/or B4005 may be applied, and then B3701+TF are applied.
I'm wondering if it should read like this:
The if ... else if sequence selects only one statement to do and then jumps to end.Code:IFR = lookup(B4001)(injector flow rate);
IPW = airmass / AFR / IFR * 1000;
if IPW <= B9021(minimum transient pulsewidth) then
IPW = B9021;
else if IPW < B4003(minimum pulsewidth) then
IPW = B4004(default pulsewidth);
else if IPW < B4006(small pulse threshold) then
IPW = IPW + B4005(small pulse adder);
end
IPW = IPW + B3701(voltage/manvac offset)
IPW = IPW + TF(transient fueling modifiers);
IBPW = IPW;
This is much simpler.
Are the < correct, should any of those be <= instead...?
Now your splitting hairs. lol.
Another question that needs answering is when TF or the transient fuelling modifiers are actually added to the equation. Are they added to the initial IPW calculation, so minimum pulsewidth or small pulse adder are in effect afterwards like I added in blue?
I can see a lot more testing & calculating may need to be done to put this to bed.
Good work on the pseudo code Joe, That looks a lot easier to follow now.
So the question is whether TF is applied first:
Code:IFR = lookup(B4001)(injector flow rate);
IPW = airmass / AFR / IFR * 1000;
IPW = IPW + TF(transient fueling modifiers);
if IPW <= B9021(minimum transient pulsewidth) then
IPW = B9021;
else if IPW <= B4003(minimum pulsewidth) then
IPW = B4004(default pulsewidth);
else if IPW < B4006(small pulse threshold) then
IPW = IPW + B4005(small pulse adder);
end
IPW = IPW + B3701(voltage/manvac offset)
IBPW = IPW;