Saturday, October 29, 2011

Adapting 4A-G(Z)E MAP Sensor to Megasquirt I

Some of us Megasquirters choose to go the difficult way of using non-standard sensors. Megasquirt comes stock with MPX4250 sensor which is a 2.5 Bar MAP sensor capable of reading boost to around 1.5 Bar. While convenient, you simply plug in the vacuum line to the on-board sensor and tune away, some of us may choose to save a few bucks and use whatever sensor we already have. In my case, when my engine was setup for NA, i already have a stock 4A-GE MAP sensor and now that i'm going for turbo, i chose to go with 4A-GZE MAP sensor simply because it's cheaper, matches the 4A-GE plug and built to be mounted in the engine bay.

The problem with using non-standard sensor is having to tell Megasquirt about it. Megasquirt (and i believe all ECU) works by reading the sensor voltage output, convert it to MS readable value using ADC (usually 0-5 volt is converted to a span of 0-255 in binary value) and, in the case of MAP sensor, convert the corresponding ADC value to a certain kPa value based on the lookup table we provided when we burn the firmware to MS CPU. Now you see where the problem lies: MPX4250 may and most likely has different ADC to kPa lookup table with other MAP sensors. In easier terms, the voltage output on MPX4250 when reading, say, 100 kPa, maybe different with other MAP sensors. This also applies when you use Toyota's 4A-GE and 4A-GZE MAP sensor.

The steps in adapting non-standard MAP sensor to your MS are:

1. Find the kPa to voltage characteristics of your MAP sensor. This is usually the hardest part but if you're lucky, the internet is your salvation. Since you're reading this, yes, you got lucky. I will share this later below. You need at least two kPa to volt mapping values, assuming your MAP sensor is linear (most of them are).

2. Using a spreadsheet application, make three colums: ADC, Volt, kPA and fill the rows. Put 0 to 255 under ADC. Under Volt column, put 0 volt next to 0 ADC, 5 volts next to 255 ADC and fill up the rows in between. Each cell is (5/255) volts above the preceding value. Round it to two digits. So directly below 0 volt, this would be 0.02 volt. Below this would be 0.04 volt etc.

3. With the values you obtain in number 1, fill kPa column with the corresponding voltage output. As i said, you need at least two values. Then fill up the rest of the rows by extrapolating. Round to zero digits. Change any value below zero to 100.

4. With MS-1 CPU, you change the lookup table values by altering kpafactor and barofactor inc files. These files will be converted to assembly language when you compile the firmware source and burned to MS when you download the firmware. I'm using MS1-extra code 029y4 and it has two sets of kpafactor-barofactor inc files that you can alter: kpafactor4115.inc-barofactor4115.inc and kpafactor4250.inc-barofactor4250.inc. You can find these files under /src folder on your firmware code files. These files contain the lookup value if you are to use MPX4115 and MPX4250 MAP sensor. Since you are not, choose one set that you will alter. I altered the 4115 set for the 4A-GE MAP sensor and 4250 for the 4A-GZE MAP. There's no way i can use stock MS MAP sensors without reflashing the firmware now.

5. Alter the values in kpafactor inc with the one you have under column kPa on step 3. You need to add "T" next to the values. Some of us don't alter the barofactor inc and get away just fine. I don't really understand the purpose of this file but i think it's only useful if you have barometric correction activated on your MS which requires you to have a second MAP sensor to continuously read the atmospheric pressure. Correct me if i'm wrong. However, if you choose to alter the barofactor as well, the values are simply mapped from the kpafactor using this formula:
100*(1-0.0047*(kpafactor value-100))

6. Compile these files to obtain the altered S19 file. Download to MS and you're done.

7. If you're using Megatune, don't forget to copy the same inc files to /mtCfg folder inside your corresponding project folder. Megatune use the same files to ensure the MAP gauge are showing the same kPa values as read by your MS CPU.

8. Ensure when you turn on your MS, Megatune MAP gauge shows approximately around 100 kPa if you live close to sea level. Any value within 4-5 kPa is fine.

If this sounds too complicated, below is the link to download my inc files to save you from the hassle.

Download link.

Remember, i altered the 4115 set for 4A-GE MAP sensor and 4250 set for 4A-GZE MAP sensor. My 4A-GZE MAP sensor is part number 89421-12110 and i believe Supra's 1JZ/2JZ uses the same sensor. If you're upgrading from a working MAP sensor, i suggest you keep the inc files for the working MAP and alter the other. As always, use the files at your own risk. The values for the lookup table are obtained from the following links (as in, don't blame me if my values are off):
- 4A-GE MAP sensor values are from this link.
- 4A-GZE MAP sensor values are from this link.

Damn, another text-only post. Oh well..

Wednesday, October 26, 2011

Worried About Your Size?

Worry no more! If you're like me, lost the original dipstick to your 16 valve 4A-GE and love your engine enough to worry if it's sufficiently lubricated, now you can save from having to pay up to 20 bucks just to get one from Ebay!

I currently use 4A-C's dipstick on my smallport and have suspected that it's shorter than the original. I filled 4 liters of oil to my freshly rebuilt engine and the next morning, i checked that it only wets the tip, far lower than the LOW mark.

I asked around on Toymods (seriously helpful Toyota guys there!) and got this measurement for my original smallport disptick:
- Rubber seal (where it touches the tube) to disptick tip = 326mm
- Rubber seal to Low mark = 316mm
- Rubber seal to Full mark = 292mm

For comparison, i measured my 4A-C's:
- Rubber seal to tip = 303mm
- Rubber seal to Low mark = 294mm
- Rubber seal to Full mark = 278mm

Just as i thought, it is shorter! Since i had a hard time finding anyone that sells the original dipstick, i asked the seller to just give me something longer and i'll cut to length. He gave me one for Daihatsu Taft (Rugger or Rocky for you?). It has a black T-handle unlike 4A-C's that has yellow looped handle. Cut it according to the measurement and done! Cost me only 3 bucks.

Obligatory picture to avoid making this a text-only post.

Monday, October 24, 2011

Nearly There

Got the engine running again finally. Since pictures worth more than thousands of words (or i'm too lazy to write), here are some progress shots with minimum amount of words in between.

ARP flywheel bolts

Turbo oil drain flange on sump

ARP head studs and 4A-GZE 8.9 CR slugs

ARP head stud protrusion. This is why some need to shave one of the studs as it fouls the distributor shaft. Obviously not this one as i took photo of the wrong side.

Considered leaving the timing belt cover off but put it back on to be safe.

Last shot before turbo conversion the next day. Notice the oil drain line is only ziptied near the strut tower.

The next day, after running the engine for a day and ensuring the rebuild was successful, turbo conversion was started. Oil sandwich adapter went in first. Only one out of four outlets was used.

HKS copy cast iron manifold with gasket cut out from a soda can. Cheap and refreshing, indeed.

The very minimum space at the back of the turbo with downpipe flange off. Gotta move some wiring to protect them from the heat.

Oil lines plugged in and this is the final shot of the day.

The next day which was yesterday, exhaust was fully redone. The initial plan was only to fabricate the downpipe and connect it to the existing exhaust but after quick reconsider, decided to ditch the whole system and put 2-inch pipes front to rear. Only 2-inch? Well, the turbo downpipe flange output is that diameter, i'm merely following. No use in going bigger, yes? The flexible joint was welded to the downpipe and only one tiny muffler was used. The rest of it was 2-inch piping and elbow joints to allow going over-axle. Oxygen sensor bung was installed on the same location as the original piping. Didn't take many photos that day, sorry.


Finally, just today, i installed an SPST switch on the bootloader jumper header on my Megasquirt. I did this to ease flashing firmwares later without having to open the MS case anymore. I'm currently focusing on finding the correct values to go into the kpafactor and barofactor inc files as i'm going to use the 4A-GZE map sensor which is not directly supported by the original MS1-Extra firmware i'm using.

Charmant In The Build

Tuesday, October 18, 2011

Check and Recheck

The parts for the overhaul just arrived yesterday after dad helped me bought them in Jakarta. I can't even find a gasket kit here! These are the part numbers for future reference.
Piston ring set is for .50 overbore. Also it's confirmed that high-comp rings will fit 8.9 4A-GZE pistons. The ring gap from the top to bottom is 1.2, 1.5 and 2.8mm. Meanwhile bigports should be 1.5-1.5-2.8 and 20 valves should be 1.2-1.5-3.0. Don't quote me on this. I bought a thermostat just to see if my engine likes it as i wasn't using one and it took forever to warm-up.

Aisin makes OEM pumps so even if the box doesn't say "Toyota", it's all good.

On a side note, do your research before you order anything online. Check and recheck your order before you make the payment. Don't expect the seller to know what he's selling. Weeks ago, I asked specifically to the seller for a "4A-GE 16v oil filter sandwich adapter". I refrained from checking myself the thread size on the oil filter although i know there are different sizes for different manufacturer. I got sent an M18x1.5 retaining nut and surprise.. surprise.. it didn't fit.

A simple Google search tells me that i should be getting a 3/4 UNF 16 thread size instead. Should've done it earlier. Since sending the adapter plate back would delay the overhaul progress, thanks to 3/4 UNF being a larger diameter than M18, the nut was rethreaded on a lathe to the correct size so now it fits.

Monday, October 17, 2011

Second Overhaul Update

Resleeving's done with nice cross-hatch finish, bore size matched to the 4A-GZE slugs.

By guessing the actual turbo position, the turbo was clocked and the provisions for locating the wastegate actuator were made. A new bolt hole was threaded and a simple bridging plate was cut so that both holes on the actuator flange can be used. Hope the actuator won't hit the cam cover.

Since i bought the wrong oil line kit, only some parts can be used (take note: T3/T4 oil line kit is useless for TD04). The supposedly turbo drain flange is now positioned on the oil pan instead and a new drain pipe for the turbo was fabricated. The nuts for the flange bolts were welded inside. This position should be above the oil level, no?

Whether it will leak oil or not, we shall see later.

Mazda 13B vs Toyota Smallport 4A-GE Injector

Left is stock Smallport's. Right is 13B's which is usually found in 2nd Gen RX7. Length-wise, they look like a direct swap.

A bit difficult to see but judging from the spray tip shown below, smallport has split stream while 13B has single spray pattern. Let's see if this affects idle speed once i swapped the 13B's in.

Different plugs. Definitely will have to change the connectors so it's not a direct swap afterall.

13B has longer spray tip. I have no idea if this will interfere with air flow inside the manifold but it won't be too worried about that.

The 13B injector shown is part number 195500-1350. This website here says red square plug with the same part number like mine should be low impedance.. but mine is definitely high, confirmed with ohm-meter. Yet another proof that you can't fully trust the interwebs, including this post.