Page 1 of 1

mathematical issues

Posted: Thu Mar 03, 2016 9:01 pm
by luda8890
Lets start with why I have this question. I am working on developing support for the 88-91 preludes using the PK2 ecus. I have had a working mask for about two years, although limited to the six fuel tables, the six ignition tables, and the check sum on/off functionality. I took a break from this project for about 1.5 years other wise I believe I would have more.

The equation I am using for the fuel is D=(V*0.027)-(110.595*M)

The variables in this are D-duty cycle, V-raw table value in hex converted to decimal, and M-table multiplier.

In the PK2 ecus the table multiplier (M) is the first character on the left of the 16 bit fuel value. So for fuel value 6411, the 6 is the multiplier value (M).

So my question finally is, can I set tunerpro to only read the hex digit of the multiplier so I don't have to manually enter the value for M into the equation for each load cell as every cell has its own multiplier value unlike many popular Honda ECU codes.

I can't seem to find a way to set the definition of M to only read the first byte.

Posted: Fri Mar 04, 2016 7:47 am
by dfddfd2
M=value/4096 should work.

Posted: Fri Mar 04, 2016 7:20 pm
by luda8890
Sorry good sir, but either I am not properly implementing your equation, or it isn't working. Where is the number 4096 derived from? It just seams to invert my tables when I use it in conjunction with my formula to determine the multiplier to use. When I use this formula singularly it simply reduces all my values but they are still incorrect, simply a smaller scale of the hex values.

Posted: Sat Mar 05, 2016 12:33 am
by dex
Is the 6411 value in hexadecimal? If so, when you divide by 4096 (in decimal) the quotient will be equal to the upper nibble (i.e. the leftmost character). Depending on how the PK2 code treats the remainder you will probably need to round this up or down to zero decimal places.

Posted: Sun Mar 06, 2016 8:12 pm
by luda8890
Okay, thank you both, I have a better understanding now. Unfortunately the math now forces me to understand my equation is wrong. When I don't truncate or round any values I end up with 0.0, so I guess that actually proves the math that lead me to find the 110.595 and 0.027000732421875 values was correct.

I guess back to the drawing board. Thank you guys again for the help.

Posted: Sun Mar 06, 2016 8:18 pm
by luda8890
dex, you're right. I can only get things to display if I round the nibble. I was hopping to have tuner pro do this for me, it seams I will have to do it by hand for each load cell for each map for each rom I work with as I have been doing.

Posted: Sun Mar 06, 2016 11:22 pm
by dex
You can use the ROUND function to round a number to a specified decimal place.

Posted: Mon Mar 07, 2016 10:49 am
by luda8890
I guess I am in over my depth. I can't figure how to apply the ROUND to tuner pro. I guess this was all just a waste of time. Thank you guys for the help. I am by far a much greater pen and paper kinda math guy then computer math guy.

Posted: Tue Mar 29, 2016 8:20 pm
by luda8890
Life can be funny sometimes. Take a break for a few weeks, and the answer appears in front of you. I did not know how to implement the ROUND function, found the FAQs, and found a better solution:

All is well now. Thank you guys for the help.

P.S. I do still feel like this is a waste of time, but it does keep my bussy :wink: