Posted: Wed Dec 31, 2008 7:37 pm Post subject: Megasquirt plug and play installation
This topic will detail installing a Megasquirt II v3.0 into a 1st gen 5E-FE engine.
For now, here is the wiring diagram for an adapter to be able to plug the megasquirt into the stock wiring harness. With this adapter you will be able to run the megasquirt with absolutely no modifications what-so-ever to any part of the engine or the wiring harness.
Which is really good, because it means that at any time you can simply plug the stock computer back in and it will still work 100%. Should you ever feel the need to do so.
To create the adapter, all you need is the DB37 connector that is supplied with the megasquirt, a spool of 18 or 20gauge wire (or both if you are really anal), and a spare stock computer that you can destroy an use its harness connector.
Alternatively, if you don't care about reverting to stock, you could cut off the stock connector from the harness, and attach the DB37 connector in its place. That way you don't need to destroy any stock ecu. But that's not for everybody...
For those not familiar with the Megasquirt, it is a completely standalone DIY engine management system.
It's superior to any piggyback system, because it gives a far greater level of control and adjustability, and it comes at a fraction of the cost of any other standalone system.
It's particularly great for anyone who's doing any kind of turbo application.
The complete kit that I got was only $247US + $45US for the simulator kit so that I could bench test it.
Posted: Wed Dec 31, 2008 8:47 pm Post subject: Board assembly
If you want you can spend a bit extra money and get a pre-assembled board. Or if you're really cheap like me, then get a kit and solder it together yourself.
This is the kit I got. It's a high quality kit, everything comes packaged nicely and is very well organised and labelled. Service was quick and friendly as well.
If you get the simulator kit too, then assemble that one first, it's good practice.
It's pretty easy to assemble, if you've ever used a soldering iron before, then you can assemble this yourself. There is no advanced knowledge nessesary at all.
All you need for the assembly is a soldering iron, and some solder. I used a decent quality 25W iron, and high quality electronics solder. For those in the GTA you can find that stuff here: http://www.sayal.com/. They've got everything you need, including all the optional components for the board you may want.
Almost all the information you need is there. Just follow those steps exactly and you'll be fine.
Here's some of my notes for the optional steps:
Step 22. Skip this step, the 5E does not have an IAC
Step 50. I installed both the Hall Effect, and the VR input circuits. The 5E-FE uses the VR circuit, and you select this using jumpers on the board. I install the Hall Effect circuit, even though it's not being used, just in case I ever want to use it in the future. You can skip Step 50 if you want, it doesn't really matter either way since it won't be used. I installed the Hall Effect circuit Step 50a.
Step 51. This step is required for the 5E-FE.
You should remove your distributor cap, rotor, and plastic cover, and look at the sensor wheels. Mine has two wheels, one of them has 4 teeth, the other has 1 tooth. If yours is the same as that, then you're golden. If it's anything different, then I suggest posting here for advice.
Step 53. Install the VR Sensor jumpers and DO NOT install the Hall Effect jumpers
Step 54. These are the bias resistors, basically they calibrate your water and air temperature sensors. They list a few different resistor values to use, depending on what brand of car you have. But the only resistors they supply are AC Delco brand. Toyota uses Denso. But it doesn't matter, use the supplied 2.49K resistors, and you can calibrate the sensors much easier in the software after it's all assembled.
Step 62. Idle controller. You can probably leave this out, since the MS doesn't seem to do well at controlling the Toyota idle controller. But if you want to try, you will need to buy a TIP120 transistor (www.sayal.com has these for about 50 cents). Follow the steps exactly as listed in the "For PWM Idle Valve Users Only" section of the instructons.
Note that a 3E-E engine uses a fast idle valve (simple on/off switch), which the MS can control very well, and needs no mods to do so. While the 5E-FE uses a PWM valve (variable control).
Also Note: If you choose not to use this, then DO NOT install the FIdle connector in your harness adaptor.
Step 65. Ignition output, this is an important step. Here, some people will use the direct coil control, or convert to some type of EDIS system simply because they can't figure out how to control the stock ignitor. But it's actually quite easy. As long as you've followed the wiring diagram I put in my first post.
You can refer to this page: http://www.megamanual.com/ms2/vast.htm
The 5E-FE does not use a VAST ignition, but there's tons of useful information on that page regardless.
Install the high current igition driver in this step.
Also use the 5v VAST Output Pull-Up. To do this, DO NOT install R57, put a jumper across where R43 should be, and run a wire from the 5V in the proto area, with a 220Ohm resistor to the IGN output (it's all on This page).
Step 69. This one is optional, but I did it anyway. It doesn't hurt anything.
Step 71. This one is also optional, but it's a very good idea to put it in.
Next is to configure the software to work with this engine. I'll stick all those details in the next post.
The last thing to do with hardware is to tune the VR input circuit. But this must be done in the car, so it should wait until after to configure the software.
Information on adjusting the VR signal here: http://www.megamanual.com/ms2/vradjust.htm
To sum up this procedue very simply: Turn both pot's fully counter-clockwise. with a laptop hooked up to the MS and running megatune, crank the engine and watch if you get a tach signal on the computer. You probably will not.
Turn R56 clockwise in half turn or quarter turn increments, and crank the engine after each adjustment. Keep doing this until you get a tach signal. You should see a cranking rpm of ~300rpm
Mine worked perfectly with no adjustments to R52 at all. As long as your wiring is healthy, yours should be the same. But if your tach signal seems 'dirty', ie the rpm in the computer seems to fluctuate, or is very unstable, you may need to adjust R52 to clean this up. But that shouldn't be nessesary.
The interesting thing to note is in the Proto area, you'll see the resistor I installed as part of the ignition 5v pull-up
Next to that, you can also see the TIP120 I used for the idle controller. I cleverly used a heatsink that I removed from the 5E-FE ECU that I took apart for the wiring harness. Make sure that TIP120 is isolated and does not short to ground at all!
You may also notice that I actually did install R43 (even though I said not to). But if you look underneath, you'll see that I shorted it out, so it's the same as if it weren't there at all.
For anyone paying attention, there's 2 extra wires underneath which I have not explained as of yet.
They are both going to the spare outputs on the MS. One of them is wired to the stock 'Check Engine Light', and the other is wired to the stock MAP sensor.
I've got the check engine light connected to one of the IAC outputs, and I've customised the output in the software, to turn that into a shift light. If the rpm is < 300, the light is turned on. So it comes on when you first turn on the key just like stock, and then turns off once you crank the engine. It also comes on at 7000rpm or whenever you want your shift light to come on.
I've wired up the stock MAP sensor, so that I can use it for constant baro correction. But I haven't got this to work just yet.
Posted: Wed Dec 31, 2008 10:32 pm Post subject: Software configuration
I started with the standard MSII code. But I re-flashed the computer with the MS2Extra code, because it has some features I thought I needed, but it turns out I probably didn't.
In any case, that's the code I'm still using.
To start with the MSConfig settings, you want to make sure that:
IDLE_Controller is set to PWM_GAUGE
LAMBDA_Sensor is set to NARROW_BAND_EGO (presuming that you're using the stock O2 sensor)
MAP_SENSOR should be set to whichever one you ordered with your kit
In the MS2Extra MegaTune software, you want to set the User Level to Extended, to access the features we need.
Basic Setup:
Engine Constants:
Control Algorithm: Speed Density
Injections: 2
Injector Staging: Alternating
Engine Stroke: Four-Stroke
Cylinders: 4
Injector Type: Port Injection
Injectors: 4
Engine Type: Even fire
More Engine Constants:
Secondary Fuel Load: Disabled
Multiply MAP: Multiply
Primary Ignition Load: Speed Density
Secondary Ignition Load: Disabled
Injector Characteristics:
Injector Open Time: 1.000
Voltage Corrections: 0.200
PWM Current LImit: 100
PWM Time Threshold: 25.6
Injector PWM Period: 66
Bank 2: disabled
More Ignition Settings:
Fixed Advance: Use Table
Use Prediction: 1st Deriv
Cranking dwell: 6.0
Cranking advance: 10.0
Dwell Type: Fixed Duty
Dwell Duty: 50
Spark Hardware 0
Rotary: Off
Overdwell: Off
Tools:
Calibrate TPS:
with the engine off:
Closed throttle: don't touch the gas and click Get Current
Full throttle: floor the gas and click Get Current, click OK
Once you get the thing started, you can start tuning your fuel and igntion maps.
There's good steps on how to do so, all in the Megamanual.
This is the step I'm currently at. Once I get a good baseline, I'll post them here.
I do have it tuned well enough that it will start the car. And it idles and free-revs just as good as stock. Doesn't drive too well yet though. Still working on that.
One thing I almost forgot, once you get it started, and idling pretty smooth, you'll want to make sure the base timing is set right.
The MSExtra code has a great feature, you can lock the timing, rather than using a table. This is the easiest way to set the base timing. Lock the timing in the MS to 10 degrees.
With the engine idling, use a timing light to check the timing, if it's at 10, then you're done. If not, then rotate the distributor housing until it is. Then tighten it down again.
You'll never need to adjust timing with the distributor again, you can do it all through the computer now.
Okay, a little bit of bad news. I just took some measurements off the factory MAP sensor. I was hoping to be able to use the stock sensor for baro correction and the megasquirt sensor as the MAP sensor. Or vice versa.
But, it turns out the stock sensor is non-linear. So... it can still be done, but it requires a lot more messing around with the software in the MS, and it's just not worth it at this point. Later when I have more time, and have everything else working right. I might come back to this.
Good news is the weather is starting to warm up. Very soon I'll be able to finally start tuning this thing!
Totally ignore my previous post.
I was doing my measurements wrong. Of course the MAP sensor is linear!
I got it figured out now. And it figures too, if I'd just done some searching on the Megasquirt forums, I would've saved myself a lot of trouble.
Here's the formula to calculate the output from the stock MAP sensor:
V=0.029*MAP + 0.63
(MAP is in KPA)
So, the sensors values to enter are -21.7 @ 0V and 150.7 @ 5 V.
However, when I did that, my readings between the stock sensor, and the one built in to the MS were slightly off at atmospheric pressure. I'm sure that's due to age and manufacturing tolerances, etc. So I fudged the 5V value down to 149, and I'm pretty much bang on.
So what does this mean? Constant baro correction! Really great for anyone who's driving for a long time and there is a significant altitude change while you are driving. Which can happen on some rally stages for me, this type of thing is basically mandatory for anyone who does hill climbs. Which I don't... but I can now!
The way I've got the MS wired up right now, I'm using the toyota sensor for baro correction, and the MS sensor for MAP. I think I'm going to switch that around, that way I won't have to swap vacuum lines around whenever I switch ecu's. It also meets the canadian rally rules a bit better (must use the stock sensors in stock class).
I got a lot done this weekend. I had taken the distributor off at one point, and when I put it back on, I couldn't get it to run right with the MS anymore... So I switched it back to the stock ECU, and setting the base timing to 10 degrees. Put the MS back, and now I had to adjust the trigger angle to 0. Which I find very interesting... anway.. That's why it's important to verify that your timing is what you think it is before doing any serious work.
So, I got the wideband O2 sensor working. Tuned it pretty nice for idle, then turned on the auto-tune on, and took it for a drive. That's a really great feature, it's made tuning the cruise settings so very easy! I think it's at a point now, I can take it in to try to pass e-test. If it passes that, then I know I've done a good job so far. I still haven't got to any of the 'fun' parts of the fuel map yet. But that will be coming soon.
Haven't really made any progress on this in a while.
I picked up a distributor from a 4E-FTE. It's got 2 big differences from a 5E distributor. The first thing you'd notice is it uses an external coil, instead of internal. Which means I can upgrade to a more powerful coil, but that's not what I got that distributor for. The second difference, is that it's got a 24 tooth wheel for the VR sensor instead of a 4 tooth. I can file one tooth off, and turn it into a missing tooth wheel. That will give me more accurate ignition timing than the 4 tooth wheel. It also means I can convert to direct ignition if I ever catch that bug.
The car is a rally car, so I really like that this sensor wheel and pickup are fully protected inside the distributor. I've heard stories of rocks and other road debris damaging the external sensor wheels that most people use on the street and for track racing.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum