EcoModder.com

EcoModder.com (https://ecomodder.com/forum/)
-   OpenGauge / MPGuino FE computer (https://ecomodder.com/forum/opengauge-mpguino-fe-computer.html)
-   -   MPGuino for Audi (https://ecomodder.com/forum/showthread.php/mpguino-audi-4912.html)

rmccomiskie 09-02-2008 09:16 PM

MPGuino for Audi
 
I've been lurking here for a while. Now I have an iDuino and I'm ready to start implementing in my 97 Audi A6 Quattro. Fortunately, Audi provides several connection points for VSS. It's a signal that's output to the other systems by the speedometer. Even better, Audi provides a fuel consumption signal that's intended for the optional trip computer. I'm hoping this signal will avoid the need to measure injector pulses directly.

Here's what the VSS signal looks like at 60 mph:

http://img440.imageshack.us/img440/1654/vss60mphgl9.jpg

I've been told the signal from the sender is 8 pulses per tire revolution. Given the stock tire size, I expected about 11 pulses per 100 mS. The oscilloscope proved it.

Now the fuel consumption signal at idle (700 rpm):

http://img253.imageshack.us/img253/3...e700rpmub0.jpg

And at 60 mph steady:

http://img253.imageshack.us/img253/7...hsteadynk1.jpg

And accelerating hard 55 to 65 mph:

http://img253.imageshack.us/img253/9...rdaccelaq6.jpg

The only expanation of the fuel consumption signal that I've found is this:

"The fuel consumption signal is a data message which is conditioned by the engine control unit. The sum total of the high levels during a defined period of time corresponds to the injected fuel quantity."

So, it sounds like I just have to count the pulses that occur within, let's say, 100 mS. The problem is, what volume of fuel does that number relate to? I may have to just estimate a ballpark volume and then adjust with every fillup.

I know that I get about 22 mpg at 75 mph. If I use the scope to capture the number of pulses at 75 mph, I should be able to get close to the fuel volume those pulses represent.

Does anyone have a better way to do this?

dcb 09-02-2008 09:36 PM

looks like about 14040 vsspulses per mile?

The "fuel consumption signal" looks basically like an injector signal.

rmccomiskie 09-02-2008 11:46 PM

Now I'm confused. The stock size tire turns 811 times per mile. The sensor is supposed to output 8 pulses per tire rev. 811*8=6488 pulses per mile.

Crosschecking that number, if the scope shows 11 pulses in 100 mS at 60mph, that's 110 pulses per second * 60 sec = 6600 pulses per minute (1 minute = 1 mile at 60 mph). So 1 mile = 6600 pulses. Pretty close.

What am I missing?

dcb 09-03-2008 07:09 AM

I guessed 117 pulses per second (7 pulses in 60ms) per the graph, and the guino will multiply that by 2 (counts rising and falling edge). You can always calibrate it using the cars odometer so close enough for getting started.

secmil 09-03-2008 11:20 AM

I'm currently working on getting mine to work on my '98 A4, and was wondering where you were able to tap into the fuel consumption signal...

I was looking through all of the wiring diagrams in the bentley manual, but I guess I missed that whole section.

rmccomiskie 09-03-2008 10:13 PM

Quote:

Originally Posted by secmil (Post 58424)
I'm currently working on getting mine to work on my '98 A4, and was wondering where you were able to tap into the fuel consumption signal...

I was looking through all of the wiring diagrams in the bentley manual, but I guess I missed that whole section.

Ahh...an Audi owner to commiserate with!

Bentley wasn't much help for me. I found a thread on AudiWorld on retrofitting a trip computer. The fuel consumption signal came from a connector behind the passenger kick panel. I checked my car and it has the proper color wire in that spot. I hooked up the scope and it looks like the right signal.

It's a Blue/Black wire in the red connector here:

http://img119.imageshack.us/img119/2696/fc1se4.jpg

I removed the connector bracket, pulled the connectors and pushed a solid wire into the top of the connector to bring the signal out to where I could attach an alligator clip:

http://img119.imageshack.us/img119/2189/fc2uk0.jpg

Remember, this is a 97 Audi A6. I don't know if the A4 will have this signal in exactly the same place. Audi is, however, pretty consistent. Since the A4 has a trip computer as an option, there must be a consumption signal somewhere. I'll bet that you will find a Blue/Black wire in a red connector in roughly the same place.

For the VSS, I found a schematic that showed the VSS going to the cruise control module. I pulled the module connector and found the signal there on a White/Blue wire. I found the same colored wire behind the kick panel and a continuity check showed them to be connected. So, I pushed a solid wire into the kick panel connector to bring that signal out.

http://img388.imageshack.us/img388/3023/vsswireeb2.jpg

Let me know if have any questions. Good luck.

Bob.

Kaneda 09-03-2008 11:08 PM

good to see others trying to remedy the audi mpg curse ... '99 A4 2.8 here

rmccomiskie 09-04-2008 06:23 PM

Can't cure the curse that Audi wrought. Best to know your enemy well though! Jump right in and join the fray.

rmccomiskie 09-05-2008 02:25 PM

Quote:

The only expanation of the fuel consumption signal that I've found is this:

"The fuel consumption signal is a data message which is conditioned by the engine control unit. The sum total of the high levels during a defined period of time corresponds to the injected fuel quantity."

So, it sounds like I just have to count the pulses that occur within, let's say, 100 mS. The problem is, what volume of fuel does that number relate to? I may have to just estimate a ballpark volume and then adjust with every fillup.
After logging more fuel consumption signals, I'm coming to the conclusion that the 97 A6 signal is one pulse for each injector firing and the pulse width is the length of time that the injector is open. So, the signal includes the injection time for all 6 injectors not just one. Summing the pulse width time is the total injector open time.

Now I need to monitor the pulse width at 75 mph where I get about 22 mpg. Then I can calculate the approximate injection time per gallon. Soon.

dcb 09-05-2008 02:50 PM

If it actually conditions the signal, then you might need to adjust your "Injector DelayuS" from its default of 500. Or just tap an injector lead :rolleyes:

secmil 09-07-2008 10:48 AM

Wow, many thanks for those pics for fuel consumption signal! I'll be tearing my car apart again this week I guess...

Assuming I can actually use the signal, and all.

rmccomiskie 09-08-2008 09:47 AM

I did some logging on the way home last night. At 75 mph, the engine is turning 3400 rpm and burning 22 mpg (my guesstimate). Here's the injector pulse width at that speed:

http://img291.imageshack.us/img291/63/550usxu2.jpg

This one happens to be 550 micro seconds width. I logged a number of these and the average is around 562 uS.

For my 2.8 liter 12 valve V6, I calculate 100,890,240 uS per gallon. Once I get this installed and running we'll see how accurate that is.

BTW: I'm using a sound card oscilloscope program on my laptop to capture the signals. I have an audio cable connected to the car with a couple of resistors to drop the signal voltage below 1V. It's plugged into my laptop microphone input. Works just fine at the frequencies we're dealing with.

rmccomiskie 09-08-2008 09:55 AM

Quote:

Originally Posted by dcb (Post 59145)
If it actually conditions the signal, then you might need to adjust your "Injector DelayuS" from its default of 500. Or just tap an injector lead :rolleyes:

Question: Since the Audi fuel consumption signal appears to be one pulse for every injector, do I have to change any settings. In my case, it's as though I am connected to all 6 injectors not just one.

My assumption is that the normal MPGuino hookup is one injector and the pulse width of that injector is being scaled up to represent the rest of the injectors. Right?

secmil 09-08-2008 09:09 PM

I would just assume that our setting for microsec/gallon (as it's called in the workspace) would just be 1/6th as much since there are six injectors reporting instead of just one.

I wish I wasn't having so many hardware issues so I could play with it and see what's what...

dcb 09-08-2008 09:17 PM

Quote:

Originally Posted by rmccomiskie (Post 59687)
My assumption is that the normal MPGuino hookup is one injector and the pulse width of that injector is being scaled up to represent the rest of the injectors. Right?

Basically.

Honestly though, I have no idea if that signal you have found will be accurate. We account for mechanical delay when measuring the injector pulse. I don't know if what you are looking at has accounted for that or not. You will have to carefully measure that pulse alongside the injector pulse and do some figguring if you want to be reasonably certain of the accuracy. I don't know how conditioned that signal has been, you are breaking new ground.

rmccomiskie 09-09-2008 11:11 AM

Quote:

Originally Posted by dcb (Post 59829)
...I have no idea if that signal you have found will be accurate. We account for mechanical delay when measuring the injector pulse. I don't know if what you are looking at has accounted for that or not. You will have to carefully measure that pulse alongside the injector pulse and do some figguring if you want to be reasonably certain of the accuracy. I don't know how conditioned that signal has been, you are breaking new ground.

Good point.

I'll check the pulse width at idle. Since the 'Injector DelayuS' value is 500uS, I'd expect to see a pulse width of 500uS plus whatever injection time is needed to sustain idle. If the pulse width is less than 500uS (assuming that's the correct delay) then it's likely that the fuel consumption signal subtracts settling time from the injector pulse and directly represents the actual injection time.

If I can easily get at an injector wire I can compare that signal as a crosscheck.

rmccomiskie 09-10-2008 09:34 PM

I logged the fuel consumption signal pulse width at different speeds and compared them:

http://img299.imageshack.us/img299/7...parisonyf3.jpg

The typical pulse widths are:

Idle = 450 uS
50 mph = 620 uS
60 mph = 740 uS
75 mph = 870 uS

Given that the idle pulse width is relatively large compared to the rest, I suspect that the settling time is contained in the signal. In fact, I'd bet that the fuel consumption signal is just a composite of all 6 injector signals with no other conditioning.

Also, since the Idle PW is less than 500 uS, the delay time should be something less. Maybe 400 uS. I have no idea. I'll have to play around with the settings against actual fuel burn to get an empirical value...in my 'spare' time.

rmccomiskie 09-17-2008 05:05 PM

Audi Fuel Injector Flow Rate
 
I found this interesting bit of information at http://www.injectorcleaning.co.uk/flow.htm

Bosch Part Number: 0280150552 (crossref to 1992-98 Audi 12V V6)
156 cc/min @ 3 bar (44.1 psi)
Resistance: 15.9 ohms

Audi typically specs their fuel rate at 43.5 psi so 3 bar is close. I'd expect the installed flow rate to be about 150 cc/min.

rmccomiskie 10-03-2008 05:11 PM

Bump.

dcb 10-03-2008 05:40 PM

Are you sure you want to go through all this to avoid tapping into an injector wire? There are a few unknowns. What is the pulse width of the injector at idle?

rmccomiskie 10-06-2008 03:33 PM

Yes. I really do want to use existing signals. They're easy to get to. It's just a matter of calibrating them.

PW at idle seems to be about 400uS.

After some experimenting, VSS = 8400 is close. Haven't gotten to uS/Gal yet.

I'm wrestling with what looks like noise. When the car is stopped with engine off, speed registers about 14-15 mph and mpg keeps ticking slowly. I'm reworking my connections to the car. Alligator clips now.

My MPGuino is on a breadboard and seems to be working correctly.

dcb 10-06-2008 04:12 PM

what is INJECTOR pulse width at idle? So that you know the conversion factor for that signal you are looking at.

rmccomiskie 10-06-2008 09:39 PM

Ah! I'll have to dig for that. Not this week. Soon though.

dcb 10-06-2008 10:26 PM

Ok, I'd suggest measuring the injector signal along side that plug signal under a couple rpms and maybe it would make more sense.

rmccomiskie 01-20-2009 09:52 AM

dcb - Another question?
 
I replaced my breadboard device with the MPGuino v1 from Fundamental Logic. Hooked up to my Audi, I adjusted VSS pulses per mile to 13418. That's within 0.10 miles distance over an 80 mile trip. So it's very close.

I adjusted fuel flow uSec per gallon to 050000000 which seems to be in the ballpark. I noticed that the GPH and MPG were responding in reverse. Up a hill, on the accelerator, GPH decreased and MPG increased. That's reverse of what it should be.

I remembered that the fuel flow signal was negative going. Assuming that the code is set up to measure a positive going FF signal, I changed the code like this:

attachInterrupt(0, processInjOpen, FALLING); changed to RISING
attachInterrupt(1, processInjClosed, RISING); changed to FALLING

The idea being to start measuring the pulse on the negative going leading edge. Now the GPH and MPG are responding in the proper direction.

Now I'm trying to zero in on the uSec per gallon number and I noticed that when I lift off the accelerator going down a hill, the GPH quickly goes to zero but then jumps up to something like 70 GPH. I'm guessing that the engine computer cuts off the fuel flow entirely when coasting and the signal is being interpreted as a very high flow rate.

Have you seen this before? Is my code change correct? Or is there something else in the code that should be changed instead?

Thanks.

dcb 01-20-2009 10:44 AM

Sorry, but we are flying blind here. The mpguino was designed to hook up to an injector, not a computer. We do not know what the computer is doing to the signal without first accurately comparing it to an injector signal and running several scenarios.

The computer could be adding offsets, it could be porportional, it could be non-linear, it could be some really weird function. If you want to avoid using an injector lead and still be accurate, you have a lot of work to sort out with this proposed signal, and it all starts with a known point of reference (i.e. a calibrated mpguino) which requires you to tap an injector line anyway.

It would be pointless for me to look at code without knowing anything about the signal it is supposed to process, and even then I'm not sure of the value of it if it means a code branch for an unknown number audis that could just tap an injector lead. If I didn't have other priorities I would be more inclined I suppose, but I can't even look at this at the moment. You need audi ECU specific help or reverse engineer what you have there if you are bent on this path.

rmccomiskie 01-20-2009 02:53 PM

OK. Thanks for the quick reply. I'll go ahead and validate that the fuel flow signal is identical to the injector signal. If it's not, I'll dig into the code to see how it can be interpreted.

As I pursue that approach, am I correct in assuming that the MPGuino code is looking for a positive going injector signal only? And that a simple method of changing from positive to negative signal is not provided.

dcb 01-20-2009 03:47 PM

Quote:

Originally Posted by rmccomiskie (Post 84123)
And that a simple method of changing from positive to negative signal is not provided.

It is probably simpler overall to change the code than to present an option for the few cases that might need positive switched, but you change these two lines exactly like you mentioned:

Change:
attachInterrupt(0, processInjOpen, FALLING);
attachInterrupt(1, processInjClosed, RISING);

To:
attachInterrupt(0, processInjOpen, RISING);
attachInterrupt(1, processInjClosed, FALLING);

rmccomiskie 02-22-2009 09:46 PM

Determining the VSS Setting
 
The speedometer face in my 1997 A6 has "K=6703" printed on it. You can see it here at the bottom.

http://img100.imageshack.us/img100/3...peedometer.jpg

That's the number of VSS pulses per mile expected by the speedo. For the MPGuino, simply double that number and enter it as the VSS pulses parameter in setup. So, mine is 13406 and the distance is dead on. The number must be doubled because the MPGuino counts both the rising edge and the falling edge of each pulse.

I've seen other Audis with a similar, but not identical number, printed on the speedo. You might have to dissemble the instrument cluster to see it. Remember, assembly is the reverse of disassembly! (8'D

rmccomiskie 02-26-2009 12:05 PM

Injector vs. ECU Signal Comparison
 
Here's a comparison of the injector signal versus the ECU fuel flow signal. I frankensteined both the injector and ECU fuel flow signals into a stereo audio plug and captured them with my SoundCard Scope. The green signal is from the injector and the red signal is from the ECU.

This is about 30 mph steady on level ground:
http://img13.imageshack.us/img13/8629/image42qz8.jpg
You can that there are 6 ECU pulses for every injector pulse as expected.

...and this is about 30 mph uphill accelerating hard.
http://img12.imageshack.us/img12/8250/image44bp0.jpg
The ECU pulses appear to be scaled down from the injector pulse width but I expect them to be proportional.

Then I started coasting downhill at about 30 mph...
http://img11.imageshack.us/img11/6482/image49ez0.jpg
When coasting, the signals start out looking like the engine is at idle.

...after a couple of seconds, the signal looked like this...
http://img14.imageshack.us/img14/931/image52xa4.jpg
The ECU signal goes completely flat while the injector signal shrinks to a very short pulse. The flat ECU signal may present a problem because the external interrupt routines will not execute.

I compared the injector pulse width versus the ECU pulse width across a range of speeds and throttle settings to get an average ratio between the two. Here's the graph of the relationship:

http://img18.imageshack.us/img18/8933/analysisgraph.jpg

The Raw data is for the full injector pulse width and the -500uS data is for the inj pulse minus the settling time. So, the ECU pulse width seems to be about 1/8th the width of the injector pulse and it's consistent across different speeds and acceleration.

If I assume that the ratio is 0.123 and I know that the injector uS/gal is 200500000 for my car, when I switch to the ECU signal input, the uS/gal should be 148000000. Calculated as 0.123 * 200500000 * 6 inj pulses. That gives me a starting point to calibrate the ECU signal.

Of course, it still remains to figure out how to handle the ECU flatline signal when coasting.

yetimus 02-26-2009 10:34 PM

rm-

You may recall that I replied to your post on 2/15 in the release one workspace thread expressing my interest in tapping the ECU fuel consumption signal on a VW TDI. Well, I finally received and assembled my Fundamental Logic v2 kit and tapped into my VSS and fuel consumption signals. I installed the MPGuino and went for a test drive with no changes to the pre-installed code. I did, however, play around with the preset parameters and changed "Injector Delay uS" from its default setting to 100. IIRC, the default setting was 500 and I somewhat randomly chose 100 uS based on the oscilloscope graphs you posted showing much shorter pulses from the ECU. On test drive #1, I noticed the same behavior in GPH reading as you originally did (i.e. GPH read higher when coasting and lower when accelerating).

So, my next step was to change the code as you did:
attachInterrupt(0, processInjOpen, RISING);
attachInterrupt(1, processInjClosed, FALLING);

The next test drive looked a lot more promising. My calibration values were obviously way off, but not only did the GPH readings display as expected (rising when accelerating/falling when coasting) I also didn't notice any strange behavior with the GPH value rising when coasting. It went to zero and stayed there - which is correct for the TDI because it cuts off all flow to the injectors when coasting in gear.

So I spent a little more time calibrating the VSS and uS/gal settings and everything seems to be running correctly. I still have a little tweaking to do with my uS/gal setting, but it appears that this setup is going to work.

I hope to get around to playing with the sound card oscilloscope program you've been using so we can see if our ECU signals are similar. But I think they are. I recently installed an instrument cluster in my TDI that originally came in the VR6 Passat. The reason I did this is that the VR6 cluster has a built-in MPG gauge that displays average MPG (not instantaneous). The TDI, though it was never originally equipped with the factory MPG guage, obviously uses a nearly identical signal from the ECU as the gasoline powered car. Read more about it here.

So I wish I could provide a bit more insight as to why my particular setup is working so far. Have you tried messing with the Injector Delay uSec preset at all?

Thanks for all the excellent info you've posted on this topic!:thumbup:

rmccomiskie 02-27-2009 09:41 AM

Hi yetimus,

Quote:

...I did, however, play around with the preset parameters and changed "Injector Delay uS" from its default setting to 100. IIRC, the default setting was 500 and I somewhat randomly chose 100 uS based on the oscilloscope graphs you posted showing much shorter pulses from the ECU...
I'm not sure that the Injector Delay uS is needed with the ECU signal. It's possible that the ECU factors out the injector settling time and presents a pure fuel flow signal. I'll be experimenting with that soon. Hopefully, I can gather a lot of OScope data and graph the relationship of the injector and ECU signals. Perhaps the resulting curves can be extrapolated to show that the settling time is or is not included in the ECU signal.

Quote:

...I also didn't notice any strange behavior with the GPH value rising when coasting. It went to zero and stayed there - which is correct for the TDI because it cuts off all flow to the injectors when coasting in gear...
I'm surprised at that. Congratulations.

Quote:

...I recently installed an instrument cluster in my TDI that originally came in the VR6 Passat. The reason I did this is that the VR6 cluster has a built-in MPG gauge that displays average MPG (not instantaneous). The TDI, though it was never originally equipped with the factory MPG guage, obviously uses a nearly identical signal from the ECU as the gasoline powered car. Read more about it here...
Wow! That's an amazing read. It took a long time to figure all of that out. Similarly, my North American 97 Audi A6 did not come with a trip computer. The rest of the world got it but not us. And to add insult, the NA wiring harness doesn't include the connector for the wiper stalk switches. I'm sure that the instrument cluster itself has all of the TC functionality but the lack of any wiring makes a retrofit a big deal.

So, that's why I'm pursuing the MPGuino. My ultimate plan is to install a wiper stalk with switches from a 96-97 A4 (lots around) and fabricate a small LCD display that fits into the instrument cluster in the trip computer location. There's not much room in there so I'll have to use a scavenged cellphone display interfaced externally to the MPGuino. Time will tell whether this all works. In the mean time, it's fun!

I'm glad to see someone else is tackling Audi issues. This thread is a good place to share experiences so other Audi-heads can find us.

Cheers.

Bob.

rmccomiskie 02-27-2009 12:04 PM

Injector Delay uS
 
I've assumed all along that the ECU fuel flow signal is an exact representation of the injector signal but narrower so all 6 injector pulses can be included within the same time period. Given that it looks like the ECU pulses are 0.123 times the injector pulse width, I expect the settling time to be similarly scaled.

For an injector settling time of 500uS, the ECU settling time would be 0.123 * 500uS = 61.5uS; Injector Delay uS = ~62uS.

I'm going to use 62uS unless experimentation disproves my theory. Keep in mind that the 500uS injector delay is simply an assumed value based on experience across a lot of different injectors. It may or may not be correct for an Audi injector.

These posts give some background information on the injector settling time issue:
http://ecomodder.com/forum/showthrea...html#post31602
http://ecomodder.com/forum/showthrea...html#post34576
http://ecomodder.com/forum/showthrea...html#post34738
http://ecomodder.com/forum/showthrea...html#post34902

rmccomiskie 03-08-2009 10:33 PM

I found injector specs for my 97 A6. Using Yoshi's formula, I calculated the injector settling time to be 615uS. Scaling that down to the ECU pulsewidth, I get 72uS. That's what I'm running now.

Over the weekend, I calibrated my uS/gal setting on a 250 mile trip. I filled the tank and reset everything. When I next filled up, my MPGuino said I had used 13.28 gallons. That was with a uS/gal setting of 123000000. The fillup was 13.53 gallons. So, I decreased the uS/gal setting a couple of times until the gallons read 13.53. I'll continue to check it over the next couple of tanks but I think it's real close now.

rmccomiskie 04-14-2009 09:28 AM

Two tankfulls later...I've recalibrated uSec/Gal to 128800000. My MPGuino now indicates fuel used within 0.7% of the fillup amount. For example, MPGuino showed 16.71 tank gal used and the pump was 16.6. After changing to 128800000, MPGuino said 16.60. Still calibrating but that's close enough for my needs.

dcb 04-14-2009 10:07 AM

That is sounding pretty useful :) Might need to confirm with a city tank or two but you are way better than in the ballpark it sounds like :thumbup:

edit: I have to wonder if 128800000 is the value that yetimus used? or that dremd could use, or anyone with a newer vw/audi? And where did you leave injdelayus?

yetimus 04-14-2009 06:06 PM

Quote:

Originally Posted by dcb (Post 97681)
I have to wonder if 128800000 is the value that yetimus used? or that dremd could use, or anyone with a newer vw/audi? And where did you leave injdelayus?

I'm still dialing in my calibration numbers - I recently (last week) replaced my injector nozzles on the TDI with some larger orifice nozzles which obviously is going to effect my uSec/gal. However, I'm currently using 135100000 uSec/gal and I'm within 2% of actual MPG.

As far as injdelayus, I had it set at 100 for a few weeks and then tried it at 0. I had forgotten about Bob's research suggesting 62 uSec. Either way, the mpguino provides fairly accurate and very usable feedback for increasing FE. On that note, just achieved my best-ever tank MPG at 47.7 on the old Passat (with the help of the Mpguino and new nozzles!):thumbup:

rmccomiskie 04-14-2009 10:12 PM

Quote:

Originally Posted by dcb (Post 97681)
...I have to wonder if 128800000 is the value that yetimus used? or that dremd could use, or anyone with a newer vw/audi? And where did you leave injdelayus?

Recall that I'm using the ECU fuel consumption signal. I scaled injDelayuS down to 72uS. I've run through 2 tanks highway and 2 tanks around town. Keeping track of all adjustments to see if the highway versus city usage is different. Haven't figured out how to tell if injDelayuS needs to change.

dcb 04-14-2009 10:26 PM

Quote:

Originally Posted by rmccomiskie (Post 97929)
Recall that I'm using the ECU fuel consumption.

I am 100% aware of that and seeing that it may cross over directly into TDI/vw land too I am especially glad you stuck with it. I'm sure there are a lot of tdi folks who would be glad to have consumption feedback.

rmccomiskie 06-12-2009 12:26 PM

High MPG When Coasting
 
I've resolved the high MPG reading when coasting. It turns out that the ECU shuts off the injectors when coasting. The injector signal from the ECU is normally negative going. However, when the injectors are shut off, there's still a very small positive spike for each injector pulse. MPGuino inadvertently interprets the small spikes as verrry long injector on pulses. The behavior is observed as an instantaneous jump to a very high MPG value after a couple of seconds of coasting.

I've made the following code mod to fix this behavior.

Code:

//This code resolves very high MPG values when coasting (1997 Audi A6)
//Based on MPGuino v0.75
//Injector signal taken from ECU, negative going signal, injectors shut off when coasting
//Adds pulse width limit parameter = 4000
//Assume any pulse width greater than the limit is invalid and sets it to zero
//Results: Out of range pulsewidths are never added to total injector open time

//insert new parameter, in this case "PW Lim", 4000ul for Audi A6

unsigned long  parms[]={69ul,13406ul,128900000ul,6ul,420000000ul,19800ul,72ul,4097ul,0ul,2ul,4000ul};//A6 defaults w/ECU signal
char *  parmLabels[]={"Contra","VSSPPM", "uS/gal","P/2rev","Timout","Tk Gal","iDeluS","WgtLbs","Scrach","VSSdel","PW Lim"};

//define new parameter

#define pulsewidthLimit 10  //insert new parameter

//modify processInjClosed() routine

void processInjClosed(void){     
  unsigned long t = microSeconds();
  unsigned long s = parms[injectorSettleTimeIdx];
  unsigned long pwLimit = parms[pulsewidthLimit];
  unsigned long x = elapsedMicroseconds(injHiStart, t);
 
  if (x >= s && x < pwLimit) {  //if elapsed time > settling time and < upper threshold
    x -= s;                    //then normal pulse, subtract settling time
  }else{
    x = 0;                      //otherwise pulse width out of range and assumed to be zero
  }
 
  tmpTrip.injHius += x;     
  tmpTrip.injPulses++;     

  if (tmpInstInjStart != nil) {
    tmpInstInjTot += x;   
    tmpInstInjCount++;
  } else {
    tmpInstInjStart = t;
  }
  tmpInstInjEnd = t;
}

I determined the 4000 uSec pulsewidth limit for my car by creating a display screen that showed the currently measured pulsewidth. I observed that the maximum normal pulsewidth was below 3000 uSec and that it would jump immediately to about 10000 uSec when coasting. So, I set my limit to 4000 uSec. Anything greater than that is assumed to be invalid and the pulse is ignored, i.e. set to zero.


All times are GMT -4. The time now is 06:17 AM.

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