Torque

Forums

Forums

Guest  

Show or hide header
Welcome Guest, posting in this forum require registration.




Torque » Torque OBD ECU Scanner » Torque Discussion / Ideas » help with the formula

Pages: [1]
Author Topic: help with the formula
santa2003007
Member
Posts: 9
Post help with the formula
on: March 9, 2019 (GMT)

Hi.
Please help with the formula.
Known Pid 0x2210E2 and byte “A”.
Can’t create a formula for this Pid, so this formula is counting the maximum value of byte “A”.

Example:

a byte value with “A” = 0 => formula => 0
a byte value with “A” = 7 => formula => 7
a byte value with “A” = 26 => formula => 26
a byte value with “A” = 15 => formula => 26
a byte value with “A” = 12 => formula => 26
a byte value with “A” = 31 => formula => 31

santa2003007
Member
Posts: 9
Post Re: help with the formula
on: March 9, 2019 (GMT)

Made so:
LOOKUP (A: A:1~255=RAVG(A))
But RAVG(A) shows so-so value.
It does not suit me.
It is necessary after a formula, to see the maximum value of byte.

Capp777
Member
Posts: 2659
Post Re: help with the formula
on: March 9, 2019 (GMT)

MAX(A:RDLY(1:A))
Maybe?

santa2003007
Member
Posts: 9
Post Re: help with the formula
on: March 9, 2019 (GMT)

No, so the same will not turn out.
Given byte “A” on will come with a delay, but to be updated all the same.
MAX formula (A: RDLY(1: A)) will compare data with a difference of 1 poll.
But all the same, the maximum value does not remain, and changes as upwards, and in smaller
Other version of this decision is necessary.

Capp777
Member
Posts: 2659
Post Re: help with the formula
on: March 9, 2019 (GMT)

Sorry can’t test with real data.

Maybe…

Pid1 equation Max(A:Val{Pid2})
Mode/Pid: 2210E2

Pid2 equation Val{Pid1}
Mode/Pid: leave blank

santa2003007
Member
Posts: 9
Post Re: help with the formula
on: March 12, 2019 (GMT)

Quote from Capp777 on March 9, 2019
MAX(A:RDLY(1:A))
Maybe?

So it did not turn out.
Shows not as it was conceived.

Capp777
Member
Posts: 2659
Post Re: help with the formula
on: March 12, 2019 (GMT)

Quote from Capp777 on March 9, 2019
Sorry can’t test with real data.

Maybe…

Pid1 equation Max(A:Val{Pid2})
Mode/Pid: 2210E2

Pid2 equation Val{Pid1}
Mode/Pid: leave blank

End Quote.

To simulate offline I created six
pids…

Simulated Value:

Pid1 – EWMAF(0.010:random()*50+65)

Max Pids:

Pid2 – Max(Val{Pid1}:Val{Pid3})
Pid3 – Lookup(Val{Pid6}::0~5=Val{Pid1}:6~10=Val{Pid2})

Min Pids:

Pid4 – Min(Val{Pid1}:Val{Pid5})
Pid5 – Lookup(Val{Pid6}::0~5=Val{Pid1}:6~10=Val{Pid4})

Startup Counter:

Pid6 – Min(Val{Pid6}+1:10)

Notes:

All units were °C which convert to °F
for display.

Then created digital displays to watch all.

Max values increased but when Pid1 decreased
the max displays remained at max until a new max
was achieved.

Min values decreased but when Pid1 increased
the min displays remained at min until a new min
was achieved.

The Min/Max Pids work after setting Pid3 and Pid5 to
an initial value equal to Pid1 until a counter reaches a
preset. Prevents zero lock on startup and resets
both Min and Max by reseting counter.

Seems like Max and Min are working. Process Min
and Max match the markers on the needle dial for
Pid1.

Edited.

santa2003007
Member
Posts: 9
Post Re: help with the formula
on: March 12, 2019 (GMT)

Hi.

Today has made as you have advised.

“01_Speed_ECU”,”ECU Speed”,”22F40d”,”Max(A: Val{02_Speed_ECU})”,0,100, “km/h”,”7E0″,””,””,1
“02_Speed_ECU”,”ECU Speed”,””,Val{01_Speed_ECU}”,0,100, “km/h”,””,””,””,1

Has made on PID of speed.
But that that unclear occurs.
Both indicators work with PID irrespective of, there are they together on the screen or not.
On one indicators on these PID, work too.

Very much and very big delay of updating of data, from 2 to 3 seconds.
For example, on speedometer figure 100, on indicators 94, in couple of seconds the indicator is updated up to 100!
BUT!
Sometimes this updating does not happen, the figure on the indicator, for example 98 can hang.
These figures show both indicators.
How it is possible to accelerate updating are given?
The line of initialization in settings, is written down such:

atsp6\natst10\natsh714\natfcsh714\natfcsd300000\natfcsm1\natcra77e\n1003

Capp777
Member
Posts: 2659
Post Re: help with the formula
on: March 12, 2019 (GMT)

Shouldn’t there be a comma between the
max and min of your pid definitions?

0.100 -> 0,100 ? Could this be causing
issues with Torque displays?

Read speed is a function of your adapter
and the vehicles protocol in use. I am a
little weak on the elm327 commands
specific for your vehicle and their effect
on your pid read speed.

santa2003007
Member
Posts: 9
Post Re: help with the formula
on: March 12, 2019 (GMT)

Hi.

Corrected, the typo was.

Very much a bolsha a data exchange delay, especially on the screen was only 1 or 2 indicators.
2 sec., it are too much!

Capp777
Member
Posts: 2659
Post Re: help with the formula
on: March 12, 2019 (GMT)

Just curious what the pid read speed
shown under Adapter Status icon
information? Your init string settings
may be causing the slower speeds?

Getting out of my expertise. In my
offline example I actually added the
EWMAF() filter to slow the simulated
values fluctuations to make it easier
to read data value. Torque had no
update issues with my simulation.

You also appear to be missing ” in Val{01_
for pid2.

You are only reading one pid over the
vehicles network, the other internal to
Torque. Dont think that would cause
delay in refreshing displays.

santa2003007
Member
Posts: 9
Post Re: help with the formula
on: March 12, 2019 (GMT)

How it is correct to me to make on my example?

“01_Speed_ECU”,”ECU Speed”,”22F40d”,”Max(A: Val{02_Speed_ECU})”,0,100, “km/h”,”7E0?,””,””,1
“02_Speed_ECU”,”ECU Speed”,””,Val{01_Speed_ECU}”,0,100, “km/h”,””,””,””,1

Quote from Capp777 on March 9, 2019
Sorry can’t test with real data.
Maybe…
Pid1 equation Max(A:Val{Pid2})
Mode/Pid: 2210E2
Pid2 equation Val{Pid1}
Mode/Pid: leave blank

The line of initialization in settings, at me is written down correctly.
In it there is nothing to change.
atsp6\natst10\natsh714\natfcsh714\natfcsd300000\natfcsm1\natcra77e\n1003

Capp777
Member
Posts: 2659
Post Re: help with the formula
on: March 12, 2019 (GMT)

When you let Torque connect on its own
are you able to read mode 010d speed pid?

Seems odd to me that your init string is
referencing 714 while your custom pid
is reading 7E0.

Ive seen 22F4xx used on Ford 6.7s.

“01_Speed_ECU”,”ECU Speed”,”22F40d”,”Max(A: Val{02_Speed_ECU})”,0,100, “km/h”,”7E0″,””,””,1

“02_Speed_ECU”,”ECU Speed”,””,”Val{01_Speed_ECU}”,0,100, “km/h”,””,””,””,1

santa2003007
Member
Posts: 9
Post Re: help with the formula
on: March 12, 2019 (GMT)

atsp6\natsh7e0\natfcsh7e0\natfcsd300000\natfcsm1\natcra7e8\n1003
Corrected, threw off not that line.

I cannot understand that with the second PID it is wrong?
How it is necessary?

Capp777
Member
Posts: 2659
Post Re: help with the formula
on: March 12, 2019 (GMT)

You were missing the opening quote for
Val{01_Speed_ECU}”.

santa2003007
Member
Posts: 9
Post Re: help with the formula
on: March 13, 2019 (GMT)

Quote from Capp777 on March 12, 2019

You were missing the opening quote for
Val{01_Speed_ECU}”.

Hi.
Where exactly passed?
Made everything by your example.
In the second formula it is.

”Val{01_Speed_ECU}”,0,100, “km/h”

Pages: [1]
WP-Forum by: Fredrik Fahlstad, Version: 2.4
Page loaded in: 0.114 seconds.

  Follow me on twitter