M20B20 to MegaSquirt build

For all your questions, problems and DIY stories
Post Reply
User avatar
Jeroen
Site Admin
Posts: 29194
Joined: Tue Sep 14, 2004 12:23 pm
My E21(s): '81 323i Baur
Location: The Netherlands
Contact:

Re: M20B20 to MegaSquirt build

Post by Jeroen »

:banana :banana :banana :launch :launch :launch :launch


Regards/groeten, Jeroen
User avatar
BertjeConti
E21 Mad
Posts: 3007
Joined: Mon Nov 04, 2013 9:49 pm
My E21(s): E12 520-6
Location: nederland , Weert

Re: M20B20 to MegaSquirt build

Post by BertjeConti »

Wideband controller tuning

As mentioned earlier, i've installed a wideband Lambda sensor to the Megasquirt.

This device is very acurate and its responce in AFR changes is very very fast. Last weeks i did a lot of fine-tuning, driving and logging and learned a lot about AFR, ECU's and tuning them.
Now the megasquirt is dialed so much better as before, and the car drives really nice.

The VE tables are dialed in properly, so EGO control while driving keeps within minimal corrections. (EGO control tries constantly correcting the amount of fuel to reach the target AFR in the AFR table)

After that i've tried to dial in the Accel Enrichment, which is the equivalent of a acceleration pump on a carburettor, only with much more settings.

At first Accel Enrichment was way to much, which was seen in very rich AFR blips when hitting the throttle a little. There are a lot of parameters for Accel Enrichment, so now the Accel Enrichment only engages when it is needed and with the right amount of extra fuel.

For example, when engaging the throttle pedal slowly, no Accel Enrichment is needed, or in higher RPM areas there isn't any enrichment needed anymore. And when the engine is cold it needs more Accel enrichment as when warmed up.
Al those things aren't possible with a mechanical acceleration pump on a carburettor.

At last i've dialed in Decelleration Fuel Amount, which is the opposite of Accel Enrichment.
When releasing the throttle you'll see rich AFR blips, and with this feature dialed in properly they are also gone.

I think a wideband Lambda sensor is the best investment ever :crazy !!
Image
Megasquirted '77 E12 520-6

Aspen Silver '96 E39 523i
User avatar
uwbuurman
E21 VIP
E21 VIP
Posts: 18637
Joined: Fri Jun 12, 2009 4:49 pm
My E21(s): 1978 type 1 323i 5speed dogleg Polaris
Location: Ljouwert

Re: M20B20 to MegaSquirt build

Post by uwbuurman »

Well, very nice to be able to tweak and tune the e12 to the optimum!!
It's the man next door!

1978 BMW 323i
1980 BMW 528i maior restitutio
1987 BMW 325iA cabriolet
2006 BMW 320d touring High Executive
2015 BMW 320dA touring xDrive High Executive ///Msport
User avatar
BertjeConti
E21 Mad
Posts: 3007
Joined: Mon Nov 04, 2013 9:49 pm
My E21(s): E12 520-6
Location: nederland , Weert

Re: M20B20 to MegaSquirt build

Post by BertjeConti »

Last tweaking sessions to the Megasquirt system is now 18 months ago, and the system performs very well. The car is used a lot since the last post in this topic. We did a lot of classic car rally's and went to some oldtimer caravan meetings with the BMW towing our 1.2Ton Eriba Titan.
Until today i didn't see any issues in the megasquirt system,but while driving to a gasstation today to fill her up, i noticed a lot of EGO correction, there is always some EGO correction, but it stays within the limits of 90% to 105%, correction below 100% is okay, because it means correcting a rich mixture to the leaner target mixture. Correction above 100% means a poor mixture correcting to a richer mixture, which is bad when EGO correction is not engaged.
Today i saw constant EGO correction towards 85% which is the limit i set into the system, so the preset mixture was very rich. The IAT (Itake Air Temperature) was very low today because of the cold weather, it was around -2 degrees, so most likely the cold weather made the huge EGO correction necessary.
EGO correction is now only active when driving in partial load, at full load and idling the EGO correction is disengaged. Result was a very rich mixture while idling and under full load.

So time to do some tweaking to the Megasquirt system today to correct these minor issues.

There is a table called "MAT air density correction". Air density changes when the air temperature changes and the pressure stays the same. Colder air is more dense and therefore has more oxygene, so it needs more fuel to reach the same AFR.
That's what this table is needed for. Above 15 degrees the table showed a shallow descending line, but below 15 degrees the line was much steeper, therefore the air density correction below 15 degrees was a little too aggressive.
Tweaking the table below 15 degree corrected the overrich mixture at very low intake air temperatures as today.
MAT air density correction is now dialed in as 1% correction per 10 degree celcius air temperature, and seems spot on.

This also means that 10 degree lower air intake temperature gives 1% more power.

Today i also tweaked the parameters for EGO control to engage, now the EGO control is almost always active, from idling to 95kpa MAP, which is almost full throttle. EGO control is allowed when the engine has reached 20 degree celcius coolant temp (was 50 degree).
EGO Control while idling made the idle RPM even a little bit more stable, and gives cleaner exhaust gases.

And i tweaked the "overrun fuel cut" engage parameters, the "overrun fuel cut" cuts the fuel completely when lifting the throttle pedal completely, and therefore saves fuel while decelerating, e.g. engine braking.
Now the "overrun fuel cut" engages faster when the throttle pedal is lifted (from 2 seconds to .5 seconds) and stays engaged until the RPM is dropped to 1500 RPM.

I did some test runs, and all the tweaking made me happy.

Thats all for now, we'll see how she performs the coming season.
Image
Megasquirted '77 E12 520-6

Aspen Silver '96 E39 523i
User avatar
BertjeConti
E21 Mad
Posts: 3007
Joined: Mon Nov 04, 2013 9:49 pm
My E21(s): E12 520-6
Location: nederland , Weert

Re: M20B20 to MegaSquirt build

Post by BertjeConti »

It's now 3 years ago since i posted an update in this topic, so time for some updates:

Is the engine still running?
No it isn't because i replaced the engine for a overhauled one, again a stock M20B20.

Still running megasquirt?
Oh yes, this car runs on Megasquirt more than 6 years now, and is used a lot. No issues.

Did you notice a improvement with the overhauled engine?
yep, this engine is much more a happy revving engine as a M20 should be, and throttle response has improved a lot.
also low rev torque has improved.

Any changes made in the Megasquirt setup?
I converted the megasquirt from speed density to MAF a few weeks ago, i'll explain:

it's all about calculating the required fuel for the engine done by the ECU. For calculating required fuel the ECU needs to "know" how much air in weight is entering the engine.
In "speed density" mode the ECU uses the pressure in the inlet plenum as a main parameter for calculation, herefore the MAP sensor comes in place, but hot air is less dense as cold air, so also the air intake temperature is needed for correcting the calculations, therefore we have a MAT sensor.
Air entering the engine is heating up by the hot intake manifold and engine, making corrections for this given the coolant temperature is also needed, a CLT sensor is needed also.
Also the barometric pressure has a effect on the amount of air entering the engine, so also a barometric sensor is needed (which i didn't use in my setup)
And now the biggest hurdle, "Volumic Efficency" of the engine, meaning how efficient the engine is by a givven inlet plenum pressure and RPM, oh yes, the efficency is different at different RPM's and pressures, so also the RPM of the engine is needed for calculating needed fuel.
Therefore a 3D lookup table needs to be tuned, in this table the ECU "reads" the eficiency by a given inlet pressure (MAP) and RPM.
Al in all there are a lot of parameters needed for the ECU calculating the required fuel.

What i've learned in practice is that this 3D VE Table needs to be tuned again when something in the engine changes, like another exhaust, or even worse, when you change the valve clearence a little. I've noticed big differences in engine Volumic Efficency by altering the valve clearency by only 5/100 mm.

This is what made me decide trying a MAF setup.
In "MAF" mode there is a MAF sensor placed in the inlet ducting, direct behind the air filter box, a MAF sensor measures the air entering the engine in gramms per second (weight), exactly what the ECU needs to know to calculate the required fuel. In MAF mode no other parameters (read sensors) are needed, and there isn't a "3D difficult to tune table" anymore. Only the MAF sensor itself needs to be tuned in the ECU if you don't have the paramaters of the specific MAF you want to use.
The MAF i used is a "HOT FILM" MAF intended for a M52B20 engine, has a 70mm diameter and isn't restrictive for the air flow at all.
I used a spare input on the megasquirt to connect the MAF sensor. This MAF sensor gives a analog signal, just like a MAP sensor or Wideband sensor does.
In megasquirt you need to tune the 2D "MAF FLOW" curve, which gives a specific Air Flow at a specific voltage, i used the "default" flow curve which was already in the megasquirt and "scaled" it to what i thoughd would be right scale after some measurements logging the already installed MAF, and still running speed density.
After changing the ECU from speed density to MAF mode, the MAF curve was almost spot on, only a very little change in the lowest regions was needed.

Very important when running "MAF" mode are:
- Air/vacuum leaks are killing, even the oil dipstick needs to be airtight.
- Injector flow and injector dead time parameters needs to be as accurate as possible. Therefore i did a lot of flow tests with my set of injectors and got the needed parameters.

This is the MAF curve 'm using:
Image

This is the MAF i'm going to use, it needs to be plummed between air filter box and intake boot:
Image

Altered the Air intake ducting:
Image

And MAF installed, Air Intake temp sensor is stil there, but not used by any calculation in the ECU anymore:
Image

Running MAF mode gives a more stable AFR, and a lot less EGO correction, when the engine is warmed up i see EGO correction from 97% - 100% under all circumstances, in speed dendity mode i saw EGO corrections going from 85% to 105%.
I also had to disable the "accelleration enrichment" totaly, because a MAF sensor reacts very fast to changing air flows and no additional enrchment tuning is needed anymore. Another big +

I'm very pleased with this "MAF" setup, works very well on a stock M20B20 :cheers :cheers
Last edited by BertjeConti on Mon Nov 21, 2022 10:12 pm, edited 2 times in total.
Image
Megasquirted '77 E12 520-6

Aspen Silver '96 E39 523i
User avatar
Amur73
E21 starter
Posts: 38
Joined: Tue May 05, 2020 2:03 pm
My E21(s): 78' 320 man

Re: M20B20 to MegaSquirt build

Post by Amur73 »

Apologies for not very valuable post but i went to their website to check it out only to realise that their webmaster sabotaged them:

Image


https://ibb.co/SfHK7j5
User avatar
BertjeConti
E21 Mad
Posts: 3007
Joined: Mon Nov 04, 2013 9:49 pm
My E21(s): E12 520-6
Location: nederland , Weert

Re: M20B20 to MegaSquirt build

Post by BertjeConti »

?
Image
Megasquirted '77 E12 520-6

Aspen Silver '96 E39 523i
User avatar
BertjeConti
E21 Mad
Posts: 3007
Joined: Mon Nov 04, 2013 9:49 pm
My E21(s): E12 520-6
Location: nederland , Weert

Re: M20B20 to MegaSquirt build

Post by BertjeConti »

Visit

https://www.msextra.com/

Thats where all the megasquirt information lives, and a big forum.
Image
Megasquirted '77 E12 520-6

Aspen Silver '96 E39 523i
User avatar
Amur73
E21 starter
Posts: 38
Joined: Tue May 05, 2020 2:03 pm
My E21(s): 78' 320 man

Re: M20B20 to MegaSquirt build

Post by Amur73 »

BertjeConti wrote: Sat Jul 24, 2021 3:12 pm Visit

https://www.msextra.com/

Thats where all the megasquirt information lives, and a big forum.
I see. Thanks
garzon
Newbee
Posts: 6
Joined: Wed Sep 28, 2022 7:44 pm
My E21(s): 79 320/6 EURO

Re: M20B20 to MegaSquirt build

Post by garzon »

I love all this process. I am going to start the same conversion based on your work. I hope it doesn't bother you if I came up with questions.

Thanks a lot for sharing.
User avatar
BertjeConti
E21 Mad
Posts: 3007
Joined: Mon Nov 04, 2013 9:49 pm
My E21(s): E12 520-6
Location: nederland , Weert

Re: M20B20 to MegaSquirt build

Post by BertjeConti »

garzon wrote: Fri Sep 30, 2022 5:31 pm I love all this process. I am going to start the same conversion based on your work. I hope it doesn't bother you if I came up with questions.

Thanks a lot for sharing.
Thanks, no problem at all, i'm pleased if my write-up helps other enthausiasts.

Any questions, post them here, and i'll try to help you with it.

My conversion still runs strong, no issues whatsoever.
Image
Megasquirted '77 E12 520-6

Aspen Silver '96 E39 523i
garzon
Newbee
Posts: 6
Joined: Wed Sep 28, 2022 7:44 pm
My E21(s): 79 320/6 EURO

Re: M20B20 to MegaSquirt build

Post by garzon »

BertjeConti wrote: Fri Sep 30, 2022 6:09 pm
garzon wrote: Fri Sep 30, 2022 5:31 pm I love all this process. I am going to start the same conversion based on your work. I hope it doesn't bother you if I came up with questions.

Thanks a lot for sharing.
Thanks, no problem at all, i'm pleased if my write-up helps other enthausiasts.

Any questions, post them here, and i'll try to help you with it.

My conversion still runs strong, no issues whatsoever.


Wow, thanks a lot for answering me!! I am located at Colombia (south america) and I have been reading this pots for the last 3 months, understanding the process. Actually, last night I purchased the fuel injection from a 323i (I still have to buy the same MAF you used lastly).

Is it possible to get the same PCB you print for your conversion?
User avatar
BertjeConti
E21 Mad
Posts: 3007
Joined: Mon Nov 04, 2013 9:49 pm
My E21(s): E12 520-6
Location: nederland , Weert

Re: M20B20 to MegaSquirt build

Post by BertjeConti »

I've done a lot of modifications on the print i'm using and it does not have a genuine megasquirt processor.

I advise using a genuine megasquirt II or microsquirt.

323i (e21) has a k-jet fuel injection and thats a mechanic injection system, which cannot be converted to megasquirt.
Later E30 323i is l-jet or motronic and is usable for megasquirt conversion.
Image
Megasquirted '77 E12 520-6

Aspen Silver '96 E39 523i
garzon
Newbee
Posts: 6
Joined: Wed Sep 28, 2022 7:44 pm
My E21(s): 79 320/6 EURO

Re: M20B20 to MegaSquirt build

Post by garzon »

I see. I will use any of megasquirt II or microsquirt then.

Could you please advise regarding the MAF sensor from the M52B20 you are using? Could you please share the part number? I found lot of them.


thanks
User avatar
BertjeConti
E21 Mad
Posts: 3007
Joined: Mon Nov 04, 2013 9:49 pm
My E21(s): E12 520-6
Location: nederland , Weert

Re: M20B20 to MegaSquirt build

Post by BertjeConti »

Maf P/N = 13621730033, according bmwfans.info, i checked mine, it's a siemens device, can't find that part number on the maf itself, but i know it comes from a M52B20 engine.

Most difficult was finding the correct connector for the MAF, i've modified a connector that was almost the same. Better using a pigtail taken from a scrapyard wiring loom.
Image
Megasquirted '77 E12 520-6

Aspen Silver '96 E39 523i
Post Reply