• Hello Guest, welcome to the initial stages of our new platform!
    You can find some additional information about where we are in the process of migrating the board and setting up our new software here

    Thank you for being a part of our community!

Injector dead time

Hint: MLV already does scatter plots.

That I know. I also know how to use the scatterplots to dial in my volttage correction slope.

So tell me this, would it take going into the req fuel pulsewidth box and changing values up and down, and plotting pulsewidth in the X axis with air fuel ratio on the Y axis and grabbing the X intercept as the dead time?

If that's the case how can I calculate a line of regression and Y-intercept in MLV? If not, how can I export the XY table into Excel so that I can calculate a point-slope and slope intersect?
 
I had a nice response typed out at work on the toilet the other day, but wifi is pretty shoddy in the shop so I guess it never made it trough.

In short, you can pick two points in the middle of the scatter plot and use those points to calculate the X intercept. Anything more complex than that is targeting an accuracy that the MS itself can't produce.

Req_fuel should not need to be touched once it's set. Adjusting global scalars won't do anything other than skew the data you're trying to collect. If you want to plot injector latency error, introducing a modifier such as a different lambda value would be much more effective.
 
Req_fuel should not need to be touched once it's set. Adjusting global scalars won't do anything other than skew the data you're trying to collect. If you want to plot injector latency error, introducing a modifier such as a different lambda value would be much more effective.

When you say "different lambda value" above, do you mean the closed loop lambda/afr target? The only other place I can think of for changing the "lambda" would be the calculator for the required fuel, which you said would skew the results.

In that miataturbo link, the guy was plotting MAP/AFR (I'm assuming that's dividing) vs. PW, and altering the opening time with a voltage correction table as the modifier. Harribert asked you if just MAP vs. PW would work and you didn't object. I don't understand why that guy would use MAP/AFR instead of just AFR, what do you think?

I've always had minor/annoying running issues that seem like they are symptomatic of the dead time not being right and I would like to try and get it close before chasing other things.
 
Holy ****! Been a while, Aaron!

What I mean is, when incorporating AFRtarget you run the AFR table as a multiplier over the VE table. Much like the OEM's do and your VE table actually represents a VE table. By introducing a different multiplier over the fuel table, you are changing the modifier to the VE table. By doing so, you're commanding that specific area to change to a different commanded lambda value. If the actual lambda doesn't track the commanded value when changed under a constant load, the injector latency is incorrect.

As far as map/afr vs plotting just afr, I'll have to get back to you on that. Somewhere on this computer I have buried a bunch of data doing just that and I forgot exactly why plotting just AFR didn't work.
 
The reason for measuring PW while varying lambda (aka AFR) gets back to the: Megasquirt Fueling Equation

PW = REQ_FUEL * VE * MAP * E + accel + Injector_open_time

E is lumped enrichments (base value is 100%). We'll ignore it here since it can be kept constant during testing. accel is acceleration enrichment. We'll ignore it too.

The REQ_FUEL term includes the desired Fuel-to-Air ratio, 1/AFR. For example, enrichening the mixture, aka increasing desired fuel-to-air ratio, increases REQ_FUEL. We'll break out the AFR dependence and replace the REQ_FUEL term with BASE_FUEL/AFR.

Re-writing the equation, we get:

PW = BASE_FUEL/AFR * VE * MAP * 1 + Injector_open_time

Or:
Injector_open_time = PW - BASE_FUEL/AFR * VE * MAP

To keep the VE term roughly constant, we can take measurements at idle (or other low rpm) and tweak the desired AFR up and down, with includeAFRtarget enabled so that the PW will adjust as we change the desired AFR up and down. I haven't worked out all the rest of this, but the intercept from plotting MAP/AFR versus PW gives the injector open time. Idle, or near idle, is used because it has the lowest fuel requirements and thus provides the most sensitivity to injector open time. [see gross polluter's followup to this]

I haven't read up on the variations on this, but it seems like after doing an initial adjustment, that you could repeat it at a different battery voltage, such as all electricals on, or alternator disconnected, and figure out the deadtime voltage correction too.

-Bob
 
Last edited:
The problem with doing everything at idle only, especially with large injectors, is you're integrating error from short pulse widths in the non linear operating area of the injector with no way of quantifying that error.

There's an iteration of the map/AFR formula specifically for MLV scatter plots that plots a linear regression from the entire operating area of the engine. Last I compared it to results from the same vehicles on the dyno, it was incredibly close.
 
Different amounts of fuel are required to get to lambda at different engine speeds. If you turn map into a common denominator the regression will be much tighter.

Hope that makes sense, that's how I explained it to myself.

The problem with doing everything at idle only, especially with large injectors, is you're integrating error from short pulse widths in the non linear operating area of the injector with no way of quantifying that error.

There's an iteration of the map/AFR formula specifically for MLV scatter plots that plots a linear regression from the entire operating area of the engine. Last I compared it to results from the same vehicles on the dyno, it was incredibly close.

Would be cool to find it. I'm too mathematically illiterate to get a scatterplot to behave like a line of regression.
 
Would be cool to find it. I'm too mathematically illiterate to get a scatterplot to behave like a line of regression.

One of the drag cars I still support draws two distinct lines that head opposite directions under 4ms pw. One follows the data I came up with on the dyno, the other one drifted off into the 2.5 x intercept territory. Perhaps an indication of how non-linear crap Rochester injectors are.
 
As far as map/afr vs plotting just afr, I'll have to get back to you on that. Somewhere on this computer I have buried a bunch of data doing just that and I forgot exactly why plotting just AFR didn't work.

You mean MAP, not AFR above right? Or else I'm lost.

The only remotely possible things for using MAP/AFR I imagined when the miata guy was using the opening time as the variable would be compensating for a FPR without MAP reference (MAP changing because of rich/lean condition not compensated by fuel pressure) or maybe just for jitter in the signals from the engine changing RPM/MAP/etc slightly on power pulses at low/idle speed, but neither really makes sense.

But using EGO correction and the AFR target table as you are suggesting makes it seem to me like the MAP/AFR would compensate for the time and/or errors it takes for the EGO to correct the actual AFR to the target value on the table. maybe?

The reason for measuring PW while varying lambda (aka AFR) gets back to the: Megasquirt Fueling Equation

PW = REQ_FUEL * VE * MAP * E + accel + Injector_open_time

E is lumped enrichments (base value is 100%). We'll ignore it here since it can be kept constant during testing. accel is acceleration enrichment. We'll ignore it too.

The REQ_FUEL term includes the desired Fuel-to-Air ratio, 1/AFR. For example, enrichening the mixture, aka increasing desired fuel-to-air ratio, increases REQ_FUEL. We'll break out the AFR dependence and replace the REQ_FUEL term with BASE_FUEL/AFR.

Re-writing the equation, we get:

PW = BASE_FUEL/AFR * VE * MAP * 1 + Injector_open_time

Or:
Injector_open_time = PW - BASE_FUEL/AFR * VE * MAP

To keep the VE term roughly constant, we can take measurements at idle (or other low rpm) and tweak the desired AFR up and down, with EGO correction enabled so that the PW will adjust to give our desired AFR. I haven't worked out all the rest of this, but the intercept from plotting MAP/AFR versus PW gives the injector open time. Idle, or near idle, is used because it has the lowest fuel requirements and thus provides the most sensitivity to injector open time.

I haven't read up on the variations on this, but it seems like after doing an initial adjustment, that you could repeat it at a different battery voltage, such as all electricals on, or alternator disconnected, and figure out the deadtime voltage correction too.

-Bob

I was looking at the formula on that page before posting here, but I thought the closed loop/EGO correction was part of the E in the formula? From what you wrote, you are excluding E from what I am trying to measure/compensate for, when I thought I was going to use E as the variable? Or maybe I'm misunderstanding and I need to read that again, my brain isn't working because I haven't eaten today.

The problem with doing everything at idle only, especially with large injectors, is you're integrating error from short pulse widths in the non linear operating area of the injector with no way of quantifying that error.

There's an iteration of the map/AFR formula specifically for MLV scatter plots that plots a linear regression from the entire operating area of the engine. Last I compared it to results from the same vehicles on the dyno, it was incredibly close.

So on the road, I should try to drive it across a wide load/rpm range, then pull over and target richer or leaner and repeat? I might try it just at idle first and see what I get.

I pulled up an old datalog in MLV and made a custom field value for MAP/AFR and it seems to work on the scatter plot.

Would you believe that I have never set up the closed loop EGO since I put MS2 on the car ~8 years ago? :wtf:
 
You mean MAP, not AFR above right? Or else I'm lost.

I was trying to answer your question about using map/AFR vs. straight AFR plots, and why plotting just AFR doesn't work.

That said, the Miata link doesn't work when driving. I'll have to see if I can dig up the formula I used to use. Same idea, different formula. I think. Again, I've only used this method for ****s and giggles.

Haven't used ego correction at all in any plots I've produced. All of the cars I've tested this idea on don't use any form of mixture feedback control either.
 
Last edited:
Okay, I didn't understand what you wrote before about changing the lambda target and the incorporate AFRtarget setting because I had no idea what you were talking about, but I think I understand now. In the past few years I have completely forgotten about that setting and how it works, so I need to go back and read the manual again to see what else I've forgotten or missed.
 
Last edited:
There's an iteration of the map/AFR formula specifically for MLV scatter plots that plots a linear regression from the entire operating area of the engine. Last I compared it to results from the same vehicles on the dyno, it was incredibly close.

It would be great if you could find & post a link to this!

Measurement at idle -
You're right, measuring at just idle, or near idle, can give poor results for big injectors and/or injectors with non-linear flow at short opening times. Once again, theory [me] versus experience [you]. Hopefully we're all still learning something interesting.

EGO Correction -
Sorry about the comments on using EGO. It's not needed and only confuses this discussion. I only added it in so that MS would adjust to reach the desired AFR as entered in the AFR table. Without EGO, the actual AFR may be off some. This doesn't matter since you're using actual AFR in the scatter plots. As long as includeAFRtarget is enabled, changing the AFR table will result in actual AFR moving. I'll redact my the earlier EGO comments shortly.

Use of MAP -
MAP is mostly proportional to air flow for a given engine. MAF is absolute airflow (assuming no leaks) but MAP works fine as long as you don't swap engines. So, if MAP is proportional to airflow and AFR is Air per Fuel, then MAP/AFR is proportional to just Fuel. And, when we plot MAP/AFR vs. PW, we end up with a plot of actual Fuel vs. PW. From this, we can extrapolate the line out to the PW that gives zero fuel, which is our desired deadtime.

Is this better, or only more confusing? Sorry if it didn't help....
 
Last edited:
Still looking. Seems Google searches only result in the Miata link anymore. Only home 2 days a week at the moment. When I'm able to get back to my tuning laptop I'll see if I can dig up old logs and post them.

The method wasn't vastly different than the Miata link. However, when I was playing around with the stuff that was posted on there it didn't work nearly as well on the same logs.
 
Can't find the original link from 6 years ago. Doing some research on my own with the Rustang. Will report back with the results. Found something quite interesting in scatter plots.
 
It would be great if you could find & post a link to this!
Use of MAP -
MAP is mostly proportional to air flow for a given engine. MAF is absolute airflow (assuming no leaks) but MAP works fine as long as you don't swap engines. So, if MAP is proportional to airflow and AFR is Air per Fuel, then MAP/AFR is proportional to just Fuel. And, when we plot MAP/AFR vs. PW, we end up with a plot of actual Fuel vs. PW. From this, we can extrapolate the line out to the PW that gives zero fuel, which is our desired deadtime.

Is this better, or only more confusing? Sorry if it didn't help....

This helped me tremendously - thank you. It is so much nicer being able to approach something with understanding rather than just following some instructions from somewhere.
 
After spending a few days playing with the MAP/AFR methods on a few cars with known deadtime values, I would not recommend using this method for determining injector opening time. Multiple data collections, implementing a ton of filters to make sure only stable parameters were plotted, and each plot not producing data consistent to show a solid number.

In my professional opinion, using commanded AFR error to dial in the dead time is still the best way to get the most accurate and consistent results.
 
Wow - so are you saying that you couldn't get a linear distribution in any of the tests or that no two tests produced the same line?

I'm not sure if I did this right but here is what I got @ a fairly steady 13.6V:

dt.png


No idea if this is meaningful or not, but I do feel pretty good about the linear distribution (r2=.888 including obvious outliers). I only did it once - but it corresponds fairly closely to the higher/lower dead time method I did while looking at target overshoot/undershoot in real time.
 
Not one test produced the same line as another. Once you filter out all the junk, you can get results that vary about 200us, which for most knuckleheads on this forum is good enough. However, I make a living calibrating control systems that have to work like stock cars for years on end, so I tend to use and recommend methods that give a much higher degree of precision.
 
So, what are your recommendations for best dead time characterization no holds barred? And for the rest of the TBricks MS crowd?
- graduated cylinders and multiple commanded pulse widths at different voltages?
- vary AFR at idle, or some other target RPM?
- vary MS PW at target RPM?
- use an oscilloscope to measure injector V-I and use the bumps for open/close delay?
- adjust 2squirts vs. 4squirts until equal?
- use your good buddy's V8 TBI settings, and AutoTune it weekly?
- other?

Thanks for your experience and wisdom,
Bob
 
Back
Top