UK & Ireland S2000 Community Discussions related to the S2000, its ownership and enthusiasm for it in the UK and Ireland. Including FAQs, and technical questions.

Tech help

Thread Tools
 
Old Mar 9, 2009 | 11:21 AM
  #1  
s2konroids's Avatar
Thread Starter
20 Year Member
Photogenic
 
Joined: Jan 2006
Posts: 20,788
Likes: 8
From: location, location
Default Tech help

I'm in the process of writing a program that resides on a mobile phone it will basically be a scanguage2 but for mobile phones mainly mine (N95 8GB) and its completely wireless (bluetooth).

It does work so far through an elm device that reads from the OBD2 port, i can read a few values correctly (ignition timing, voltage and speed) and regulary too.

Anyone any ideas how i can work out average MPG?

I was thinking using the following values, and given a value every minute or so to get an average. I might have to put in an option to reset when you fill up with petrol but that would be a bit of PITA maybe no other to do it?

(fuel trim)
(Vehicle)
(MAF)
(AFR)
(VSS)

Cheers
Reply
Old Mar 9, 2009 | 11:52 AM
  #2  
loftust's Avatar
Registered User
 
Joined: Oct 2008
Posts: 9,234
Likes: 3
From: Fareham, Hants
Default

Well you're going to need to know distance, which I'd take from the Odometer. You'll also need to know how much fuel is being consumed. The inverse of this is fuel remaining, so you can obtain a voltage proportional to fuel level from the gauge.

With some magic on your part, both bits of data will give you your MPG.

It's not going to be spot on accurate, you'd have to look into something more complicated by looking at the amount of fuel injected (possibly by looking at MAF and air/fuel ratio).


Reply
Old Mar 9, 2009 | 12:00 PM
  #3  
NineBolts's Avatar
15 Year Member
 
Joined: Sep 2007
Posts: 3,713
Likes: 1
From: SW London
Default

I think the SGII does it by using RPM or Duty Cycle of the injectors (or something) and the engine capacity. It does use the TPS (throttle position) but I think that is only relevant to when its on idle. It has a measure for the FPR but that is blank on the S and it still works it all out quite well. I suspect its just using RPM and capacity.

It does have a correction factor that you can adjust when you fill up and the MPL economy figures are realtime ish but it also keeps a tally for trip, day and tank.
Reply
Old Mar 9, 2009 | 12:01 PM
  #4  
s2konroids's Avatar
Thread Starter
20 Year Member
Photogenic
 
Joined: Jan 2006
Posts: 20,788
Likes: 8
From: location, location
Default

Thanks guys, think its simplier.

Here is a formula that should do.

Based on VS, AFR of 14:7:1, MAF reading

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

This will be an approximation MPG, but better than nothing

Here is a list of items you can read (main ones)

Engine RPM
Calculated Load Value
Coolant Temperature
Fuel System Status
Vehicle Speed
Short Term Fuel Trim
Long Term Fuel Trim
Intake Manifold Pressure
Timing Advance
Intake Air Temperature
Air Flow Rate
Absolute Throttle Position
Oxygen sensor voltages/associated short term fuel trims
Fuel System status
Fuel Pressure
Reply
Old Mar 9, 2009 | 12:06 PM
  #5  
NineBolts's Avatar
15 Year Member
 
Joined: Sep 2007
Posts: 3,713
Likes: 1
From: SW London
Default

14.7 - if only
Reply
Old Mar 9, 2009 | 12:10 PM
  #6  
s2konroids's Avatar
Thread Starter
20 Year Member
Photogenic
 
Joined: Jan 2006
Posts: 20,788
Likes: 8
From: location, location
Default

Yeah
Reply
Old Mar 9, 2009 | 04:01 PM
  #7  
m1bjr's Avatar
15 Year Member
Liked
Loved
 
Joined: Oct 2006
Posts: 11,445
Likes: 7
From: Plymouth
Default

Dont forget to add on the 'null' level from the TPS.
For when coasting on over run / closed throttle (no consumption).

The scanguage - you read TPS raw value with foot off the pedal, add a couple for slop and set this as the point where below this value there is zero fuel consumption (closed throttle).
Reply
Old Mar 10, 2009 | 12:22 AM
  #8  
98RON's Avatar
Registered User
 
Joined: Jan 2009
Posts: 929
Likes: 1
From: Nth Yks
Default

OK; I know I'm twice you age Aj, but MPG on your mobile??? WTF???! Can't you youngsters just divide the miles covered between fill-ups by the amount of fuel used between fill-ups and then spend all that free'd up time drinking and sh@gg!ng??

98
Reply
Old Mar 10, 2009 | 12:57 AM
  #9  
BSM139's Avatar
UK Moderator
25 Year Member
Liked
 
Joined: Mar 2001
Posts: 4,798
Likes: 6
From: Vtecville
Default

Originally Posted by 98RON,Mar 10 2009, 08:22 AM
OK; I know I'm twice you age Aj, but MPG on your mobile??? WTF???! Can't you youngsters just divide the miles covered between fill-ups by the amount of fuel used between fill-ups and then spend all that free'd up time drinking and sh@gg!ng??

98


Bharat
Reply
Old Mar 10, 2009 | 01:37 AM
  #10  
m1bjr's Avatar
15 Year Member
Liked
Loved
 
Joined: Oct 2006
Posts: 11,445
Likes: 7
From: Plymouth
Default

Originally Posted by 98RON,Mar 10 2009, 08:22 AM
Can't you youngsters just divide the miles covered between fill-ups by the amount of fuel used between fill-ups and then spend all that free'd up time drinking and sh@gg!ng??
Cyber sex can be over in a just a dozen well formed packets now.
More time for drinking
Reply



All times are GMT -8. The time now is 03:45 PM.