MegaSquirt for Diesel?

ECU's, Mapping, New Injection systems, etc

Moderators: Dan J, Diesel Dave, Crazymanneil, Stuart

Post Reply
oilburner
I luv the smell of Diesel...
Posts: 216
Joined: Sun Dec 31, 2006 10:55 am

MegaSquirt for Diesel?

Post by oilburner »

In a recent posting Crazymanneil lamented the fact that there are no open source ECU's for diesel such as the Megasquirt for gasoline engines.

I may be way off base here, but I've been looking at the Megasquirt II for a while now and I think it has enough inputs that with some ingenuity it could be made to work with some serious programming. It seems that most of the ECU inputs for a diesel have a comparable function on gasoline engines. Mind you, when you look at the success stories for MegaSquirt projects, the ones that work still need lots of tuning.. It might be cheaper in the long run to buy an off the shelf ECU - it might take *years* to get a MegaSquirt to work half decent.

If I had a common rail engine sitting around I'd be tempted to give it a try.

FWIW

Avery
oilburner
I luv the smell of Diesel...
Posts: 216
Joined: Sun Dec 31, 2006 10:55 am

Post by oilburner »

A bit of Googling provided the answer: the simple answer is MegaSquirt can't fire injectors sequentially so it won't work. There are a bunch of other things that are showstoppers.

FYI

Avery
User avatar
Crazymanneil
Site Admin
Posts: 566
Joined: Sat Dec 02, 2006 10:10 pm
Location: Bangor, Northern Ireland
Contact:

Post by Crazymanneil »

Actually I did some more research on this. MS can fire injectors sequentially although you need MS V3 and a cam position sensor (presumably on a CDI engine already?). I also read on the MS forum that the main reason it won't work is that CDI injectors may require a different input voltage (80 volts instead of 12v), but surely that could not be *that* big an obstacle? Oh what I'd do for some more time to fiddle!

Having an open source diesel ECU would really open up a lot of possibilities!!! The only things I think it would need to control are -

Injection time
Injection quantity
Fuel rail pressure
Turbo boost pressure

And inputs -

Exhaust gas 02 sensor / exhaust gas temp
Coolant temp
Boost pressure / mass airflow
Crank/cam position sensor

Surely could at least get an engine going roughly to start with? I can't imagine it would take a lot of computing power.

Neil
Smart engined 800cc turbo diesel triumph tiger. 100mpg (imp)
Belfast to Kathmandu overland, 2010/2011 - http://www.suckindiesel.com
Bangkok to Sydney ???
User avatar
Crazymanneil
Site Admin
Posts: 566
Joined: Sat Dec 02, 2006 10:10 pm
Location: Bangor, Northern Ireland
Contact:

Post by Crazymanneil »

actually scratch what I said about MS v3 - I was getting confusted with ignition timing as opposed to injection timing - tho maybe there is a way to use ignition timing to time injectors on a diesel I dunno. It looks as though an opensource ECU for diesel would need to be built from scratch to do things like pre-injection that don't happen on a petrol...

Neil
Smart engined 800cc turbo diesel triumph tiger. 100mpg (imp)
Belfast to Kathmandu overland, 2010/2011 - http://www.suckindiesel.com
Bangkok to Sydney ???
User avatar
Crazymanneil
Site Admin
Posts: 566
Joined: Sat Dec 02, 2006 10:10 pm
Location: Bangor, Northern Ireland
Contact:

Post by Crazymanneil »

I'm gonna have a go at building something for this myself now. I have some experience of electronics and am a software engineer by day so hoping that counts for something. I reckon one big hurdle for me will be working out the map for the finished ecu so I need to learn about factors affecting fuel quantity and injection timing if anyone has any useful links?

neil
Smart engined 800cc turbo diesel triumph tiger. 100mpg (imp)
Belfast to Kathmandu overland, 2010/2011 - http://www.suckindiesel.com
Bangkok to Sydney ???
greg123
Been here a while now..
Posts: 25
Joined: Fri Jun 15, 2007 8:32 am
Location: Nottingham, UK
Contact:

Post by greg123 »

That would be GREAT.

There are 3 systems, controlling an electronic pump such as the VP37 bosch (I think voltage or pulse width modulation of solonoids to move leavers in the pump controling fuel delivery and advance), controlling a common rail (generally control a bank of 4 solonoid injectors with time and also a fuel rail pressure, presumably pwm) and finally the PD unit injectors which are pretty much solonoid controlled.

Why don't you start with megasquirt v3.0 and see if you can develop it out? Not to put a damper but I started following megasquirt must be 10 years ago, and it's taken till now to get something that isn't a complete nightmare to try and work, it still isn't 'plug and play'. So a from scratch project built by one person may take a long time?

Mapping the engines is fairly easy, I have some ideas for that if you contact me, the hard part is being able to write or get the ecu to write a map that's graphically easy to understand.

The other option is to take a sophisticated unit like the VW one that exists already and reverse engineer the code, like the chip tuners do, then write your own code/modify it. As the unit is very robust and sophisticated already with all needed sensors and outputs, but a 'fixed' program.

Greg.
Greg
Freelance Mechanic specialising in vegoil conversions and VW TDi engines
User avatar
Crazymanneil
Site Admin
Posts: 566
Joined: Sat Dec 02, 2006 10:10 pm
Location: Bangor, Northern Ireland
Contact:

Post by Crazymanneil »

Cheers for the reply Greg. Unfortunately I've come to the conclusion that I am going to have to go with a commercial unit at the moment. The reason being that I don't have enough time to develop my own and I would like to see the bike on the road this year (maybe even in time for the rally??). I'd still like my own unit as I could modify the settings easily that way so might come back to it at some point though.

The problem with starting with the megasquirt unit is that its designed for batch injection which is no use for the diesel scenaro. It may be possible to overcome this by extending the existing platform, but then you run into the second issue that for CDI engines, the injectors are typically driven by a high voltage (80 - 100v) at the start to saturate the solenoid before being switched down to 12v to lift the needle and then finally down to a PWM holding current. (plus I don't have these values for my engine!). This would require completely different drive electronics and possibly software so you might as well start from scratch.

I've got the diesel autodata book now and it has some interesting info on pump drive voltages etc for other engines such as unit injector and rotary pump etc. It does not have info for the Smart CDI specifically unfortunately although it does give an idea.

I'd be interested to hear about any info you have on mapping the engines? Presumably some dyno time? The issue is made more complex on the Smart CDI in that it has multiple injection phases (pre-injection) so you need to know timing and quantity of each of these. I am not sure how well the engine would do without the pre-injection phase if you did away with it.

The other thing to consider in the CDI application is that fuel pressure is variable. The combination of fuel pressure and injection duration is what determines injected quantity (along with a few other factors but I am summarising). This means that you also need to know injector flow rate at various pressures, which again I don't have info for this engine...

I tried a couple of chip tuning companies but they were all unable to help me with the engine I am using. The main issue with the stanard ECU is that it will look to talk to various parts of the car including ABS, traction control, dashboard, immobiliser, etc to make sure they are there and working ok. When this is not the case the ECU goes into limp home mode. Theoretically this should be possible to get around if you can figure out the ECU, but thats all a bit of a black art, clouded in secrecy. I do however have a contact that can modify a VW ecu to get around this. (I decided on the smart CDI engine primarily for weight reasons)

Neil
Smart engined 800cc turbo diesel triumph tiger. 100mpg (imp)
Belfast to Kathmandu overland, 2010/2011 - http://www.suckindiesel.com
Bangkok to Sydney ???
greg123
Been here a while now..
Posts: 25
Joined: Fri Jun 15, 2007 8:32 am
Location: Nottingham, UK
Contact:

Post by greg123 »

Hi Neil,

Yes most of what you say makes sense there. I would say, don't be frightened by things like 'data for how many injections per cycle' and worrying about fuel pressure, the good thing about diesel is that once you have air in the cylinder if you inject diesel very predictable things happen. It's fairly fixed in it's burn rate and timing is fairly obvious by egt and ear, if you have a knock sensor I guess that could catch the advanced side better than ear. I typically run an extra 5 degrees on the tdi engines which to ear gives a nice 'crisp' sound without any 'knocking' and results in noticably easier rev-up and effortless part throttle performance, for emissions reasons mfr's often run engines out of optimum for economy and performance.

You may think multiple injection stages would be rocket science and if you didn't get them right bad things would happen, but actually there isn't much difference between multiple and single injection. you can cushion the burn a bit, play with emissions and go a bit better on economy with a pre-injection before tdc, but for example this guy took a merc and put vw 2-stage injectors in it, but with the merc nozzle (using the wrong injector nozzles would be an issue) and his now two stage old idi merc ran just fine. Hard to tell the difference by ear but it ran a bit better due to the pilot injection getting things warm before the main charge.

So mixing and swapping can work! some systems don't vary the pressure at all, just the timing, others vary both - no noticable difference is to be had. Remember the single stage injection mechanical pump Perkins Prima 2.0 di engine (known as the Rover Montego/Maestro diesel) was averaging 55mpg back in the 80's. The best cars now are a big heavier and are faster, but driven sensibly still can't better that figure. Though partly that's because the engine is hampered for emissions reasons, which most of these multiple and post injections are for.

Anyhow, if you do every get a system up with all the inputs and outputs it wouldn't be hard to figure how to make it run okay. It's even been done to put injection pumps for a completely different type of vehicle on and engine and they run okay, or near okay - unlike petrol (swapping carbs, hugely varied advance with load etc) the perameters with diesels are not so wide.

BTW do you have a link or two to educate me on the smart diesel engine? So far I have ignored it as a 1.4 idi Citroen AX (a bigger car) will do 71mpg on motorway with a 95mph top speed and the Octavia 1.9tdi estates we run will average 55mpg mixed and do 60-67mpg on a run, from a 1.4 ton 5 door estate with a top speed of 125mph. Given the smart's weight I found the 80-odd mpg a bit dissapointing given it's technical advances over the ax (CDI direct injection, turbo, ecu control etc).

But maybe I'm wrong and if you sort out the issues running the engine maybe it's the way forward. The 1.2tdi vw is too rare and as you say the iron block 1.4 may be a bit big/heavy. In any case unless somethign can be done it's little more economic than the 1.9tdi non-pd as the pd engines are less economic (I suspect due to timing and tuning and emissions optimisation, rather than inherrently worse at atomising and igniting).

Greg.
Crazymanneil wrote:Cheers for the reply Greg. Unfortunately I've come to the conclusion that I am going to have to go with a commercial unit at the moment. The reason being that I don't have enough time to develop my own and I would like to see the bike on the road this year (maybe even in time for the rally??). I'd still like my own unit as I could modify the settings easily that way so might come back to it at some point though.

The problem with starting with the megasquirt unit is that its designed for batch injection which is no use for the diesel scenaro. It may be possible to overcome this by extending the existing platform, but then you run into the second issue that for CDI engines, the injectors are typically driven by a high voltage (80 - 100v) at the start to saturate the solenoid before being switched down to 12v to lift the needle and then finally down to a PWM holding current. (plus I don't have these values for my engine!). This would require completely different drive electronics and possibly software so you might as well start from scratch.

I've got the diesel autodata book now and it has some interesting info on pump drive voltages etc for other engines such as unit injector and rotary pump etc. It does not have info for the Smart CDI specifically unfortunately although it does give an idea.

I'd be interested to hear about any info you have on mapping the engines? Presumably some dyno time? The issue is made more complex on the Smart CDI in that it has multiple injection phases (pre-injection) so you need to know timing and quantity of each of these. I am not sure how well the engine would do without the pre-injection phase if you did away with it.

The other thing to consider in the CDI application is that fuel pressure is variable. The combination of fuel pressure and injection duration is what determines injected quantity (along with a few other factors but I am summarising). This means that you also need to know injector flow rate at various pressures, which again I don't have info for this engine...

I tried a couple of chip tuning companies but they were all unable to help me with the engine I am using. The main issue with the stanard ECU is that it will look to talk to various parts of the car including ABS, traction control, dashboard, immobiliser, etc to make sure they are there and working ok. When this is not the case the ECU goes into limp home mode. Theoretically this should be possible to get around if you can figure out the ECU, but thats all a bit of a black art, clouded in secrecy. I do however have a contact that can modify a VW ecu to get around this. (I decided on the smart CDI engine primarily for weight reasons)

Neil
Greg
Freelance Mechanic specialising in vegoil conversions and VW TDi engines
User avatar
Crazymanneil
Site Admin
Posts: 566
Joined: Sat Dec 02, 2006 10:10 pm
Location: Bangor, Northern Ireland
Contact:

Post by Crazymanneil »

Greg,

Thanks for the info. Its reassuring to hear that you can make such big modifications to the fueling and the engine still runs ok. It would be nice to develop something although like I say, at this point I don't have the time I would need. Apart from the diesel bike project I've a fair bit of other things on my plate at the moment and the commercial unit makes sense for now although I'd still like to revisit a DIY one at a later point. My interest is primarily in getting this thing going this year at the moment.

I once tried to fit the fuel pump from a VW 1.9 AFN (110hp) engine to a car with a 1Z (90 bhp) ECU without much success. Perhaps with a bit more research it could have worked, i suspect differences in feedback voltages were the issue in the end. I'd say if I had the electrical info for the Smart engine I'd be well on the way to be able to develop an ECU.

Not sure where you got the info for the smart CDI, but bear in mind that a US gallon is smaller than an imperial one. I recall from looking at info on the net before that the smart CDI gets economy close to that of the VW polo 3L (the 1.2 engine). Some links -

http://100mpg.ca/?p=131

http://tinyurl.com/322a2s

http://www.ecofly.de/

http://autospeed.com/cms/A_108104/article.html (part 1)
http://autospeed.com/cms/A_108105/article.html (part 2)

http://www.fram.nl/workshop/engine/smartengine.htm

http://www.dmv-bootsdiesel.de/Englisher ... index.html (look under the OM660 link).

Weights quoted in some of these links range from 100kg (with full marinisation) to 50kg or so (presumably with alternator etc). All I know at the moment is that I can (just about) lift the thing myself which is something I can't do with any other car engine I've ever come across. It really is quite remarkable as a diesel engine. Another nice thing is that the camshaft is chain driven and all enclosed in the engine much more like a petrol bike engine. Time will tell...

Neil
Smart engined 800cc turbo diesel triumph tiger. 100mpg (imp)
Belfast to Kathmandu overland, 2010/2011 - http://www.suckindiesel.com
Bangkok to Sydney ???
Darren
I luv the smell of Diesel...
Posts: 103
Joined: Fri Dec 08, 2006 12:06 am

Post by Darren »

Niel,

What are your plans?- modified original ECU or the same ECU as Erik uses?

Best

Darren
Enfield Bullet with Hatz IB30
See my sites for veg oil fuel info
www.vegburner.co.uk
www.wiki.obed.org.uk - Open Biofuel Engine Development wiki
User avatar
Crazymanneil
Site Admin
Posts: 566
Joined: Sat Dec 02, 2006 10:10 pm
Location: Bangor, Northern Ireland
Contact:

Post by Crazymanneil »

Darren,

Can't get anyone to modify the original ECU so am going with a commercial one for now.

If anyone is using a VW tdi engine I have a contact who can get the original ECU modified.

Neil
Smart engined 800cc turbo diesel triumph tiger. 100mpg (imp)
Belfast to Kathmandu overland, 2010/2011 - http://www.suckindiesel.com
Bangkok to Sydney ???
greg123
Been here a while now..
Posts: 25
Joined: Fri Jun 15, 2007 8:32 am
Location: Nottingham, UK
Contact:

Post by greg123 »

Great load of info Neil, thanks ;-)

I'll take back what I said, seems to be a good engine maybe the mpg not being 'that' staggering is more to do with relatively poor aerodynamics/weight on the Smart. In a good body or a bike with a good tuning setup to optimise for performance looks like this baby can perform.

Keep up posted!

Greg.
Crazymanneil wrote:Greg,

Thanks for the info. Its reassuring to hear that you can make such big modifications to the fueling and the engine still runs ok. It would be nice to develop something although like I say, at this point I don't have the time I would need. Apart from the diesel bike project I've a fair bit of other things on my plate at the moment and the commercial unit makes sense for now although I'd still like to revisit a DIY one at a later point. My interest is primarily in getting this thing going this year at the moment.

I once tried to fit the fuel pump from a VW 1.9 AFN (110hp) engine to a car with a 1Z (90 bhp) ECU without much success. Perhaps with a bit more research it could have worked, i suspect differences in feedback voltages were the issue in the end. I'd say if I had the electrical info for the Smart engine I'd be well on the way to be able to develop an ECU.

Not sure where you got the info for the smart CDI, but bear in mind that a US gallon is smaller than an imperial one. I recall from looking at info on the net before that the smart CDI gets economy close to that of the VW polo 3L (the 1.2 engine). Some links -

http://100mpg.ca/?p=131

http://tinyurl.com/322a2s

http://www.ecofly.de/

http://autospeed.com/cms/A_108104/article.html (part 1)
http://autospeed.com/cms/A_108105/article.html (part 2)

http://www.fram.nl/workshop/engine/smartengine.htm

http://www.dmv-bootsdiesel.de/Englisher ... index.html (look under the OM660 link).

Weights quoted in some of these links range from 100kg (with full marinisation) to 50kg or so (presumably with alternator etc). All I know at the moment is that I can (just about) lift the thing myself which is something I can't do with any other car engine I've ever come across. It really is quite remarkable as a diesel engine. Another nice thing is that the camshaft is chain driven and all enclosed in the engine much more like a petrol bike engine. Time will tell...

Neil
Greg
Freelance Mechanic specialising in vegoil conversions and VW TDi engines
fran9r
I'm pretty new here..
Posts: 7
Joined: Wed Jan 13, 2010 2:42 pm
Location: nottingham

Re: MegaSquirt for Diesel?

Post by fran9r »

I'm building a megasquirt unit for my turbo petrol application, and although the base unit (V2.2) only batch fires, there is a JB Performance add on board which allows sequential. If you look at it go straight to the extra code features.

However, I think the code writers are stating that diesel control is outside the remit of MS. Shame...
Post Reply