PDA

View Full Version : Map Data Filters in V8 Scan Tool



koolky
July 7th, 2018, 07:01 PM
I specifically need to figure out how to apply a filter like throttle position is changing more than 5.00 % per 100 ms from V7.5 to work in V8. I've figured out how to code the the calc pids but have no clue how to factor in the 100ms timer while tracking variation in TP. I know how I would do something like this in C++ but I'm lost with Lua. Hoping I've missed something and it will be as easy as V7.5.

Thanks

Blacky
July 9th, 2018, 10:08 AM
Does this help?

22236

Regards
Paul

koolky
July 10th, 2018, 03:25 AM
Can you break down the first line of code for me? I get the initiation of there variable 'tpdx' but what is dx() and what is going on within dx()?. Are frames always 1 second?

Blacky
July 10th, 2018, 11:58 AM
The dx() function is provided by EFILive, this is the implementation (written in Pascal/Delphi) within the V8 software of the dx() function. It simply computes the rate of change with respect to time for a given PID value between two frames. Also known as a derivative and is usually written as dx/dt.



function dx(aPid: string; aFrame1,aFrame2: integer): double;
var
rise,run: double;
t1,t2: double;
begin
// Ensure frames are in range and are ordered low->high
CoerceAndOrder(aFrame1,aFrame2,0,FrameCount-1);

// Get the change in PID value between the two frames.
rise := pid(aPid,aFrame2)-pid(aPid,aFrame1);

// Get the timestamp in ms for each frame
t2 := time(aFrame2); // ms
t1 := time(aFrame1); // ms

// Calculate the elapsed ms
run := t2-t1;

// Compute the rate of change of the PID value per second
if ( not IsZero(run) ) then
Result := (rise*1000)/run // *1000 to convert from "change per ms" to "change per second"
else
Result := 0;
end;


Note: the pid() and time() functions used in the dx() function above can be called directly from a Lua script. The pid() function always returns the metric value of a PID. Use the convertValue() function to convert from metric to other supported units. E.g. convertValue(k,"km/h","mph") would convert the value in k to mph. If k was 100, then the function would return 62.137 mph.


Regards
Paul

koolky
July 10th, 2018, 03:59 PM
How do I include a filter in a custom pid code? With the filter set as 'boolean' they don't list as pid's that can be included.

Blacky
July 10th, 2018, 04:07 PM
Any calculated PID that is configured with units of "boolean" will (should) show up as selectable as a filter PID.

22240

22239

Regards
Paul

koolky
July 10th, 2018, 04:27 PM
Got it now. I didn't realize that I had to include them in the pid selection in order to write them into my custom pid code.

koolky
July 11th, 2018, 07:38 AM
Is there a pdf tutorial that I'm missing? The only way I can think to integrate the filter pids into the calc pid is to write the code as show here:

22242

I've set the filter pids so that they are false (zero) when the desired conditions aren't meet. That way I can multiply by each filter pid, so if one filter pid is false the equation is multiplied by zero therefore the result is zero. I haven't confirmed, but I am worried that by doing this I will have cells being filled with zeros, bringing my cell average down.

Thanks

joecar
July 11th, 2018, 11:57 AM
Instead of multiplying them, you would separate the individual filters with the && operator, and drop the leading asterisk.

Blacky
July 11th, 2018, 12:08 PM
You should not "embed" the filter PIDs as part of the wide band BEN calculation. Your filter PIDs should all be ANDed together in a separate "master filter" PID that return true of false depending on whether all your conditions are met or not.

Then you simply load up your normal log file with your normal BEN factor PID logged in it and select the master filter PID by selecting it in the drop down list box at the bottom of the scan window.

Then you apply/un-apply the master filter PID to your data by clicking on the "funnel" icon in the VCR bar. When the filter is applied all other data displays (including the maps) only include the data frames that pass the filter test.

Filter not applied:
22243

Filter applied:
22244

Regards
Paul

Blacky
July 11th, 2018, 12:13 PM
Also, when a filter PID is selected in the drop down list box (but not yet applied), you can search backwards and forwards through the un-filtered log file for changes in the filter PID's true/false status. Use the two arrow buttons next to the filter/funnel button.

Ctrl+PgUp and Ctrl_PgDown are the equivalent hot keys for searching.
Ctrl+F is the hotkey for the filter/funnel button.

Regards
Paul

joecar
July 12th, 2018, 05:19 AM
Paul, how do you get a calculated filter pid to show up in the filter dropdown (at bottom right of scan window)...?

joecar
July 12th, 2018, 05:20 AM
Also, when I create a new calc pid group, it limits the group name to 4 chars only.

koolky
July 12th, 2018, 08:57 AM
Paul, how do you get a calculated filter pid to show up in the filter dropdown (at bottom right of scan window)...?

You have to add it to the pid list first. (Selected pids)

Blacky
July 12th, 2018, 12:35 PM
Paul, how do you get a calculated filter pid to show up in the filter dropdown (at bottom right of scan window)...?

If the calculated PID's units are "boolean" then it is added to the filter drop down list.

Blacky
July 12th, 2018, 12:36 PM
Also, when I create a new calc pid group, it limits the group name to 4 chars only.

Correct, otherwise the PID's unique name (which includes the group) gets too long to display on FlashScan's screen during BB logging.

Blacky
July 12th, 2018, 12:38 PM
You have to add it to the pid list first. (Selected pids)

No, a filter PID does not have to be a selected PID - all filter PIDs (i.e. PIDs with units of boolean) show up in the drop down list.
However any PIDs that the chosen filter PID references during its calculation have to be selected.

Regards
Paul