ADU number function, integrate or add to a previous value

Hi, is there a way to either integrate a channel over time, or to update a value, such that the new value is the old value plus another channel?

For example, t = 0.998s and channel 1 = 10 and channel 2 = 3, then at t = 1.000s, make channel 1 = previous value plus channel 2, ie 10 + 3 so channel 1 reports 13.

There is no integration operation available in ADU, but you can perform it later in Data Master if needed.

Regarding seconds question:
image
So the new c1 is the c1 value from the previous loop execution plus the c2 value from the previous loop execution.

Thank you for the response. Both questions were aimed at trying to do he same thing, convert a fuel flow (cc/min) into a total fuel flow, ie L for the virtual fuel tank. The Data Master tip is handy, but won’t work in this case.

Think I might have to get an arduino or something to do this, since I can’t see a way to do this via my ECU (Megasquirt 3). Thanks for the help.

Could you send me a log from your ADU with the fuel flow data? I’ll check if it’s even feasible to calculate it on the ADU.

@Tim

Please check the example project below — I’ve created something that may be useful for you.

In this project, the total fuel in liters is calculated from fuel flow in ml/min * 10.
So, for a value of 10,000, it represents 1 liter per minute.



fuelFlowToTotalFuelExample.adu (6.4 KB)

Please note that the order of numbers and functions in the project tree is important, so do not change it.

1 Like

Thank you! That’s a really clever way of doing it. I will integrate it and report back!

It works! Thank you so much. For anyone interested, these were my Tunerstudio settings for sending the fuel flow.

I might play around with increasing the frequency of the calculation, but I don’t think it should be necessary, since the ECU is averaging the fuel flow over the 1000ms.