08-29-2008, 09:39 AM
|
#21 (permalink)
|
|
EcoModding Lurker
Join Date: Aug 2008
Location: UK
Posts: 44
|
Hardware idiot check - there is 1.3 volts on pin2 at idle. I am using Analog In pin 2.
Software:
I have added "int press = 0" here:
--------------------
byte screen=0;
byte holdDisplay = 0;
int press = 0; //declare press
#define looptime 1000000ul/loopsPerSecond //1/2 second
void loop (void){
--------------------
Removed the "int" from this line:
-----------------------------------------------------------------------
press = analogRead(2) + 1; //press is common rail pressure approx in bars
-----------------------------------------------------------------------
And modded the display as you suggest.
Press is displaying 0.1 at 1.3 volts, rising to 0.9 max when driving. Maybe a display issue?
InstMPG is zero for any value of "us per gallon" and currentMPG is 999. It looks like it thinks no fuel is being used. Instant raw data shows a "random" value for injus. Could it be that the value is out of range for calcs and for displaying a sensible number?
On the plus side, CPU is now down to 52% from 500%...
Last edited by ecoxantia; 08-29-2008 at 02:53 PM.
|
|
|
|
08-29-2008, 09:43 AM
|
#22 (permalink)
|
|
EcoModding Lurker
Join Date: Aug 2008
Location: UK
Posts: 44
|
Quote:
Originally Posted by wagonman76
Did you possibly get the VSS and INJ wires switched around? I did even after checking quite a few times. Others have too, seems like a common mistake.
|
Well the displayed mpg has been making some sense, so I think I escaped this particular mistake! It did take me many attempts to get the right wire for Vss: as they say, measure twice, cut once. Not so easy to measure something that needs the wheel to turn though.
My only complication is an injection system that varies in pressure by 10x...
Last edited by ecoxantia; 08-29-2008 at 02:05 PM.
|
|
|
|
09-09-2008, 09:47 AM
|
#23 (permalink)
|
|
Master EcoModder
Join Date: Feb 2008
Location: 3rd rock
Posts: 1,308
|
Quote:
Originally Posted by ecoxantia
Press is displaying 0.1 at 1.3 volts, rising to 0.9 max when driving. Maybe a display issue?
|
That looks pretty good actually  We avoid floating point math on these little chips so instead the display routine assumes every number you pass it is 1000 times larger than it is.
So multiply the pressure number by 1000 before displaying it if you want to see it as a whole number.
So it would be something like 100 to 900, which is like perfect 
|
|
|
|
09-09-2008, 11:37 AM
|
#24 (permalink)
|
|
EcoModding Lurker
Join Date: Aug 2008
Location: UK
Posts: 44
|
Oh I see! Why didn't I think of that  Good news.
My breadboard is looking dangerous so I'm taking time out for an enclosure, decent connections and tidying up. This is my daily driver so I can't afford any mistakes. Besides my partner thinks I've lost the plot, what with filling the car with bare wires!!
I got as far as multiplying pressure by a thousand for the mpg calc, and at that stage mpg was kind of making sense. I get the impression that pressure has a far bigger effect on fuel burnt than injector duration.
I have read that 1350 bar is unlikely to be seen- since there is only a small window at 4000 rpm where it's called for. And in any case my pump is 120 000 miles old!!
|
|
|
|
09-10-2008, 12:05 AM
|
#25 (permalink)
|
|
Master EcoModder
Join Date: Feb 2008
Location: 3rd rock
Posts: 1,308
|
Cool, some more unsolicited thoughts:
Note the analogRead*1000 reading and the pressure gauge reading at minimum pressure.
Note the analogRead*1000 reading and the pressure gauge reading at maximum pressure.
Note the analogRead*1000 reading and 25% pressure. At 50% and 75%
Graph and determine linearity or if curve function needed to predict pressure from analogRead.
the injectorDelay is probably a lot less than the typical 500. That initial pulse probably isn't 500us long. Might just be 100 us. How long is the pre-pulse?
The flow is a function of time and differential pressure. You have the input pressure, might need to guess at the BMEP (150.8 x TORQUE (lb-ft) / DISPLACEMENT (ci) ). Given that your injectors are at like 3000 psi at idle, and bmep is maybe 300 psi at full throttle? It won't represent more than a %10 error, should be much less. But worth thinking about.
What is redline on that anyway?
|
|
|
|
09-10-2008, 06:33 AM
|
#26 (permalink)
|
|
EcoModding Lurker
Join Date: Aug 2008
Location: UK
Posts: 44
|
Thanks. The analogread is all I have for pressure, I was going to assume linearity. Non-linearity is not a problem I had anticipated!
I also agree that the cylinder pressure should not significantly affect injection, I'm not going to worry about 10% effects.
My enclosure should arrive today 
I have read that the "pilot injection" is a few us long, I could not separate it from the main injection last time I scoped it. So for my purposes I hope I can treat the injection as a single event. I'm thinking that running a scope whilst driving would be illuminating at this stage.
Redline is about 4500rpm; but I rarely exceed 2200 as peak torque is 184ft-lb at 1750rpm. Nice and relaxed!
Last edited by ecoxantia; 09-10-2008 at 06:49 AM.
|
|
|
|
09-10-2008, 09:21 AM
|
#27 (permalink)
|
|
Master EcoModder
Join Date: Feb 2008
Location: 3rd rock
Posts: 1,308
|
I would check linearity with the system pressure gauge and the analogread just to be sure, simple enough test.
Sounds like at 72 volts and tons of pressure you can just about turn injectordelayUS to 0.
|
|
|
|
09-14-2008, 11:17 AM
|
#28 (permalink)
|
|
EcoModding Lurker
Join Date: Sep 2008
Location: Leeds, UK
Posts: 5
|
Hi ecoxantia
I'm looking at building an MPGuino to put into my 2001 A2 1.4TDi - am I looking at similar challenges in getting things to work as you are with your HDi? Or can I use the standard code with the VSS & injector control signals?
I'm in the UK too - can I ask where you bought your bits from?
Eamonn
|
|
|
|
09-14-2008, 01:13 PM
|
#29 (permalink)
|
|
Master EcoModder
Join Date: Feb 2008
Location: 3rd rock
Posts: 1,308
|
Hi eamon, I would direct you to the TDI guino thread, it looks like a different animal but I'm no expert on diesels. dremd has been preoccupied with hurricanes, but he has a TDI and is looking to figure it out also, as is wyatt and tas and I'm sure more than few others for whom a scangauge won't work.
mpguino TDI feasability
|
|
|
|
09-14-2008, 02:18 PM
|
#30 (permalink)
|
|
EcoModding Lurker
Join Date: Sep 2008
Location: Leeds, UK
Posts: 5
|
Thanks dcb
Eamonn
|
|
|
|
09-15-2008, 06:44 PM
|
#31 (permalink)
|
|
EcoModding Lurker
Join Date: Aug 2008
Location: UK
Posts: 44
|
Exactly so; I'm not familiar with your TDi I'm afraid!
I got my bits from NKC, a bargain.
|
|
|
|
09-23-2008, 09:19 AM
|
#32 (permalink)
|
|
EcoModding Lurker
Join Date: Aug 2008
Location: UK
Posts: 44
|
The HDiguino is now boxed and looking half decent!
A colleague tells me that flow will scale with square root of pressure.
At the moment I've got a calculation that:
-multiplies press by 1000 - to get bars
-multiplies sqrt (press) by injus - to scale injus
It's almost there; with the max allowed "us per gallon" I get a very small mpg in instant display mode, so another factor of 100 and it might display something useful!
|
|
|
|
09-23-2008, 05:25 PM
|
#33 (permalink)
|
|
EcoModding Lurker
Join Date: Aug 2008
Location: UK
Posts: 44
|

Ran a scope over my connections - I still don't have a -ve injector input!
Interesting to see the "pilot" injection and "main" injection.
dcb - will the software be able to cope with these 2 pulses, and where is the code for measuring injector us please?
|
|
|
|
09-24-2008, 10:02 AM
|
#34 (permalink)
|
|
Master EcoModder
Join Date: Feb 2008
Location: 3rd rock
Posts: 1,308
|
Cool, so at whatever speed/load that was, the preinjection was about 2ms
the guino should detect what is on that graph, but I don't know the full range of signals.
Dont forget to turn "Injector DelayuS" down to compensate for the higher pressure.
|
|
|
|
09-25-2008, 06:06 AM
|
#35 (permalink)
|
|
EcoModding Lurker
Join Date: Aug 2008
Location: UK
Posts: 44
|
That's at idle.
At the moment the displayed pressure signal is erratic. Seems to me like I need to learn more about programming the arduino if it's to work on this engine.
|
|
|
|
09-29-2008, 07:33 AM
|
#36 (permalink)
|
|
EcoModding Lurker
Join Date: Aug 2008
Location: UK
Posts: 44
|
I can't get a "negative" signal for my injector input with respect to battery (and duino) ground.
dcb - is there any way to change the code to accept the waveform above? Or will I have to do it with hardware?
|
|
|
|
09-29-2008, 08:22 AM
|
#37 (permalink)
|
|
Master EcoModder
Join Date: Feb 2008
Location: 3rd rock
Posts: 1,308
|
Sorry, eco, I don't understand your comment, your graph doesn't seem to go negative.
re: code, since you have a scope, I would simply display the injHIus value on the guino while scoping a couple injector pulses and compare the injHIus per half second duty cycle with what you calculate from the scope, and see how far off it is.
You might want to sample some other pulses at the high end of the pressure gauge/rpm scale to see how small that gap might get.
|
|
|
|
09-29-2008, 09:53 AM
|
#38 (permalink)
|
|
EcoModding Lurker
Join Date: Aug 2008
Location: UK
Posts: 44
|
Thanks - good idea about checking the numbers agree.
As the the negative issue -I thought I'd read that I need a negative-going pulse. Well, I scoped both leads to my injector, with respect to battery earth. A black one is shown above, goes from 1 to 3.5V (after the 100k resistor). Is this OK for a mpguino?
So, I scoped the other injector wire - it pulses from 0 to greater than 20V even after the resistor, so is not suitable and looks like the 80V injector feed.
Numbers on my pressure display fluctuate wildly- I need to scope this as well and find out why.
My leads are all screened as I expected noise pickup from the injection system. So far I've thought of noise on the signal that needs to be averaged; noise pickup that I need to filter out, arduino hardware issues that I'm unaware of, and maybe software issues. This is taking a lot longer than I expected!!
Last edited by ecoxantia; 09-29-2008 at 10:22 AM.
|
|
|
|
09-29-2008, 06:37 PM
|
#39 (permalink)
|
|
EcoModding Lurker
Join Date: Aug 2008
Location: UK
Posts: 44
|
Quote:
Originally Posted by dcb
Sorry, eco, I don't understand your comment, your graph doesn't seem to go negative.
re: code, since you have a scope, I would simply display the injHIus value on the guino while scoping a couple injector pulses and compare the injHIus per half second duty cycle with what you calculate from the scope, and see how far off it is.
You might want to sample some other pulses at the high end of the pressure gauge/rpm scale to see how small that gap might get.
|
OK I have got some data to check the injector signal - scoped the injector at a range of rpms and noted the raw data (us). Note that this is all with no load, simply revving the engine at standstill.
This is what I got -
rpm [guino (us)] [scope pulse width (us)]
800 398000 10700
1800 260000 9500
2500 191000 9500
3000 91000 11000
The guino appears to be timing between pulses as it drops with rpm.
Also tried to look at the fuel pressure.

The red line is fuel pressure, which rises from 1.3V at idle to 1.8V at 2800rpm (again no load) so that's around 400bar.
Interesting that blips can be seen in the fuel pressure signal, which I reckon are shock waves from the injector suddenly opening and closing.
On driving today, the pressure signal displayed looks OK and I think it's just the display that's erratic. At idle it's about 6, rising to around 32 at the redline. Often it displays 6 digits like "234567" and flashes back to something more believable.
The MPG is inverted, just as you'd expect from the us figures in my table. Looks like it's reading the us between start of injector pulses, rather than the duration of the pulse? So more accelerator pedal = higher displayed mpg!
On a downhill coast, the mpg increases with speed, so the link with mph works OK.
Mph is very stable.
Last edited by ecoxantia; 09-30-2008 at 06:53 AM.
|
|
|
|
09-30-2008, 11:21 PM
|
#40 (permalink)
|
|
Master EcoModder
Join Date: Feb 2008
Location: 3rd rock
Posts: 1,308
|
Wow  that is a little hard for me to get used to  Your injector times are longest at idle though, so as you predicted the pressure plays a much larger role.
An injector sanity check might be to look at the injpulses per half second and try and fugure out if it is counting the gap at different rpms or not (watch out for the cold start after pulse).
on the pressure sensor, do you think those "blips" at 0,2,~11,~13 on the red line might be a kind of pwm? does their spacing change with pressure and if so, how?
re: 20 volts, where is the zener?!?  I'm not %100 on which wire you want. I don't quite get how one side of the injector can have higher highs and lower lows than the other, but for now it looks like you found a working signal (1-3.5 is sufficient for off and on to the atmega).
The atmega triggers on at ~2.5 volts and off at ~ 2.2 volts, so I'm not sure that the red line is registering. might need to amplify it or something (ugh)
|
|
|
|
|