Results 1 to 3 of 3
  1. #1
    King Dumbass McCloudsZJ's Avatar
    Join Date
    Nov 2012
    Location
    Roanoke, VA
    Posts
    2,048
    Rep Power
    105

    EFI Tuning Calculator Thingy

    Iíve decided to try this SCT tuning voodoo, however, Iím pretty f*cking stupid when it comes to these things, soÖ Iím trying to write a program to do all the thinking for me. The end goal is a stand-alone executable that will generate injector pulse width, fuel tables, spark tables, enrichment parameters, VE topographies, etc etc etc for an ideal hardware (engine and shit?) configuration. Load those tuning parameters, datalog the results, and then adjust a series of feedback gains and refine the tune until itís perfect.

    The executable is still in its infancy, but Iím also doing a ďdumbed downĒ version in VBA that uses Excel to do all the heavy lifting to verify the math stuff and make sure my documentation is straight. PRP is still in the mail, so I havenít even had the actual software in front of me. A lot of what I have is reverse-engineered Megasquirt logic and a lot of ICE theory.

    A lot of the fundamentals of this is borrowed from the algorithms page on DIY EFI, a now-defunct site dedicated to building and programming GM ECMs from scratch. They word the explanations much more better-er than I can. This is the general ideaÖ Iím looking for feedback onmy methodology. Academically sound? Practically sound? Stupid as f*ck? Give up and go carbíd?

    PW=0.67(InjTurnOn + BattComp) + AccPw +(ReqdFuel/InjFlowRate)

    Where: PW = Fuel Injector Pulsewidth in microseconds. InjTurnOn = Time (in microseconds) for injector to open fully when 12 volts is applied. Typical value is 1.5 ms. User-defined. BattComp = Compensation (+ or - microseconds) to turn-on time for fact that battery voltage may not be exactly 12 volts. 0.67 = Factor to account for the fact that the average fuel flow rate is only ~1/3 the max rate during turn-on time. The 1/3 factor comes from F=Ma applied to a solenoid, and assuming flow is proportional to the opening of the solenoid:

    TurnOn + (ReqdFuel-0.33(IFR)TurnOn)/IFR = 0.67(TurnOn) + ReqdFuel/IFR

    AccPw = Temporary extension of pulsewidth (in microseconds) during acceleration. User-defined. May be left as 0.0, as there is also an acceleration enrichment term in ReqdFuel, which is a function of throttle rate. InjFlowRate (IFR) = Injector flow rate at operating pressure (lbs/microsecond). User input. ReqdFuel = Total fuel required (pounds) for a particular cylinder firing:

    ReqdFuel = MassAirFa(GammaEnrich/100)*(1+ PmFuel/100)

    PmFuel = a +/- integer incremented/decremented by the end user. Each increment represents a 1 percent increase/decrease in the fuel/air ratio. Havenít played with this in SCT yet, but I know it exists, so the program accounts for it. MassAirFa = Mass air (pounds per cylinder firing) for desired fuel/air ratio, also equal to the mass fuel required (exclusive of special enrichments):

    MassAirFa = AirDen(CID/1728)(1/14.7(NCyl))(MAP/MAP(WOT))(VE/(AirFuel/14.7))

    Where air density (in lbs/ft^3) is given by:

    AirDen=0.039157(BaroPress-31.0)/((MatTemp/10)+459.7)

    with BaroPress = barometric pressure in KPa * 10 (from sensor), 31 = 3.1 Kpa correction for vapor pressure, assuming a humidity of 75 percent at 85 degrees F temperature. This is arbitrary since we do not sense humidity, but should be better than assuming 0 percent relative humidity in most cases. MatTemp is the intake manifold air temperature in degrees F * 10 (from sensor). Mass Air Coefficient, which is a subset of the MassAirFa equation, is given by:

    VeafCorr = VE(MAP, RPM)/(AirFuel/14.7)

    Ideally this entire table should be values at or below 1.0 if youíre naturally aspirated.
    This is where I started to get away from the work on DIY EFI. Itís great, but the Megasquirt VE(MAP,RPM) calculations are a more accurate model. VE is derived from a couple ambient conditions, engine performance characteristics, and plotted over either a MAP vs RPM table or a Load % vs RPM table.
    Weíre going to use quadratic coefficients to calculate VE .

    VE = A*RPM^2 + B*RPM + C

    Where A, B, and C are the quadratic coefficients. Defined as:

    A = (y2-y1)/((x2*x2)-(2*x1*x2)+(x1*x1))
    B = -2 *A + x1
    C = y1+ (A + x1*x1)

    Once youíve gotten this far, you can calculate the theoretical PulseWidth for any conditions. But, somebody somewhere once told me that ďTruth is stranger than fictionÖ Or theory for that matter.Ē Thatís where datalogging comes in.

    Iím still working on the injector timing and spark table part, but it doesnít look very difficult. The fuel enrichment calculations, on the other hand, are pretty convoluted, and get worse when more than one condition applies. So I might just skip them.

    TL;DR, looking for feedback from people who do voodoo shit. Here's a pretty picture for attention:





  2. #2
    im super special x10radsponge's Avatar
    Join Date
    Jan 2013
    Location
    Knoxville, TN
    Posts
    3,205
    Rep Power
    2288
    My head hurts now. Can this help http://computing.ornl.gov/supercomputing.shtml

  3. #3
    King Dumbass McCloudsZJ's Avatar
    Join Date
    Nov 2012
    Location
    Roanoke, VA
    Posts
    2,048
    Rep Power
    105
    Quote Originally Posted by x10radsponge View Post
    My head hurts now. Can this help http://computing.ornl.gov/supercomputing.shtml
    Maybe? But it's a simple enough program you could run it with a Gameboy or graphing calculator.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •