Torque

Forums

Forums

help with the formu...
 
Notifications
Clear all

help with the formula

16 Posts
2 Users
0 Reactions
642 Views
(@santa2003007)
Posts: 30
Eminent Member
Topic starter
 

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

 
Posted : 09/03/2019 5:54 am
(@santa2003007)
Posts: 30
Eminent Member
Topic starter
 

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.

 
Posted : 09/03/2019 6:17 am
(@capp777)
Posts: 2999
Famed Member
 

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

 
Posted : 09/03/2019 6:37 am
(@santa2003007)
Posts: 30
Eminent Member
Topic starter
 

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.

 
Posted : 09/03/2019 8:03 am
(@capp777)
Posts: 2999
Famed Member
 

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

 
Posted : 09/03/2019 11:27 am
(@santa2003007)
Posts: 30
Eminent Member
Topic starter
 

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.

 
Posted : 12/03/2019 3:41 am
(@capp777)
Posts: 2999
Famed Member
 

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.

 
Posted : 12/03/2019 8:34 am
(@santa2003007)
Posts: 30
Eminent Member
Topic starter
 

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

 
Posted : 12/03/2019 4:18 pm
(@capp777)
Posts: 2999
Famed Member
 

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.

 
Posted : 12/03/2019 4:20 pm
(@santa2003007)
Posts: 30
Eminent Member
Topic starter
 

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!

 
Posted : 12/03/2019 4:25 pm
(@capp777)
Posts: 2999
Famed Member
 

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.

 
Posted : 12/03/2019 4:35 pm
(@santa2003007)
Posts: 30
Eminent Member
Topic starter
 

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

 
Posted : 12/03/2019 4:57 pm
(@capp777)
Posts: 2999
Famed Member
 

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

 
Posted : 12/03/2019 5:32 pm
(@santa2003007)
Posts: 30
Eminent Member
Topic starter
 

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?

 
Posted : 12/03/2019 6:02 pm
(@capp777)
Posts: 2999
Famed Member
 

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

 
Posted : 12/03/2019 6:41 pm
(@santa2003007)
Posts: 30
Eminent Member
Topic starter
 

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”

 
Posted : 13/03/2019 3:06 am
Share:

  Follow me on twitter