Please consider adding a totalizer function
based upon difference from time/value
between samples.
Total(Val{MPH},Period)
Where base Period could be second, minute,
hour, day?
Example:
Total(Val{MPH}, Hour) would totalize up over an
hour to a constant MPH value.
Total(Val{LPM}, Minute) would totalize up over a
minute to a constant LPM value.
and so on...
Could be reset to zero using the same technique
as RAVG().
Just a thought.
New Totalized Value =
(Delta Time in seconds/3600*Val{MPH})+Last Totalizer Value
(Delta Time in seconds/60*Val{LPM})+Last Totalized Value
(Delta Time in seconds/1*Val{LPS})+Last Totalized Value
Last Totalized Value = New Totalized Value.
Where Base Period equals...
3600 for hour
60 for minute
1 for second
86400 for day?
Where Delta Time equals...
Difference between current sample time and
last sample time in seconds.
The timestamp math should be doable.
There is already an example in the forum on
using two pids as an accumulator if you can't
save the last totalizer value as part of the function.
https://torque-bhp.com/forums/?wpforumaction=viewtopic&t=6110.0
Would still need a method like RAVG() to reset.
Edited.
Hi
Thats a reasonably difficult one, as some data could potentially be forward looking, point values, and backward looking.
I'll need to have a think about this one a little bit, but once it's done, basically will make any future data handling really easy to do (then it's just a case of adding flow control to the PID editor, which will be 'interesting' to do)
All the recent work done to the equation parser makes the basics of adding support simple, it's just the integration side (time series data) that needs to be handled properly.I will try to get this done sometime in the next couple of releases as I think it's also quite an important feature
Bump for edits.
Hi!
Done - just need to finish testing(as it was a bit late last night) and merge it into the beta and I'll then get released
Any more useful functions, please list them and I'll try to get them in
Two more come to mind...
Delay(Time Amount, Value)
A delay function where data goes into a
queue and is time delayed by a user
specified time amount before coming out. This
would be useful when dealing with process
lag times.
------- 5 4 3 2 1 ---»
5 4 3 2 1 * * * ---»
* delay period
Filter(Filter Constant, Value)
A filter function using EWMA for dealing with
noisey signals. Your new averaging functions
should be very helpful with this.
Thanks for listening to your users!
Edited.
Done, done and done.
Please check the totalizer function
Currently testing 1.8.119 and noticed that
I cannot test or save
tot(60:600) note the coma didn't work colon did!
without adding + abs(0)
Yielded PID cannot be empty...
Otherwise its looking good so far. I especially
like how it continues totalizing when changing
screens.
Thank you Ian.
It will be interesting totalizing MPH and fuel
rate!
Hi
Yes - the ':' separator is used because some countries use commas for their decimal separator (and that makes things more than a little problematic)
The tot function adding up when not on screen is more a symptom of how it works with the delta function - the display *will* stop being polled when not visible (unless it's being logged) and when you return to it, the delta is sufficiently large from the last to next read that it "catches" up
I mentioned the fact about the colon
because your changelog and wiki examples
are using commas which doesn't work.
So a floating widget would be the way
to continue polling the value precisely
if not logging?
Good point - I'd missed that in the wiki page!!
A floating widget would cause the lookups to continue, yes, though logging might be better as then you don't clutter your screen up