TunerPro ADS math.... help.

Discuss anything TunerPro related.

Moderators: Mangus, robertisaar, dex

Post Reply
CRE
Posts: 3
Joined: Thu Aug 16, 2007 2:19 pm

TunerPro ADS math.... help.

Post by CRE »

Okay, I've beaten myself over the head with this app for a while now trying to figure out how to build ADS additions to suit my needs. I've looked all over this forum for hints, tips and work to downright plagiarize.

Seeking two equations or the knowledge to figure out the equations... as I am at a loss right now.

Equation 1 : TPS %

I managed to get a TPS% display which is accurate to within ~4%... not perfect but it works. Naturally, after having worked all night on that one I could remember the next day how I came up with it. The math for it makes no sense to me now.

I would like to know if there's a was to enter your own equation other than selecting from the couple presets in the ALDL Definition Editor. As you know in the case of most TPS you have a base value above 0v that needs to be deducted from the factor before anything else is applied to the equation and the preset selections won't do that.

The math that I finally got close with is as follows:

Item size - 16Bit
Operation - Multiply ([X*Factor] + Offset)
Factor - 0.002600
Offset - -18.75
Range High - 45673 (100.00)
Range Low - 7212 (0.00)

My base voltage is .5v and my peak is ~3.51v....

So, is there a better way of doing this?!

Hell, anyone care to remind me how I came up with this? I remember the calculations for the Range values, but that's it.


Equation 2 : Vacuum inHG

I would like to add a definition for vacuum in inHG. I am using a MAFT Pro and was informed that the Boost Pressure definition was corrected for ambient pressure when the car was started, so I figured this would be the best definition to just modify the scaling of. It's defined as follows:

Size - 16 Bit
Operation - Multiply([X*Factor] + Offset)
Factor - .001451
Offset - -14.7
Range High - 20470 (15.00)
Range Low - 0 (-14.70)

So, I know that there are 2.036 to every one psi, but I don't understand how the factor and offset are calculated.


Any help would be appreciated. At this point I'm just trying to bully the numbers into cooperating... if i end up with something that works, great... but I'd like to know what it is that I'm missing for future projects.

Thanks!
User avatar
Mangus
TunerPro Author
Posts: 1926
Joined: Wed Mar 19, 2003 1:49 pm

Post by Mangus »

I'll get back to you on equation 2 (it's the 4th of July, so I only have enough brain power to read through the first one).

First, what vehcle is this for (sorry if I missed it)? Are you sure that the TPS ECM input is 16 bit? For GM vehicles, it's 8 bit. So let's work with 8 bits for now. The point of this is to dump how I wouild think through this.

8 bits is a range of 0-255. TPS is a 5v input (again, for GM). This means that the 0-5v range is spread over the input range of 0-255. (16 bit input range is 0 - 65535).

0 = 0v
255 = 5v

If your TPS sensor is "zeroed" at .5v, .5v is 10% of 5v. 10% of 255 is 25.5. This means you want the raw input value 26 (to round up) to be 0%. This means we know the first part of the equation: (X - 26), where X is the raw A/D value.

For me, my TPS maxes out at 4.3v (if I recall correctly). This corresponds to 220 on the raw input side.

We know that there are 100 percents in percentage. We know that our usable input range is 220 - 26 = 194.

So now we know that the calculation would be (X - 26) / 194.

If we plug and chuck, for a "zero" value of .5v, which is raw input of 26, we get (26 - 26) / 194 = 0%

if we were at full throttle, (which for me is 4.31v, or 220 for raw input), we'd get (220 - 26) / 194 = 194 / 194 = 1. Oops, this should be 100%. We need to multiply both sides by 100.

That gives us:

(X - 26) / 194 * 100


I'll let you simplify from there.

If we were to generalize this a bit more, we'd have:

(X - <zero value>) * 100 / (<max input value> - <zero value>)


When I'm too tired to think straight, I find that bullying the numbers can be just as effective.
***************************************
TunerPro Author
1989 Trans Am
CRE
Posts: 3
Joined: Thu Aug 16, 2007 2:19 pm

Post by CRE »

Yeah, well that's pretty much what I had originally come up with, but there are no equations I can select in that format in the ALDL definitions setup. The closest thing that can be made to work anything like that is the multiply or divide and they math is thoroughly different... So where do I go to setup my own equation format (like the one you just demonstrated)?

Pretty sure the TPS signal is 16bit (at least that's how Bob set it up in the definitions file). This is on the MAFT Pro running in a MKIII Supra. My voltage range is approx. .5v - 3.5v.

Thanks!


Happy 4th!!!
User avatar
Mangus
TunerPro Author
Posts: 1926
Joined: Wed Mar 19, 2003 1:49 pm

Post by Mangus »

CRE wrote:Yeah, well that's pretty much what I had originally come up with
Well, then your math skills are good. You were almost there. Using my example from above, we simplify (with a few extra steps in the middle for clarity):

(X - 26) / 194 * 100

= 100 * ((X / 194) - (26 / 194))
= 100 * ((x/194) - .134))
= 100X/194 - 13.4
= .515 * X - 13.4
= factor of .515 and offset of -13.4

Remember, thoguh, these numbers are only an example. You'll need to use use your usable range, min and max, etc, to solve yours.
***************************************
TunerPro Author
1989 Trans Am
desmo01
Posts: 26
Joined: Sun Jun 04, 2006 9:48 am

Post by desmo01 »

Mark,

Is there a way to to math on two different values in the .bin?

Basically I have two variables that are added together to come up with a corrector for individual cylinder fuel trim. I would LOVE to be able to adjust the trimmed cylinder in terms of resultant value....
User avatar
Mangus
TunerPro Author
Posts: 1926
Joined: Wed Mar 19, 2003 1:49 pm

Post by Mangus »

desmo01 wrote:Mark,

Is there a way to to math on two different values in the .bin?

Basically I have two variables that are added together to come up with a corrector for individual cylinder fuel trim. I would LOVE to be able to adjust the trimmed cylinder in terms of resultant value....
If I understand your question correctly, the answer is yes.

X + Y as the equation. Set each variable to link to the output of another value.
***************************************
TunerPro Author
1989 Trans Am
Post Reply