FAQFAQ SearchSearch MemberlistMemberlist UsergroupsUsergroups RegisterRegister
ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in

 
mathematical issues

 
Post new topic   Reply to topic    TunerPro User Forum Forum Index -> Honda & Acura
 
luda8890



Joined: 03 Mar 2016
Posts: 6

PostPosted: Thu Mar 03, 2016 9:01 pm    Post subject: mathematical issues Reply with quote

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.
Back to top
View user's profile Send private message
 

 
dfddfd2



Joined: 27 Feb 2008
Posts: 112
Location: Burgaw, NC

PostPosted: Fri Mar 04, 2016 7:47 am    Post subject: Reply with quote

M=value/4096 should work.
_________________
NismotronicSA Tuning Package/Powered by TunerCodeSA
Speed-Density Tuning for Nissans
Back to top
View user's profile Send private message AIM Address
 

 
luda8890



Joined: 03 Mar 2016
Posts: 6

PostPosted: Fri Mar 04, 2016 7:20 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
 

 
dex
The Ford Guy


Joined: 07 Oct 2004
Posts: 522

PostPosted: Sat Mar 05, 2016 12:33 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
 

 
luda8890



Joined: 03 Mar 2016
Posts: 6

PostPosted: Sun Mar 06, 2016 8:12 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
 

 
luda8890



Joined: 03 Mar 2016
Posts: 6

PostPosted: Sun Mar 06, 2016 8:18 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
 

 
dex
The Ford Guy


Joined: 07 Oct 2004
Posts: 522

PostPosted: Sun Mar 06, 2016 11:22 pm    Post subject: Reply with quote

You can use the ROUND function to round a number to a specified decimal place.
Back to top
View user's profile Send private message
 

 
luda8890



Joined: 03 Mar 2016
Posts: 6

PostPosted: Mon Mar 07, 2016 10:49 am    Post subject: Reply with quote

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.

Last edited by luda8890 on Tue Mar 29, 2016 8:25 pm; edited 1 time in total
Back to top
View user's profile Send private message
 

 
luda8890



Joined: 03 Mar 2016
Posts: 6

PostPosted: Tue Mar 29, 2016 8:20 pm    Post subject: Reply with quote

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:
D=(V*.027)-(110.595*(V>>12))

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
Back to top
View user's profile Send private message
 

Display posts from previous:   
View previous topic :: View next topic  
Post new topic   Reply to topic    TunerPro User Forum Forum Index -> Honda & Acura All times are GMT - 9 Hours
 
Page 1 of 1
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
 


Powered by phpBB © 2001, 2002 phpBB Group
RedSquare theme 1.0.3 © DoubleJ(Jan Jaap)