Goin' Digital

Analog Guy in a Digital Age

One of the complexities of this project is that the donor car, a 1992 Miata, was built in the very early digital days. It had electronic fuel injection, electronic ignition, and an engine control computer (ECU), but very primitive versions of them. ECUs and the sensors that feed them information have become much more sophisticated since 1992. I could have built my project car with all of the original electronics but I chose to wire the car from scratch and use a modern ECU because a) using modern sensors eliminates the need for about 12 cubic yards of air intake ducting in the engine bay, b) it seemed like wiring the car myself could actually be less of a hassle than reworking the original wiring harness to remove all the unnecessary stuff (there were a lot of electric features on the original Miata that aren't needed for an open top roadster). 

Even more paleolithic than the donor car is the builder; a 1965 model. When I worked on cars as a teenager, they had mechanical distributors and carburetors. Until recently, even the relatively antiquated electronics of a 1992 Miata would have been challenging for me.

So getting involved in ECU programming has been a steep learning curve. Fortunately Shane the ECU Guru, a friend of Paul the Actual Mechanic who Actually Knows What He's Doing, has been preposterously generous with his time and expertise and guided me through this process. Some people are born to teach - there have been some parts of the ECU setup where I have read a particular section in the manuals two or three times over without understanding it, and Shane shoots me an email that makes it suddenly and miraculously clear.

If you're familiar with modern engine control, the following will be of no interest whatsoever. But to a guy like me raised in an analog world, it's fascinating.


Above are two different displays of the same data. This is the ignition table. Back in the Olden Days, distributors had a vacuum advance mechanism that advanced the ignition timing based on the pressure in the intake system. This enhanced power when needed, while avoiding damaging pinging or knocking caused by too much advance. The modern version, above, allows adjustment of the ignition timing for specific combinations of load and RPM - same basic function as vacuum advance, but with more granular control, and governed by two variables instead of one. How to set the values for each of the cells in the above right table is tricky. You can manually enter or adjust individual values, and the tuner software can fill in the other values by interpolation. There's also a smoothing function, which adjusts any outlier values. The increments of RPM (horizontal) and load (vertical) are also set by the user. If I'd tried to work my way through this process by myself it would have taken me months - Shane's help has been invaluable here.

The engine tuning software (TunerStudio in this case) is used to set these values and analyze the data collected when the engine is running. There is an auto-tune function that allows the software to make adjustments, but from what I gather this only gets you close to a good tune; not quite there. Another thing I hear from everywhere is that making max power at full throttle is actually the easiest part - the real challenge is to make the engine well-behaved in all conditions. An example: it seems like half of the questions on the engine tuning forums are people's frustrations getting the engine to idle reliably when hot or cold. 

Yay! More Troubleshooting! My Favorite!

So after burning the current tune to my ECU I moved to the next step in the setup/startup procedure: testing the injectors. Plug laptop into ECU, go into test mode, test injectors, hear click from injectors, done. 

Then it was test coils, which was... less successful. Coils weren't working at all. The early Miata ignition system is a little archaic with some extra bits and pieces that modern cars don't have. Also not helpful; the OEM Mazda ignition schematics aren't drawn for clarity and don't clearly correlate to my modern ECU's wiring diagram. More helpfully still, my donor car's wiring does not match the wire color codes in the 1992 Miata shop manual. And to top it off I got a piece of misinformation from the ECU company's tech support. The upshot of all this is that I had the ignition wired incorrectly.


Above: astonishingly, I was able to de-pin the igniter and coil connectors without destroying them.


So now the ignition is re-wired, hopefully correctly, and ready to try the coil test again.

Goin' Back to Analog

In the midst of all these digital shennanigans, I discovered a distinctly analog problem: a fuel tank leak. I did test the tank when I first made it, but there was a tiny pinhole leak that I didn't find. Only when I filled the tank with fuel and let it sit for a couple of days did it become apparent there was a very small, very slow leak. When TIG welding, and especially aluminum, it is important at the end of your weld to back off the heat slowly and leave the torch in place while the post-flow inert gas continues to shield the hot area as it cools. If you get impatient, it causes a dimple in the middle of the weld. This became obvious when my lovely and long suffering wife helped me fill the tank with colored water and watch for leaks on all the joints. The dimple was very small, but it was enough to allow fuel to leak out.


Above: test weld. Until this problem came up I had only welded steel since getting my own TIG machine, so before re-welding the dimple I did a test weld on aluminum scrap to make sure my settings were correct. Comparing the test piece above to the welds on the fuel tank made it clear that my TIG skills have improved since I welded the tank. The above sample still isn't up to a professional standard, but it's dramatically better than the welding on the fuel tank.

I wrestled with the question whether to fix the old tank or order new metal and make a new one. Naturally I chose the most complicated option, which is to do both. Weld over the leaks so I have a tank for now, to get the engine started and initially tuned. Then there will be the lengthy bodywork and painting process, during which I won't need a fuel tank. I decided I can use that time interval to weld up the new tank at leisure. The decider here was thinking thusly: if a nagging voice tells me I should re-do the fuel tank, I should probably listen to that voice.

When I went to SendCutSend to order the new sheet metal, some of the old CAD files from the first fuel tank parts order didn't make friends with SCS's latest system upgrades. So there was more debugging to do. Did I mention debugging is my favorite? One problem Julie the SCS Tech Support Guru never did solve was why the part comprising the back and bottom of the tank made the 3d previewer go haywire. It kept generating a shape that looked correct on one side, but totally bizarre on the other side. This led to the following interchange:


It's always fun when you lay out your own quirky brand of humor and someone picks up and runs with it. I love SendCutSend, not just because it's a super handy service, but because their company culture is so agreeable to people with my kind of crazy.

Another Non-Digital Distraction
(that's sort of digital, actually)

It's not really period correct, but I like how on new Aston Martins the badge is recessed in to the body work.


No, they didn't do them like this in the 1950s. I'm not sure this version of the logo even existed in the 1950s. But having a recess for the badge has a more finished appearance to me. I do think it's odd that the profile of the recess doesn't include the bottom and top notches, but still.


To make a recess in fiberglass, you first have to make a reverse recess. Anti-recess. Bulgey-outy-thing. Above left: Solidworks designed bulgey-outy-thing. Above right: bonnet lid and boot lid versions, 3d printed, sanded, primed, sanded, painted. The one for the bonnet is a little bit bigger and it's on a slightly curved surface. I'll need to cut holes in the existing bodywork, fit these in place, and then lay new fiberglass into the space. If all goes well, when I remove these pieces, I'll have two recesses in the bodywork just the right size to fit my Aston badges. It will probably be a couple of months before I get to this stage of bodywork but it's a good idea to work ahead because 3d printing projects take a while. You don't see your mistakes until 10 or 12 hours after you make them. I'll need similar bits for a US-sized license plate and for the fuel filler cap recess.

Second Time's the Charm

The de-bugs noted above weren't quite enough to pass the coil test - I had also wired the ignition relay incorrectly. 


So it was nice to see these little sparks on the second try of the coil test.
I think I need go back through the other relays and make sure I didn't make the same cross-eyed mistake when I wired the headlight, fog light, and radiator fan relays.


(Hopefully) the Last Bug

After what seems like an eternity on this one job, I wrapped up what I hope will be the final stage of electrics de-bugging.  After passing the coil test, I promptly failed the cam/crank sensor test. There was a lot going on in this part of the wiring harness and I was never entirely satisfied with it, so I dissected it and found at least one problem. When used with a stock Miata cam angle sensor the Microsquirt ECU wants resistors wired in series with the 5v sensor reference feeds. First time through, I wired these into the loom which was neither secure nor elegant. This time I decided to make the world's smallest turret board (above left). Just having those three turrets to wire onto simplified matters greatly. Then I 3d printed a case for the turret board (above middle) and re-wired this part of the harness (above right). 
Next I need to hook up my laptop, power up the car, and see if the CAS problem is truly fixed. At the moment of typing this I am dawdling in the house, avoiding the pending re-test for dread of failure.

Test Passed... I Think (?)


So this much is progress at least: the formerly red box screaming "RPM NOT SYNCED" has now changed to a pleasant green color, and the text is more pleasant too. The lost synch counter is sitting at zero, which is good (you don't want an increasing number of lost synch incidents).


Less certain is the above data log screen, about 5% of which I understand. At least the 5% I do understand looks good.
I am very much a product of a bygone analog era, and this whole ECU sub-project has been like taking up permanent residence in a vast desert of my own ignorance with a very steep learning curve. 
The next step in the startup procedure is to set the timing... and the next step after that is "Start the Engine and Begin Tuning."

And... Back to Troubleshooting

So when I said my car had passed the fuel injector test, what I meant was "when I run the test I hear clicking sounds from the injector rail like I'm supposed to." But the actual fuel-delivery part was not happening. 
Sir John of the Imperial British Order of Kit Car Knights Templar helpfully pointed out that the most common mistake is reversing the direction of the fuel flow through the injector rail - which indeed, I had done. The way it works is counterintuitive, unless you understand how the fuel pressure regulator works, which I now do. This was not a super difficult fix, other than it prompted me to re-do the rubber fuel lines because they're really stubborn and don't want to fit over the hard line flanges. In the interim I've learned two tricks that make it just difficult instead of impossible: 1) use silicone grease on the outside of the hard line (cautiously to avoid getting silicone into the fuel lines) and 2) soak the end of the hose in boiling water to soften the hose before cramming it on to the hard lines. The factory hard line flanges actually weren't too bad, but my way of putting flanges on my DIY hard lines was to solder on brass compression fittings - which are a bit thicker than strictly necessary. 

And, along the way, I also learned that not all of my injectors were clicking as desired. I did a rather elaborate cleaning procedure on these back in the 'put all the engine parts together' phase ages ago - but it turns out this was about 25% successful. I tried cleaning the injectors in the ultrasonic cleaner without joy. Fortunately I'd foreseen that I might need new injectors so I took a gamble on a cheap Amazon injector set of mixed repute. Which, probably fortunately, didn't fit. There don't seem to be a lot of mid-priced options for Miata injectors. Used OEM... which already failed for me. Cheap aftermarket injectors... which already failed for me. Or OEM Mazda injectors - which are upwards of $300. Or hyperfancy NASA-certified platinum plated moon rock injectors.
Above: hyperfancy NASA-certified platinum plated moon rock injectors; one of the brands that Shane the ECU Guru sells. Shane has been giving me a lot of free advice lately and I've been looking for an excuse to pay him for something, so this fit both needs. These are actually not a great deal more expensive than OEM Mazda injectors and are objectively better - albeit in ways I probably don't need, unless I decide to boost this engine some day, which seems unlikely. But in addition to throwing a modicum of actual business at the ever-helpful Shane, these do have the real advantage that they come with 'characterization data.' Upshot: instead of plugging nominal/expected values for the OEM injectors in to the ECU, then adjusting by trial and error, I can give the ECU the actual measured behavior of these injectors from the start. Paying a little more to eliminate some variables is probably a good value.




Comments