Ages ago I was using cruise control to do some road tuning for best fuel economy.
I'd drive a set piece of road at a set speed. Then had digital inputs on the dash that added different combinations of ignition timing.
So I'd go do a run at XYZ speed, which has lots of ups and downs in it to vary the load. Record a log file.
Then come do that same thing again, with different amounts of ignition advance added by the switches.
This showed clear as day in the CC per min fuel usage logs, and TPS, which was best.
So I took this a step further and made an arduino canbus unit that would wait for certain conditions to be met (cruise control on,steady driving no tps movement)
When cruise control is turned on, a virtual aux is triggered by the Teensy which sends a digital canbus input to turn on a 4D ignition table that has an analog canbus input as the load axis.
Then the Teensy has a full separate ignition table in it, and outputs the can value that represents ignition advance for the table.
It would collect 100 samples of fuel economy. Advance the ignition 3 degrees. wait for conditions to stabilize again. Then collect another 100 samples.
Then it would compare the results of the test. If the results were better above a certain margin, it deinterpolates the current load/rpm ignition timing addition back over the 4 cells that its interpolating from.
Then it checks that if there is any lower load area or lower rpm that has less ignition timing than this, it will update those values too.
If the economy got worse, it would creep the ignition timing slightly back from where it started from, and do it again.
Basically it's auto road tuning for MBT. (But only works in a fairly narrow rpm and load range, because you dont have cruise control turned on at 8000rpm WOT)
So it iteratively builds up an ignition timing map on its own and keeps fine tuning it.
Starting with 10 degrees timing everywhere, it builds up a relatively sane ignition timing map in about an hour or two which is really cool.
But whats nice is that when the car comes to a stop I can store the values to Eeprom so they're not lost when car shuts off.
So I'm also planning to shuffle the knock sensing logic over to this board too, so I can store long term knock trims instead of losing everything when car turns off.
However, this then also scope creeped into a context sensitive plug and play digidash / 3d printed housing.
With a whole bunch of other crap going on like auto dimming, changing screens based on what you're doing, xy plots, histograms, etc etc.
Also takes all of the standard dash inputs like lights, indicators, etc etc. Work in progress! (Its for an 80s car hence LCD type look)
Working through some bits at the moment like estimated range off remaining fuel, and things like that. Has been a good learning experience and I'm pretty happy with the results so far.
Once the auto dimming became functional It's been really nice to drive with.
Trust me though, you dont want to see the code hahaaha.