Megasqurting a 4age 20v DIY ECU

Moderators: Simjen, KiwiBirkin

bzrse7en
Posts: 1467
Joined: Thu Apr 23, 2009 3:40 pm
Location: Rolleston Canterbury

Megasqurting a 4age 20v DIY ECU

Post by bzrse7en » Sat Nov 14, 2009 7:43 pm

In this thread I will post developments of my Megasquirt MSII V3 ECU construction.
I am going to fit it to a 4age 20v blacktop and tune it initially without the use of a dyno using megatune software.
My engine currently uses the factory ECU. With what I thought were only minor differences between my instillation and the BZR Levin, the 4age ran very lean and the factory ECU could not correct this, in fact even with the working O2 sensor, it did not register the lean condition.

The Megasquirt is a standalone engine management system. It comes as a kit that you assemble and then tune yourself. The tuning software has a self-tuning function where you can set it to write it’s own fuel maps with target AFRs.
It has hardware features comparable to other current engine management systems, and user friendly tuning software.

For fuel map tuning a wideband oxygen controller is required. I chose to build a Tech Edge kit as it seemed feature packed, reasonably priced compared to other WB systems and is made in Oz. You can check it out here:
http://wbo2.com/2y/default.htm

It has way more features than is necessary to tune the Megasquirt. All that the MS requires is a WB controller with an acurate 0 – 5v output, 2.5v being equivalent to an air-fuel ratio of 14.7.
The Tech edge has a digital display, wide and narrow band O2 sensor outputs, several thermocouple drivers and voltage inputs such as TPS and MAP volts, a 1meg data logging memory plus a lap top can be used to data log and display all of the inputs.
I believe there are several other WB kits out there. One WB kit on the web called JAW (just another wideband) looked OK, more simplistic and perfectly adequate.

Assembling the Tech edge kit was reasonably straightforward. The kit comes as a complete kit with all parts and I was impressed with the quality of the parts. When finished in it’s enclosure it looks fairly good, not like a Dick Smith kit shoved into an ice cream container as an enclosure.
I had a couple of problems with the WB controller kit though.
The kit had two capacitors and a connector pin missing. These items were not mentioned in the instructions I downloaded. After it did not work, I went to the Tech Edge forum where I found a thread on problems with the kit. Posted by a staff member were detailed known problems with the kit. What pissed me off was that this post was three months old and they had neglected to update the on line kit instructions or add the 50c worth of missing parts to the kit. The WB controller now appeared to work, but didn’t connect with the PC. After much stuffing around I found another reference in the forum that one of the wiring diagrams for the serial cable had been mirrored in the instructions. The pin numbering was correct but the graphic had been reversed. I had wired it graphically not numerically. On reflection it is quite funny reading the Tech Edge web site where they say in the fault diagnosis section that they get quite annoyed at so many DIY customers blaming their product when the customer has wired up a cable incorrectly. Get the instructions right first fella!

So apart from these small but frustrating issues, it went together well and has worked reliably for 6 months now.
I have used it to tune the 4age’s lean mixture with an adjustable fuel pressure regulator and slightly larger injectors. It has been invaluable for this.

Patrick

User avatar
Super Seven
Paid Member
Posts: 170
Joined: Mon Apr 20, 2009 8:22 am
Location: Petone

Re: Megasqurting a 4age 20v DIY ECU

Post by Super Seven » Fri Nov 20, 2009 8:56 pm

Interesting post. I was tempted to go down the Megasquirt route before I got an Emerald K3. The great thing about having a programmable ECU is to get the engine running so much better than it would with a stock computer in such a light car.

Mike

bzrse7en
Posts: 1467
Joined: Thu Apr 23, 2009 3:40 pm
Location: Rolleston Canterbury

Re: Megasqurting a 4age 20v DIY ECU

Post by bzrse7en » Mon Nov 23, 2009 6:56 pm

The parts all turned up a few days ago, I got hit with another $60 GST thru customs - bugger!
I had forgotten the $400 threshold, under $400, customs don't generally bother. I just needed to split the invoice.
The three kits (Jimstim, MS11-V3 and zeal board) were all well packaged, with screwed up bra catalogues for packing. Nice!
The kits themselves were well packaged also, it looks like every item is in it's own labelled snap lock bag. That's what you pay for I suppose. I could have bought a short form kit and sourced the bits here, it would probably have been a bit cheaper, but this way looks idiot proof.

The PCBs are nicely made, all of the boards look robust, the MS V3 main board is multi-layered and is said to be electrically very robust.
After downloading and printing off the 20 page build manual and reading it, I learnt I need to run the 'MS extra code' as uposed to the standard MS code. This more sophisticated firmware requires a few mods or a slightly different assembly to the standard board. So download and print another 40 pages for assembly and another big lump for setting up the extra code.
The general instructions are well written and very clear, they are written for people with only basic electronics experience with reminders everywhere of which way around components go.
There is a great deal to read though and get your head around. Although the assembly instructions are very clear, what particular circuit to add isn't quite as clear. There is just so much jargon. Much of the instructions just aren’t relevant to my particular install, but you still end up sifting thru it.
It might be a little while before I get started on the build.
The first item is the Jimstim. This stimulator or diagnostic tool is also available direct from the designer in Canada. It is also available as a short form kit.

Patrick

bzrse7en
Posts: 1467
Joined: Thu Apr 23, 2009 3:40 pm
Location: Rolleston Canterbury

Re: Megasqurting a 4age 20v DIY ECU

Post by bzrse7en » Tue Dec 01, 2009 4:23 pm

I purchased all the kits from DIY Auto tune. http://www.diyautotune.com/catalog/inde ... b694be5329
The DIY autotune guys are very helpful and knowledgable. The prices are identical to Glens Garage, but Glen doesn’t seem to answer questions as often.

I started with the er, Stimulator.
This is a diagnostic tool to test the megasquirt. It can be used on other ECUs as well. Basically the stim generates signals that mimic the various sensors found on an EFI engine. It also reads outputs such as injector and spark pulses with LEDs. While plugged into the ECU, you can also see what is going on in more detail with the megatune or tuner studio software.

I bought the more expensive Jimstim instead of the megastim as the megastim only has a basic distributor emulator. The 4age 20v has an unusual dizzy with 2 wheels and 2 VR (variable reluctor) sensors so it was necessary to buy the Jimstim which can emulate a whole range of distributors and toothed wheels.

The kit went together very easily, it took maybe 2 -3 hours with my 4 yr old son “helping”. So you can figure on 1 hr by yourself. Instructions are clear and the kit had every component necessary including hook up wire. Next time though I would definitely just buy the bare board and IC directly from the designer in Canada here: http://www.jbperf.com/JimStim/index.html

The testing instructions were easy enough to follow, thou I had to read them a couple of times to understand what they were on about. When testing I found the second Tach signal didn’t work so I put a note on the megasquirt forum. The question was answered within 3 hours by the Jimstim’s designer. He was very helpful. As it turned out by this time I had already fixed it by re-soldering a couple of components.

Next I built the Zeal daughter board.
This board isn’t necessary, but helpful with using the Nippon Denso dizzy. The board has 2 VR sensor conditioner circuits. In reality, the megasquirt V3 board already has one VR conditioner and another can be built in the proto area of the board. I decided to keep it tidy and build these two circuits together. This board also has a few other low current output circuits that are probably not necessary for me, but might be useful later on.
As it turns out another board is available from Canada that has the same 2 VR circuits, but not the extra stuff. Next time I’d get one of these: http://www.jbperf.com/dual_VR/index.html
The Zeal board also has an PWM (pulse width modulated) idle control circuit to control 2 wire idle valves. The 20v has a 3 wire valve. This circuit will drive the valve with a slight mod, but ultimately a dedicated 3-wire board would be better. These boards can be bought from Glen’s Garage in the US:
http://www.glensgarage.com/catalog/wire ... -p-79.html
The Glen’s garage board also has 2 extra coil drivers, which are not necessary on a standard 20v, unless you want to do something real special with your ignition as the megasquirt V3 already has 2 coil drivers.
I am sure you can see at this stage there is not one board as yet available with all of the circuits you’d need on a 4age 20v.
There is however room to build extra circuits in the proto area of the v3 board. The schematics are readily available as long as you can be bothered looking.

OK, back to assembly, the Zeal board again went together as easy as. Again with my son “helping”.
There are a couple of mods suggested by the board designer Ken Culver to improve noise filtering:
“The main thing you'll want to do to your lm1815 circuits to make them a bit more noise-proof is to ground pin 14 on each of the lm1815 chips. Next you'll want to put a .01uF cap across G+ to ground (don't do this on Ne). Assuming you have things wired up the way I do, this *should* clean up a lot of noise.
When I read these instructions, I didn’t fully understand them until I had the board in my hands, it then becomes clear.
More details are posted on this forum:
http://forums.club4ag.com/zerothread?id=11048&page=12
The one mod I also did do was put the lm1815 ICs into sockets, that way if I fry one, it’s easy to replace.

Pictures to follow
Patrick

User avatar
Simjen
Posts: 551
Joined: Tue Aug 18, 2009 10:57 am
Location: Cambridge NZ
Contact:

Re: Megasqurting a 4age 20v DIY ECU

Post by Simjen » Fri Dec 18, 2009 2:21 pm

Hey Patrick,

Any more progress?
It would be a lot simpler if you didn't have idle control etc.....mine has all been disconnected on my stock ecu, just doesn't like idling for the first few minutes but then it runs sweet, although its pretty good at startup on a warm day!
If I was going Megasquirt (as i want to) i would be going the simplest option possible and leaving idle control out as well as a toothed wheel for crank pickup.
I'm interested in your progress :)
Kids bus: Toyota Avensis Wagon
My Car: 1991 Eunos Roadster
Toys: Ducati 996 Monoposto, Honda CB400 Twin Cafe Project
My Blog: http://simjenlotus7.blogspot.com/

bzrse7en
Posts: 1467
Joined: Thu Apr 23, 2009 3:40 pm
Location: Rolleston Canterbury

Re: Megasqurting a 4age 20v DIY ECU

Post by bzrse7en » Thu Dec 24, 2009 1:14 pm

Yea, all is good.
I will post a paint by numbers of the set-up in a wee while.
The building / assembly was easy in the main.
I had a few trips to Jaycar and SICOM during the build for odds and sods for the extra circuits required. It is a bugger going into Ch-Ch(from Rolleston) for one 5c capacitor and then finding when you get home you should have got a couple of 5c resistors at the same time!

Appart from a bit of research and experimentation trying to get the ignitor to work with MS, it started straight away and ran reasonably well. No one on the forums had posted info on using the full 20v ignition system, infact the 20v is a bit of an odd-ball in the US where most megasquirters are. Plenty of info on MSing your average V8 thou.
Setting up to use the OEM dizzy was actually very easy, almost an aniclimax. I was expecting allsorts of trouble.
I am now part way thru tuning. I have a pretty good fuel map using megatune's autotune function. I do need to look at full load high RPMs thou and will probably datalog those as Autotune needs to sit on a load site for 1 sec before adjusting.
I did a drive along the summit Rd, Gebbies pass to Sumner with no acceleration enrichment and there was no issues at all - except for the expected flatspot just off idle.
The AFRs are soo much cleaner than when using the OEM ECU.
I got an advance map off the net, it needed a few tweeks around the idle and low rpm to stabilise the idle. Full load advanace is 32 deg. and dosn't appear to knock.

Yes, idle controll is a bit of a problem at the mo. The circuit does work, but not well yet on closed loop or fast idle.

Patrick

bzrse7en
Posts: 1467
Joined: Thu Apr 23, 2009 3:40 pm
Location: Rolleston Canterbury

The write up for Megasqurting a 4age 20v DIY ECU

Post by bzrse7en » Mon Jan 04, 2010 8:17 pm

* Here is the text to the write up, I am having a few issues with uploading the pictures and other attachments *

Setting up MS2 V3 for a 4age 20v using MS2 Extra code.
Patrick Neal
4th Jan, 2010

This is a guide to setting up MS2 V3 for the 4age 20v using OEM sensors and ignition with no modification.
My personal aim was to be able to swap the MS and OEM ECU easily in case problems occurred.
Although I found building and setting up MS quite pleasurable and fairly straightforward, I would not recommend this type of thing if you want a straightforward joint part A to part B, add part C, buy the T shirt, apply the stickers and go race. If you are a cheque book hobbyist, Megasquirt probably isn’t your cup of tea.
I have to say that I am not an electronics expert. Quite the contrary, I am no more than a low level hobbyist. Take this info as a guide only, I can take no responsibility for the problems you get yourself into or if you use my MSQ or fuel maps file without modification or tuning.

This information has been gathered from many sources with the Megasquirt for dummies thread on club4ag.com being the most informative. The Megasquirt forums have also been invaluable, although there is just too much info and 99% of it is not relevant. What I found impressive was the quick response to questions. Board designers or MS firmware writers generally answered the questions I placed, these guys are very helpful as is the staff at DIY Autotune.

Manuals required or worth reading
 V3Assemble.htm Assembly instructions for the V3 board
 MS2-Extra_Ignition.htm Ignition hardware set-up when using the extra code
 MS2-Extra_Nippon.htm Instructions for using the Nippon Denso distributor
 MS2-Extra_Conversion.htm Instructions to install MS2 Extra code and general Megatune set-up.
 Zeal board or similar VR conditioner board construction and install.
 Toyota Vast ignition The 20v doesn’t use Vast, but is similar-ish
 MS2-Extra tuning guide.mht. These two documents are almost the same, but not quite so read both.
 Tuning Your Megasquirt-II (or MicroSquirt).mht

Some of the above info is not relevant to this install, but is worthwhile taking a look, you might fancy trying COP, (coil on plug), wasted spark, launch control or something else at a later stage.

Build the V3 main board as per instructions except:
 Do not do step 22
 Do not do step 50 you can build this part if you wish, but the 20v will not require it, so it will be disabled in favour of the VR circuit in step 51.
 Do step 51
 Do the VR sensor jumpers on step 52: VROUT – TSEL (not VROUTINV).
 Replace the resistors R4 and R7 with 2K2 resistors. These are not included in the kit.
 Step 64, do not install Q4. Check the instructions for the PWM idle valve just below where it will explain how to fit a TIP120, 121 or 122 transistor for your 3 wire idle valve.
 Do step 65, although do not jumper it exactly way it shows in this manual. Look at the MS2-Extra ignition manual for using the D14 LED for Spark A output, although you will need a 5V pull up resistor as indicated on page 16 of the V3 main board manual.
 Do not do step 69, the 20v has high impedance injectors. The space that these components take up on the heat sink can now be used by other components such as PWM FIdle and the VVT output transistors.


Second VR conditioner
You will need to build a second VR conditioner, you can build it in the Proto area, although I decided to build a 3-wire idle valve circuit there and use a separate Zeal board for the VR.
Modification to the Zeal board VR circuit as posted by Ken Culver (Zeal board designer):
Put a ceramic .01uF cap across G+ to ground and also ground pin 14 of the lm1815 chip.

This small modification cleans up some of the noise issues people have had with using Nippon-Denso Dizzies.
To date I have not had any issues with the ignition, it just ran.

Idle control
The 20v uses a three wire PWM idle valve.
Here is the 3-wire circuit.


I built this circuit in the proto area. There is now not much space for anything else. You could build a separate 3 wire board and have it in the case, or outside the case as indicated by the diagram. Or don’t bother with the 3-wire circuit and follow the Megamanual’s suggestion and simply put a resistor onto one of the 3 terminals of the 3-wire valve. I am unsure how well the simplistic single resistor method works – probably just fine.
I have found closed loop PWM idle control is a bit erratic when the maps are not flat in the idle area.
You could of course not bother with a fast idle.
I set my normal idle mechanically @ 800rpm instead of relying on the idle valve, when you are setting up maps the last thing you want to do is struggle with the idle valve settings. Under the velocity stacks you will find 4 air-bleed screws to adjust the idle speed. From the factory they are set low and I doubt it’ll idle without adjusting these. Make sure they are kept synchronised to avoid an unbalanced mixture at idle.
VVT Output
Here is the output circuit required for the VVT, although you can (and I did) replace the 2N2222 with a TIP122 transistor and do away with the relay. The TIP122 will fit on the heat sink
I connected this circuit to the IAC2 pin on the CPU under the V3 board and Spare 1 on the DB35.
I set it up so the VVT comes on at 3500rpm with 70% TPS.

If you do decided to use the Zeal board, it has an output circuit just like the one above, but it will not drive the VVT directly, you will have to use a relay for this.

Here is the link to the MS2 output section of the manual
http://www.msextra.com/ms2extra/MS2-Ext ... tm#outputs

Setting up in Megatune
 Firstly install the MS2-Extra firmware.
The 3x firmware (currently in Beta testing) will enable better fuel control of the ITBs (Independent throttle bodies). In saying that, the 2x code I am using seems OK. I believe Megatune won’t work with the 3x code, you’ll have to use Tunerstudio.
Make sure you follow the instructions for installing this as I found an icon for downloading the firmware onto the MS2 Ecu and it didn’t seem to work. I found this frustrating starting a bit of a Spanish inquisition of checking all of my work. As it turned out the icon doesn’t work, you have to use a boot loader program. If I had only read the instructions!
 Follow the instructions in the MS2-Extra conversion manual.
 Set up the ignition settings as per the Nippon Cas instructions except spark out should be Normal, not inverted, this is very important if using the ignitor!
 Dwell is controlled by the ignitor. I originally set the dwell as per the MS2_Extra Ignition manual and had no issues. But as the ignitor controls dwell, I later changed to fixed dwell with a duty cycle of 10%. Any higher and it got hot. My method is hardly scientific, but I have had no issues with misfires and the ignitor is barely warm.
 Idle control is PWM. Closed loop will probably not work well until your maps (VE and Advance) are sorted and fairly flat around the idle areas.
 VVT on the programmable outputs, I set it up thus: RPM > 3500rpm, TPS > 70%. I found the standard 4000rpm kick in gave a bit of a dead spot between 3000 – 4000rpm (factory ECU), you could feel the change in performance. Setting at 3500, the kick in is hard to detect which to me, means it is probably about right, although my car only weighs 550kg. I connected the check engine light to the same output to monitor what it is doing.
 Thermistor settings will need changing in Megatune to calibrate to the Toyota sensors.
Cooling system sensor
32 deg F = 6.02 Kohm
77 deg F = 2.080 Kohm
212 deg F = 230 ohm
Intake Temperature sensor
4 deg F 15 Kohm
32 deg F 5.5 Kohm
68 deg F 2.5 kohm
140 deg F .55 Kohm

Testing
I used the Jimstim because it could simulate the Nippon Denso dizzy’s signal.
Unfortunately the Jimstim would not trigger the second VR circuit. Jean, the designer recommended using a 0.01uf cap in series with the VR2 jumper wire to turn the square wave the stim’s second trigger output produced into a sort of crossover signal. I have to assume this’ll work, but I didn’t bother trying. The car was running by this time.


Wiring
I built an adapter using a plug from an old ECU, I think from a Honda. Don’t bother trying to remove the plug with a solder sucker, just cut the pins close to the board. Make sure you use heat shrink on all of the wire joins. The plug was housed in a sheet metal box. The box is large enough to store another circuit or a relay if so required. It is velcro’d onto the stock ECU at present just in case MS fails. I doubt it ever will, but it takes up stuff-all space.

The only thing I think worth mentioning of great importance is the wiring from the G1 and NE sensors to the Megasquirt is best to be shielded. Use a light 2-core cable with shielding. The shield becomes the common negative wire from both sensors.
Below is the pin outs for the blacktop. Silver top pin outs are different and available off the net. I have read at least one other install that said that Toyota wires up their TPS reverse polarity to other manufacturers, I have not found this the case, it wires up standard.
Linking it all up is fairly straightforward.
 Silver top has an AFM, get rid of it, the wires can be utilised for the air temp sensor.
 Leave +B, this is for a non-switched supply to stock ECU.
 RSO and RSC are the idle valve wires, if you get them mixed up, you can reverse them in Megatune.
 Don’t bother with CF and ELS2 unless you want a second cooling fan. The main fan does not use the ECU.
 FC is your fuel pump relay
 Pair 2 injectors together as MS only has 2 injector outputs
 IGF can be left open; IGT goes to your ignition output.
 Use the G1 sensor to the zeal board, and Ne signal to the MS, leave G2 open.
 G- is the common ground wire for all dizzy sensors, use the shield wire for this.
 VC is wired to the 5v TPS feed on MS.
 Definitely connect up an inline fuel filter in the MAP hose as a vacuum damper. As an extra precaution I also put a restrictor with a 2mm hole into the hose as outlined in one of the tuning guides.

Here is a shot in the foot-well of my car. It isn’t the final resting spot for the MS, it is just assesable.
You can see the MS in the foreground and the stock ECU just in behind. The adapter box is velcro’d onto the stock ECU, I can switch back in the event of a problem. You can plainly see the fuel filter in the MAP line positioned close to the MS. The random white wire goes to the Wideband controller above the foot-well.

Patrick Neal

Russell
Posts: 22
Joined: Sat Jul 18, 2009 1:05 am
Location: Christchurch

Re: Megasqurting a 4age 20v DIY ECU

Post by Russell » Wed Jan 06, 2010 12:21 pm

If I was going Megasquirt (as i want to) i would be going the simplest option possible and leaving idle control out as well as a toothed wheel for crank pickup.
I'm interested in your progress

I have a 4age turbo which I bought 12 months ago

It has no idle up on starting and needs to be at temperature before it will idle
No idle is not a problem and easily achieved initially once you know attention is
needed

My point is I think many others have taken the simple option as mentioned in an earlier post

Cheers

Russell

bzrse7en
Posts: 1467
Joined: Thu Apr 23, 2009 3:40 pm
Location: Rolleston Canterbury

Re: Megasqurting a 4age 20v DIY ECU

Post by bzrse7en » Wed Jan 06, 2010 9:10 pm

Progess is going very well. I have stopped using the autotune function and now datalogging drives. The MS log view program has a cool tool. It loads the log and all your maps, then it analyses the logged data against your target air fuel ratio map and suggests changes. You push OK and it is all done. Easy! It seems very accurate so far.

Yes simplicity is the best way, although setting up the extra board for the dizzy was easier than making a bracket for a VR sensor + wiring and setting up a toothed wheel.

Patrick

Russell wrote:If I was going Megasquirt (as i want to) i would be going the simplest option possible and leaving idle control out as well as a toothed wheel for crank pickup.
I'm interested in your progress

I have a 4age turbo which I bought 12 months ago

It has no idle up on starting and needs to be at temperature before it will idle
No idle is not a problem and easily achieved initially once you know attention is
needed

My point is I think many others have taken the simple option as mentioned in an earlier post

Cheers

Russell

User avatar
nz_climber
Paid Member
Posts: 1650
Joined: Sat Apr 18, 2009 5:15 pm
Location: Palmerston North
Contact:

Re: Megasqurting a 4age 20v DIY ECU

Post by nz_climber » Thu Jan 14, 2010 6:26 pm

Here is the file with write up and photos of Patricks set up

http://aarons7.wordpress.com/files/2010 ... ge-20v.doc

To get the file right click on it and pick save as from the drop down menu and it will download to your PC so you can read it offline.

Post Reply