Kia Optima Forums banner

1 - 20 of 38 Posts

·
Registered
Joined
·
366 Posts
Discussion Starter #1 (Edited)
Hello,
I have started this project to get the turbine/compressor RPM on my car. From there, I added more stuff to get a better understanding of our engine. In addition, I provided an alternate version of some formulas to accommodate the 2.4L platform.

I'm a software engineer, so you will see some weird tricks that I used to make this work with Torque Pro. I recommend to start with the easy equations and validate them one by one. It is quite easy to screw up a formula and get a bad result. Let me know if you find something wrong or just want to add a new gauge to your dashboard.

*: Replace the * by the multiplication sign (x) when entering the equation.
/: Replace the / by the division sign (÷) when entering the equation.

In order to create your custom PIDs, you need to go the "Settings > Manage extra PID/Sensors >... Add custom PID" menu.

OBD-II Sensors (For reference only)
[0b]: Intake Manifold Absolute Pressure (kPa)
[0c]: Engine RPM
[0d]: Vehicule Speed (km/h)
[0f]: Intake Air Temperature (C)
[33]: Barometric Pressure (kPa)
[34]: Bank 1 - Sensor 1 Lambda
[46]: Ambient Temperature (C)

For more information: http://en.wikipedia.org/wiki/OBD-II_PIDs

Torque Pro Operations (For reference only)
abs(): Absolute value.
{X:B}: Verify if the bit B is set within the X byte.
[pid]: Refers to the pid number of a sensor.
val{Long Name}: Refers to another equation using its long name.

Air Density
This equation gives the air density inside the intake. Used to calculate the mass air flow rate or as a standalone gauge. The relative humidity is assumed to be constant at 50%.
Unit: lb/cf
Equation: .0717*(303.15/([0f]+273.15))*([33]/101.325)
OBD Header: 7E0

Sea Level Comp
This equation computes a compensation factor to normalize your horsepower/torque values to sea level, 30 celcius, 50% humidity. Useful to compare your HP/Torque values with other members.
Equation: .0717 / (val{Air Density} + .0000001)

IsBoost
This equation indicates whether the car is in boost or not. It is used to filter unwanted results from other equations. It checks if the MAP sensor is between 96 kpa and 255 kpa which means a boost between -0.78 PSI and 22.275 PSI.
PID: 010b
Min: 0.0
Max: 1.0
Equation: ({A:7}+({A:6}*{A:5}))-({A:7}*{A:6}*{A:5})
OBD Header: 7E0

IsRpmGT2048
This equation indicates whether the engine runs at least 2048 revolutions per minute.
PID: 010c
Min: 0.0
Max: 1.0
Equation: {A:6}+{A:5}-({A:6}*{A:5})
OBD Header: 7E0

IsRpmGT3072
This equation indicates whether the engine runs at least 3072 revolutions per minute.
PID: 010c
Min: 0.0
Max: 1.0
Equation: {A:6}+({A:5}*{A:4})
OBD Header: 7E0

IsRpmGT3584
This equation indicates whether the engine runs at least 3584 revolutions per minute.
PID: 010c
Min: 0.0
Max: 1.0
Equation: {A:6}+({A:5}*{A:4}*{A:3})
OBD Header: 7E0

IsRpmGT4096
This equation indicates whether the engine runs at least 4096 revolutions per minute.
PID: 010c
Min: 0.0
Max: 1.0
Equation: {A:6}
OBD Header: 7E0

IsSpeedGT128
This equation indicates whether the car is going over 128 km/h in order to filter unwanted results from other equations.
PID: 010d
Unit: km/h
Min: 0
Max: 255
Equation: {A:7}
OBD Header: 7E0

BSFC
This equation gives the Brake Specific Fuel Consumption at WOT.
Equation (2.0L): (((-0.000025*[0c])+.59)*abs(val{IsRpmGT3584}-1))+(((.000029*[0c])+.40)*val{IsRpmGT3584})
Equation (2.4L): (((-0.000056*[0c])+.68)*abs(val{IsRpmGT4096}-1))+(((.000037*[0c])+.30)*val{IsRpmGT4096})
OBD Header: 7E0

P.S I'm still working to improve this formula based on the engine load when you are not at WOT...

T-Outlet PR
This equation gives the pressure ratio as seen by the turbo outlet. I used an average value of 0.5 PSI drop to compensate for the pipe/filter restriction and 1 PSI drop for the intercooler. Depending of your setup and what you want to monitor, you can change these values to accommodate your needs.
Min: 0.0
Max: 3.0
Equation: (([0b]*.145)+1.0)/(([33]*.145)-0.5)
OBD Header: 7E0

T-Intake PR
This equation gives the pressure ratio as seen by the intake manifold.
Min: 0.0
Max: 3.0
Equation: [0b]/([33]
OBD Header: 7E0

T-RPM
This equation gives an estimate of the turbine/compressor RPM based on the turbo pressure ratio of the td04-19t compressor map. The number is only valid while you are in boost.
Unit: x1000
Min: 50.0
Max: 175
Equation: ((((val{T-Outlet PR}*80)-30)*(([0c]*.000015)+.91))*val{IsBoost})+(abs(val{IsBoost}-1)*50)
OBD Header: 7E0

T-Inlet Air Temp
This equation gives an estimate of the air temperature at the turbo inlet. This estimate assumes that 65% of the air entering the air box is provided by the intake air temperature and 35% by the ambient air temperature at 0 km/h (Idle). As you go, this ratio is changed to reach 100% of the ambient air temperature at 128 km/h. This model is based on data that I collected on my car last summer. You will need to create an extra PID reading this value if you want to convert it to Fahrenheit instead of Celcius.
PID: 010d
Unit: Celcius
Min: -40.0
Max: 215.0
Equation: ((([46]*((.005*A)+.35))+([0f]*((-.005*A)+.65)))*abs(val{IsSpeedGT128}-1))+([46]*val{IsSpeedGT128})
OBD Header: 7E0

T-Outlet Air Temp
This equation gives an estimate of the air temperature at the turbo outlet. You will need to create an extra PID reading this value if you want to convert it to Fahrenheit instead of Celcius.
Unit: Celcius
Min: -40.0
Max: 215.0
Equation: ((((((((val{T-Inlet Air Temp}+273.15)*((val{T-Outlet PR}*.2)+.8)))-273.15)-val{T-Inlet Air Temp})/.7)+val{T-Inlet Air Temp})*val{IsBoost})+(abs(val{IsBoost}-1)*val{T-Inlet Air Temp})

IC Efficiency
This equation gives an estimate of the intercooler efficiency. You will see a negative result when you are not in boost since the air entering the IC is cooler than the intake air temperature (the equation acts a heater in this case). If you do not want to see this, you can multiply the equation by val{IsBoost} to filter out the result.
Unit: %
Equation: (((val{T-Outlet Air Temp}-[0f])+1)/((val{T-Outlet Air Temp}-[46])+1))*100
OBD Header: 7E0

VE
This equation gives an estimate of the volumetric efficiency based on the RPM.
Unit: %
Min: 0.0
Max: 100.0
Equation (2.0L): (((.005*[0c])+81)*abs(val{IsRpmGT3584}-1))+(((-.005*[0c])+117)*val{IsRpmGT3584})
Equation (2.4L): (((.009*[0c])+53)*abs(val{IsRpmGT4096}-1))+(((-.006*[0c])+115)*val{IsRpmGT4096})
OBD Header: 7E0

Volume Air Flow
This equation gives the volume air flow rate of your turbo car.
Unit: cf/min
Min: 0.0
Max: 500.0
Equation (2.0L): (1.998*val{VE}*[0c]*val{T-Intake PR})/5660
Equation (2.4L): (2.359*val{VE}*[0c]*val{T-Intake PR})/5660

Mass Air Flow
This equation gives the mass air flow rate of your car.
Unit: lb/min
Min: 0.0
Max: 100.0
Equation: val{Volume Air Flow}*val{Air Density}

Mass Fuel Flow
This equation gives the mass fuel flow rate of your car. Bank 1 - Sensor 1 Lambda has been used to measure the A/F ratio.
Unit: lb/min
Min: 0.0
Max: 100.0
Equation: val{Mass Air Flow}/(14.7*[34])
OBD Header: 7E0

Horsepower (At the crank)
This equation gives the horsepower at the crank.
Min: 0.0
Max: 300.0
Equation: (val{Mass Fuel Flow}*60)/val{BSFC}

P.S Multiply this equation by val{Sea Level Comp) if your want to normalize the result to sea level, 30 celcius, 50% relative humidity.

Torque (At the crank)
This equation gives the torque at the crank.
Unit: lb.ft
Min: 0.0
Max: 300.0
Equation: (val{Horsepower (At the crank)}*5252)/[0c]
OBD Header: 7E0

Torque (At the wheels)
This equation gives the torque at the wheels based on the circumference of my 215/55/R17 tires.
PID: 010d
Unit: lb.ft
Min: 0.0
Max: 3000.0
Equation: ([0c]/(((A/60)/.0021)+.001))*(val{Torque (At the crank)}*.84)*(A/(A+.001))
OBD Header: 7E0

P.S Replace .0021 km (or 2.1 m) by the circumference of your tires for more accuracy.

Fuel Instant
This equation gives the instant fuel consumption of your car. I used 1.68 pounds/liter of gasoline at 25 celcius in the formula. The gasoline weight is compensated using the ambient temp.
PID: 010d
Unit: L/100 km
Min: 0.0
Max: 100.0
Equation: ((val{Mass Fuel Flow}*60)/(1.68/((([46]-25)*.00095)+1)))*(100/(A+.001))*(A/(A+.001))
OBD Header: 7E0

Fuel MPG Instant
This equation gives the instant fuel consumption of your car in miles per gallon.
PID: 010d
Unit: MPG
Min: 0.0
Max: 100.0
Equation: (((100/(val{Fuel Instant}+.001))*3.785)/1.609)*(A/(A+.001))
OBD Header: 7E0
 

·
Registered
Joined
·
366 Posts
Discussion Starter #4 (Edited)
Nice work. I can see some immediate used to validate the efficiency of any intake or intercooler changes.

As for the IsBoost, how about a 24psi ceiling since some of the newer tunes bump it up to 23psi?

Thanks for this!
I had to think a bit about this since the original formula could report 2.0 instead of 1.0 in this situation (the 3 Most Significant Bits are 1 in this case) Finally, I came up with a simple (and rather smart:D) solution to cover the maximum range from our MAP sensor.
Original formula:
{A:7}+({A:6}*{A:5})

Updated formula:
({A:7}+({A:6}*{A:5}))-({A:7}*{A:6}*{A:5})

Since the MAP PID is limited to 1 byte by the OBD II protocol, it means that the highest value reported is 255 KPa, which translate to 36.975 PSI at see level, which translates to a maximum boost of 22.275 PSI (36.975-14.7 PSI). So, if you have a 24 PSI of boost, you will still read 36.975 PSI at see level...

P.S I did not test it on the car but I'm rather confident in this one...
 

·
Registered
Joined
·
366 Posts
Discussion Starter #7
Here are all the common PIDs and their equations so you can use them in Torque this way...

OBD-II PIDs - Wikipedia, the free encyclopedia

Now to get the custom ones :)
Thank you. I use this link a lot and added it as a reference in my first post for quick access . On the other hand, the reader must be aware that a lot of the PIDs listed on the OBD II protocol are not supported by our ECU (for instance, the MAF and Fuel Pressure will read zero).
 

·
Registered
Joined
·
366 Posts
Discussion Starter #8 (Edited)
Updates
1) The volumetric efficiency is computed dynamically via IsRpmGT3072 and VE equations.
2) The Volume Air Flow equation has been updated to use the VE formula.
3) Added the OBD Header field to optimize the communication on the CAN bus.

P.S The Fuel Flow Rate and Instant Fuel Consumption equations should follow soon...
 

·
Registered
Joined
·
366 Posts
Discussion Starter #9
Updates
1) Corrected the Volume Air Flow formula which was overestimated in vacuum.
2) Added the Mass Fuel Flow equation.
3) Added the Fuel Instant consumption in L/100km.
 

·
Registered
Joined
·
366 Posts
Discussion Starter #11 (Edited)
Thanks for your continued algebraic contributions. Sounds like you are on your way to making a new torque plugin for us all to download ;)
My next update should be great for all the members...The HP and Torque numbers given by Torque Pro are way off and there is a lot of lag in the display. I will provide some equations computing these numbers from the engine instead of the wheels. BSFC will be computed dynamically based on the work RedHotDamn has done. VE is already done this way. If it works as I expect, I hope to deliver a VIRTUAL DYNAMOMETER in your car!!! :D

P.S I'm testing the VIRTUAL DYNAMOMETER now, BSFC is working as expected... It's not easy with the traffic I have going to my work. So far, I achieved 267.8 lb.ft for max torque, 255 HP for max horsepower. I'm pretty sure I have enough juice to go over 274 HP with my setup which I estimate to be around 282 HP at the red line. It's a real improvement over the default Torque Pro gauges for sure... :rolleyes:
 

·
Registered
Joined
·
366 Posts
Discussion Starter #13 (Edited)
any more updates to this please ?
Sorry for the delay, I have been busy lately. In addition, my harddrive died on my main computer (I need to reinstall Windows 7 and all the stuff)...and I have been sick like **** in the last 3 weeks! And, I was not sure if someone was interested by my stuff (not a lot of activity on the thread :))...:p

It seems to work very well on my car and all the formulas are on my Android tablet. We can see the HP/Torque numbers rolling at a steady speed, not only during the acceleration like the Torque built-in algorithms (and the numbers were not good). I have been able to get 281 HP at the crank shaft (WOT) and 278 ft.lb (WOT) for the torque. Stay tuned, I will post soon the missing formulas... :cool:
 

·
Registered
Joined
·
366 Posts
Discussion Starter #15
I just added the BSFC along the horsepower/torque formulas at the crank. Basically, you will need to enter the following formulas to get your virtual dynamometer:

Air Density
IsRpmGT3072
BSFC
T-Intake PR
VE
Volume Air Flow
Mass Air Flow
Mass Fuel Flow
Horsepower (At the crank)
Torque (At the crank)

Let me know if it works, it is so easy to do a typo with this stuff...:)
 

·
Most Clever
Joined
·
145 Posts
excellent work - finally got round to adding...

how do i change this to miles per US gallon please ?

Fuel Instant
This equation gives the instant fuel consumption of your car. I used 1.65 pounds/liter of gasoline in this formula.
PID: 010d
Unit: L/100 km
Min: 0.0
Max: 100.0
Equation: ((val{Mass Fuel Flow}*60)/1.65)*(100/(A+.001))*(A/(A+.001))
OBD Header: 7E0
 

·
Registered
Joined
·
366 Posts
Discussion Starter #18
excellent work - finally got round to adding...

how do i change this to miles per US gallon please ?

Fuel Instant
This equation gives the instant fuel consumption of your car. I used 1.65 pounds/liter of gasoline in this formula.
PID: 010d
Unit: L/100 km
Min: 0.0
Max: 100.0
Equation: ((val{Mass Fuel Flow}*60)/1.65)*(100/(A+.001))*(A/(A+.001))
OBD Header: 7E0
I'm gonna do that for sure.
First, I need to review all the formulas since I overestimated the fuel consumption by 8% compared to what I have computed manually at the gas station (might be the air density formula, sensor error, etc.). On the other hand, the average given by the ECU seems to be underestimated by 2%...
 

·
Most Clever
Joined
·
145 Posts
cool - loving these - is there a way to export my dashboard settings (file in android file system) and import/copy to another android device (i.e. phone to tablet) ?really appreciate what you are doing here !!

---------- Post added 01-22-2015 at 09:42 AM ---------- Previous post was 01-21-2015 at 08:13 PM ----------

ok - worked out how to share/save dashboards in torque pro.

when in the dashboard on your mobile device ...

go to menu..layout settings and there you have an import or export layout function.

This stores the file to /storage/sdcard0/.torque/dashboards on your phone/tablet ......this might vary depending on android version/profiles etc. I found it by saving a layout with a unique name and then using es file explorer (set to show hidden files) and searching from top directory for the unique name

In the .torque directory there are other useful files - just need to work out how to use them - i believe this is for themes etc - I'll work on this if we need it.

Hope this helps - it means we can perfect the perfect Optima dashboard and share with the forum.
 
1 - 20 of 38 Posts
Top