Page 1 of 1
Running 5 minute average calculation

Posted:
Sun Oct 26, 2014 9:39 am
by JulianEdgar
I have an ADL3 dash and M400 running a 3 cylinder Honda Insight turbo.
I'd like to be able to calculate averages for certain rolling time frames - for example, average fuel economy for last 5 minutes.
I have instantaneous fuel consumption being calculated (via adv maths functions, with calculation based on duty cycle and speed).
Can anyone tell me how to gain this 5 minute rolling average?
I am very new to the advanced maths functions, so be nice if the answer is obvious!
Re: Running 5 minute average calculation

Posted:
Mon Oct 27, 2014 4:18 pm
by JulianEdgar
OK easiest way proved to be in channel maths - just use a filter (with a constant of 5000) on the instantaneous fuel consumption channel. That gives a rolling average of about 5 minutes - I just trialled different constants until it seemed about right.
However, I have another issue.
I am using two expressions in the ADL3 advanced maths:
('Fuel Inj Duty'[ratio]*0.643*60)/('GPS Speed'[km/h])*100
- with the output channel of 'Ins Fuel Econ'
This gives me instantaneous fuel economy in litres/100km and works well. However, to avoid it showing silly stuff when the car is stopped (and wrecking averages like the 5 minute filter described above), I have added:
choose('Drive Speed Left'>1,'Inst Fuel Econ',0)
- which returns a value of 0 for Inst Fuel Econ when speed is les than 1 km/h. It uses channel output User Math 1.
The problem is that User Math 1 then has no decimal places - just whole units. I need at least one decimal place (and preferably two) in this output channel.
How do I get back my missing decimal places? I have tried adding the units, multiplying by 100 at an earlier stage and then subsequently dividing - nothing seems to work.
Re: Running 5 minute average calculation

Posted:
Tue Oct 28, 2014 9:55 am
by JulianEdgar
OK, fixed this problem.
Incredibly, it seems as soon as you select a 'user maths' channel, resolution immediately drops to whole digits.
I got around it by selecting higher resolution unused channels (eg aero pressure 1, aero pressure 2) to do the calculations and then display those under changed names.
Re: Running 5 minute average calculation

Posted:
Thu Oct 30, 2014 7:28 pm
by AdamW
I think your problem is that the user math channels are not for normal use in an ADL, it seems you have selected a channel that belongs to the Interpreter category:

You should instead choose one of the general purpose channels from the top of the category list (not shown in this pic).
.
Re: Running 5 minute average calculation

Posted:
Fri Oct 31, 2014 8:13 pm
by JulianEdgar
Thank you - I hadn't realised channel selection was so important, Now I do!