Converting to a MAF: Busting Some Myths
Abstract
One of the most heavily investigated modifications in the E30 enthusiast community is a conversion from the stock "Barn-Door" volume air flow meter to a more modern Mass Air Flow (MAF) meter. There are numerous kits available, but they require the original control software to be reprogrammed, or involve very expensive signal conditioning equipment and countless hours on a dynamometer. It is commonly thought that this will yield power gains as most people intuitively think that the flapper-door in the stock meter poses a restriction. In reality, the door poses little restriction at all; the spring that seemingly "fights" the incoming air does very very little to impede flow. The important part is the crossectional flow area through the meter. In the case of the M42 motor, the sensor is sized perfectly, and no power can be gained from converting from one sensor to the other. The M20 could benefit slightly as its meter is undersized, hence why the M30 "Big Six" meter conversion is widely popular. The following article details the development of my own MAF conversion and some of the difficulties involved.
Theory
The two sensors work on fundamentally different principles, and their outputs are of different natures as well. The stock meter is a multiple input, multiple output system; it senses volumetric flow as well as ambient air temperature, and has a separate output for each which the engine control unit (ECU) reads. The MAF meter has multiple inputs, and a single output; it can sense the mass flow rate of the incoming air, the temperature and the pressure of the air. Due to the principle on which it operates, it can compensate for these factors very easily without adding excessive complexity. This leaves a single output to contend with; the mass flow rate of air entering the motor in any ambient condition. While this is convenient, it also requires additional work to interface it with the ECU.
Since the ECU requires a volumetric flow rate input, and an ambient air temperature input, the MAF cannot simply be hooked up and utilized. This is on top of the fact that the two sensors measure different variables, and their transfer functions differ far too much to be interchangeable under any conditions. To account for this, the transfer function of the stock meter's thermistor had to be determined, and a suitable "dummy resistor" selected to "tell" the ECU that it was a certain ambient temperature. Since the MAF accounts for temperature changes internally, it is not necessary to have the ECU know the actual temperature. Once a suitable temperature was chosen, the ideal gas law was used to create a conversion map between the two sensors' transfer functions for that temperature.
The Beginning
The very first MAF conversion was developed by a fellow engineering student and myself as our senior Mechanical Engineering project in college. A Ford Mustang MAF sensor was selected due to its availability and low price. To determine the transfer function for the stock air flow meter, a flow bench was used in an engineering laboratory. From there, the MAF's transfer function was determined using the stock air meter, ambient temperature, ambient air pressure and the ideal gas law. A prototype was bread-boarded and debugged. Thereafter, a test prototype was soldered together for an intial trial.
Once it was determined that the conversion map was properly calibrated, printed circuit boards (PCB's) were designed and built. The design was cleaned up as much as possible and installed to be displayed at the Senior Design show. Due to engine resonance, there was a small "hiccup" in the full-throttle performance at 4000RPM. The motor would run lean and cause a disturbance in acceleration. This issue, along with the cumbersome fitment of the Ford sensor, led to a completely new converter design using a different sensor after the Senior Design course was over.
The Second Generation
For the second design, calibration was performed after-hours during my employment at Cisco Systems (which was generous enough to let me use their wind tunnel for my own project). The new sensor fit the stock engine hardware much better, eliminating the need for clunky adapters and big ugly filter. The new converter was completely different as well. My original converter involved an EPROM chip that was used as a lookup table, which was a somewhat limited design (though effective), combined with a wide variety of other components. The new converter was run by a PIC microcontroller, and many of the external components could be eliminated. I experimented with using the Pulse-Width Modulation module with a second order passive filter to create an analog output, but ended up using a DAC chip instead. I developed the PIC-based converter in my free time after work, taught myself PIC Assembly and developed some efficient routines for performing the desired tasks while also checking for erroneous inputs.
When I had the new hardware and software fully debugged and bench-tested, I set out to install it on my car. Initial testing seemed promising. The car ran very smoothly, and throttle response was certainly improved versus the stock meter. There was a major problem though; if the car saw full-throttle in the 2200-3000RPM and idle-1500RPM ranges, the motor would cut out. Although these are not typically areas that one floors the throttle in, this was not acceptable from my standpoint. I fully intended to release the converter as a product to the enthusiast market, and an issue like this could mean lawsuits and a very bad reputation. So, the project suddenly became more complicated. My main hypothesis regarding this odd behavior was that induction track resonance was causing the MAF to give erroneous outputs. The MAF was physically coupled to the stock air filter box with some makeshift adapters at this point, which I suspected were not helping. Initially, I added an RC High-Pass filter to the converter's MAF signal input. This helped a little, but the problem was far from solved. I developed some simple MS Excel sheets to play with the RC filtering, and determined that I wanted a maximum signal delay of 50ms. I designed the filter around this, and found that it would provide a good deal of damping should there be any appreciable induction system resonance. I also played with the filter in PSpice to get a handle on the exact attenuation I would see in the problem range. An engine speed of 3000RPM coincides with intake pulses at 100Hz, which would be attenuated to 3.3% of its original amplitude with the selected filter. Trial and error experiments on the physical adapter hardware seemed far too tedious at this point. With my exposure to PIC devices, I decided that it would be best to design, program and build a simple data acquisition device.
Offspring of the MAF Converter
Designing a data acquisition unit was as big a project as the MAF converter, and easily had the potential to be far larger. I needed to be able to sample 4 analog signals at a minimum of 500 samples per second (SPS) each, and 750 SPS ideally. On top of this, I needed some way of actually collecting the data. Unfortunately, time would not permit me to make a VBasic application to capture the incoming data easily, so I resorted to using Wondows' Hyperterminal in text-capture mode. From there, the data was exported to MS Excel and manipulated there. The data acquisition unit was simple to design and was able to sample 800 times per second on each channel. Data was kicked out of the PIC at 19200 baud, with the code written by hand (for timing accuracy, and the PIC I was using had no onboard UART module). A MAX232 IC was used to convert the TTL-voltage signal form the PIC to the range required for RS232 communications. The design for this data acquisition module will be covered in a separate article on the site, but this is the gist of it.
Resonating With Problems (/bad pun)
The new logger was up and running, so it was time to go find out exactly what was happening when the motor was cutting out. The car was already outfitted with a Wide-Band Oxygen Sensor system from a previous project, and had a second analog output for me to program and read. The air-fuel ratio is the GREEN line, and is plotted on the right axis. All other variables are plotted on the left. Throttle position was logged and is BLUE. The MAF's output is the MAGENTA line, and the converter's output is ORANGE. The first two images show a full-throttle run from 2000RPM to 6500RPM. It should be immediately obvious where the problem was. Right in the area where I was having problems was the signature of a big resonance issue. I had already applied an RC filter to help with this, but due to the logarithmic output/sensitivity of the MAF, the lower peaks of the pulses caused problems; the sensor's sensitivity to low flow rates is greater than its sensitivity to higher ones, so the lower peaks were shifting the average flow rate too low. In short, the resonance was bringing the average flow rate reading down, and causing the ECU to run the motor lean. In the second plot, you can see that each individual intake pulse was being clearly resolved! I found this to be quite interesting.
My next course of action was to look at the design on the M44 motor which utilizes a MAF meter as original equipment. The motor is similar enough to the M42 that I felt I could learn from its design. The MAF in that application had a large velocity stack in front if it, as opposed to my square-to-round transition and short length for the air flow to stabilize. I constructed a crude velocity stack from some matching-diameter acrylic tubing (from TAP Plastics) and put the oversized conical air filter over it. The first image shows the new result. The car hesitated slightly with the velocity stack, but the air-fuel ratio was not going dangerously lean anymore, and the resonance seemed to be greatly diminished. From here, I developed a new corrected curve and fitted a (VERY) high-order polynomial curve to the modified transfer function. This was necessary because it would make filling in the new look-up-table (LUT) values much easier than using an arm-full of piecewise linear functions. One of the early experimental curves can be seen in the last image. After the transfer function was optimized, the final log can be seen in the second image. The severity of the kink in the orange line was greatly reduced at full-throttle, and the air-fuel ratio (AFR) stayed close to the stock value. The third image shows the AFR across the engine speed range with stock equipment (taken on a dynamometer). Looking at the dynamometer plot in the fourth image shows that the torque curve dips right in the problem region as well, even in stock configuration. This is due to the harmonic-resonance in the induction track at that engine speed.
Some Results and the Finishing Touches
With the converter working properly, I went out for some dynamometer testing. To my surprise, the conversion did not net the M42 one single horsepower. Throttle response was improved, as was idle stability, but the lack of power gain killed the converter's viability as a product in the automotive aftermarket. I continued working on it however, as I enjoyed having the newer sensor on the car, I was enjoying continually learning new things and my original meter was beginning to have its moving parts wear out. The MAF conversion was actually cheaper than buying a new or refurbished stock unit anyway! My next goal was to have the sensor fit the factory air box so that I would not have to remove it for smog checks (a large cone filter would never pass the visual inspection). The car should perform BETTER on the smog test with this sensor as the original one on the car was worn out and causing a rich-running condition. I used a much less worn-out stock meter to calibrate the converter from of course; spare parts are my middle name! Anyway, I cut a round hole in the air box where the velocity stack would go through, and made an aluminum prototype flange. The acrylic prototype velocity stack was tested with the flange, and the car performed admirably, or at least without any "hiccups."
Next I made a duplicate flange from some mild steel. Initially it was because I planned to weld in some 2.75" OD tubing, and I am far better at welding steel than I am at welding aluminum. Unfortunately, 2.75" OD steel tubing is all but non-existant. So, I opted to epoxy in an acrylic velocity stack (since it is the ONLY tubing I could find that came in 2.75" OD as a stock size), sand and paint it. A rotary table and center-finder were most useful in performing the larger hole cuts. A 2.75" hole saw would have caused the relatively thin steel plate to callapse under the force needed to cut the hole. Using a 0.25" end mill to make the cut sounded like it would work far better!
After the paint had a chance to dry, more sanding and more painting, the adapter was ready to roll. The MAF sensor housing was also modified slightly on the mill. The unnecessary mounting flange was removed, leaving the sensor looking like it actually belonged on the motor. There is nothing worse than having something look completely hokey after massive amounts of time are spent designing it. This project definitely needed to look good, especially since other enthusiasts would be seeing the motor!
Also of note is the provisions I took to make this into a marketable product. Although I did not complete much of what I had planned to do in that regard (due to the dynamometer results), I did manage to draw up an installation overview diagram for the system and some 3D CAD models of the hardware. Perhaps someday I will sell this as an OEM replacement alternative since the stock air meters are only getting more expensive, and harder to find at all. Hopefully this article was able to clear up some of the myths about the benefits of a MAF conversion, and highlight the few real benefits. It might also be apparent that the conversion is not for the faint of heart, and it requires a lot of electronic test equipment, patience and desire to learn. My recommendation is to leave the stock meter alone and get as much use from it as possible. The designers at BMW knew what they were doing! Please do not ask me for more detailed information regarding this project. The original design is half-owned by my project partner from college, and much of the newer information is the fruit of many days of toil on my part. The image of the transfer function for the converter with corrections is NOT for the Ford MAF meter, nor is it a final revision. Using it with ANY MAF sensor could lead to serious engine malfunctions, including holes in pistons. I apologize for not being able to make everything about this publicly available, but much of it is proprietary! Happy motoring everyone, the flapper-door meter under your hood really is not as evil as it is made out to be!
Version 2.5 - Additional Considerations
You may have noticied that the installation diagram included an ambient air temperature sensor. While the second converter design did not necessarily need this initially, the corrections made to the transfer function called for some compensation. Since the ambient air temperature could swing through a wide range, multiple correction curves had to be developed for various temperatures. Essentially, the "hump" you saw on the example transfer function needed to shift according to the ambient temperature. The motor always pulls air at the same volumetric rate at a given engine speed and throttle position, but the density can change due to temperature fluctuations. This effectively shifts where on the transfer function the converter is "working." Ambient temperatures had to be measured to shift the corrections to the proper place on the function. The final version could operate anywhere from -40 Fahrenheit to +140 Fahrenheit with a maximum error drift of 0.65%. No corrections were made for pressure/altitude changes, and none are planned in the future on this design.
DISCLAIMER: I take no responsibility (and thus I cannot be held responsible) for damages and/or injuries caused by attempting the procedures outlined on this site. The information provided is to be used at the reader's discretion and all necessary safety precautions requiring emplacement (mentioned or not) are the responsibility of the reader.




