E28 Megasquirt FAQ

Discussion pertaining to positive pressure E28s.
Post Reply
Brad D.
Beamter
Beamter
Posts: 10735
Joined: Feb 12, 2006 1:00 PM
Location: San Antonio, TX
Contact:

E28 Megasquirt FAQ

Post by Brad D. »

E28 Megasquirt FAQ
By Bradley Denton
Revised 01/06/10


Since there is a lot of interest in Megasquirt as well as a lot of people on this board either using MS or planning to, I felt that I would try to help add to the knowledge base. I don't know if the FI forum is the best place for this, but felt that since most of the MS users are FI guys as well, it was fitting. I am hoping this can be stickied as well, in whatever forum the Beamters deem appropriate. I hope as much of this information is as correct as possible, but I am human and occasionally make mistakes. If anyone has any questions, comments or corrections, please feel free to contact me. Enjoy!

What is Megasquirt?
Megasquirt (MS) is a DIY programmable standalone electronic fuel injection (EFI) computer. It performs many of the same functions as the factory Motronic unit in the e28 but allows the end user to adjust different parameters (fuel, timing, idle speed, etc) affecting how the engine runs. Since it is DIY, it is much less expensive than many other standalone ecus or even some piggyback computers. Megasquirt can be used to control fuel only or both fuel and spark. It is my opinion that for an e28 application you want to control both fuel and spark. It is also an excellent learning tool to understand how EFI works while making your car run better. You can read more about Megasquirt here. The user forums can be found here.

Why would I want to run Megasquirt on my e28?
The stock Bosch Motronic system in your e28 works well for a car in stock form. If many modifications are made to the car such as a large cam, high compression and headwork, or by adding forced induction (turbo or supercharger), or even a stock engine and you want to optimize things yourself instead of just installing a chip, fuel and timing maps will need to be modified for optimum performance. The stock Motronic can only be adjusted by altering the programming on the “chip” in the ecu. This is not the easiest way to tune your engine. You are also still left with the outdated architecture of the original Motronic system whose primary load input is a vane style air flow meter (AFM). By replacing Motronic with a MS unit you can now adjust fuel and timing maps, datalog, adjust your rev limiter, change idle speed, control electric fans, if you can think of it, MS can probably do it. Just plug in your laptop to MS, make your changes, save your tune, and you are good to go!

What do all of the different versions of Megasquirt mean?
Megasquirt has gone through several iterations since its inception. The main thing to keep in mind is that there are versions of both the MS board as well as the MS processor itself. The most current versions of the MS board are the v3.0 and the v3.57. They are both functionally the same, but the v3.57 has surface mount components. This can make it a bit more robust, but it is also more expensive and is harder to modify. There is also an earlier board, v2.2, but it requires some additional work to make it work properly on an e28.
The two different processors available are MS1 and MS2. Both processors have been used with success on the e28 chassis. Some of the differences between the two processors can be found here. I am running MS2 and am very happy with its performance in my car.

Do I buy a prebuilt unit or do I build my own?
The answer is – it depends. If you have basic soldering skills or want to learn, I highly recommend building your own unit. By building it yourself you gain an understanding of how the unit works as well as how to troubleshoot and fix any problems that might arise later. There are several places that prebuilt units can be purchased, even ones that are “Plug n Play” for BMWs.

Where do I buy Megasquirt?
I recommend you buy your kit from www.diyautotune.com. They also sell handy tools and additional sensors you will need to complete your install. Peter Florance is an excelent resource for MS and can sell prebuild, plug and play units. Ely, known on mye28.com as rs4pro3 will custom build you a MS unit inside a Motronic case as well. Ryan Nimick, aka Goathumper on most boards also build an excellent adapter board available through diyautotune and sells built units customized to your specs. If you do not use the adapter board you will need a 3 wire Bosch PWM idle control valve board available through Glen’s Garage.I have no affiliation with these sellers. Please contact them with any specific questions on their products.

What else do I need to buy?
If you don’t already own one, and you intend you build your own unit you will need a good soldering iron. I like the Weller WLC100 as it has adjustable heat, a nice stand and sponge and is reasonable priced. Some small tips will also need to be purchased. I also recommend purchasing a lead bending tool as it makes bending all of the small components a bit easier. You will also want to purchase a Stimulator. What is a Stimulator you ask?! It is a device that lets you s(t)imulate the various inputs and outputs of the MS unit during the building process to confirm it is working properly, or for troubleshooting later. It is also useful for flashing code onto your unit without it being attached to your car. You really need to buy a JimStim as it is the only unit that will properly simulate the VR sensor input that your BMW uses. You will also need to buy a GM open element intake air temp sensor. Since MS requires a variable throttle position sensor, one will need to be purchased. For m30 engines, the easiest solution is to use the 6 pin TPS from an automatic e32/e34. Make sure you also source the plug with some wire to solder to. M20 users will need to use an adapter to use the m50 TPS. Or, as I recently discovered, the m30 6 pin TPS can also be used on the M20 TB. It would be possible to do this with the 35 pin Motoronic case, but I haven't done this directly. My recommendation though is that for m30b34 engines, that you purchase the 60-2 tooth trigger wheel (mounted to the harmonic balancer) from an m30b35 and its associated VR sensor as this is the preferred input. For the m20b27 (non super-eta engine), you will need a 60-2 tooth trigger wheel from an '88 528e super-eta, a late 325i or super-eta 325e. .

I received my Megasquirt kit, where do I start?
Download the entire Megamanual and spend some time digesting the information. Some of it will seem confusing at first but read through the info to the best of your abilities. Your next step is to print the instructions for the board assembly. These are found here. Familiarize yourself with the instructions and lay your parts out neatly on your workspace. As you read through the assembly guide you will notice that there are some options when assembling the board. Some of these options depend on which processor you are using. Follow the instructions to the letter and your build will go smoothly.

What options do I install and modifications do I need to make?
You will want to make sure that you build the VR sensor circuit. I also recommend you build the hall sensor circuit even though it is not used, which could potentially be used in the future for a cam sync pulse. Step 52 will tell you which tach circuit jumpers need to be connected. Make sure that if you are using either the Glen’s Garage PWM idle board or Goathumper’s adapter board, do NOT follow the instructions for PWM idle valve users in the Megamanual. This assumes you are NOT using an additional PWM board. You will want to build it exactly as the base instructions say. The Fidle output will be sent to the idle/adapter board which does all of the work. This is noted in my pinout.
There are also a few steps needed to setup ignition correctly. Your MS unit should be using the high current ignition driver (either the older vb921 or new BIP373). There are a few ways to do this but since I am using MS2 I used these instructions found here. I am using a 330Ω resistor instead of the 680Ω listed. Setup will be slightly different if you plan on running wasted spark. I realize it is a bit more complex than this so please email me if you have any specific questions.

How do I wire Megasquirt into my car?
The easiest method is to either buy a preassembled Plug n Play unit or buy the adapter board from Diyautotune. If you wish to go it alone as I did, I gutted an old 55 pin Motronic box and utilized the plug and created a jumper harness that connects the Motronic ECU to the MS unit. I enclosed the Glens Garage idle board inside the Motronic case. I have modified Matt Kosonen’s (Matt325is on e30tech.com) wiring diagram to be more specific to an e28 which show basic connections to get the car running. If you want to add options such as fan control or boost control, I recommend you do this later when you are a bit more experienced and familiar with MS. I did not include them as there are different ways to achieve similar results and the outputs can change depending on application. The diagram can be seen below. I have also included a pinout in Excel for connecting the 55 pin Motronic connector to the DB37 MS connector.

Image

Image

I realize that e28s have a 35 pin connector. Since I had a b35 swap it made things much easier as the engine already has the correct trigger wheel and VR sensor. I have included a 35 pin diagram variant that should help for those not running a b35 or not wanting to change from the stock wiring harnesses. Make it known again that you will want to use the b35 trigger wheel and VR sensor. This will get wired in using the original wiring leads from one of the original reference sensors. I used the reference point input, but you could use the engine speed input instead.

The wiring diagram is forthcoming.

I have everything installed and am ready to start the car, what do I do?
You must first setup the Megasquirt unit using Megatune. What is Megatune you ask? It is the interface software that allows you to make inputs to your MS unit, view
gauges and datalog. Another option is to use TunerStudio, which is, in my opinion, far superior to MegaTune allowing a cleaner and better looking interface and additional tools and features that makes tuning easier. Since there are many factors that determine your individual settings, such as MS processor (1 or 2), and what firmware you are running, my settings should be used only as a guide to set up your car. I am including screenshots of my menus for those that are visual learners. I am running 2.1.0 Release Code so if you are running another code variant, I recommend you enter my settings manually. I will provide exported VE, timing and AFR tables so they can be loaded into your current version of code. You will also need to setup your ReqFuel value. This basically scales your VE table to your injector size. You can change this number later if you change injector size and only have to make minor corrections to your VE table. I recommend you use the ReqFuel calculator and use the vale it provides. You will also need to to setup your ignition and trigger wheel settings. Shown below are the trigger settings and ignition options used in my setup. These are for the 60-2 trigger wheel. . MAKE SURE YOU SET THIS TO 0 IF YOU ARE RUNNING RELEASE CODE.

Image


How do I get my car to idle?
Getting the car to idle is one of the most critical things you need to do. The car must idle before you go out on the road and try to tune. I highly recommend that you use some form of electronic idle control that uses the stock idle valve and not mechanically crack the throttle plate. You can use either PWM warmup only or closed loop idle. I like closed loop idle as it acts like stock and idle will always be on target, even if the AC compressor cycles or if there is load placed on the car. Below are my PWM idle settings which can be used as a baseline. You will likely need to tweak your settings to get your idle perfect. It is possible to achieve an idle that is as good or better than stock.
You will first need to set the cranking enrichment so that you get the car to “hit” while it’s cranking enough to lift speed above cranking rpm (~300). It should catch and then die if the actual VE table isn’t tuned right. This is ok, we will work on that next. I will usually switch over to the VE table tuning page under the “Tuning” drop down menu. At your idle break point you will want to watch the green dot as the car catches and begin to increase fueling in that region until it begins to stay running. You will want to smooth out adjacent cells to a similar value. Your goal is to get an idle that produces the strongest vacuum possible (lower kPa). Tuning the PWM idle is a bit tricky. I recommend you start with some known settings and work with the PID settings to tune out any hunting that may occur. Ryan Nimick (Goathumper) has a great writeup of the PID settings on the MS unit here.
Screenshots of my PWM idle menu's can be seen below.
Image

The car idles, now how do I tune it so I can drive it around?
This step requires an assistant to drive the car for you while you tune. Make sure that all acceleration enrichment and O2 feedback is off (set authority to 0%)is turned off as you don’t want it to skew your tune. You will want your assistant to drive the car in a smooth manner slowly watching your wideband. At this point at low vacuum while cruising you should be fine tuning to stoichiometric (14.7:1 for gasoline). When you reach a specific load and rpm breakpoint, have your driver hold there while you tweak the VE table to bring the AFR up or down. If the car feels like it is hitting a wall and won’t accelerate, try dragging the fuel up until the car accelerates past this point. Continue to do this if the wall has moved up the rev range. Since engines are very linear devices, a tuned VE table will be very smooth. Once you have a few manifold pressures fleshed out, you can drag the higher pressure points up above the lower points so that the map has an upward slope. This will get the car drivable enough to use MegalogViewer to hone your tune.
The key here is to make sure you datalog your entire drive. You will want to download MegalogViewer which is an invaluable tool when tuning your car. When you have a few minutes of logging, you will open MLV and open your datalog. Also open your current .msq file. My recommendation is the while you are tuning you will create a slightly different AFR target table than when you began to tune for fuel economy and closed loop O2 feedback. You can see a sample of the AFR table I used while tuning my car below.
Image
Image

By using the VE analyzer tool in MLV, it will adjust your VE table to try to match these AFR targets based on your datalog and your .msq file. With a few hours of driving around varying load and rpm, you should be able to flesh out most of the vacuum region of your VE table. Later, you can activate O2 feedback (by changing the authority from 0% to 3-5%) and begin to tune for fuel economy. Below you can see a sample of my current closed loop AFR map(coming soon Remember, there should be no major peaks or valleys in the map. It should be very smooth and sloping. If it isn’t, it’s likely there is something wrong.

How do I tune under boost?
Tuning under boost is not terribly difficult but requires a trained ear to listen for detonation and if done on the street, a large stretch of open road. I tune with my windows up as wind noise can mask detonation. Make sure you are logging during this time as you can use this data later. Have the driver slowly increase throttle until boost begins to build. Closely watch you AFR display and keep an ear peeled for the sound of gravel being tossed against the firewall (one of the many descriptions of detonation). If the mixture looks lean as boost comes in, richen up the associated cells in the VE table. When this looks good, proceed to come on boost. If at any time it leans out or you hear detonation, lift immediately. Continue tweaking the required VE cell while watching the green ball. If everything looks good, continue throughout the rpm range checking that your AFRs are where they need to be. I tune my car to 12:1 at 8psi on 93 octane. Some like to be a little richer, say 11.5-11.8:1 and this is fine, especially if you are running lower octane fuel. After a run I like to open MLV and use the VE analyzer tool as above but set the minimum MAP to say, 90kPa, and analyze your VE cells under boost. This will fine tune your AFRs and it works quite well. Go drive the car again while logging and check the changes to the VE table that MLV might have made and if necessary run the VE analyzer tool again, and you should be very close to a good tune.

My current (1/05/10) VE and timing table can be seen here for reference.
Image
Image
Image
Image

Some recommended books on tuning.

Here are a couple of books that focus on tuning methods and technology. They are a good readthrough before or even after building a MS unit.
How to Tune and Modify Engine Management Systems by Jeff Hartman

Engine Management: Advanced Tuning by Greg Banish

Designing and Tuning High Performance Fuel Injection Systems by Greg Banish

Conclusion.
There are many more factors at play here and I intentionally and unintentionally left out certain items and some items that are just too difficult to try to cover in writing. It will also be necessary to tune such things as acceleration enrichment. Everyone tunes this differently and I will leave it up to the end user to do a bit of homework and do what works for their setup. Since everyone tunes differently, you will develop your methods as you go through the process. I recommend keeping a little “tuner’s logbook” and note changes you make and how they affected the car. This can be a valuable reference if you need to go back later and review any changes you might have made. I hope this FAQ helps answer some basic questions and provides those interested in Megasquirt the courage to jump in and start your own project.


-Note - this is not completed yet. There are images and files that I still need to get uploaded but wanted to get the bulk of the info up as it is easier to edit it here than compile it offline. I really hope this helps everyone.
-Brad-
Last edited by Brad D. on Jan 10, 2010 12:43 AM, edited 21 times in total.
George
Posts: 2889
Joined: Sep 12, 2007 11:23 PM
Location: Seattle, WA

Post by George »

Well Done again Brad!

I recommend Peter Florance for any one who hates soldering or wires. He built my MS system. It looks and functions great.
Brad D.
Beamter
Beamter
Posts: 10735
Joined: Feb 12, 2006 1:00 PM
Location: San Antonio, TX
Contact:

Post by Brad D. »

Thanks. I would also like to make this a place where those that have good working setups can post their maps and outline their setups as a resource of maps and .msq files for those starting out.
SamSpade
Posts: 229
Joined: Dec 17, 2008 7:07 PM

Where to put IAT sensor?

Post by SamSpade »

Great write-up!

Where should the IAT sensor be placed on the M30 intake manifold if going NA? I suppose there's drilling involved?
bornagain
Posts: 756
Joined: Apr 19, 2008 2:18 PM
Location: Edmonton AB

Post by bornagain »

thanks brad this is great.
Canuck YYC
Posts: 325
Joined: Oct 06, 2008 10:03 PM
Location: Calgary, Alberta

Post by Canuck YYC »

Nicely done mate.
rs4pro3
Posts: 489
Joined: Feb 12, 2006 1:00 PM
Location: Chattanooga, TN

Post by rs4pro3 »

Nice job man! :banana:
Kyle in NO
Posts: 17635
Joined: Feb 12, 2006 1:00 PM
Location: Nasty Orleans------> Batten-Rooehjch------>More Souther LA

Post by Kyle in NO »

Awesome!!!
George
Posts: 2889
Joined: Sep 12, 2007 11:23 PM
Location: Seattle, WA

Re: Where to put IAT sensor?

Post by George »

SamSpade wrote:Great write-up!

Where should the IAT sensor be placed on the M30 intake manifold if going NA? I suppose there's drilling involved?
I originally had mine at the bottom of the manifold. Its a 3/8npt so you have to drill and tap. I moved mine up to the charge pipe (right before the ICV) because I was encountering problems with heat soak after stopping and then starting in a short time.
Image
Image
Brad D.
Beamter
Beamter
Posts: 10735
Joined: Feb 12, 2006 1:00 PM
Location: San Antonio, TX
Contact:

Post by Brad D. »

Mine is in my charge pipe as well right before the TB. Make sure that you put the IAT sensor before the IACV pull off (as seen in George's pic above) as you always want your airflow to flow past the sensor, even from the IACV. I initially made the mistake of locating mine upstream and if the car would sit and heat soak, the idle would hunt upon restarting as the senor had no cool air flowing past it as all of the IACV bypass air was flowing downstream of the sensor. It would clear up as soon as you opened the throttle though and flowed air past it. Moved the sensor and all was well.
SamSpade
Posts: 229
Joined: Dec 17, 2008 7:07 PM

Post by SamSpade »

Thanks, great tips!

What do you think about VEMS compared to MS2? I'm deciding which standalone to choose. I'm restoring an E23 and swapping an M30B35 in there, and maybe eventually get a TCD Stage 2.
CSBolger
Posts: 3485
Joined: Nov 27, 2007 1:00 AM
Location: Palmdale, CA

Post by CSBolger »

Incredible writeup.
I may go MS just because of you.
e30-m30_kid89
Posts: 433
Joined: Oct 20, 2008 1:17 PM
Location: Toronto, ON

Post by e30-m30_kid89 »

Great write up! I FINALLY figured out the problem with mine (turned out to be a wiring error) so im going to re-install the components I removed so i should be good.

Im using the Diyautotune pigtail and once i get my car running i'll post a chart showing the connections to motronic wires if you decide to directly connect your harness to MS.

Question though for you guys already megasquirted...Did you re-wire the injectors to:Bank1=123 Bank2=456? Some M20 guys say the idle is better and have gotten more smooth operation when its like this and the injections staging is set to simultaneous. Stock is Bank1=135 Bank2=246
Brad D.
Beamter
Beamter
Posts: 10735
Joined: Feb 12, 2006 1:00 PM
Location: San Antonio, TX
Contact:

Post by Brad D. »

e30-m30_kid89 wrote:
Question though for you guys already megasquirted...Did you re-wire the injectors to:Bank1=123 Bank2=456?
Yes, mine are rewired like that and I point that out above in the wiring pinout for the 55 pin connector that the banks should be changed. This only applies to Motronic 1.3 though.
Im using the Diyautotune pigtail and once i get my car running i'll post a chart showing the connections to motronic wires if you decide to directly connect your harness to MS.
If you look above I have already done that for you. ;)
Brad D.
Beamter
Beamter
Posts: 10735
Joined: Feb 12, 2006 1:00 PM
Location: San Antonio, TX
Contact:

Post by Brad D. »

I just added trigger settings and some other ignition options such as coil dwell and spark duration settings that work well and should not smoke older VB921 coil drivers.
e30-m30_kid89
Posts: 433
Joined: Oct 20, 2008 1:17 PM
Location: Toronto, ON

Post by e30-m30_kid89 »

Ha. Yeah you already included the rewiring and pinout info. I didn't read it all.

I acutally copied your trigger settings from when you posted em up on E30tech. :D

I think i have something useful to say, I think everybody should be using the MS-Extra code since it allows you to run COP or wasted spark:P
Brad D.
Beamter
Beamter
Posts: 10735
Joined: Feb 12, 2006 1:00 PM
Location: San Antonio, TX
Contact:

Post by Brad D. »

Tonight I will try to upload my .msq file and my .vex table files (useful if using a different version of MS as they can be imported or opened in Excel) to a file sharing site so that they can be downloaded by whoever wants to view them.
Brad D.
Beamter
Beamter
Posts: 10735
Joined: Feb 12, 2006 1:00 PM
Location: San Antonio, TX
Contact:

Post by Brad D. »

e30-m30_kid89 wrote:it allows you to run COP
Theoretically you can only run full sequential coil on plug if you have a second cam trigger sync input. I suppose you could waste fire COPs if you wanted to though.
SamSpade
Posts: 229
Joined: Dec 17, 2008 7:07 PM

Post by SamSpade »

Any comments about MS2 vs VEMS, especially from those who have tried both?
babisbabou
Posts: 365
Joined: Jul 15, 2006 6:43 AM
Location: Greece.athens

Post by babisbabou »

Well done 1 more time BBR!!!

Wish could install MSsquirt on my car with few wire cuts :roll:
shaunmlavery
Posts: 391
Joined: Apr 28, 2008 9:17 AM
Location: Cincinnati

Post by shaunmlavery »

Very nice. Thanks for taking the time to do this for all of us that lacks the knowledge. :up:
alijonny
Posts: 5612
Joined: Apr 09, 2008 5:05 PM
Location: Chicago, IL

Post by alijonny »

this should get the sticky treatment!!
e30-m30_kid89
Posts: 433
Joined: Oct 20, 2008 1:17 PM
Location: Toronto, ON

Post by e30-m30_kid89 »

Hey can i post my Fuel and ignition tables and you guys take a look? i just want to know if its stable enough for the car to idle on and won't blow it up..

also regarding startup i have my cranking advance set to 10deg. is that too much? i see you have yours set at 6.
George
Posts: 2889
Joined: Sep 12, 2007 11:23 PM
Location: Seattle, WA

Post by George »

e30-m30_kid89 wrote: also regarding startup i have my cranking advance set to 10deg. is that too much? i see you have yours set at 6.
I'm running 10 as well. Starts right up every time.
turbodan
Posts: 8715
Joined: Jan 09, 2007 11:19 PM

Post by turbodan »

10 degrees cranking is fine.
Post Reply