Torque

Forums

Forums

Guest  

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




Torque » Torque OBD ECU Scanner » Torque Discussion / Ideas » Comprehensive list of PID operators and functions

Pages: 1 2 3 [4] 5 6
Author Topic: Comprehensive list of PID operators and functions
bjt
Member
Posts: 6
Post Re: Comprehensive list of PID operators and functions
on: August 22, 2017 (GMT)

Haven’t been able to get this to work correctly and only seem to get back garbage. My formula for fuel level is ((A*50)/100) how do you take the result of that and use TAVG(seconds:value)?

Capp777
Member
Posts: 2993
Post Re: Comprehensive list of PID operators and functions
on: August 22, 2017 (GMT)

Quote from bjt on August 22, 2017
Haven’t been able to get this to work correctly and only seem to get back garbage. My formula for fuel level is ((A*50)/100) how do you take the result of that and use TAVG(seconds:value)?

End Quote.

I would try…

TAVG(5:A*0.5)

alawadhi3000
Member
Posts: 41
Post Re: Comprehensive list of PID operators and functions
on: December 23, 2017 (GMT)

I’m trying to make a custom PID that translate the response into text

If I’m using the example in the equations FAQ
LOOKUP(A::1=’moo’:2=’boo’)

To my understanding that means if the value of A=1 then display “moo” instead, else if the value of A=2 then display “boo” instead.

Whenever I put that equation in the custom PID it gives me the below error:-

Variable ‘:1=’moo’:2=’boo” does not exist.

alawadhi3000
Member
Posts: 41
Post Re: Comprehensive list of PID operators and functions
on: December 23, 2017 (GMT)

Okay I got it, it doesn’t work on the latest public version, I tried the BETA and it works.

crabber
Member
Posts: 19
Post Re: Comprehensive list of PID operators and functions
on: January 25, 2018 (GMT)

Could someone explain in simple terms for me this line from the first post please:

{A:b} — returns the bth bit of the byte A. Least significant bit is 0, example A = 00001010b = 09h, {A:0} = 0; {A:1} = 1

I notice that cintakc has pointed out that the example is wrong

A = 00001010 should be 0A in hex but what does the “bth” bit mean?

In the example {A:0} = 0 does the 0 mean the first bit then 1 the second etc? I just cant get my head around individual bits or am I looking at this in completely the wrong way?

cintakc
Member
Posts: 1661
Post Re: Comprehensive list of PID operators and functions
on: January 25, 2018 (GMT)

bit count in byte starts right from zero
00001000 – Bit(A:3) or {A:3}
76543210

00000010 – {A:1}

Capp777
Member
Posts: 2993
Post Re: Comprehensive list of PID operators and functions
on: February 9, 2018 (GMT)

How to handle signed HEX values…

https://torque-bhp.com/forums/?wpforumaction=viewtopic&t=9705.0

andriy_
Member
Posts: 1
Post Re: Comprehensive list of PID operators and functions
on: February 10, 2018 (GMT)

Need to convert run time (PID 011F) in seconds to hours.minutes format. Smth like this:
Round(A%3600+(A-A%60)/100, 2). But I see no round or modulus functions…

Any ideas?

vl_vic
Member
Posts: 11
Post Re: Comprehensive list of PID operators and functions
on: April 10, 2018 (GMT)

Hi,
Who can help determine the equation for 1158 – short term fuel trim percent (ford focus 2)?
Here is the response: 7E8 05 62 11 58 87 AE 00 00 (should be -5.4 %) A=87 B=AE
1158 – short term fuel trim percent – 2 bytes – subtract 32768 then divide by -327.68 -not work(

Capp777
Member
Posts: 2993
Post Re: Comprehensive list of PID operators and functions
on: April 10, 2018 (GMT)

Quote from vl_vic on April 10, 2018
Hi,
Who can help determine the equation for 1158 – short term fuel trim percent (ford focus 2)?
Here is the response: 7E8 05 62 11 58 87 AE 00 00 (should be -5.4 %) A=87 B=AE
1158 – short term fuel trim percent – 2 bytes – subtract 32768 then divide by -327.68 -not work(

End Quote.

A*(100/128)-100 ?

((A*256)+B)*(100/32768)-100 ?

Positive result though?

Might try multiplying by -1.0 to
invert results…

(A*(100/128)-100)*-1.0 ?

(((A*256)+B)*(100/32768)-100)*-1.0 ?

Edited.

vl_vic
Member
Posts: 11
Post Re: Comprehensive list of PID operators and functions
on: April 10, 2018 (GMT)

no,value is considered 2 bytes.
A=87 B=AE.
((A*256)+B)-32768/-327,68 -not work(

FntX
Member
Posts: 59
Post Re: Comprehensive list of PID operators and functions
on: April 12, 2018 (GMT)

Your view on the variables is slightly wrong. I was wrong too.

7E 80 56 21 15 88 7A E0 00 0
R0 = 7E
R1 = 80
R2 = 56
R3 or A = 21
R4 or B = 15
R5 or C = 88
R6 or D = 7A
R7 = E0

This looks odd. Are you sure this is the right response?

If so you need to split the bits up:
{R5:1}*256+{R6:0} ***first byte
{R6:1}*256+{R7:0} ***second byte

Which, in theory, translates into the formula:
((({R5:1}*256+{R6:0})+({R6:1}*256+{R7:0}))-32768)/-327,68

Right?

Capp777
Member
Posts: 2993
Post Re: Comprehensive list of PID operators and functions
on: April 12, 2018 (GMT)

His response looks like typical CAN. Torque
would parse the data following 62 11 58 as
A, B, etc.

Note that internally the adapter treats 7E8
as 07 E8 whereas Torque’s Rx addressing
may not and may require a nibble shift for
proper alignment.

My two cents anyway.

Discussed here where ATD1 was used to achieve
shift…

https://torque-bhp.com/forums/?wpforumaction=viewtopic&t=3646.2

cintakc
Member
Posts: 1661
Post Re: Comprehensive list of PID operators and functions
on: April 12, 2018 (GMT)

is not BMW – this ford focus 2 so there is no nibble shift

vl_vic
Member
Posts: 11
Post Re: Comprehensive list of PID operators and functions
on: April 12, 2018 (GMT)

yes, I did not meet nibble shift in any formula of focus

vl_vic
Member
Posts: 11
Post Re: Comprehensive list of PID operators and functions
on: April 13, 2018 (GMT)

By the way, it is a working formula for Long Trim (LONGFT1)
(A*256+B)/2.56-100. But SHRTFT1 calculates something differently:(

Capp777
Member
Posts: 2993
Post Re: Comprehensive list of PID operators and functions
on: April 14, 2018 (GMT)

Could you post a sample raw hex bytes
and expected value for your LTFT equation?

((A*256)+B)*(100/32768)-100

would have been my guess.

00 00 yields -100.0
FF FF yields 99.997
80 00 yields 0.0

(65535/2.56)-100 = 25499.61

Trying to understand as my son drives
a Crown Vic so these pids/equations would
be useful to us as well.

vl_vic
Member
Posts: 11
Post Re: Comprehensive list of PID operators and functions
on: April 15, 2018 (GMT)

LONGFT1 for ford focus 2:
request:7E0 03 22 11 56 00 00 00 00
response:7E8 05 62 11 56 00 EF 00 00 (-6.64)
response:7E8 05 62 11 56 00 F7 00 00 (-3.52)

Capp777
Member
Posts: 2993
Post Re: Comprehensive list of PID operators and functions
on: April 15, 2018 (GMT)

Signed(B)*(100/256) ?

((A*256)+B)*(100/256)-100 ?

vl_vic
Member
Posts: 11
Post Re: Comprehensive list of PID operators and functions
on: April 16, 2018 (GMT)

((A*256)+B)*(100/256)-100 it is for LONGFT1

Pages: 1 2 3 [4] 5 6
WP-Forum by: Fredrik Fahlstad, Version: 2.4
Page loaded in: 0.071 seconds.

  Follow me on twitter