Megasquirt Write-up for KA24 series engines.

Your premier source for information on the Turbo KA: KA24E-T and KA24DE-T (KA with aftermarket turbo kit)!
User avatar
The_Chosen_One
Posts: 1664
Joined: Tue Oct 17, 2006 2:05 pm
Car: 2009 Subaru Impreza 2.5i
Contact:

Post

With permission by the crew at DIYAutotune (Jerry, Matt) I am posting up the write up they did to install a Megasquirt ecu on stock KA ignition.
DIYAutotune wrote:Jerry and I have put together a guide to setting up Megasquirt on the KA-series engine. Right now this article covers what specific mods you will need to the Megasquirt and what wiring you will need to set up Megasquirt on an S13 with a KA24E or KA24DE. We'll be adding more information on settings, the S14, and the factory ignition module soon!

How to MegaSquirt your 240SX

Directly driving the coil with the MegaSquirt-I PCB 3.0 and MSnS-E 029v or later or the MegaSquirt-II

Updated 1/10/2007

Application(s): 1989-1994 Nissan 240SX with KA24E or KA24DE

Also applies to 1994.5 and later converted to an external coil distributor from the 89-94.

Other vehicles with KA series engines, such as Nissan pickup trucks, are similar.

Level of control: Full Standalone EMS-- Fuel and Ignition Control



The optical trigger on a 240SX may look a bit complicated, with two rows of slits and the unequal slit sizes in the inner ring. However, setting up Megasquirt to work with this ignition is surprisingly simple. Megasquirt does not need or use the information provided by the second ring of 360 slits or the length of the inner slits, so you just need to obtain a signal from the trailing edge of the ring of 4 slits. This writeup covers using a VB921 for controlling the coil.

ECU Modifications

It's choice time, MS-I with MSnS-E firmware, or MS-II. The choice is yours. It's possible to make your KA run with either ECU. The MS-I with MSnS_E is extremely mature, has a ton of features, and is pretty near the end of its development cycle. The MS-II is much newer, faster hardware, though the development is really just getting kicked off. While it has some features that MSnS_E doesn't have, the reverse is also true in that MSnS_E has some features that the MS-II doesn't have (though most require mods to enable them). The writer of the MSnS_E firmware has been conducting some tests on the MS-II firmware and I expect to see some really cool things happen soon...

Using the MS-I PCBv3 with MSnS-E firmware

This is assuming you are starting with an ECU built up like I build my assembled MS130-C MegaSquirt-I PCB3.0 units. If you are building your unit up from a kit you can implement these changes during assembly.Flash ECU with MSnS-E version 029v or later. (How? Click Here.) (Or Here)Jumper IGBTOUT to IGN to send to IGBT ignition coil driver signal out of pin 36 on the DB37.Cut out C12 and C30. (Only needed when triggering from the - terminal of the coil, which you are not)Remove D1 and jumper it, or just install a jumper wire across it's leads. (Only needed when triggering from the - terminal of the coil, which you are not)Cut out R57 if fitted (this won't be there on my units though).Get a 330 ohm 1/4w resistor and cut the leads down to about 1/2" at each end. Maybe a bit less.Tin each end of the resistor with a bit of solder.Cut a 5" piece of hookup wire (22ga is fine) and strip just a 1/8" or so. Tin the stripped wire with solder. Melt the tinned wire tip to one end of the tinned 330 ohm resistor tip and let it cool.Heatshrink wrap this wire/resistor assembly.Use this wire/resistor combo to jumper the 'top' (top as in when you facing the silkscreen side of the PCB, with the text so that you can read it normally) lead of R26 to IGBTIN on the opposite side of the PCB.

Thats it!

Using the MS-II PCBv3 ECU

Build the ECU up to trigger from the Hall/Optical Input (all of our MS230-C units are by default configured this way).The only change is to enable the IGBT High Current Ignition Coil Driver Circuit to directly drive the coil.Remove the jumper from JS10 to IGN (if exists)Jumper IGBTIN to JS10Jumper IGBTOUT to IGN(This will enable the VB921 Ignition Coil Driver)

Thats it!

Wiring]

The output is quite straightforward - you will just need to connect the negative terminal of the coil to pin 36. The specifics of the input wiring will depend on which year 240 you have; Nissan changed the wiring colors in 1991. However, the wires serve the same purpose; only the colors changed. Note that these years apply to the 240SX and are not the same for other KA-powered vehicles. For example, it appears that some Nissan pickup trucks with the KA24E engine retained the earlier color scheme for considerably longer.





Distributor Wire Colors'89-'90 [Purpose]B/W [12v]+G/B [MS Trigger (to Pin 24 on DB37, or Relay Board TACH terminal)]G/Y [not used]Black [Ground]

'91 and later PurposeB/W 12v+White MS Trigger (to Pin 24 on DB37, or Relay Board TACH terminal)Black not usedBlack Ground

Fast idle valves, relays and other components

The 240SX used a thermal type fast idle valve that just needs to be supplied with 12 volt power when the engine is turned on. The valve will open on its own, so you do not need to set up any sort of idle control with Megasquirt.

The stock Nissan ECCS relay is grounded through a circuit in the ECU. Also, the stock S13 wiring harness is set up to send the injectors 12 volts at all times, even when the ignition is turned off. When converting to Megasquirt, the injectors must not have 12 volt power unless the Megasquirt is also powered up. Sending the injectors 12 volt power with the Megasquirt ECU off can result in damage to the injector drivers.The wiring diagram below shows one possible way of modifying the stock wiring so that the ECU and injectors power up at the same time, and also allows the other components drawing power from the ECCS relay to work as normal.



An alternate method of dealing with this is to use the Megasquirt relay board instead of the stock ECCS relay to power the Megasquirt, injectors, and crank angle sensor.

MegaTune Configuration for MSnS-E

On the 'Spark' menu choose 'Spark Settings' and set 'Spark Output Inverted' to YES. It is critical to get the Spark Output Inverted setting correct, as setting this wrong can result in damage to the VB921. Dwell settings will depend on the coil used. A typical rule of thumb is to back off the dwell until you can just barely detect a misfire under lean cruising conditions, then add 0.2 ms of dwell time.

If you use someone else's .msq file I do recommend you check the MSnS-E firmware version the .msq file was built on as you cannot always use a file built on one version of MSnS_E with a different version-- it's best to use the .msq files with the same version of the MSnS-E firmware that it was built on.

MegaTune Configuration for MS-II

As this is a 'path less traveled' thus far you probably won't find people with maps to share for your car just yet. You can however dial it in with a bit of patience and some 'how to tune' homework, most of which you can do in the Megamanual at http://www.megasquirt.info.

Set ignition capture to "Falling Edge."

Important when using the VB921: On the 'Ignition Settings' menu make sure to set 'Spark Output' to 'Going High (Inverted)' and set 'Coil Charging Scheme' to 'Standard Coil Charge'.

We'd like to hear from you!

These settings cover the basic hardware changes required and some of the MegaTune settings based on our research and customer feedback, but we would love to hear from anyone who has set up Megasquirt firsthand on a KA24E or KA24DE and would like to share their configuration settings to help better this article. Also were particularly interested if you are using the stock ignition power transistor (ignition module) instead of VB921 direct coil control which will simplify things further for many. We have a couple of local 240's we may get in the shop soon to 'squirt and further improve this article.

If you have any further information, contributions, or questions about this article, please contact us..
Again I do not take credit for this, this was done by the awesome crew at DIYAutotune and gave me permission to post this.

Definatly will go great with the other write up for the CA.


User avatar
fiznat
Posts: 5651
Joined: Sun Sep 15, 2002 10:15 am
Car: Grown up :(
Contact:

Post

Nice, thanks Chosen One and thanks DIY AutoTune!

I'll add it to the stickey.

KATwo40
Posts: 1761
Joined: Tue Feb 01, 2005 9:40 am
Car: 1993 240sx KA-T

Post

Very cool.

User avatar
Biggamehit
Posts: 1236
Joined: Sat Jan 29, 2005 10:13 pm
Car: R33 Skyline
DR30 Skyline
Sil80
180sx
Location: Japan
Contact:

Post

cool

im so glad I did great in electronics in highschool very straight forward and simple schematics

im doing it very very soon

User avatar
WDRacing
Moderator
Posts: 15983
Joined: Mon Nov 25, 2002 2:00 am
Car: 95 240SX, 99 BMW 540i, 01 Chevy Express, 14 Ford Escape
Location: MFFO
Contact:

Post

I added it to the articles forum. Great info, pass on my thanks.

WD

bige240
Posts: 82
Joined: Tue Mar 21, 2006 10:57 am

Post

The guy from DIY autotune posted this link in the ka section. This is some of the best info out there besides the megasquirt Mega manual... I wish I woulda found this first. Great info for megasquirt interested people.

http://www.diyautotune.com/tec...s.htm

User avatar
daconkiftador
Posts: 2595
Joined: Sat Jan 14, 2006 5:27 pm
Car: '92 Coupe SE, '83 Rabbit GTi, '91 Golf GTi

Post

awesome!

User avatar
WDRacing
Moderator
Posts: 15983
Joined: Mon Nov 25, 2002 2:00 am
Car: 95 240SX, 99 BMW 540i, 01 Chevy Express, 14 Ford Escape
Location: MFFO
Contact:

Post

Added that to the sticky as well, what we need are a few more members running MS.

WD

S13FX
Posts: 1892
Joined: Sat Apr 30, 2005 10:59 am
Car: '69 l20b Dimeski :)

Post

Great now that I crash my car you guys post this. Maybe if this came a week earlier I wouldn't have crashed my car, cause I would have been busy installing MS lol. Awesome JOB BTW.

User avatar
The_Chosen_One
Posts: 1664
Joined: Tue Oct 17, 2006 2:05 pm
Car: 2009 Subaru Impreza 2.5i
Contact:

Post

WDRacing wrote:Added that to the sticky as well, what we need are a few more members running MS.

WD
You'd be surprise how many people are running megasquirt on Nissans and 240's

User avatar
Biggamehit
Posts: 1236
Joined: Sat Jan 29, 2005 10:13 pm
Car: R33 Skyline
DR30 Skyline
Sil80
180sx
Location: Japan
Contact:

Post

im comign soon, wait up

bige240
Posts: 82
Joined: Tue Mar 21, 2006 10:57 am

Post

I promise I'm still gonna do a megasquirt write up...I'm just waiting until I've done all the tuning first, so I'm not talking outta my ***...But one thing my buddy who is well versed in megasquirt told me, he said you could run two different engines with it (pikes peak style). because it works in banks.. Thought that was a cool idea...

User avatar
The_Chosen_One
Posts: 1664
Joined: Tue Oct 17, 2006 2:05 pm
Car: 2009 Subaru Impreza 2.5i
Contact:

Post

do you mean 2 different maps? If so yes you can.

TheOne
Posts: 1836
Joined: Mon Aug 09, 2004 4:28 pm
Car: 93 240sx FB
Location: Arlington, TX

Post

nice writeup, seriously makin me think about using MS, i though 1 of the hard parts was gettin the ignition installed, guess that made it easy.

but really, somebody needs to do a full writeup of all the wires that go here and there on a 240, what sensors are kept, or wires, what gets used to control the idle and other things.

KATwo40
Posts: 1761
Joined: Tue Feb 01, 2005 9:40 am
Car: 1993 240sx KA-T

Post

I'd like to discuss with someone their thoughts on the reduction in map resolution when going with MS.

The stock ECU uses 16x16 tables, whereas the MS uses 12x12.

While both use interpolation to fill the gaps between cells, I wonder if anyone finds that they need to tune a particular area that just can't be accessed because it's an interpolation spot, rather than a tuneable cell on the map.

I'm still not giving up on using MS, as I've been SERIOUSLY contemplating using it. WD and I have discussed this pretty in-depth and I'm nearing a point when I can do some MS testing.

User avatar
The_Chosen_One
Posts: 1664
Joined: Tue Oct 17, 2006 2:05 pm
Car: 2009 Subaru Impreza 2.5i
Contact:

Post

in reality really 12x12 is actually more than enough.

The cool thing about the megasquirt software if their is a trouble spot, you can expand it and tune it more.

you can also run Dual maps 1 for each bank of injectors.

Interpolation happens on every single ecu because its impossible to map every point on a motor no matter how big your maps are, thats why it's EXTREMLY important that the code is solid to make good calculations when the system interpolates.

I'm a megasquirt user with boost, to be honest my car actually feels a lot better than any stock ecu setup that I've driven or used. To put it bluntly it feels like I'm driving a brand new car thats how smooth it is, from normal cruising to boosting hard.

Also a lot depends on the person tuning, after speaking with a few people that have used both stock and MS. Some said they had issues because their wasnt enough map points, it was the result of crappy tuning.

Here are examples of insane Megasquirt setups with high boost.

http://diyautotune.com/cars/cu...k.htm

http://diyautotune.com/racing/...6.htm

Dont forget these are computers based on user inputs "Garbage In, Garbage Out"

User avatar
The_Chosen_One
Posts: 1664
Joined: Tue Oct 17, 2006 2:05 pm
Car: 2009 Subaru Impreza 2.5i
Contact:

Post

TheOne wrote:nice writeup, seriously makin me think about using MS, i though 1 of the hard parts was gettin the ignition installed, guess that made it easy.

but really, somebody needs to do a full writeup of all the wires that go here and there on a 240, what sensors are kept, or wires, what gets used to control the idle and other things.
Aside from the wires that are listed above for the distributor. Their is only 2 other wires to connect. 1 is Fuel Pump, their is a plug near the battery hold down area, its a Brown 8 pin plug, look for a Black/Pink wire thats your fuel pump relay wire thats where you wire up for Megasquirt. The 2nd wire is the 12volt ignition, you can find it on the ignition cylinder where you insert your key, test for the wire that gives power while cranking and on the run position I'm pretty sure its Black/White on the cylinder and when you follow it, it changes to a Black/Red wire.

Go here for more info and pics.

zerothread/164446

KATwo40
Posts: 1761
Joined: Tue Feb 01, 2005 9:40 am
Car: 1993 240sx KA-T

Post

So, with the MS2, you can pull the stock ECU out and sell it?

User avatar
WDRacing
Moderator
Posts: 15983
Joined: Mon Nov 25, 2002 2:00 am
Car: 95 240SX, 99 BMW 540i, 01 Chevy Express, 14 Ford Escape
Location: MFFO
Contact:

Post

I believe basically yes. Although IIRC some people use the factory ECU for gauges.

Great thread so far.

KATwo40
Posts: 1761
Joined: Tue Feb 01, 2005 9:40 am
Car: 1993 240sx KA-T

Post

The only way I'm gonna use any standalone is if I can completely remove the stock ECU and still retain the OEM gauge operation.

Hopefully Neo (The Chosen One) will chime in here with some good news for me!

User avatar
WDRacing
Moderator
Posts: 15983
Joined: Mon Nov 25, 2002 2:00 am
Car: 95 240SX, 99 BMW 540i, 01 Chevy Express, 14 Ford Escape
Location: MFFO
Contact:

Post

Why? is it that important to remove the ecu? Are you being gay?

S13FX
Posts: 1892
Joined: Sat Apr 30, 2005 10:59 am
Car: '69 l20b Dimeski :)

Post

WDRacing wrote:Why? is it that important to remove the ecu? Are you being gay?
Do you really have to ask?

KATwo40
Posts: 1761
Joined: Tue Feb 01, 2005 9:40 am
Car: 1993 240sx KA-T

Post

WDRacing wrote:Why? is it that important to remove the ecu? Are you being gay?
Hell yeah, it's important. What's the use in spending several hundred dollars on MS (or any other standalone) if you still must shoulder the stock ECU? If I have to keep the stocker, I'll just use it for the whole deal.

User avatar
The_Chosen_One
Posts: 1664
Joined: Tue Oct 17, 2006 2:05 pm
Car: 2009 Subaru Impreza 2.5i
Contact:

Post

The Gauges are standalone, all the sensors run right to the gauge cluster.

Just remove the engine harness, and ECU, but keep the lower harness as that connects your speedo, reverse lights etc etc. The lower harness connects to the main body harness which Tees off to the cluster harness.

At the moment the DIYAutotune crew is experimenting with A/C load detection which is what the stock ecu does when you turn on the A/C. But if you arent using A/C it doesnt matter and your good to go.

So yes removing harness and ecu is ok and cluster still works fine.

The only thing you have to do is run a wire for your Tach to Megasquirt.

The wire on the Tach is Yellow/Red.

User avatar
babowc
Posts: 3108
Joined: Mon Oct 25, 2004 3:26 pm
Car: 240sx
Contact:

Post

Nice! This should be a sticky! Unless it already is?

User avatar
WDRacing
Moderator
Posts: 15983
Joined: Mon Nov 25, 2002 2:00 am
Car: 95 240SX, 99 BMW 540i, 01 Chevy Express, 14 Ford Escape
Location: MFFO
Contact:

Post

What about ABS...any issues with ABS? I have no real idea how thats controlled, is it also a standalone system? This could sound stupid I guess but I don't care.

User avatar
The_Chosen_One
Posts: 1664
Joined: Tue Oct 17, 2006 2:05 pm
Car: 2009 Subaru Impreza 2.5i
Contact:

Post

For ABS I'm pretty sure it becomes neutralized, since its controled by the ecu. I'm sure Megasquirt can control ABS if you truly wanted because in reality ABS is just a hall sensor on each wheel, but come on real men dont need ABS

User avatar
WDRacing
Moderator
Posts: 15983
Joined: Mon Nov 25, 2002 2:00 am
Car: 95 240SX, 99 BMW 540i, 01 Chevy Express, 14 Ford Escape
Location: MFFO
Contact:

Post

Maybe I'm really a women inside of a man

User avatar
The_Chosen_One
Posts: 1664
Joined: Tue Oct 17, 2006 2:05 pm
Car: 2009 Subaru Impreza 2.5i
Contact:

Post

than whats with the Fetish of Flesh Lights as Your Avatar?

User avatar
WDRacing
Moderator
Posts: 15983
Joined: Mon Nov 25, 2002 2:00 am
Car: 95 240SX, 99 BMW 540i, 01 Chevy Express, 14 Ford Escape
Location: MFFO
Contact:

Post

I like to keep everyone guessing...


Return to “KA24ET / KA24DET Forum”