PDA

View Full Version : ECU info/calculations



Hiten
11-05-2008, 01:55 AM
I had started a project earlier in the year on devleoping an ecu for the FSAE race car and have managed to get up to simulation tests on the software. I am now at the stage where i need info for my thesis write up and have reached a point where i am having some trouble finding out some information.

I am aware that most aftermarket ecu's come with basic start up maps for the particular engine its being used on and im able to get the fuel/ignition maps, but as for the theory side of my project i have to some how justify the values in the maps.

What i would like to find out is if there is anyone who has any info on how to roughly calculate the fuel injector pulse width from known variables such as rpm, throttle position, injector size, compression ratio,etc?

Mikey Antonakakis
11-05-2008, 02:50 AM
Okay so from those variables you listed, you really only need to know the injector size. And the only other thing you need to know is volumetric efficiency. Okay, so it's a little more complicated than that, because VE is going to be a function of RPM and throttle. BUT there is a useful bit of data that will really help you to predict VE. And that is your intake manifold pressure, which is measured with a MAP sensor. Because PV=nRT, and V, R, and T pretty much stay the same, n and P are pretty much proportional. Okay, so I'm not exactly sure of the extent of temperature changes, or how to really even incorporate temperature, but for now, I'm going to ignore it.

Okay so if you can measure your MAP, you can create a decent base fuel and ignition map. Remember that pressure is proportional to the mass of air you have? That's an important thing to know, because now pressure and injector pulse width can be about proportional. So that takes care of pulse width vs load.

Now for PW vs RPM, you have to make some fairly simple predictions. First, what does a torque curve from a stock motor look like (VE is proportional to torque, too!!)? Secondly, how is your intake and exhaust set up going to be different than the stock bike, namely, where will your resonances occur? Add several percent in VE there. Exactly what percent, I don't know. Someone else might, though. If you can figure out where you are going to have anti-resonances, incorporate those, too. Then find the choked flow of your restrictor. This will correspond to the flow at a certain RPM assuming a VE of 1. After that point, your VE will taper downwards. I think on most FSAE 4-cylinders, this occurs between 7500 and 9000 RPM. So now you should have a general shape for a full-throttle VE curve. Part-throttle changes proportionally to MAP. So at full throttle, there should be certain RPMs where your MAP is less than atmospheric. If my theory is correct in any way, MAP should have a proportional relationship to torque.

Okay so if you know how much fuel you need, it is trivial to convert to pulse width. Given that a constant AFR is desired, once you calculate the mass of air flowing into the engine, you can calculate the mass of fuel needed based on the AFR you desire. The mass of air per cycle is a simple conversion from displacement times VE times density. Once you have the air mass, you simply divide by your AFR to figure out the required mass of fuel needed. I'm making an assumption that when an injector is rated "x" pounds/hr, that means that at a specific fuel pressure you will flow x pounds of fuel if left open for one hour. So for your final conversion, your pulse width is the injector rating times fuel mass required. So to put it all together, let's work backwards. PW=injector rating times fuel mass, or IR*Air mass/AFR... which is IR*VE*displacement*density/AFR. If you don't want to use VE, use MAP in atmospheres. It's a pretty simple calculation if you choose your variables correctly.
The only flaw I can think of in this is that MAP is not exactly proportional to VE which is not exactly proportional to air mass. But as long as it is in the ballpark, you will have a GREAT base fuel map. Throw the sucker on a dyno or drive it around and log AFR vs load and RPM, and you'll have a decent map in no time.

Ignition maps are something I know less about. What I've read is this: The basic principles are to determine a maximum advance for your engine and work backwards from there with heuristics ('rules of thumb'):

older engines (1960s up to 1990 or so) with two valves - max advance = 36?
newer two-valve engines - max advance = 30?
three or four valve engines - max advance = 26?
then adjust for bore size:
under 3.5" (89mm) - subtract 3?
between 3.5" and 4.000" (101.6mm) - no adjustment
over 4.001" (+101.6mm) - add 3?
then adjust for the fuel:
regular - subtract 2?
mid-grade - subtract 1?
premium - no adjustment
That gives us a maximum advance figure. It you have an aftermarket combination with a good squish area and optimized quench, subtract another 2?. If you have a flathead, add 3? or 4? or more.
We will use this to fill in the table at 100 kPa from 3000 rpm to the redline.

From idle to 3000 rpm, we want the advance (@100kPa) to increase fairly linearly from the idle advance to the maximum advance. idle advance is really a matter of tuning, but assume 8? to 16? in most cases, with stock engines being on the lower end, and 'hotter' engines being on the upper end.

So if we have a hot engine with 36? maximum advance and 16? idle advance (at 800rpm), the spark table might look like this for 100kPa:

100 16? 16? 18? 24? 28? 36?

rpm 600 800 1000 1500 2000 3000
Below 100 kPa, we add 0.3? per 1 kPa drop. So for example, if our total spark at 100kPa and 4000 rpm was 36?, the advance at 50 kPa would be:
36? + 0.3? x (100-50) = 51?

and the advance at 45 kPa and 800 rpm would be:

16? + 0.3? x (100-45) = 32.5?

However all of these would need to be tuned, and it often helps idle stability to limit the advance at idle to under 20?.

Finally, for boosted engines, you subtract 0.3? of advance for every kPa above 100 (it's not a coincidence that this is the same factor as for the 'vacuum' adjustments). Because 101.3kPa=~14.7psi, this works out to ~2? per pound of boost. It is often the case that you want to limit the retard under boost as well, typically so that it takes out no more than about ½ of the maximum advance at 100 kPa.

None of these will give you the 'right' values for your engine though, and like the VE table calculator, are just a relatively safe starting point. They should be somewhat closer than starting with an empty table, though!

I'm getting tired now, but I'm sure you can figure out how to relate VE/MAP and rpm to ignition timing, although things will be a little different for a motorcycle, for instance, you can get away with a lot more maximum advance. That said though, having a less than perfect ignition map is less devastating than having a less than perfect fuel map. Yes, timing plays a role in AFR, but it's essential to have a car than can reach the upper ends of the map. As long as you aren't burning pistons with too much advance, you're fine. You can tweak timing after you tweak fuel. Case in point, last year I had our ignition map UPSIDEDOWN, with timing increasing with load. The car was very responsive to throttle input (read, it was like an on-off switch), and guzzled down gas, but it still ran like a champ. A few weeks ago I realized my mistake and flipped the map the way it is supposed to be, and at idle at least, I was able to cut the fuel consumption in half. Basically, you need a good fuel map to get a good ignition map, and then you'll need to tweak the fuel map as you change timing. But following those rules in the ignition guidelines above should give you a decent enough base map to get a good fuel map.

Hope this helped.

Mikey Antonakakis
11-05-2008, 02:53 AM
Also, the stuff in italics, I stole from megamanual.com. Go there, click the "configuring megasquirtII" link on the left side, and read to your heart's content. A lot of the info is product-specific, but there is a lot of general info about tuning. There is also a lot of good info in the other links on the left hand side.

crzycav86
11-05-2008, 07:41 AM
I made this spreadsheet a month ago on another forum. It might help with this discussion.

http://www.houston240sx.com/forums/attachment.php?attac...id=6064&d=1225898059 (http://www.houston240sx.com/forums/attachment.php?attachmentid=6064&d=1225898059)

What you do is enter the engine and fuel parameters, and fill out the VE table and desired AFR table. On the second page, it spits out the fuel map in terms of pulsewidth and duty cycle. Red texts are outputs and should not be modified.

This spreadsheet was derived using the method pretty much described by Mikey Antonakakis. (Using the ideal gas law to find air mass, then using the desired AFR to convert to fuel injector pulsewidth and duty cycle). Most ecu's will assume a constant temperature for the theoretical pulsewidth maps, which need to be multiplied by the temperature compensation factor to get the correct fuel flow. The output maps on the second page were derived using a constant temperature of 100*F. (And you can see that the temp compensation factor is 1 at 100*F) The temperature compensation table should follow the ideal gas law, but at higher temperatures you may want to deviate from it to provide extra fuel for knock resistance.

The VE table should be found by tuning on the dyno, but there are general trends. VE vs RPM should be roughly proportional to the torque vs RPM curve. And I'm pretty sure the VE should decrease as the MAP pressure increases. (because back-pressure increases).

Hope that helps. A good text to read would be Heywood's I.C.E. fundamentals.

crzycav86
11-05-2008, 07:52 AM
As for timing, it's not really feasible to get accurate timing predictions without OEM-level simulation equipment. But again, there are general trends.. Timing will be roughly inversely proportional to the VE table, but should also be advanced from that with increasing RPM.

Wesley
11-05-2008, 09:03 AM
Or find a BSFC curve for the engine, and poof, you have your data right there.

Hiten
11-06-2008, 01:47 AM
Many thanks to all for your input! Definitely much appreciated...