Microsquirting the NC30, part #46: Tricky Tuning

Since the last post only got to the first tricky thing, here’s the sequel.

In addition to getting the air density right, the second tricky thing has been parametrizing the volumetric efficiency.

The Megasquirt engine controller can use different parametrizations of the VE. It always depends on the engine RPM, but there are several alternatives for the  second variable (usually referred to as “load” because it describes how much power the engine is producing):

  • Manifold pressure (MAP) is the most common variable. In general this works well for automobile engines that have a common intake manifold and a single throttle valve for the air entering the manifold. In those engines, there’s enough volume to get a fairly stable “average” pressure in the manifold that determines the density of the air the engine is ingesting. However, for motorcycles and other engines with “individual throttle bodies” (ITB), the volume behind each throttle butterfly is small and is only used by a single cylinder. This leads to a highly variable manifold pressure (see the post on idle tuning) that is difficult to use as an indicator of engine load.
  • The throttle position sensor (TPS) is sometimes used in the situations where it’s difficult to get an accurate MAP reading. I don’t have a lot of experience with this but my impression is that it works fairly well at high throttle openings but with the throttle almost closed small changes in throttle and RPM can have drastic changes in the VE and it’s difficult to get an accurate mapping of the volumetric efficiency.
  • To overcome the problems with these two methods, they’ve added the “ITB mode”, which is essentially a combination of the two: at low throttles and manifold pressures, it uses the manifold pressure; at high throttle and MAP, it uses the throttle position. The switch happens when the MAP is greater than 90% of barometric pressure and the throttle position is higher than an RPM-dependent value. Because this method does this blending inside the ECU, the procedure for tuning the VE table is the same as for the other ones, it’s just the load value that’s calculated in a different way.

Because my setup combines the measurements of the pressure in all four manifolds and times the measurement to when the intake valve closes, I thought I had a good MAP value and embarked on tuning using the MAP value as the load variable in the VE table. (Actually, the two VE tables, since I have one table for the front and one for the rear cylinders, because they actually have a quite different VE.)

This worked well at first, but as my tuning converged and I began to be able to run at full throttle without going horribly lean, I noticed that at as the throttle was opened beyond the halfway position, the manifold pressure no longer changed, but the air/fuel ratio did.

This is apparently a fairly normal effect on engines with individual throttle bodies. Because my setup uses the minimum of all four intakes and there are strong pressure pulses in the intake, the manifold pressure reading will essentially never get to ambient pressure once the engine RPM is high enough that this becomes important. Essentially, the intake is like a pipe in an organ. While there is no standing wave, the pressure pulses created when the intake valve opens and closes will travel up the intake and reflect off the end of the runner in the airbox. (Because this is a reflection off an open medium, the reflected wave will also be out of phase, i.e., a high-pressure wave will be reflected as a low-pressure wave.)

The intake is about 0.3m in length, so it takes the pressure wave about 1.8ms to do the round trip. At the 14,500 redline, that’s 150 crank degrees, so always much less than an engine cycle. So these waves bounce back and forth many times during an engine cycle.

Anyway, the end result of this is that the manifold pressure sensor never really reads ambient pressure, even with the throttle fully open, especially since it’s using the minimum value within the sample interval. The amount of air that gets into the cylinders, though, does change. This means the volumetric efficiency can not just be dependent on the measured MAP and RPM.

Like I said, this is not some new phenomenon, and people have solved this before by adding a secondary, throttle position-based, load table. The VE is then determined by multiplying the values in the two tables, and this makes it possible to add throttle-dependent fueling at high throttle values when the MAP value no longer responds.

The problem with this approach is that I’m already using two tables, for the front and rear cylinders. The Microsquirt can use two separate tables for separate injectors, or two tables that are multiplied together. It does not have the capability to do both at the same time. The newer Megasquirt-3 based ECUs can do this, but that’s not really an option.

The other option that is available are the “trim tables”, that make it possible to trim fueling to individual outputs if different cylinders require different amounts of fuel. This sounds exactly like my situation, but the problem is that these tables can only adjust fueling +/- 12% from the “master” table, and in some conditions my current tables differ by more than 25%. This means the trim tables won’t have enough authority to handle the full difference, but it would be close so I decided it was worth a shot.

The first thing I did was to convert my two separate VE tables into one average VE table and two trim tables. I coded up some python code to read the table dumps from TunerStudio and output the new tables. This appears to have worked well, because there was no noticeable difference when running with the average VE + trim tables compared to the two independent VE tables.

At that point I could start playing with the throttle-based correction. To do this, I started with all 100% everywhere, then plotted the air/fuel ratio as a function of RPM and throttle position. Where the data showed the engine ran lean, I increased the values, up to about 120% in the most lean spots. While this was somewhat painful, because the “auto tune” function doesn’t understand the dual table calculation making manual tweaking necessary, it totally worked!

While there were still a few spots where it was a bit leaner than ideal, the engine now had reasonable fueling in all conditions from cruise to wide open throttle at redline. Unfortunately that’s where things stood when I left the ignition on and ran down the Ballistic lithium battery. Lithium-ion batteries are very sensitive to overdischarge and in this case it was dead. Rather than ordering a new hundred-dollar battery I decided to attempt to just replace the cells. But that turned out to be a rather long story that will have to wait for a later time.

 

2 Comments

  1. Patrik, there’s a lot of information and change happening in this post (#46).

    I’m watching and following your progress with the NC30 because I know my currently implemented solution in my GSF400 (pure Speed Density with one of Don MacPhail’s QuadraMAP units desperately trying to make sense out of the high-RPM intake system chaos) isn’t truly optimized or anything close to polished/elegant, but I’m pretty sure that’s where your project is headed so I’m keeping up with what you’re doing. When my summer tinkering season arrives I want to make the effort to bring my GSF up to a better, more completed/correct standard and your work definitely sets the bar for that and points the way forward.

    I guess when I was first putting the GSF400 project together I was wishful-thinking that the QuadraMAP could be an across-the-board, semi-magical solution. Watching you work methodically through issues with the NC30 tells me what I suspected but didn’t want to admit: That in the end, even with the advancement offered by the QuadraMAP, a high-revving multi-throttle body engine with 100cc cylinders can’t be managed properly end-to-end in speed density. I’ll be reading/studying up on how to properly implement ITB mode and may come to you with a questions or begging to see your MSQ for reference.

    Now that you’ve realized ITB mode is the way to go, what is your overall opinion of the QuadraMAP? Is it a good item or not with its now more limited applicability within your project? Are you a big fan of the item? Would you say that it’s a good thing to have because it does a very good job in the idle to mid-range portion of the bike’s operating envelope? Or, has the implementation of ITB mode rendered the QuadraMAP superfluous?

    At least I’m only trying to manage a simple Inline-4 instead of your challenging V-4 situation.

    Lead On…

    • Hey Greg,
      Yeah, I’m not sure about the QuadraMap. I think it’s still probably useful, but I had hoped that you could use the “timed minimum” sampling method to get the MAP reading at the time the valve closed, but because of this intake resonance at high RPM it doesn’t seem like measuring at a fixed crank angle is going to be very meaningful. It certainly does give a much more reliable MAP value at low RPM, and maybe it just works for something like a low-revving V-twin, but once you get to 10,000 RPM and above dynamic effects start being important.

Leave a Reply

Your email address will not be published. Required fields are marked *