Edit. Flash. Log. Repeat.
What about a way to change the output of maps dynamically? Maybe reducing the amount of time spent flashing just very small tweaks when narrowing down towards an optimal setting?
I haven’t done any modifications for a while now. I’ve been reading a lot of books instead (which is perhaps what I should have done to begin with…). I gather certain aftermarket systems let you alter the maps dynamically which is nice if you have a load holding dyno. For ME7 I understand there are emulators as well which achieve the same thing. Although I’ve never actually seen an aftermarket ecu or emulator either
Now I can’t dynamically change the map values in my MED9.1 and I don’t have an emulator, but what about the output of the map? This is a variable anyway and by simply adding or subtracting a bit, it’s effectively the same as changing the map.
For example, let’s say at 3000 rpm and 190% load, KFZW is 1.5 degrees. At those conditions, this is the output of the map (1.5 degrees) and is contained in a register. I could add this register to a second register that contains a dynamic value of my choice (say 1 degree) and put the sum of the two (2.5 degrees) back in the original register. Now the ecu would carry on and faithfully process this, just as though it had looked up 2.5 degrees to start with. If torque increases, that’s good and you should add 1 degree to that cell in the bin next time you flash (for a total of 2.5 degrees) . If knock increased, that’s bad and you should leave that cell alone.
So how is this dynamic? Well, what about changing the contents of that second register by turning a dial?
I used the CANBUS to implement this. I discovered that the messages received on the CANBUS by the ecu populate a table in RAM. By creating my own CANBUS message, I could change the byte values in the RAM table. I could then use those RAM addresses in some custom ASM to add two registers together as described above.
Bit of background on the CANBUS.
1) In the flash there is a table containing the CANBUS ID’s that the ECU will actually receive. There are a lot of CANBUS messages floating around on the bus. Normally CANBUS nodes don’t listen to all messages by default since they’d spend all their time processing interrupts and discarding irrelevant message ID’s instead of getting on with the job. So there’s usually an access filter which only allows certain messages. Only if one of these permitted messages is received does the node process it. Here’s the table in flash. There are three sections (lining up with the three TouCAN modules in the MPC562 processor). This is nicely documented in the FR as well which describes exactly what each message ID is used for. Have a look at sections CAN_CONF and CANECUR. In my S3 the configuration table starts at 0xA09F4.
2) So the message ID’s are contained in a table in the flash and that table also has spare entries (the ones marked 7FF). Here’s the equivalent table in an A6 MED9.1 ecu. You can see extra entries, presumably for equipment that I don’t have in my S3. I’m guessing I can add my own message ID’s that I wish to receive in the spare lines of the table.
3) Ok, but where do the received messages pop out then? I used my RAM logger and took a snapshot of the ecu RAM. Lo and behold, nestled away was a table containing the CANBUS ID’s and the received CANBUS data bytes. Could it be this simple? Add my own message ID to a spare line in the flash table, transmit a message with that ID on the powertrain bus and it pops out on the corresponding line in the RAM table? Not quite