With respect I dont think you understand regression. What you are showing here has nothing to do with regression. regresssion is not fitting data to a curve. regression is fitting a curve to set of random data points. For any given set of collected data points (x,y) you only get one least squares regression fit and three coeffecients A, B, and C of the second order polynomial. X and Y are collected with sensors. Too create a statistical model you need both to be collected accuratly. Once you know the relationship after regressing it out of the collected data, If you have one from an accurate sensor you can predict the other. Eliminating one of the sensors. I suggested using the known good TB model as it can be used in place of a MAF or MAP sensor for a target to correct the statistical model too. You didnt seem to think that would work and said you want people to use fuel trims. Its not a fueling model. Its not a MAP to load model. Its not an airmass to load model. It is a airmass to MAP model.
FYI blowthrough skews the O2 sensor readings, hence the model. So that are not a viable source for correcting the SD model.
I don't trust you, and as im very busy with my other interest I am losing interest in this conversation quickly. Especially with users like Veefour on here who make these forums miserable to be apart of.
Why even try to decipher the information from the patent if what you are seeing in the ECU code isn't what is in the patent? Rethorical question. I understand the patent entirly and I have read it dozens of times.I have the mathmatical background and am an individual patents always reference "one of ordinary skill in the art will recognise...". I have applied what I saw in the patent to my own personal car and come up with my own coeffecients that work fine. Best of all, I know why they work and its not a complete fabrication or guess.
If I dont reply dont take any of this personal, im just too busy to try and help people figure out what the patent, along with many other Ford patents and many professional research papers, explain.
Last edited by murfie; 01-17-2025 at 01:20 AM.
Just WOW man...you were on my "over complicated guy that does nothing but has some sort on knowledge list" but now you made to "trying to sound smart but has no skills whatsoever"...
Rob is a very smart guy, we solved few issues together while you were reading patents...seems those patents you red were in a language beyond your comprehension...
Im with Rob on this one...you trying to do what you do best - over-complicating simple things...no user ever had any use of your criticism and uber self confidence.
You so smart why dont you start your own business that will do better then HPT? LOL
Last edited by veeefour; 01-17-2025 at 02:18 AM.
v-performance.pl/
facebook.com/veee.performance/
https://www.instagram.com/v.performance.pl/
Remote tuning(don't work for free!):
[email protected]
+48 697276579
I'm not even sure where to begin. I wrote out a whole thing but I think I'm just gonna take the high road on this one and let your post speak for itself. I've run out of both carrots and sticks. No disrespect, no hard feelings, good luck with everything.
I hope the productive conversation doesn't die down here because I think we were starting to get somewhere.
Same here.
Was able to write the code to solve for airmass. Now I need to run it backwards on some measured data to solve for the quadratic and etc. I really need a good log to go any further.
forumSD6.png
That curve looks solid to me. I also find it comforting that the quadratic to linear transition doesn't aggressively snap to high load values when you do it this way.
I'm on vacation but I'm working on a visualization tool in my spare time similar to what someone else mentioned earlier. Perhaps it'd be easier for people to just eye-up a curve rather than regress
Im not sure if its time to bring blowthrough into the equation, but I'll talk about it if youre interested. It doesn't quite do what everyone thinks it does
Thanks. The only question I'm havingrelates to what we talked about earlier. The SD Calculator in HPTuners clips the curve at a steeper slope than Max Aircharge (when the quad slope is less than max aircharge). Its weird, I calculated the difference and no matter the RPM, MAP, or airmass, the ratio of the max aircharage slope to SD Calc slope is ~0.927331265. Meaning the SDcalc slope is greater (steeper) by that amount and its the same amount no matter what RPM i look at. Anyways, I guess I lied and went ahead and tried to match the SDCalc output and was only able to do it by using this constant "ratio".
If I don't use the ratio the resulting curve is very similar, just clips to a slope that is less. This is when the quad slope is lower and not considered. You can see that here:
forumSD7.png
I need to investigate a different Mappoint that includes conditions where the Quad Slope will be greater than Max Aircharge. That way I can test to make sure the code selects the correct clip slope.
I wont turn down an offer to learn. I would like to hear more about how it fools (or not) the EQ ratio. Im also thinking that I may need to know how to calculate c_norm and the pushback ratio to be able to solve the slope and the quadratic at the same time. So If there is an equuation available for c_norm (Gen3 Coyote here) I'd be interested. I think you provided the pushback ratio equation earlier (Im not sure I know what airslope). But, again, I would not turn down an offer to learn more about blowthrough too.
Very cool. I saw that post and it inspired some thought on how I was planing to provide some visualization tools (external to HPTuners of course) that may be useful. Now that I can solve for airmass using the quad, slope, offset, aircharge mult, etc with a push of the button, it is now easy to see how changes to those inputs change the shape of the curves. Not just the airmass vs MAP, but when you look at charts like airmass vs RPM (looks like a torque curve) you can adjust the inputs and change the shape intuitively. Was also thinking about a VE chart compared to a error in VE chart (using measured MAP).....but all just dreams at this point. I need a log bad. Maybe I can use a random number generator on the calculated airmass and generate a hypothetical log for testing.
With that said, if you proceed with some additional tool development, everyone that tunes SD would be grateful, because having that inside of HPTuner (if that's what you're thinking) would be awesome. No need to copy info back and forth, and the scanner might be able to show some info realtime (histograms, 3d SD correction charts, etc).
Big thanks for the info/discussion.![]()
"c_norm" is basically a reciprocal slope value of engine displacement, normalized for a standard pressure of 29.95inHg and an temperature correction of 60F that mathematically works out to 520/560 or roughly 0.9285. So you don't really need the exact formula for this. That multiplier should work as it has been for you, and if you want to know c_norm just take the reciprocal.
This is interesting. Are most of your slopes like this? Mine are not.
Knowing the pushback ratio doesn't help very much with generating new coefficients, because your coefficients will have their own blowthrough intercept, their own pushback ratio, etc.
I'll refresh myself on blowthrough before writing some more detailed information, but from what I can remember, there isn't any EQ ratio bending during blowthrough conditions. Ford generally prioritizes keeping the catalyst at it's ideal operating condition (stoich) so long as the now-enriched cylinder conditions don't breach combustion stability. But like I said, I'll double check.
Do you have a library that will regress your plotted points? I was just developing a standalone tool out of my own interest, not necessarily something to propose to be added to VCM. I don't think that individually bending each curve in the type of visualization/edit tool discussed would be the best workflow by the time you account for every column of every mapped point. Plus there are considerations for NA vs EcoBoost calibration approaches. EcoBoost will be interested in tuning using fuel trims the same way that NA guys tune their MAF using fuel trims.
There is still a mathematical issue at hand when determining blowthrough data points or prioritizing the slope over the quad.
Okay, so blowthrough does operate the way I suggested, but I need to differentiate some things about the way that MAF cars work versus EcoBoost.
I mentioned this earlier, but there's a switch on every calibration that basically says "if we have STFT, where is the error coming from?" and the two options are air or fuel. When we set this to air, the calibration assumes that essentially the MAF calibration is the source of the error, and thus in order to correct in closed loop, we need to apply the error to our in-cylinder airmass. Most people know that the reported MAF doesn't really bend to fuel trims, it always tracks what's coming out of the MAF transfer function. Air load however will bend, which is an indication that our in-cylinder airmass was updated by our STFT (and thus, we get the appropriate amount of fuel). This is how most MAF cars are configured.
On EcoBoosts, this switch is typically set to "fuel". What this means is that air load stays put and instead we assume there was something wrong with the fueling model (presumably something like the injector flow rate). What it does in this case is applies the STFT error to the commanded EQ ratio to even things out. Many people get confused by this because now the commanded EQ isn't following their power enrichment, but their actual lambda is. There may be exceptions to how the switch is set for NA vs EcoBoost, but this is the general rule.
With that out of the way, I'll talk about what blowthrough does on my Focus ST. The code evaluates blowthrough when determining how much to let the STFT influence the commanded lambda. In these cases, we can choose to prioritize either the catalyst or the in-cylinder conditions, but not both. Ford usually chooses the catalyst for emissions purposes, but if you want to calibrate this out, there's a table that basically says "this is the most rich we can command before risking combustion stability in-cylinder." So if you knew the ratio of blowthrough air versus in-cylinder aircharge, AND your SD model was dead on, you could set this table to your power enrichment lambda, and the PI loop that controls closed loop fueling would effectively disable in blowthrough conditions. I don't see anything that suggests that the STFT or reported lambda would adjust accordingly in these conditions, you would just embrace the STFT in knowing that you correctly calibrated this.
I would have to see how this works on the MAF side when the aforementioned switch is set the other way.
Does this mean that the MAF transfer function must be dialed in before logging Air Load for SD tuning? If someone made changes to the MAF house size (CAI) and added ported heads (changing SD model) then there would be no way to tune the car. They would need to convert back to a calibrated MAF housing, log external MAP vs. Air Load, and then make adjustments until SD model was correct and STFTs were also calibrated. Then switch to new MAF house size and tune MAF transfer function using STFTs. Am I tracking that correctly?
Looks like i accidentally calculated the pushback ratio.
Yes, so far Max Aircharge Clip is driving the curve in the linear region....but I haven't look at very many Mappoints where VE is different. And, appears that Max Aircharge is mostly "tuned" by the Aircharge Mult. So tuning a boosted coyote (above baro) may depend mostly on Aircharge Mult (I need to look at more Mapponts to see, but it would make sense).
This is becoming clearer to me, since Im just starting to take log data and run the calcs "backwards". Leaning towards using "sliders" to make adjustments to inputs to match curves. Will have to see what direction to persue, been spending time on fabricating log data (using the SD model set to different quad, slope, offest, etc.) then trying to tune SD to that log and see how close I get to the "known" solution. May bust out the calculus book next.![]()
I would dial in the MAF first, yes. The MAF is effectively permitted to act within the parameters of the SD model, but I dont think this prevents you from tuning the MAF first? So long as you don't clip inferred MAP in some way. The MAP may report incorrectly (until you fix it) but on MAF cars this is more of a filtering/anticipation/throttle/failed MAF thing. Many people tune boosted coyote's without ever touching SD aside from a few parameters (doesn't mean I approve).
You accidentally calculated c_norm, aka the linear line from the SD calc you've been trying to figure out, aka the theoretical maximum in-cylinder aircharge when the pushback ratio is 0. The line you had earlier that was slightly off has no place in the model because it comes from some other standard for temperature and pressure, I think 100F and 29.91inHg, don't quote me.
The pushback ratio is the distance between this c_norm line and linear line we create using the quadratic slope, IF the quadratic slope "wins". If it loses, the pushback ratio would mathematically be negative but in these cases we dispense with the quadratic slope and just clip the pushback ratio to 0. So to put that more simply and in your terminology, if the Max Aircharge Clip is steeper line, the pushback ratio is zero. If the other slope is steeper, the pushback ratio is some positive number describing the ratio of the distance between the two lines.
Perhaps the coyotes don't suffer as heavily from pushback through the intake valves and this is why murfie felt I was nitpicking this point. On my 2.0 EcoBoost, the stock data suggests a far more critical effect, and if you attempted to add VE to certain points without considering this effect, you'd appear to hit a hidden wall. You're correct that if you "hit the wall" you would need to raise the aircharge multiplier in order to get more. But this line already has manifold pressure as a variable, and therefore it's already accounting for boosted conditions. Putting this stupid simple again. Theoretically if a coyote can consume 5L of air at atmospheric conditions, it can consume 10L at twice the atmospheric condition, 2.5L at half the atmospheric condition, etc (I'm talking in volume which is nonsensical but you kinda get my point). This is what this line is showing. If you somehow managed to cram in 10L at atmospheric conditions (no boost), then you would need to double the aircharge multiplier (first we would obviously need to decorate you with various awards and honors for defying theoretical physics). Sarcasm and extreme examples aside, if anything you may need to make a small adjustment to the multiplier to account for a condition where the model has strayed from the real world conditions just slightly. This happens to me on Ecoboost, but in your case it's unlikely that a minor inferred MAP calculation error will be critical. You also have to ask yourself if crossing this line is the result of a blowthrough condition rather than a legit exceeding of the line. More on this in a second.
Calculus not required for this one thankfully. It an issue of multivariate regression. I think I made some headway here though.
Looking at my factory data, blowthrough is really a low rpm medium load occurrence. Just because blowthrough logic is enabled doesn't mean that blowthrough occurs at every point, and in my calibration, Ford uses a value of 23922 to basically say "blowthrough doesn't happen here" because this slope is so high that blowthrough will always resolve to 0. Every time my calibration has a legit blowthrough value, my pushback ratio is 0 (which makes sense because air can't push back over the intake valve while also flowing through to the exhaust valve). I was hung up because technically you could define a pushback ratio AND blowthrough at the same time, and I had no earthly clue how to figure which was which. With this in mind I think I can see a recalibration approach, at least assuming you collect complete data for any given dataset:
1) You need to see if the linear data points you collect in high MAP regions reflects either the c_norm ("Max Aircharge Clip"), or that you need it to be steeper than that. If so, you need to do a linear fit on that data to get a solid slope value because you're experiencing pushback. Then you do your best with the quad and offset to define your dilution region.
2) If it seems like your new slope is just slightly offset from your c_norm line, then probably just a multiplier change is needed.
3) If your data points are generally riding the c_norm, then your pushback ratio is probably 0. So you can generate all three coefficients to best fit your your quadratic data, but you need to be careful that you don't accidentally generate a slope that results in a pushback ratio. Blowthrough should be set calculably out of the way.
4) For blowthrough you just filter out the non-blowthrough data and do a linear fit.
I don't think the original authors of the patent are going to kick down anyone's door if you solve this with visual adjustment rather than least-squares regression. The calculator isn't really doing this anyway because you only get to specify one value per point rather than importing an entire set of individually collected points. I think we're both working to make identical tools at this point, which is fine. I think a more refined approach may present itself if this proves successful
Last edited by Rob@HPTuners; 01-21-2025 at 03:26 PM.
Screenshot 2025-01-23 024441.png
This is what I've got so far, functionally it's just doing things that I was already doing in Excel. I think this kind of color coding helps to understand better than the typical heat map. Pink is quadratic, blue is clipped against the slope line, purple is clipped against c_norm, and red is clipped against the maximum load parameter. So as you bend, it should be easy to see what it is you need to move.
I decided to avoid 2D plots for individual columns for a few reasons:
1) People are used to the 3D table the calculator provides
2) People are likely to continue using histograms with averages rather than regressing a scatter plot, and said histogram is likely to be a 3D table with similar axis
3) Editing one column at a time is extremely unwieldly across ~30 mapped points
I have to think through the sliders a bit. For the quadratic in particular its tricky because the resolution can be in the millions, and it isn't obvious how best to scale it. I may just do a up/down arrow with an adjustable interval.
Last edited by Rob@HPTuners; 01-23-2025 at 04:29 AM.
Very nice! I like it.
I've been headed in several different directions. Spent some time working on a way to identify the function changing from linear to quadratic to process all the log data and then suggest some "average" MAP/Airmass pairs. I did bust on the calc book to refresh my memory. It works, but I haven't really tried it on different Mappoints where the linear region is different. Work in progress.
Here is a similar 3d VE table and a chart showing the 2d MAP vs Airmass curve for a single RPM along with raw log data and the calculated "average" (not really an average) suggested points.
More to come from both, I hope!
forumSD8.png
Are those log points using a MAP sensor? Or logging inferred MAP?
I don't think there's an easy way to identify the switchover point between quad/linear/etc. because it's a catch-22. Points that have a reasonable variance from the maximum trapped aircharge line can be excluded for obvious reasons. Points that exist as part of either the quadratic or a slope that has a positive pushback ratio remain multivariate. For example, that cluster of yellow points on your graph can probably be regressed linearly with an 80-90% R-squared value. I think you would have to simulate combinations of different data points until you found the lowest variance for each curve (where the slope is shared of course).
Got a MAP sensor installed and wired through the PROLINK. Will go log some data when weather clears!![]()
Logged some SD data the other day. Went ahead and installed the 3psi wastegate spring to start collecting in the lower MAP/Load region.
Here is a screenshot of the SD tuning tool.
AutoSD.png
Upper left quadrant = SD calculator for a Mappoint and a RPM region. Blue line is the quadratic, red line is max airmass, green line is slope of quadratic. White dots are logged data and yellow dots are a statistical best fit for the logged data at a given MAP (inhg). User can adjust the quad term (blue), quad slope (green), and aircharge mult (red) to fit the HPT settings to the logged data.
Upper right quadrant = SD calculator for a Mappoint and a MAP region. Orange line is the aircharge vs RPM commanded by the HPT settings in the tune (could also be reconfigured to report VE instead). White dots are logged data, and the colored dots show which setting is limiting aircharge in the tune (blue = quadratic, green = quad slope, red = aircharge mult). You can see in the example of 36.5 inhg (~3psi) that the tune needs a little more aircharge at 3600 and 4150 rpms and that the quadratic and aircharge mult (blue and red dots) are limiting it in the tune.
Lower left quadrant = volumetric efficiency error for MAP vs RPM. Positive numbers represent percent error that is limiting aircharge to less than the logged data suggests is needed. The color of the cells represents what setting is limiting aircharge (same color codes as above). This table gives a quick overview of any problem areas that can be further explored and adjusted in the upper two charts. For example, VE has positive error in the 3600 and 4150 rpm regions.
Lower right quadrant contains two charts of logged data. One MAP vs. Airmass and one Airmass vs. RPM. Also, several filters can be applied to remove outliers and to just view all the logged data for that Mappoint.
Currently collecting log data without locking the Mappoints in the tune and getting good data in optimum power for Mappoints (21, 25) that have snap to point set. We will see what happens as Mappoints are blended in the upper RPMs. May have to lock to one of the Mappoints (23, 24, 16) later.
More to come.
Going from HDFX weights to error contribution is essentially backpropagation, which is about where I ended up needing to move onto other things. You'd need to generate variances based on the weights and the distance of the original data to the error. Or you can lock the cams but ive found that some cars will refuse to idle at certain MPs.
EDIT: Read your post more closely and just wanted to clarify something. The consequence of the error on a MAF car won't be a VE clip. If your MAF is reporting beyond what the "clip" would be based on your sensor, the inferred MAP will simply calculate higher. Your goal on a MAF car is to get inferred MAP to be as close to your sensor as possible, not necessarily for fuel, but for other things that will become happier as a result of having this correct (ie. anticipation logic, fuel rail pressure drops that use inferred MAP, etc).
Now, if your inferred MAP was so much higher than actual that it hits the maximum MAP values in the tune, then you start to clip the in-cylinder aircharge, and the STFT will be lean.
Last edited by Rob@HPTuners; 03-13-2025 at 05:01 PM.