Go Back   EcoModder Forum > EcoModding > Instrumentation
Register Now
 Register Now
 

Reply  Post New Thread
 
Submit Tools LinkBack Thread Tools
Old 10-10-2008, 10:01 AM   #11 (permalink)
lyd
It smells funny in here.
 
Join Date: Sep 2008
Location: Southern Wisconsin
Posts: 63

GeeOh - '97 Geo Metro Base
90 day: 33.41 mpg (US)
Thanks: 0
Thanked 0 Times in 0 Posts
I can't comment usefully on the above, but there seems to be a number of links to information and code in this thread on gassavers.org: OBDII CarPC MPG Calculator - GasSavers.org - Helping You Save at the Pump

  Reply With Quote
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 10-10-2008, 10:32 AM   #12 (permalink)
lyd
It smells funny in here.
 
Join Date: Sep 2008
Location: Southern Wisconsin
Posts: 63

GeeOh - '97 Geo Metro Base
90 day: 33.41 mpg (US)
Thanks: 0
Thanked 0 Times in 0 Posts
DOH! I just noticed that thread is all about you! Sorry. ;-)
  Reply With Quote
Old 10-10-2008, 10:56 AM   #13 (permalink)
EcoModding Lurker
 
Join Date: May 2008
Location: Helena Mt
Posts: 37

01 Insight - '01 Honda Insight DX
Team Honda
90 day: 67.82 mpg (US)
Thanks: 2
Thanked 1 Time in 1 Post
Do you know if your version will work with the ELM327 1.3 chip? I just sent my scantool in for an update (was free aside from shipping) they threw in a new chip and upped the data rate to 38000bps.

I might get a chance to test is this weekend. though I think they released the 1.14 to be compatible with it, even that one didn't work.

also some thing I noticed in the OBD2007 pdf that was posted:

Quote:
Late model vehicles which use Oxygen sensors known as wide range linear Oxygen sensors, can also introduce another Pid 0x44, Commanded Equivalence Ratio. This pid allows fine adjustment of air fuel ratio from the constant 14.64 by modifying the air fuel ratio by a value between 0 and 1.999 which permits air fuel ratios to be measured to greater precision. If a vehicle supports Pid 0x44, OBD 2007 fuel consumption figure is modified by the effect of Commanded Equivalence Ratio.

Last edited by mtgeekman; 10-10-2008 at 11:02 AM.. Reason: added information
  Reply With Quote
Old 10-10-2008, 02:30 PM   #14 (permalink)
Pokémoderator
 
cfg83's Avatar
 
Join Date: Dec 2007
Location: Southern California
Posts: 5,864

1999 Saturn SW2 - '99 Saturn SW2 Wagon
Team Saturn
90 day: 40.49 mpg (US)
Thanks: 439
Thanked 530 Times in 356 Posts
mtgeekman -

Quote:
Originally Posted by mtgeekman View Post
Do you know if your version will work with the ELM327 1.3 chip? I just sent my scantool in for an update (was free aside from shipping) they threw in a new chip and upped the data rate to 38000bps.

I might get a chance to test is this weekend. though I think they released the 1.14 to be compatible with it, even that one didn't work.

also some thing I noticed in the OBD2007 pdf that was posted:
I am 85% sure that mine is based on the 1.14 version. If you can't get that version to "talk" to your ELM327, you'd probably have the same problem with mine.

Originally, I had lots of problems making it work. I found out that I needed a "vanilla clean" XP OS install to make it work. It didn't work with my XP off the bat because it was encrusted with all sorts of "barnacle-programs" that interfered with the COM1 port connection. Here's an experiment to emulate a "vanilla clean" OS that might work for you :

1 - Assuming you have Windows XP
2 - Assuming you are using COM1 or COM# port connection.
3 - Assuming COM# ports work in Safe Mode.
4 - Boot into Safe Mode
5 - Run Scantool 1.14 and see if it works.

I am also assuming that the Alegro SW graphics package won't get too upset with Safe Mode.

I will also try this experiment this weekend if I have the time (messy weekend coming up to say the least).

EDIT: No comment on the wide range linear oxygen sensor because I am narrow band. This may be a BIG help to wide band owners. Good catch!!!

CarloSW2
__________________

What's your EPA MPG? Go Here and find out!
American Solar Energy Society

Last edited by cfg83; 11-17-2008 at 04:03 AM..
  Reply With Quote
Old 10-16-2008, 11:44 AM   #15 (permalink)
Pokémoderator
 
cfg83's Avatar
 
Join Date: Dec 2007
Location: Southern California
Posts: 5,864

1999 Saturn SW2 - '99 Saturn SW2 Wagon
Team Saturn
90 day: 40.49 mpg (US)
Thanks: 439
Thanked 530 Times in 356 Posts
Convert MAP to MAF?

Hello -

(edited multiple times to get info correct)

I have a question. If you know the following about your car :

1 - Engine displacement in Liters. For example, my engine is 1.9 liters (1901 cc).

2 - Manifold Absolute Pressure (MAP) in inHg (inches Mercury). For example, the value that my engine returns in the OBD II protocol.

3 - Compression Ratio (Optional?) . For example, my car has a compression ratio of 9.5:1.

Question : Can you *calculate* the Manifold Absolute Flow (MAF) in grams per second?

Reason : I ask because I am trying to emulate the published OBD 2007 algorithm

Thank You,

CarloSW2
__________________

What's your EPA MPG? Go Here and find out!
American Solar Energy Society

Last edited by cfg83; 10-16-2008 at 03:58 PM..
  Reply With Quote
Old 10-16-2008, 04:57 PM   #16 (permalink)
lyd
It smells funny in here.
 
Join Date: Sep 2008
Location: Southern Wisconsin
Posts: 63

GeeOh - '97 Geo Metro Base
90 day: 33.41 mpg (US)
Thanks: 0
Thanked 0 Times in 0 Posts
Do you have a link to that alg, Carlo? I was looking for it the other day and couldn't track it down.
  Reply With Quote
Old 10-16-2008, 05:39 PM   #17 (permalink)
Pokémoderator
 
cfg83's Avatar
 
Join Date: Dec 2007
Location: Southern California
Posts: 5,864

1999 Saturn SW2 - '99 Saturn SW2 Wagon
Team Saturn
90 day: 40.49 mpg (US)
Thanks: 439
Thanked 530 Times in 356 Posts
lyd -

The "alg"(orithm?) is from post #10 above :

OBD 2007 - Installation Guide
http://www.glmsoftware.com/Documenta...de20080822.pdf - Page 15 of PDF
Quote:
fuel consumption can be calculated, if a vehicle supports Pid 0x0D Vehicle Speed and Pid 0x10 Mass Air Flow. All vehicles support vehicle speed and nearly all vehicles support MAF.

MAF, the mass of air moving into the engine is measured in grams per second. A petrol/gasoline engine burns the air/fuel mixture at the stoichiometric air fuel ratio of 14.64:1. The oxygen sensors in a modern vehicle are designed in conjunction with both the short and long term fuel trims to maintain this ratio. Under ideal conditions for every 14.64 grams of air an engine will consume 1 gram of petrol. We can therefore calculate FuelFlowGramsPersSec = MAF/Air Fuel ratio. We can convert the previous figure to FuelFlowLitresPerSecond by dividing FuelFlowGramsPerSec by the density of petrol/gasoline.

We can then readily convert that figure to FuelFlowLitresPerHour -- i.e. litres/hour. Fuel consumption is then simply SpeedKmsPerHour/FuelFlowLitresPerHours -- i.e. litres/kms.
CarloSW2
__________________

What's your EPA MPG? Go Here and find out!
American Solar Energy Society
  Reply With Quote
Old 10-16-2008, 08:06 PM   #18 (permalink)
lyd
It smells funny in here.
 
Join Date: Sep 2008
Location: Southern Wisconsin
Posts: 63

GeeOh - '97 Geo Metro Base
90 day: 33.41 mpg (US)
Thanks: 0
Thanked 0 Times in 0 Posts
Oooohh. Right, sorry. ;-) I misunderstood what you were referring to there.
  Reply With Quote
Old 07-25-2010, 05:00 PM   #19 (permalink)
Pokémoderator
 
cfg83's Avatar
 
Join Date: Dec 2007
Location: Southern California
Posts: 5,864

1999 Saturn SW2 - '99 Saturn SW2 Wagon
Team Saturn
90 day: 40.49 mpg (US)
Thanks: 439
Thanked 530 Times in 356 Posts
Hello -

I was toodling around the scantool website and looking at their "OBDWIZ" MPG feature. Look at it's configuration inputs :

ScanTool.net LLC - OBDwiz Automotive Diagnostic Software


It looks like they have three "Fuel Calculation Method" algorithms. Is the "Volumetric Efficiency" of one's engine easy to find?

The above led me to some other interesting (to me) places :

METHOD FOR ON-LINE ADAPTATION OF ENGINE VOLUMETRIC EFFICIENCY USING A MASS AIR FLOW SENSOR - Patent application
Calculating MPG from VSS and MAF from OBD2 - Page 4 - MP3Car.com
http://www.mympgtracker.com/

CarloSW2
__________________

What's your EPA MPG? Go Here and find out!
American Solar Energy Society

Last edited by cfg83; 08-08-2010 at 09:29 PM..
  Reply With Quote
Old 08-08-2010, 09:24 PM   #20 (permalink)
Pokémoderator
 
cfg83's Avatar
 
Join Date: Dec 2007
Location: Southern California
Posts: 5,864

1999 Saturn SW2 - '99 Saturn SW2 Wagon
Team Saturn
90 day: 40.49 mpg (US)
Thanks: 439
Thanked 530 Times in 356 Posts
Hello -

Ok, I now have a workable formula, thanks to post #9 :

Calculating MPG from VSS and MAF from OBD2 - MP3Car.com
Quote:
... For the record, the first "one-line" MPG formula above, taken from my Circuit Cellar article, is off by 100! The "4.54" should in fact be "454". The correct formula is:

MPG = (14.7 * 6.17 * 454 * VSS * 0.621371) / (3600 * MAF / 100)
MPG = 710.7 * VSS / MAF

Note that OBD-II VSS reading is in kilometers/hour and MAF reading is grams/sec times 100.

This formula works very well in a modern automobile because the engine computer spends almost 100% of its time managing the fuel-air-ratio to 14.7, which it can do very well because of the "closed loop" feedback from the O2 sensor(s).

In fact, the accuracy of this method has been proven in literally tens of thousands of gasoline-powered vehicles. Accuracy within a few percent is typical, often limited by the accuracy of the vehicle speed reading (i.e., VSS).

As for other ways of doing this, especially if you don't have a MAF sensor, by knowing the displacement of the engine, and after a simple "calibration" using fuel tank "fill-up" data to find the only unknown, namely the "volumetric efficiency" (VE) of the engine, MAF can be calculated from RPM, MAP and IAT. With VE, one can use the following formulas to calculate a synthetic "mass air-flow" (MAF) in grams per second, all without a MAF sensor, using the "Ideal Gas Law", as follows:

IMAP = RPM * MAP / IAT
MAF = (IMAP/120)*(VE/100)*(ED)*(MM)/(R)

where manifold absolute pressure (MAP) is in kPa, intake air temp (IAT) is in degrees Kelvin, R is 8.314 J/°K/mole and the average molecular mass of air (MM) is 28.97 g/mole. Note that, in the above formula, the volumetric efficiency of the (4-cycle!) engine is measured in percent and the engine displacement (ED) is in liters.

The VE of my 1999 7.4L Chevy Suburban is about 65%. Smaller, higher performance engines can have VE's of 85% or higher.

...
That led me to this code :

Code:
//
// For signalling when one of the critical input variables has been received from the ECU/PCM
//
typedef struct
{    
    // 32 bits
    int    mph:1;
    int    map:1;
    int    iat:1;
    int    rpm:1;
    int   _PADDING:28;
} accessbits32;

//
// MPGData is global data structure for calculating MPG
//
typedef struct
{
    union
    {
        int          accessbit32:32;
        accessbits32 accessed;
    };

    double speed_kmh;
    double speed_mph;
    double map_inHg;
    double map_kPa;
    double rpm;
    double iat_c;
    double mpg_instant;
    double fuel_instant;
    double miles_instant;
    int    mpg_count;
    double mpg_avg;
    double imap;
    double maf_gs;
    double total_miles_travelled;
    double total_fuel_consumed;
} MPGData;

MPGData m; 

//
// Drivetrain specific variables that can be loaded from a file
//
typedef struct
{
    double ed;             // Engine Displacement
    double ve;             // Volumetric Efficiency
    double odo_correction; // odometer correction
} DriveTrain;

DriveTrain dt;

//
// calc_mpg_formula
//
int calc_mpg_formula()
{
    int ret;
    double iat_k; 
    int kmh_zero;

    iat_k = m.iat_c + 273.15;
    
    if ( iat_k == 0.0)
        iat_k = ALMOST_ZERO; 

    // IMAP =  RPM   * MAP:kPa    / IAT:K
    m.imap  = (m.rpm * m.map_kPa) / iat_k;

    // MAF = (IMAP/120)*(VE/100)*(ED)*(MM)/(R)
    // MAF   = ((   IMAP / 120  )*(VE:% /100)*(ED:liters)*(MM)   )/(R)
    m.maf_gs = (( m.imap / 120.0)*(dt.ve/100)*(dt.ed)    *(28.97))/(8.314);
    
    if ( m.maf_gs == 0.0)
        // then protect against divide by zero later on
        m.maf_gs = ALMOST_ZERO;
              
    // where manifold absolute pressure (MAP) is in kPa,
    // intake air temp (IAT) is in degrees Kelvin, 
    // R is 8.314 J/°K/mole and 
    // MM is the average molecular mass of air (MM) = 28.97 g/mole.
    // Note that, in the above formula, the volumetric 
    // efficiency of the (4-cycle!) engine is measured in 
    // percent and the engine displacement (ED) is in liters.
    
    if ( m.speed_kmh == 0.0)
    { // Not a good solution for 0 MPH, but lets give it a try
        m.speed_kmh = 0.161 / 1000.0;
        m.speed_mph = 0.10  / 1000.0;
        kmh_zero = 1;
    }
    else
    {
        kmh_zero = 0;
    }

    // miles travelled in 1 second
    m.miles_instant = m.speed_mph / 3600.0;
    
    if (( m.rpm < 100) && (kmh_zero == 1))
    { // then EOC
        m.mpg_instant = 9999.0;
        m.fuel_instant = 0.0;
    }
    else
    {
        // MPG - miles per gallon
        // 14.7 grams of air to 1 gram of gasoline - ideal air/fuel ratio
        // 6.17 pounds per gallon - density of gasoline
        // 454 grams per pound - conversion
        // VSS - vehicle speed in kilometers per hour
        // 0.621371 miles per hour/kilometers per hour - conversion
        // 3600 seconds per hour - conversion
        // MAF - mass air flow rate in 100 grams per second
        // 100 - to correct MAF to give grams per second => NOT NEEDED

        //MPG = (14.7*6.17*454*KPH*0.621371)/((3600*MAF)/100)
        //            => 710.7335739 * KPH          / MAF
        //            => 7.107335739 * KPH          / MAF_gs
        m.mpg_instant = (7.107335739 * m.speed_kmh) / m.maf_gs;

        // GPH / 3600 = GPSecond = ( MPH         / MPG          ) / 3600.0
        m.fuel_instant    = ( m.speed_mph / m.mpg_instant) / 3600.0;
    }

    m.mpg_count++;
    m.total_miles_travelled += m.miles_instant;
    m.total_fuel_consumed   += m.fuel_instant;

    if ( m.total_fuel_consumed != 0.0)
    { 
        m.mpg_avg = m.total_miles_travelled / m.total_fuel_consumed;
    }
    else
    {
        m.mpg_avg = 0.0;
    }

    ret = m.accessbit32;
    m.accessbit32 = 0;
    return (ret);
} // END calc_mpg_formula()
There are lots of limitations to what I am calculating. I need to get IAT, MAP, MPH, and RPM in one second in order to be able to datalog. This sounds like plenty of time for a computer, but my standing theory is that the ECU/PCM communicates in it's own good time.

Also, I don't know the Volumetric Efficiency (VE) of my engine. This doesn't address the knowledge that VE changes under different loads.

However, I *am* datalogging MPG numbers that are very very very similar to what a Scangauge displays. This has always been my goal, to have a formula that can give me the same *relative* MPG changes as the ScanGauge.

Me Happy, .

CarloSW2

__________________

What's your EPA MPG? Go Here and find out!
American Solar Energy Society

Last edited by cfg83; 08-08-2010 at 10:54 PM..
  Reply With Quote
Reply  Post New Thread






Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com