So, this morning I thought to myself "I'll just write a script that converts that 12x12 table into a 16x16 table and works out the values in the middle"
If you ever find yourself having thoughts like that, stop them immediately. They are not good thoughts.
I'm fairly certain my brain has turned to mush and a large percentage of it has dribbled out of my ear. I'm fine with this for the following reason:
Cliff Clavin wrote:Well, you see, Norm, it’s like this. A herd of buffalo can only move as fast as the slowest buffalo. And when the herd is hunted, it’s the slowest and weakest ones at the back that are killed first. This natural selection is good for the herd as a whole, because the general speed and health of the whole group keeps improving by the regular killing of the weakest members.In much the same way, the human brain can only operate as fast as the slowest brain cells. Now, as we know, excessive intake of alcohol kills brain cells. But naturally, it attacks the slowest and weakest brain cells first. In this way, regular consumption of beer eliminates the weaker brain cells, making the brain a faster and more efficient machine.
And that, Norm, is why you always feel smarter after a few beers.
On the face of it, it seems easy, calculate the slope a-la highschool maths, plug that value in, and ka-blammo, it's done.
Except it's not that easy. We actually know the values of the slopes we want (ie; RPM and kPa values) what we want to find out is the *other* value, which is the value of the intersections of the slopes? I think? I don't know man, it's all a bit heavy. And sometimes there's three 'old map' bins between one 'new map' bin, and sometimes one 'old map' bin needs to cover a couple of 'new map' bins. I seriously considered a giant pre-compute table of every RPM and kPa increment, it would have only been 1Gb or so....
I asked Droo, he didn't really know either, but he mentioned interpolation, and it put me on the path of finding the equation for Bilinear Interpolation, which is almost exactly what we want. I say "almost exactly", because Bicubic Interpolation will be "nicer" - I need to find the equation for that (or; a version I can understand enough to turn into code), but Bilinear Interpolation will allow me to write the rest of the script. Having the equation is the hard part, the "easy" part is comparing the values of the RPM and kPa bins and seeing which corresponding RPM/kPa bins we need to interpolate from, which is easy, if you like nested for loops and if statements and gimp suits.
The best explanation for Bilinear and Bicubic Interpolation is in the top two pictures on the right of this article (Treat it like a porn magazine; ignore the words, look at the pictures - lest thy brain melt and runneth forth from thy ears):
https://en.wikipedia.org/wiki/Bicubic_interpolationUnless... *Casts Summon Grant* Do you happen to know off the top of your head what sort of interpolation the MS uses internally to compute the values between cells? (Bilinear or Bicubic, or "something else"?)
Either way; here's a thing:
http://imgur.com/OmR6gjg Green matches an RPM Column from the "original" map.
Yellow matches a kPa row from the "original" map.
Blue is interpolated RPM + kPA.
Red is a copy of whatever is to the left.
There's still heaps to do. Like make the bottom table actually update when you change the top one, at the moment it's all just hard-coded in so I could test the maths and the loops and the gimp suits. With a little bit of photo-shoppery the plan is to be able to upload one of the screenshots, have OCR read the table, present it for verification, allow an edit, and then give you a 12x12 or 16x16 table from a 12x12 or 16x16 for a given set of RPM/kPa bins - although at the moment it just does 12x12 -> 16x16, and none of that fancy stuff works.
And I want a "map difference" mode, so it will show me which partsof a "new" map a higher/lower than an existing one. Being able to upload .msq's and have them spat back out with the new map inside it will also be cool. None of that is happening today though...
datfreak wrote:A reminder to change your dwell settings for the cops setup, so it doesn't kill one of them.
Ta!
Thanks to the contents of this post, I didn't actually put the COPS on today... Tomorrow, maybe? (Car isn't running anyway, no coolant due to the O-Ring a couple of posts back, so I'm not in any real hurry)
Oh yeah, after-shot of the painted pipe, because arts and crafts are fun:
datfreak wrote:I dont have a na6 ignition table on this pc but my WOTS (90-100kpa) above 3500rpm were 38 degrees. Im running 98 fuel with this much advance.
I'll pester you for a look at this sometime in the future ;)
gslender wrote:Some folks have stated that the stock ecu is as much as 40 deg adv in the spark curves.
You've probably seen this, but here's a linky-loo:
http://www.miataturbo.net/megasquirt-18 ... 662/page2/ looks like all of that advance is in the vacuum/decel bins.
Time to rest my brain I think...