Re:Whittlebeast's RPMxMAP vs Duty function

This is a forum for discussing the development and testing of alpha MS2/Extra code. Documentation
(Runs on MS2 and Microsquirt)

Moderators: jsmcortina, muythaibxr

ol boy
Super MS/Extra'er
Posts: 1532
Joined: Mon Sep 10, 2007 3:06 am
Location: Tucson, Az

Re: Re:Whittlebeast's RPMxMAP vs Duty function

Post by ol boy »

I'll post my ride home from tonight and my ride to work. Might have to email them straight to you Rob.

Sent from my SM-G920V using Tapatalk
306 SBFord, Torquer II EFI intake, 60 lbs injectors, 8 LS2 coils, VS Racing 7668 turbo, 4R70W, MS3x fw1.4 w/built in trans controller.
ol boy
Super MS/Extra'er
Posts: 1532
Joined: Mon Sep 10, 2007 3:06 am
Location: Tucson, Az

Re: Re:Whittlebeast's RPMxMAP vs Duty function

Post by ol boy »

From my drive this morning I plotted RPM>>MAP>>VE and got this nice histogram. Nice flow of values from high to low across the table. This of course is a short load and rpm range. Had a tire separate on me a few days ago and limped it into the tire shop this morning.
VE table_rpmxmap.jpg
Vetable AFR range.jpg
looks like the filters wont work for AFR range because MLV is producing the AFR value internally and not from the log itself.
306 SBFord, Torquer II EFI intake, 60 lbs injectors, 8 LS2 coils, VS Racing 7668 turbo, 4R70W, MS3x fw1.4 w/built in trans controller.
ol boy
Super MS/Extra'er
Posts: 1532
Joined: Mon Sep 10, 2007 3:06 am
Location: Tucson, Az

Re: Re:Whittlebeast's RPMxMAP vs Duty function

Post by ol boy »

Got a new version from Rob a few hrs ago. Took it for a spin around the block. Ran 2 miles down the freeway and back. I loaded the log into MLV and selected VE1 for y, map x rpm for X and AFR for z. Just don't see the tune doing much. 14.5 from lower mapxrpm to higher but on the same VE1 plot.

This might be hard to get good data, much past 30% throttle I begin to make boost. Near impossible to get 5krpm at 100kpa. Can do 200kpa at 5k... see how the morning drive goes.

Sent from my SM-G920V using Tapatalk
306 SBFord, Torquer II EFI intake, 60 lbs injectors, 8 LS2 coils, VS Racing 7668 turbo, 4R70W, MS3x fw1.4 w/built in trans controller.
ol boy
Super MS/Extra'er
Posts: 1532
Joined: Mon Sep 10, 2007 3:06 am
Location: Tucson, Az

Re: Re:Whittlebeast's RPMxMAP vs Duty function

Post by ol boy »

VE1 on y and rpm on x with AFR on z. Does get slightly richer with rpm on same VE1 row. That weird 16.7 group is about where the converter flashes to on throttle tip in. Need to sort AE next...


Image

Sent from my SM-G920V using Tapatalk
306 SBFord, Torquer II EFI intake, 60 lbs injectors, 8 LS2 coils, VS Racing 7668 turbo, 4R70W, MS3x fw1.4 w/built in trans controller.
robs
Master MS/Extra'er
Posts: 564
Joined: Sun Jan 17, 2010 4:26 pm
Location: Sydney, Australia

Re: Re:Whittlebeast's RPMxMAP vs Duty function

Post by robs »

ol boy wrote: This might be hard to get good data, much past 30% throttle I begin to make boost. Near impossible to get 5krpm at 100kpa. Can do 200kpa at 5k... see how the morning drive goes.
Yeah, the green dot tuning is good for light to moderate driving. Heavier load is probably best done by looking at a log file after a few bursts. Wouldn't be hard to write an autotune for this stuff, but first we have to see if it works at all. Were you able to zero in on a value for "degrade"?

Feel free to e-mail me a log (or two).

Have fun,

Rob.
ol boy
Super MS/Extra'er
Posts: 1532
Joined: Mon Sep 10, 2007 3:06 am
Location: Tucson, Az

Re: Re:Whittlebeast's RPMxMAP vs Duty function

Post by ol boy »

Quick one for the software guys... why do we not read AFR to the xx.xx instead of xx.x? In the INI file afr1 is an s16 so it could be solved to xx.xx.

Sent from my SM-G920V using Tapatalk
306 SBFord, Torquer II EFI intake, 60 lbs injectors, 8 LS2 coils, VS Racing 7668 turbo, 4R70W, MS3x fw1.4 w/built in trans controller.
ol boy
Super MS/Extra'er
Posts: 1532
Joined: Mon Sep 10, 2007 3:06 am
Location: Tucson, Az

Re: Re:Whittlebeast's RPMxMAP vs Duty function

Post by ol boy »

Rob: didn't see your reply until now. I played with the degrade value a little and saw the Afr swing richer or leaner depending on which way I adjusted.

Had a thought for better chasing down how the corrections work. With ego on can we have the code change the values to VE1 and store them for the trip? Is this something VEAL could do instead? Would be nice to see a rpm to map to ego correction table. Suppose I could just try auto tune. Is VE1 even active?

Sent from my SM-G920V using Tapatalk
306 SBFord, Torquer II EFI intake, 60 lbs injectors, 8 LS2 coils, VS Racing 7668 turbo, 4R70W, MS3x fw1.4 w/built in trans controller.
robs
Master MS/Extra'er
Posts: 564
Joined: Sun Jan 17, 2010 4:26 pm
Location: Sydney, Australia

Re: Re:Whittlebeast's RPMxMAP vs Duty function

Post by robs »

VE1 isn't active at all when running this option. Interesting thought about storing the values to VE1 as you drive -- you'd still need a laptop (or whatever) connected so the values could be written from RAM to flash at the end of the run. I don't think it buys us much since the laptop could log the drive anyway. VEAL would be puzzled with this firmware. If it thought a bucket was rich it'd lower its value, and go on lowering it since the table has no effect.

Autotuning would require a different flavour of VEAL which just played with the Whittle control points and the degrade value.

FWIW, checking a few more log files (including Andy's) it looks like a degrade of around 0.30% / 100 rpm would be reasonable, but it's not terribly consistent between Whittle contours. Just adding the degrade option has complicated things quite enough. I have a feeling that if this approach is good for anything, it's for a quick couple of sessions' tune, then poplulate the VE table with the result and back to traditional methods.

Not sure on the AFR question. Both my cars' readings are far too noisy to make much use of another digit. At a hardware level, the A2D unit is 10-bit. For the LC1's default config (range of 7-22AFR IIRC), that gives you 0.015 as the least step, so it wouldn't quite get to the 0.01.

Have fun,

Rob.
ol boy
Super MS/Extra'er
Posts: 1532
Joined: Mon Sep 10, 2007 3:06 am
Location: Tucson, Az

Re: Re:Whittlebeast's RPMxMAP vs Duty function

Post by ol boy »

What's the planned end result of the whittle curve? Quick start to a VE table, an alternative to SD/%baro, fail safe to MAF?

Talking out loud:
It's not that I don't like VE tables, I just think there is an easier/better way to solve for PW, the whittle curve seems to be it with a few modifiers. I think VE1 could be used as a place to store ego corrections applied to the curve at different rpms. Maybe view it as a short term fuel trim. Have the ego saved in ram and stored and referenced from ram. (Just realized that dam burn stumble.) Maybe to that hot...

Maybe a CAN bussed micro SD card with a short term trim table. I think there is a bigger application making MS2 closers to self tuning.

Holley claims to have a self tuning ecu. Wonder if they are doing a map x rpm curve and doing a quick correction from O2 output to adjust the curve. Short drives around the block will get about 90% of the curve. Any other oddities could be handled with a short term correction table or the %/rpm degrade. The burn stumble is a problem though. Maybe only on deceleration (over run fuel cut situations).

Sent from my SM-G920V using Tapatalk
306 SBFord, Torquer II EFI intake, 60 lbs injectors, 8 LS2 coils, VS Racing 7668 turbo, 4R70W, MS3x fw1.4 w/built in trans controller.
robs
Master MS/Extra'er
Posts: 564
Joined: Sun Jan 17, 2010 4:26 pm
Location: Sydney, Australia

Re: Re:Whittlebeast's RPMxMAP vs Duty function

Post by robs »

There isn't really a "plan" at the moment. It has just been an experiment to see how Andy's idea panned out.

The basic idea of seeing a pattern in good tunes and that this pattern follows along an "easy to drive on" MAPxRPM contour is very appealing. In the flesh, the changes I've made so far don't seem so promising. The direct lookup of VE from MAPxRPM was easy to tune, but resulted in a tune that was only right along the chain of RPMs it was tuned for. Adding the degrade parameter, which put the highest VE at the lowest revs and had a constant decline in VE as the revs increased, gives a broadly better tune, but it's a bit odd to handle. Each change to "degrade" causes the entire tune to change and to change more at higher revs, tilting the whole VE surface. So, like dead time, you need to get degrade right before getting too carried away with tuning the control points, but you need some curve points about right before you can work out what degrade should be.

The idea was to make tuning simpler; doesn't seem like a win.

I'm not sure where Andy stands on this. He would be right to say that I haven't actually implemented what he was looking for (i.e. a duty cycle lookup). I have already explained my reasoning. I also sent Andy some plots a couple of days ago showing that, even after fitting the best possible line to the Duty graph, there was still quite a significant variation in duty around this line and 1% of duty can be much more important that 1% VE. In essence, what plotting Duty against MAPxRPM does is to transform the VE table into a long thin parallelogram whose major diagonal is the line that looks so appealing on the graph.

Have fun,

Rob.
ol boy
Super MS/Extra'er
Posts: 1532
Joined: Mon Sep 10, 2007 3:06 am
Location: Tucson, Az

Re: Re:Whittlebeast's RPMxMAP vs Duty function

Post by ol boy »

Rob: do you think both a x and y axis degrade value is needed? Is this something MS2 could could sort out on its own or would be sorted from TS?

I really think VE1 could be used to sort out both axis of degrade by letting auto tune lean on those cells. Once it's done tweaking VE1 generate a SD VE table with the degrade values.

I could pull a hose and have the turbo blow air around the engine instead of into the intake to see how much rpm degrade is needed.

Sent from my SM-G920V using Tapatalk
306 SBFord, Torquer II EFI intake, 60 lbs injectors, 8 LS2 coils, VS Racing 7668 turbo, 4R70W, MS3x fw1.4 w/built in trans controller.
robs
Master MS/Extra'er
Posts: 564
Joined: Sun Jan 17, 2010 4:26 pm
Location: Sydney, Australia

Re: Re:Whittlebeast's RPMxMAP vs Duty function

Post by robs »

Ryan, I don't think a Y-axis degrade is needed. Things might be improved with a different slope value for each control point. The Whittle contours would then be able to follow different slopes down the VE surface. But the simplicity of tuning is then completely gone, and I think that's the only potential benefit of this fuelling model. Same applies if we use a trim table: why the curve if we're tuning a table anyway?

As for trying to tune your car with the Whittle curve v2 firmware, I don't think you should do anything drastic. You want to nail down the slope value first. With that out of the way, just tune the control points as for v1. And then log a drive covering a decent range of loads and speeds and see how the AFR looks in MLV.

To get that initial slope, choose a mid level contour; say that's 50kPa @ 3000rpm: the 1500 MAPxRPM/100 contour. Ride that up a hill (say at 2000rpm,75kPa) and adjust the curve control point to get stoich. Then drop it back a gear (or run down hill) to raise the revs and lower the load, but stay on the same 1500 contour. If the mixture is now lean, reduce "degrade". Degrade is global in effect, so all control points will change every time you change it, but at the moment you're only really worried about this one control point (with others somewhere in the ballpark so you can drive it).

We're hoping all the other contours will be reasonably happy with the same degrade value (nothing wrong with hoping...), so the rest of tuning is just a matter of getting the other control points happy at some point on their contours. Beyond this, it'd be log file analysis to analyse the whole range and try to improve control points and/or slope.

Have fun,

Rob.
whittlebeast
Super MS/Extra'er
Posts: 2221
Joined: Tue May 04, 2004 8:20 pm
Location: St Louis
Contact:

Re: Re:Whittlebeast's RPMxMAP vs Duty function

Post by whittlebeast »

From the time I slowed hanging round here, about 8 years ago till recently, I have been working on all sorts of motors and all sorts of tuning systems. Almost every one of the several hundred motors came back to the same pattern once fully tuned.

My head keeps coming back to the same conclusion. Do a lookup from MAPxRPM to get DC, quick do a calculation to get back to VE and feed that number into the fueling equation. A little gitter from integer math will simply not be an issue in the big picture of fueling.

Andy
robs
Master MS/Extra'er
Posts: 564
Joined: Sun Jan 17, 2010 4:26 pm
Location: Sydney, Australia

Re: Re:Whittlebeast's RPMxMAP vs Duty function

Post by robs »

Andy, there are patterns and there are patterns.

Just because a great tune tends to have a pretty tight line relationship in the MAPxRPM->Duty graph doesn't mean that all tight line relationships in the Duty graph are good tunes. These two plots are from Ryan's log.
ryan.png
On the left is MAP*RPM vs PW*RPM/1200 -- the duty cycle plot -- After a day or two's tuning the graph looks pretty tight (over the range shown here at least). However, the plot on the right is RPM vs MAP coloured according to AFR. Generally too rich, and higglety-pigglety into the bargain. Far from ideal. So the tight relationship may be necessary, but it's not sufficient to say a tune is good.

For interest:
ryan2.png
That's MAPxRPM -> VE1, coloured according to VE1. Everything on the Whittle contour gets the same VE. The RPM degrade value would smear this to something a bit less weird, but probably still a long way from a good tune.

No regrets from me, I've enjoyed it, but I don't think there's much future in it.

Have fun,

Rob.
ol boy
Super MS/Extra'er
Posts: 1532
Joined: Mon Sep 10, 2007 3:06 am
Location: Tucson, Az

Re: Re:Whittlebeast's RPMxMAP vs Duty function

Post by ol boy »

Make sure you scaled the afr correctly. One log was raw volts values and I had to do a calculated field to report the correct afr. I'm seeing 14.4 to 15.0 across most of the tune when not into boost.

Sent from my SM-G920V using Tapatalk
306 SBFord, Torquer II EFI intake, 60 lbs injectors, 8 LS2 coils, VS Racing 7668 turbo, 4R70W, MS3x fw1.4 w/built in trans controller.
robs
Master MS/Extra'er
Posts: 564
Joined: Sun Jan 17, 2010 4:26 pm
Location: Sydney, Australia

Re: Re:Whittlebeast's RPMxMAP vs Duty function

Post by robs »

You're quite right Ryan. Average AFR for the whole log was 14.6, with half the values between 14.0 and 15.2. Given that your target was 14.7 for MAP < 80, the tune isn't all that bad. It does trend leaner as MAP increases though, which isn't the way you want it. The later version with a suitable degrade parameter could definitely get you closer.

I suppose this raises another question for Andy: looking at the duty graph, can we just say "mission accomplished"?

Have fun,

Rob.
whittlebeast
Super MS/Extra'er
Posts: 2221
Joined: Tue May 04, 2004 8:20 pm
Location: St Louis
Contact:

Re: Re:Whittlebeast's RPMxMAP vs Duty function

Post by whittlebeast »

These two screen shot are what keeps haunting me. When MAPxRPM does not want to work, always ends up Alpha-N related. Still MAPxRPM a;ways works better at predicting DC than it does predicting VE. This is a really raspy 4 cylinder motor getting rung out on a road race course.

http://www.nbs-stl.com/motec/MAPxRPM%20 ... %20TPS.png

http://www.nbs-stl.com/motec/MAPxRPM%20 ... %20RPM.png

Here is the raw data.

http://www.nbs-stl.com/racecardata/2016 ... OG0071.msl

Andy
robs
Master MS/Extra'er
Posts: 564
Joined: Sun Jan 17, 2010 4:26 pm
Location: Sydney, Australia

Re: Re:Whittlebeast's RPMxMAP vs Duty function

Post by robs »

Andy, a 1mm difference at the left of the duty graph makes as big a difference to PW as, say, a 10mm difference on the VE graph and I think this scaling according to engine speed pretty much accounts for the difference between those graphs.

But my point is a simpler one. The firmware Ryan's using has a narrow Duty plot. Never mind that it does it in a way you weren't expecting, it delivers the graph you were after. So either the job is done, or the graph is not the whole story. My money's on the latter.

Thanks for the log file. It is interesting digging around in these things; by the looks of it, this engine would not suit the whittle contour + degrade ramp -- it has a VE dip at the elbow and appears to ramp up at both lower and higher revs. You did say this was a raspy engine, so doesn't kill the idea for more mundane ones. Ryan has sent me a couple of his log files. Will see if I have anything to recommend.

Have fun,

Rob.
ol boy
Super MS/Extra'er
Posts: 1532
Joined: Mon Sep 10, 2007 3:06 am
Location: Tucson, Az

Re: Re:Whittlebeast's RPMxMAP vs Duty function

Post by ol boy »

Weeellll... I gave up the ghost and switched back to %baro. I got up to 0.8 on the degrade % and still had that bad weird lean hole at 1500 rpm and fat at higher rpm with the same rpm x map value. I could see when I updated the %degrade that the VE value would fall by 0.5 VE or so. It just feels like we are trying to make up for a poorly set deadtime.

I'll play with dead time in %baro and get it sorted then switch back to the whittle curve.

Sent from my SM-G920V using Tapatalk
306 SBFord, Torquer II EFI intake, 60 lbs injectors, 8 LS2 coils, VS Racing 7668 turbo, 4R70W, MS3x fw1.4 w/built in trans controller.
ol boy
Super MS/Extra'er
Posts: 1532
Joined: Mon Sep 10, 2007 3:06 am
Location: Tucson, Az

Re: Re:Whittlebeast's RPMxMAP vs Duty function

Post by ol boy »

Rob.. can you create a S.19 file for a microsquirt module? I'm doing a single 4 stroke soon and will have a chance to try your code revision in a more stable environment.

Thanks Ryan

Sent from my SM-G920V using Tapatalk
306 SBFord, Torquer II EFI intake, 60 lbs injectors, 8 LS2 coils, VS Racing 7668 turbo, 4R70W, MS3x fw1.4 w/built in trans controller.
Post Reply