How the DME calculates load, i.e. the Transfer Function
Posted: Mon Nov 24, 2025 4:51 pm
I was about to start documenting how the fuel maps work when I realized I really needed to explain how the DME engine load is calculated first. This step has for some reason usually been called the "transfer function" by others over the years. It's a bit cryptic in how it works but not hugely complicated. The end result is a number that combines rpm and airflow and serves as the actual fuel injector base pulse width.
The reason for the "cryptic" part of the code is that the AFM's output is logarithmic, not linear, with respect to airflow, and the code linearizes it in a weird unconventional way.
That logarithmic curve very deliberate. I know it's deliberate because the potentiometer part is actually linear, so the logarithmic curve must be coming from the physical shape, which took some trouble to get right (look at the curve of the air channel). The logical reason I would guess is that this gives more of the available resolution (which is very limited) to the low/medium airflow ranges, where better sensitivity and accuracy are needed for driveability.
Anyway here is my attempt at explaining all this in 2 parts - first an overview with lots of pictures and then a code walkthrough with fewer pictures (but still not zero).
https://jhnbyrn.github.io/951-KLR-PAGES ... ation.html
https://jhnbyrn.github.io/951-KLR-PAGES ... rough.html
Maybe I should update it with some physical details of the AFM. I have a spare one that I could probably get some pics of and maybe create a diagram.
Anyway the reason all this is important when it comes to fuel maps is that the maps don't really contain anything that can meter out fuel in proportion to airflow, which obviously is needed. That's done by the base fuel pulse explained here. The maps really just stretch or shrink the base pulse a little bit here or there to target different AFRs. If you're looking in the raw maps, any place you see "128", that means 14.7:1, higher means richer, lower means leaner. But the details of how all that works will have to wait for another documentation drop!
The reason for the "cryptic" part of the code is that the AFM's output is logarithmic, not linear, with respect to airflow, and the code linearizes it in a weird unconventional way.
That logarithmic curve very deliberate. I know it's deliberate because the potentiometer part is actually linear, so the logarithmic curve must be coming from the physical shape, which took some trouble to get right (look at the curve of the air channel). The logical reason I would guess is that this gives more of the available resolution (which is very limited) to the low/medium airflow ranges, where better sensitivity and accuracy are needed for driveability.
Anyway here is my attempt at explaining all this in 2 parts - first an overview with lots of pictures and then a code walkthrough with fewer pictures (but still not zero).
https://jhnbyrn.github.io/951-KLR-PAGES ... ation.html
https://jhnbyrn.github.io/951-KLR-PAGES ... rough.html
Maybe I should update it with some physical details of the AFM. I have a spare one that I could probably get some pics of and maybe create a diagram.
Anyway the reason all this is important when it comes to fuel maps is that the maps don't really contain anything that can meter out fuel in proportion to airflow, which obviously is needed. That's done by the base fuel pulse explained here. The maps really just stretch or shrink the base pulse a little bit here or there to target different AFRs. If you're looking in the raw maps, any place you see "128", that means 14.7:1, higher means richer, lower means leaner. But the details of how all that works will have to wait for another documentation drop!