[DIY] : How to add custom PIDs to your Torque Pro Setup (Mass Air Flow, Turbine Speed, FFR
  1. Welcome to Kia Optima Forum – General discussion forum for Kia Optima

    Welcome to Kia Optima Forum - a website dedicated to all things Kia Optima.

    You are currently viewing our forum as a guest, which gives you limited access to view most discussions and access our other features. By joining our community, at no cost, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is free, fast and simple, Join Kia Optima Forum today!
     
Page 1 of 4 123 ... LastLast
Results 1 to 10 of 38

Thread: How to add custom PIDs to your Torque Pro Setup (Mass Air Flow, Turbine Speed, FFR

  1. #1
    Driver's License K5Canada's Avatar
    Join Date
    Jul 2013
    Location
    Québec, Canada
    Posts
    366
    Year
    2013
    Make
    Kia
    Model
    Optima 2.0T
    Trim
    EX+

    How to add custom PIDs to your Torque Pro Setup (Mass Air Flow, Turbine Speed, FFR

    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
    Last edited by K5Canada; 03-01-2015 at 06:11 PM.
    2013 Bright Silver EX+ Turbo
    Rear Tinted Windows
    Polyurethane Roof Spoiler
    Anodized Stiff Rings
    75A Polyurethane Rear Engine Mount
    Ultra-Racing Front Strut Bar
    Ultra-Racing 20 mm Rear Sway Bar
    BFGoodrich g-Force COMP-2 A/S

  2. Remove Advertisements
    Optima Forums
    Advertisements
     

  3. #2
    OptimaForums Veteran MDJammin's Avatar
    Join Date
    Jan 2013
    Location
    Bel Air, MD
    Posts
    1,407
    Awesome! Although I'm not certain at the moment how we'll make use of these, I have a feeling it will be useful one day when we realy start understanding deeper into the way our PCM makes use of the sensoring and monitors in the vehicle.

    Thanks for your technical work!

  4. #3
    04/2014 ROTM stoli's Avatar
    Join Date
    May 2013
    Location
    Lakeland, FL
    Posts
    3,611
    Model
    2011 SX
    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!

  5. Remove Advertisements
    Optima Forums
    Advertisements
     

  6. #4
    Driver's License K5Canada's Avatar
    Join Date
    Jul 2013
    Location
    Québec, Canada
    Posts
    366
    Year
    2013
    Make
    Kia
    Model
    Optima 2.0T
    Trim
    EX+
    Quote Originally Posted by stoli View Post
    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) 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...
    Last edited by K5Canada; 09-09-2014 at 06:44 PM.
    2013 Bright Silver EX+ Turbo
    Rear Tinted Windows
    Polyurethane Roof Spoiler
    Anodized Stiff Rings
    75A Polyurethane Rear Engine Mount
    Ultra-Racing Front Strut Bar
    Ultra-Racing 20 mm Rear Sway Bar
    BFGoodrich g-Force COMP-2 A/S

  7. #5
    04/2014 ROTM stoli's Avatar
    Join Date
    May 2013
    Location
    Lakeland, FL
    Posts
    3,611
    Model
    2011 SX
    Thanks for that. Now I just need the time to put it all to use.

  8. #6
    Learner's Permit
    Join Date
    Jan 2014
    Posts
    248
    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
    2012 Optima SX Turbo - Snow White Pearl
    Technology Package
    Premium Package
    Luxury Wheels
    3.0 K-Badges

  9. #7
    Driver's License K5Canada's Avatar
    Join Date
    Jul 2013
    Location
    Québec, Canada
    Posts
    366
    Year
    2013
    Make
    Kia
    Model
    Optima 2.0T
    Trim
    EX+
    Quote Originally Posted by DaOne View Post
    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).
    2013 Bright Silver EX+ Turbo
    Rear Tinted Windows
    Polyurethane Roof Spoiler
    Anodized Stiff Rings
    75A Polyurethane Rear Engine Mount
    Ultra-Racing Front Strut Bar
    Ultra-Racing 20 mm Rear Sway Bar
    BFGoodrich g-Force COMP-2 A/S

  10. #8
    Driver's License K5Canada's Avatar
    Join Date
    Jul 2013
    Location
    Québec, Canada
    Posts
    366
    Year
    2013
    Make
    Kia
    Model
    Optima 2.0T
    Trim
    EX+
    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...
    Last edited by K5Canada; 09-21-2014 at 03:08 PM.

  11. #9
    Driver's License K5Canada's Avatar
    Join Date
    Jul 2013
    Location
    Québec, Canada
    Posts
    366
    Year
    2013
    Make
    Kia
    Model
    Optima 2.0T
    Trim
    EX+
    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.

  12. #10
    OptimaForums Veteran MDJammin's Avatar
    Join Date
    Jan 2013
    Location
    Bel Air, MD
    Posts
    1,407
    Thanks for your continued algebraic contributions. Sounds like you are on your way to making a new torque plugin for us all to download

  13. Remove Advertisements
    Optima Forums
    Advertisements
     

Page 1 of 4 123 ... LastLast

Similar Threads

  1. Torque app add-on Specially made for KIA Cars
    By haveatank in forum 3RD Generation Optima (2011-2015)
    Replies: 52
    Last Post: 07-20-2018, 02:01 PM
  2. My Torque Pro App setup
    By Jasper in forum Entertainment: Audio, Navigation, and Electronics
    Replies: 16
    Last Post: 01-17-2015, 07:47 PM
  3. Torque Pro - Using 0-60mph and 1/8 to 1/4mile timed runs
    By MDJammin in forum Engine and Technical Discussion
    Replies: 4
    Last Post: 03-23-2014, 02:02 PM
  4. A/C has very low air flow.
    By OPTIMAKC in forum Engine and Technical Discussion
    Replies: 5
    Last Post: 08-21-2013, 09:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBadvanced CMPS v4.3.0