Sign up for our newsletter! 
Home News Products Downloads Forum Distributors Store Contact Us
PPE User Forum
May 21, 2013, 11:44:25 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: My attempt at writing a script for MPG from Map  (Read 4906 times)
0 Members and 1 Guest are viewing this topic.
RichardP
Newbie
*
Offline Offline

Posts: 3


View Profile
« on: June 17, 2008, 04:41:10 pm »

I know it's not perfect, but it may be a starting point for someone brighter than me.

It gives a reasonably accurate readout compared to tank fill and mileage on my cavalier.

2 user variables need to be set in the first 2 lines.

Rik
Logged
Shon@PPE
Global Moderator
Jr. Member
*****
Offline Offline

Posts: 61


View Profile
« Reply #1 on: June 24, 2008, 08:51:41 pm »

Nice, hopefully we see some more scripts posted soon.
Logged
Philc
Newbie
*
Offline Offline

Posts: 1


View Profile
« Reply #2 on: July 20, 2008, 09:13:46 am »

Thanks for creating this script- I need it as my car doesn't monitor 'SAE.MAF'.

however, when I attempt to import, I get "Invalid Pid Script File!". I am able to import other scripts.

Is it possible to paste the body of the script in this thread?

thanks a million!!
-Phil
Logged
RichardP
Newbie
*
Offline Offline

Posts: 3


View Profile
« Reply #3 on: July 20, 2008, 09:50:08 am »

var Cap = 2.2; // USER VARIABLE engine size in litres (edit to your engine size)
var FT = 75; // USER VARIABLE Variable for fine tuning result according to your own calculations from tank mileage, normally between 60 and 90, 75 is a good base to start from.

var VE = FT / 100; // volumetric efficiency of engine
var KIAT = Obdii.GetPidValueMetric("SAE.IAT") + 273.15; // convert metric IAT to Kelvin scale
var IMAP = Obdii.GetPidValueMetric("SAE.RPM") * Obdii.GetPidValueMetric("SAE.MAP") / KIAT; // Intermediate MAP value for calculations
var DAM = 8.314 / KIAT; // divisor for air mass
var MM = 28.97; // Molecular mass of air
var CF = IMAP / 120; // one fill cycle every 2 revolutions and convert RPM to per second value
var CMAF = CF * VE * Cap * MM / DAM; // Calculated MAF Value


   Obdii.PidValue.English = Obdii.GetPidValueEnglish("SAE.VSS") + 0.001 * 2686.5 / CMAF; //MPG (US Gal) For UK gal replace 2686.5 with 3198.2
   Obdii.PidValue.Metric = Obdii.GetPidValueMetric("SAE.VSS") + 0.001 * 1137.1 / CMAF; //km/l
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.201 seconds with 20 queries.
Home | News | Products | Downloads | Forum | Distributors | Store | Contact Us
Copyright © 2012 Palmer Performance Engineering, Inc. All Rights Reserved.