Results 1 to 18 of 18

Thread: Math Params - IF conditional

  1. #1

    Math Params - IF conditional

    Simple question - How do I get a PID not to log, if it's outside the conditional? So IF(MAP<90) THEN don't log AFR. Something like that. I already know how to use math in HPTuners and I already know how to set up IF conditionals. The problem is, the conditional always returns 0 or 1 so it either zeroes the answer or it keeps it as whatever it is. This is no good because the scanner just averages all the zeroes with all the non-zero data and gives nonsense. Imagine seeing an AFR of 5.2 on your chart and being like WTF? That's what I get because it's averaging a bunch of 0s with stuff like 14.7. I just want to not record the values that are out of bounds. How do I do that?

  2. #2

  3. #3
    Senior Tuner
    Join Date
    Jan 2014
    Location
    Australia
    Posts
    1,076
    some info may help look at the filters and math parameters it shows how they have to be combined to work
    https://www.hptuners.com/help/VCM-Scanner/

  4. #4
    Quote Originally Posted by 07GTS View Post
    some info may help look at the filters and math parameters it shows how they have to be combined to work
    https://www.hptuners.com/help/VCM-Scanner/
    Thank you but I have read this already and all of the conditional statements that are supported return either 1 (if true) or 0 (if false). This means it will either leave the PID unchanged (if it's a 1) or it will zero the value (if it's a 0). If you chart something that consists of a bunch of zero'd values, the average will be meaningless. I'm looking for a way to simply discard the false values but nothing i've seen so far in the math params support this.

  5. #5
    If you just use the histogram's 'Average' function it will ignore cells with no data, rather than assuming they're zeroes.
    1998 Pontiac Grand Prix GTP (first 3800 FWD in the tens), 9.499 @ 145.13 mph
    1998 Pontiac Firebird (first 3800 RWD in the eights), 843 whp, 8.991 @ 152.12 mph, driven by Tim King
    1999 Pontiac Grand Prix GT (first 3800 FWD in the eights), 8.902 @ 154.90 mph, driven by Bob Cook
    2000 Pontiac Bonneville SSEi (first 3800 Bonneville in the twelves, elevens and tens), 10.711 @ 125.71 mph, driven by Ed Morad
    2008 Pontiac G8 (first G8 in the tens), 10.727 @ 129.87 mph
    2018 Cadillac ATS-V, 619 whp

  6. #6
    Quote Originally Posted by Tapout Tuning View Post
    If you just use the histogram's 'Average' function it will ignore cells with no data, rather than assuming they're zeroes.
    I'm not talking about cells with no data, nor am I asserting that the chart assumes anything. The VCM scanner takes PID values that are chosen for logging and fits them into a given chart based on the row and column values. So if you have an LTFT table that depends on RPM and MAP values in the axes, it will check an LTFT value, 2.6 for example, to see what RPM and MAP values exist at that very moment. If the RPM is 1200 and the MAP is 40, it will stick 2.6 at the 1200/40 cell location. However if you use Math Params to modify the values being recorded, for example:

    IF(MAP>90) && IF(RPM>3000) THEN(LTFT) I realize this isn't the correct syntax but it's just pseudo-code for the sake of argument

    Then if either of the 2 conditionals is false, it will return a 0, which will then be multiplied by LTFT and return 0. Thus the value presented to the chart will be 0 and it will be recorded as such. It won't be an absence of cell data. It will be 0. In a given 5 second period, the scanner may send the following data to the chart: 2.6, 2.1, 0, 2.3, 0, 0, 2.5, 2.6, 0, 0, 0, 2.2

    The zeroes above are all failed conditional statements where something was false. Instead of just deleting those entries, the VCM accepts them as valid and then the chart averages everything (it thinks there are 12 valid entries), giving some nonsense answer like 1.2 instead of what the real answer is, 2.4.

    What we need is a means of omitting recorded values if they don't meet the conditional requirements or at the very least, telling the chart not to average them. I am starting to believe that this functionality simply doesn't exist yet, in which case, what the hell is the point of conditional math params? They are all but useless... scratch that... they are worse than useless - they are harmful because they mislead tuners by yielding incorrect values in the charts.

    The mathematical logic is not implemented correctly, in a programmatically useful way. It's supposed to be IF(condition) THEN(action), emphasis on the action because that's what's missing here. We only have the condition and then you're supposed to multiply that by the sensor reading, as if that's an adequate enough action but all that does is screw up the data stream. Anybody who doesn't understand how this works is probably modifying their VE tables with junk and getting knock as a consequence. This isn't a new feature. It's adding a bug and a pretty big one at that.

  7. #7
    Senior Tuner
    Join Date
    Jan 2014
    Location
    Australia
    Posts
    1,076
    your "IF(MAP>90) && IF(RPM>3000) THEN(LTFT)" line dosnt work as an "either" to produce a 0, because u have both and an "&" in the middle its IF both are meeting the condition then it will result, if just one does it wont so ur prob still getting some other data going on if im reading ur example correctly, just checked mine and when im in a true cells are populating and when im false my cells are blank (not zeros) so its not taking any data, if u have your maths funtion u can make it show true/false so u can then look at it in the scanner and see exactly where its showing either true 1 or false 0, try what ur doing but without the IF just the pid number [50030.90]>90 for example its a straight true or false and put it in the graph filter funtion space for what u want to not see like LTFT graph and it will remove it from just that one
    Last edited by 07GTS; 3 Days Ago at 03:55 AM.

  8. #8
    Quote Originally Posted by 07GTS View Post
    your "IF(MAP>90) && IF(RPM>3000) THEN(LTFT)" line dosnt work as an "either" to produce a 0, because u have both and an "&" in the middle its IF both are meeting the condition then it will result, if just one does it wont so ur prob still getting some other data going on if im reading ur example correctly, just checked mine and when im in a true cells are populating and when im false my cells are blank (not zeros) so its not taking any data, if u have your maths funtion u can make it show true/false so u can then look at it in the scanner and see exactly where its showing either true 1 or false 0, try what ur doing but without the IF just the pid number [50030.90]>90 for example its a straight true or false and put it in the graph filter funtion space for what u want to not see like LTFT graph and it will remove it from just that one
    Can you please show me an example of one of your entire math statements that doesn't record a value when FALSE? If you show a complete example of something that works this way for you, I will be able to immediately determine what's wrong with mine and report back what the problem was.
    Last edited by RRRocketMan; 3 Days Ago at 11:39 AM.

  9. #9
    Senior Tuner
    Join Date
    Jan 2014
    Location
    Australia
    Posts
    1,076
    [14.161]<10 i tried this on my main spark graph to only show timing below 10 deg and my whole table goes blank no numbers at all, if u just go into the variable wizzard and pick the pid u want then for the special funtion select "none" then u get the pid like i have at the start of this msg and just put your variable to it as u want below of above, same with the map [50030.90]>90 will only show values above 90kpa, then if u want to put them together like u mentioned earlier u could try ([11.91]<90 and [12.56]<3000) so this will only show map below 90kpa and rpm below 3000rpm and no other cells show anything

  10. #10
    Quote Originally Posted by 07GTS View Post
    [14.161]<10 i tried this on my main spark graph to only show timing below 10 deg and my whole table goes blank no numbers at all, if u just go into the variable wizzard and pick the pid u want then for the special funtion select "none" then u get the pid like i have at the start of this msg and just put your variable to it as u want below of above, same with the map [50030.90]>90 will only show values above 90kpa, then if u want to put them together like u mentioned earlier u could try ([11.91]<90 and [12.56]<3000) so this will only show map below 90kpa and rpm below 3000rpm and no other cells show anything
    I don't see how that will work for what I'm trying to do. Let me demonstrate.

    What I actually want to do is: "If MAP > 94 and ECT > 85 and ECT < 95 THEN MPVI A/D Input 1" so if I'm going WOT and coolant temps are nominal then log my wideband O2. Here's the actual formula that gives bad results


    ([50030.90]>94)*([50010.241]>85)*([50010.241]<95)*(2.375*[30001.10]+7.3125)


    Presently, if any of the conditionals are false (any of the first 3 PIDs listed above), as you can see, they will become 0 and then multiply to make the entire line 0. How would you modify the line above to make it behave properly?

  11. #11
    Quote Originally Posted by RRRocketMan View Post
    I don't see how that will work for what I'm trying to do. Let me demonstrate.

    What I actually want to do is: "If MAP > 94 and ECT > 85 and ECT < 95 THEN MPVI A/D Input 1" so if I'm going WOT and coolant temps are nominal then log my wideband O2. Here's the actual formula that gives bad results


    ([50030.90]>94)*([50010.241]>85)*([50010.241]<95)*(2.375*[30001.10]+7.3125)


    Presently, if any of the conditionals are false (any of the first 3 PIDs listed above), as you can see, they will become 0 and then multiply to make the entire line 0. How would you modify the line above to make it behave properly?
    If I understand you correctly the way I would do that is to make a graph for the data you want to collect (Data will be A/D 1). Create a filter inside of the graph that only plots the data you want to use. ([50030.90]>94 & [50010.241]>85 & [50010.241]<95)

    Unless I am way off.


    https://www.hptuners.com/help/VCM-Sc...arameters.html

  12. #12
    Quote Originally Posted by black02ss View Post
    If I understand you correctly the way I would do that is to make a graph for the data you want to collect (Data will be A/D 1). Create a filter inside of the graph that only plots the data you want to use. ([50030.90]>94 & [50010.241]>85 & [50010.241]<95)

    Unless I am way off.


    https://www.hptuners.com/help/VCM-Sc...arameters.html
    What do you mean by create a filter?

    I already have the chart made - it's the same sort of chart I use to log KR or spark... just RPM on 1 axis and MAP on the other. The only difference is that for this chart I'd be logging the wideband O2, as you said. However the problem is recording only values that satisfy the conditions. What filter are you proposing and what built in feature of HPT allows you to implement such a filter? Maybe a screenshot would be helpful if you know a feature I don't know about.

  13. #13
    Senior Tuner
    Join Date
    Jan 2014
    Location
    Australia
    Posts
    1,076
    u can enter any string of filters in this so it only does it to the graph u already have, u can get a log up so u can see all data (use your wideband graph with no filters so its map v rpm showing all WB data) and then enter in each part of the filter u want in where i have the pic showing and it will instantly change it in the graph so u can see the data dissapear or change as u put it in then u can put them together and if it dosnt work the box will change red, so add each filter as u want it ([50030.90]>94 & [50010.241]>85) u prob cant have the below temp also as they will cancel eachother out


  14. #14
    Quote Originally Posted by 07GTS View Post
    u can enter any string of filters in this so it only does it to the graph u already have, u can get a log up so u can see all data (use your wideband graph with no filters so its map v rpm showing all WB data) and then enter in each part of the filter u want in where i have the pic showing and it will instantly change it in the graph so u can see the data dissapear or change as u put it in then u can put them together and if it dosnt work the box will change red, so add each filter as u want it ([50030.90]>94 & [50010.241]>85) u prob cant have the below temp also as they will cancel eachother out

    Well, it seems I was wrong from the beginning. It does look like HPT employed a means of properly filtering the charts. And it was staring me in the face the whole time. Thanks for the help. Now I just need to find some parameter that indicates when the car is decelerating. I realize I need to filter out all data points that are recorded when the car is in decel because it messes up the AFR during that time. I found something curious called throttle trajectory but there might be something even better so the search continues.

  15. #15
    Senior Tuner
    Join Date
    Jan 2014
    Location
    Australia
    Posts
    1,076
    u can use the decel fuel trim number or like my WB one i have about 6 filters doing different things all i done was make the maths filter show a 1 or 0 and then u can overlap it to log on your to your chart v time data and see exactly where its going to read data or ignore it then u can change it to do what u want and then apply the filter to the graph u want, u can see in the light blue where it shows 1 im using that data or zero so its much easier to see it like this to see exactly what ur getting before adding it to your pid filter


  16. #16
    Quote Originally Posted by 07GTS View Post
    u can use the decel fuel trim number or like my WB one i have about 6 filters doing different things all i done was make the maths filter show a 1 or 0 and then u can overlap it to log on your to your chart v time data and see exactly where its going to read data or ignore it then u can change it to do what u want and then apply the filter to the graph u want, u can see in the light blue where it shows 1 im using that data or zero so its much easier to see it like this to see exactly what ur getting before adding it to your pid filter

    I don't know if decel fuel trim would work in my case because my car is running entirely in open loop. I can try to log it and see if it will register. Back in the old days there used to be a fuel trim cell that would be 0 1 2 3 or 4 I think. Those corresponded to Decel, Idle, Low throttle, Medium and High. I could then filter out all decel values, since they tend to screw up the fuel trims. However with HPT, I don't see anything that categorizes the regimes like that.

  17. #17
    Senior Tuner
    Join Date
    Jan 2014
    Location
    Australia
    Posts
    1,076
    or u can just use 02 mv as a filter anything below 100mv ignore so when ur in decel and no fuel it will cut it out, just find any pid that u can use to filter out any data u dont want to see

  18. #18
    Why not create a filter where pedal position is > 10%.