M20B20 to MegaSquirt build

For all your questions, problems and DIY stories
Post Reply
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 »

Hey Steed, graphic displays on a megasquirt is easy done with a android phone or tabled loaded with the msdroid app. The msdroid app is fully configurable and has different style analog meters to show the wanted values.
Msdroid uses bluetooth to connect with the megasquirt.
I've tried it and it looks great.

Disadvantage is that you have to startup the phone or tablet each time you go for a drive and it shows only values out of the megasquirt.

Google msdroid for views


Maybe a graphic oled display for next winter project, who knows


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 (Ignition Timing)

Post by BertjeConti »

Since i'm running the megasquirt setup i didn't proper tune the ignition timing table.
What i actualy did was writing ignition tables with the information gathered from the old distributer setup, so took over the advance curve from the distributor and added by best gues the vacuum advance and retard curves from the haines manuals to it.

The engine seems to run well with these ignition tables, but who knows it could be better.

What i was searching for was a method to simply change the iginition timing a few degrees more or less while driving, best way would be a dial knob with a scale on the dash which gives a signal to the ECU to advance or retard the ignition with the dialed in value. Until now i didn't find a way making such a dial, instead i was testing with switching between two ignition tables, but that didn't give usable results.
Last days i worked out a method that gives me the wanted dial knob, and makes it possible to change the advance setting on the fly.

The Megasquirt has a input for a FlexFuel sensor, such a sensor tells the ECU the amount of Ethanol in the fuel, and with this the ECU adds extra fuel and a little extra ignition advance. For example E85 fuel has a much higher octane value as regular fuel, and it burns slower, so a little more ignition advance is wanted when running E85.

A real FlexFuel sensor gives a square wave signal with a freqency of 50Hz to 150Hz depending on the percentage Ethanol in the fuel. No Ethanol gives a 50Hz signal and 100% Ethanol gives 150Hz signal.

So next step is making a device imitating the signal from a FlexFuel sensor and feed that signal to the Megasquirt. I've made such device and it is now running on a test board and hooked up to my second test megasquirt system. Next step is building it in a neat casing and throw it in the car and hook it up to the megasquirt.

I tune the megasquirt in such a way that it does not change the fuel settings at all when FlexFuel signal changes and it changes ignition in such a way that 50% ethanol doesn't change advance, scaling it up and down to +5% an -5% ignition advance at 100% and 0% Ethanol mixture, et voila here is my so wanted ignition setting dial knob.

When the device is ready and in the car i want to tune the ignition the following ways:
1) Drive on a flat road at a constant speed with the cruise control enganged, and then change the ignition timing and aming for lowest throttle position and fuel consumption. Both throttle position and fuel consumption are readouds on my display.
Repeating this with different speeds and RPM's.

2) doing full throttle pulls in 2nd gear from 2000 to 6000 RPM and logging the ECU with different ignition advance settings, and later analizing the logging to determine the best setup (fastest pull from 2000rpm to 6000rpm)

I'll keep you informed about the results.
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 (ignition tuning)

Post by BertjeConti »

And the flexfuel sensor imitating device is in the car.

Here the device hooked up to the ECU:
Image

And my wanted knob on the righside of the radio in the console:
Image

Now i've the ability to adjust the ignition advance 5 degrees up or down while driving.
Image
Megasquirted '77 E12 520-6

Aspen Silver '96 E39 523i
steed
Upcoming E21 fanatic
Posts: 66
Joined: Fri Apr 25, 2008 10:57 am
My E21(s): '79 316 manual (4spd)
Location: Southampton

Re: M20B20 to MegaSquirt build

Post by steed »

that's a very cool little dial indeed, tuning timing on the fly!
Are you running with a wideband AFR, as this will help the tuning on load? If not it might be worth borrowing one as I wouldn't want to accidentally run lean with too much timing tweaking
'79 316 (sepiabraun, awesome!)
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 »

steed wrote:that's a very cool little dial indeed, tuning timing on the fly!
Are you running with a wideband AFR, as this will help the tuning on load? If not it might be worth borrowing one as I wouldn't want to accidentally run lean with too much timing tweaking
No, still running the narrow band, wide band is on the wish list.

I've noticed that tweaking the ignition timing 5 degrees more or less doesn't do much, in fact it is not noticeable at all while driving. I think fine tuning ignition timing is only done right on a dyno.
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 »

Replacing connectors

At the moment i'm building a second ECU, most parts i had already on the shelf. I want to have a spare ECU just in case...

The ECU in the car right now is connected with the wiring loom with screw terminals, and thats something which is 'not done' in automotive wiring because screw terminals aren't reliable in a vibrating environment. In the past i've had already problems with the wiring to the speakers using screw terminals which had losened.

Thats why i'm changing the connection to the ECU for automotive correct multi connector blocks with crimped connectors.
Another annoying thing is the wiring in the ECU itself with lots of wires soldered to connector pins which are prone to failure in the future too.
this is the inside of the ECU which is in the car right now:

Image

and how the wiring loom is connected with screw connectors to the ECU right now:

Image

Until now it's all OK, but in the future there is a chance that some screw connectors can cause problems, and my goal is reliability.

So i've designed and made two daugther PCB's which make a reliable connection between the multi connectors and the main PCB, one board feeds all the power connections like coilpack, injectors, relays and idle control valve, this board is connected directly to the main PCB, the second daughter board connects all the sensors and switches and is connected to the main board with headers and a flatcable.

Here are the main ECU board and the 2 daughterboards:
Image

and this is how it looks in the ECU all build together:
Image
Much better i would say

ECU open:
Image

and ECU closed:
Image

When this second ECU is ready and in the car i will change the old ECU to the same connectors. At the moment i'm waiting for the last parts to complete this ECU and then it is ready to go in the car.

I've also designed a testboard to replace the old "breadboard" testboard. This new testboard hookes up to the new connector board and sensor header connector.

Here is the test board hooked up to the ECU:

Image

Image

This test board is mainly used to test functions and settings in the ECU, all sensors and switches are emulated on the board and all outputs are visible trough leds.
Image
Megasquirted '77 E12 520-6

Aspen Silver '96 E39 523i
steed
Upcoming E21 fanatic
Posts: 66
Joined: Fri Apr 25, 2008 10:57 am
My E21(s): '79 316 manual (4spd)
Location: Southampton

Re: M20B20 to MegaSquirt build

Post by steed »

the test board appears impressive! is it your own version of the 'JimStim' that is popular with MegaSquirt users? a noticeable size reduction in your latest ECU configuration ,I suppose the depth of the enclosure is limited by the height of the internal components? (looking at these larger bits on the tilt, FET's?)
'79 316 (sepiabraun, awesome!)
User avatar
Jeroen
Site Admin
Posts: 29199
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 »

+1, amazing work again!
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 »

steed wrote:the test board appears impressive! is it your own version of the 'JimStim' that is popular with MegaSquirt users? a noticeable size reduction in your latest ECU configuration ,I suppose the depth of the enclosure is limited by the height of the internal components? (looking at these larger bits on the tilt, FET's?)
Yes, it is my own version of the 'JimStim' design, ditched unused parts and made the pcb the way i liked it.
There is enough height space left in the enclose, choice of this enclosure was very simple, they were binned at work.
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 on Dyno

Post by BertjeConti »

Last weekend at the famous Sharknose meeting i had to dyno this car, couldn't get around it because many forummers where there and kind of pushed me onto the rollers.

Image

So what would be the verdict?
I've told here the drivability of the car had improved a lot with this Megasquirt conversion, gaining extra power never wasn't my goal. better fuel consumption was.
keep in mind that the engine:
- is 39 years old, has done 200k km without a overhaul
- has had two cracked heads in his life(as far as i know), and thereby ran at least 1000km (proably much more) with oil mixed with coolant
- has a worn camshaft due lack of lubrication, 2 lobes are shaved at least 1mm if not more
- has the 200 casting head which does not match the ports from the intake manifold, should be a 731 cast.
- noname euro95 fuel in gastank.
- stock specs 122bhp@6000rpm, 160nm@4000rpm

So that are a lot of excuses for me to expect no more power as a moderate 100bhp.

it came out a lot better (or the dyno is a little optimistic)
They did 3 runs, whereby the last run is done with fuel and ignition tables switched, a little more advance and fuel.

The guys from the dyno expected that the engine was already running a little to rich at full throttle, that explaines why the third run is in fact the worst

Image

There is also a big dip around 2500rpm, cause unknown.
I forgot to connect my laptop and log the runs :cry: while my laptop was lying in the boot.

But all in all a good result, which i'm happy with

here is also a youtube from the 3 runs, first run starts at 0:38:



Greetz Rob
Image
Megasquirted '77 E12 520-6

Aspen Silver '96 E39 523i
steed
Upcoming E21 fanatic
Posts: 66
Joined: Fri Apr 25, 2008 10:57 am
My E21(s): '79 316 manual (4spd)
Location: Southampton

Re: M20B20 to MegaSquirt build

Post by steed »

that's an amazing and quite consistent result. especially considering its tuned for economy over anything else!
'79 316 (sepiabraun, awesome!)
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, replacing connectors part 2

Post by BertjeConti »

Replacing connectors part 2

A few months ago i wrote about altering the ECU from screw terminal connectors to crimp terminal connectors, because screw terminals aren't reliable in a vibrating environment,

So the second ECU was ready and laying around for a while. today i loaded a copy of the tune from the ECU in the car to this second ECU and started changing the connectors.
The whole process was documented in detail, so tiny room for error.
I cut al the wires from the screw terminals, crimped new suitable terminals for the box connectors to the wires and put the wires in the new connectors. There is no room for error because it's a real pain in the ... when you'll have to pull a wire which was accidentaly put in the wrong position.
A little nerve wrecking job it was, but it ended without any error.

The car started and ran with the new ECU like always, the whole system was fully functional without any error.

ofcourse some pictures from the work done:

Old ECU wired up with screw terminal connectors before the change, wiring looks a little messy:

Image

Image

Image

Second ECU with 2 box connectors, much cleaner looks:

Image

some wires already in the new connector box, other wires with connectors crimped:

Image

first connector box finished:

Image

a little more progress. documentation in background:

Image

both connector boxes finished:

Image

ECU hooked up and ready for a test run:

Image

Test run was OK, so wrapped the wiring together in 2 looms, looks much better.

Image

Swapping a ECU is now a piece of cake, so in the future when making long trips i'll take the spare ECU with us.

another job done.

Next is changing the IAT sensor for a fast one, The Intake Air Temperature sensor which is now in reacts a little bit to slow when the engine is hot, in some occasions this can cause lean running at full throttle, which we certainly don't want to happen.
i've already ordered a fast IAT sensor on ebay.
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 »

Nice, dont want to stall because of faulty wires
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
Jeroen
Site Admin
Posts: 29199
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 »

Nice clean up operation too!
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 »

compression test

The original ECU is now modiefied to the new connectors style and back in the car.
So now i have 2 identical ECU's, always a good feeling to have a spare:

Image

Image

Today i've done a compression test on the M20B20 engine. After the dyno results done at the Sharnose Meeting i needed to know if my engine is realy that healthy or the duno results were a little optimistic.

I purchased a fairly cheap compression test kit from Ebay, yesterday i tried it out. first ran the engine to operating temperature and pulled the spark plugs.
Did measuments on all cylinders and this came with surprisingly low and differend values, varying from 95 to 120 PSI, a second run over all cylinder didn't confirm the first readings, so is the pressure gauge faulty?

results yesterday:
Image

So i hooked the Compression tester to a pump with a reliable gauge. pumping the pressure up to 6 bar both gauges gave the same reading, but above 8 bar the rubber o-ring seals in the compression tester started leaking.
Mounted some smaller and stiffer o-rings did the trick, now the compression tester held pressure till 12bar and gave similar readings.

With the compression tester fixed i performed new compression meassure today, and now the readings in 2 runs were consistant and a little higher as yesterdays readings.
After the dry test run i did a wet test, and as suspected the wet readout where significant higher.

Here are my results, left column are dry readings (done twice, noted once, because both readouts where the same), right column are the wet test, also done twice and noted twice:

Image

If you retry a wet tests on the same cylinder each next test gives a lower pressure, because the oil will be pressed past the piston rings. thats why we see different readouts at the wet test.

dry compression test varies from 125Psi to 135Psi for all cylinders, so the wear is fairly even.
wet compression test is much higher in all cylinders, which means all piston rings are worn out.

In my opinion my engine is worn out a little and the dyno run results where a little to optimistic.

The pulled spark plugs looked all okay to me:

Image

Readouts dry test:

cylinder 1:
Image

cylinder 2:
Image

cylinder 3:
Image

cylinder 4:
Image

cylinder 5:
Image

cylinder 6:
Image

I think my spare engine needs an overhaul.
Image
Megasquirted '77 E12 520-6

Aspen Silver '96 E39 523i
Post Reply