Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: AEM EMS Tutorial Notes

  1. #1
    Runs on alcohol. The car does too. Not Verified
    Join Date
    Sep 2010
    Owner Since
    1999

    Location
    San Francisco, CA
    Posts
    638
    Thanks
    18
    Thanked 49 Times in 35 Posts

    AEM EMS Tutorial Notes

    Who knows if I'll ever finish the tutorial... it's a lot of work. So I've decided to start dumping my notes. These are going to be dense and not organized for easy consumption, but you might find them useful. Let me know if you notice any errors or something isn't clear.

    Timing Basics

    We start with some basic facts about the 6G72:
    • 4-stroke - 720° in a full engine cycle.
    • 6 cylinder - 120° between cylinders (720° / 6 = 120°).
    • Waste spark ignition - paired cylinders are 360° out of phase (1&4, 2&5, 3&6).


    The cam and crank sensors (either the 1st gen CAS or 2nd gen Hall effect sensors) are the most important inputs and the basis of all timing. As Jeff's notes (Stealth 316 - 3S Ignition System) show, these provide two square wave signals to the EMS. The rising and falling edges are used as reference points for timing calculations.

    Take a look at this chart. It shows how these signals correspond to the engine cycle and each cylinder's individual strokes:



    Syncing Up

    The first thing we're interested in is how the EMS synchronizes itself with these signals. Jeff says,

    If the TDCS signal is high when the CAS goes from low to high, the ECU knows that cylinders 2 and 5 are in either the compression or exhaust stroke. When the CAS then goes from high to low, the ECU uses this as a reference to turn power transistor "B" off to produce sparks in cylinders 2 and 5. If the TDCS is still high at this time the ECU also knows that cylinder 1 was near TDC and is currently on the combustion stroke, and that it was cylinder 2 that was on the compression stroke.

    If the TDCS signal is low when the CAS goes from low to high, the ECU waits until the CAS signal goes from high to low to determine which of the other two cylinder pairs should be fired. When the CAS signal goes from high to low and the TDCS is high, then cylinders 3 and 6 are in either the compression or exhaust stroke. If instead the TDCS is low, then cylinders 1 and 4 are in either the compression or exhaust stroke. In each case, the ECU uses this (the CAS signal going from high top low) as a reference to turn the appropriate power transistor off ("A" for cylinders 1 and 4 or "C" for cylinders 3 and 6) to produce sparks in the cylinder pair.
    I don't know if this is actually how the stock ECU works (maybe the flashable ECU guys can tell us) but it is NOT how the EMS works.

    Being a generalized ECU for multiple platforms, the EMS has multiple sync strategies. The one used on a 3S is called Sync Crank S Count. It is extremely simple - it watches for a particular number (Sync Teeth: 4) of crank "teeth" (both rising and falling edges, Crank Falling Edge: ON, Crank Rising Edge: ON) to pass between cam "teeth" (falling edges only, Cam(T2) Falling Edge: ON, Cam(T2) Rising Edge: OFF).

    I want to take the previous diagram and make it a bit more intuitive. First, all the events are listed in degrees BTDC of the following cylinder. Instead, let's think about a full 720° engine cycle, starting at TDC of the #1 cylinder. Here are the cam and crank signals with each edge's degree in the cycle:



    Let's drop the cam rising edges (Cam(T2) Rising Edge: OFF). This represents the significant events as seen by the EMS:



    Notice that between the cam edges at 550° and 70°, there are 4 crank edges. This is the ONLY time this occurs in the 720° cycle, and is what the EMS uses as its sync signal. This is very important - the EMS considers the passage of 4 crank signals between cam signals to be the sync event, and synchronizes on the following crank edge at 115°. This won't make much sense yet, but 115° is the tooth reset point for the 3S.

    How the EMS "Counts"

    Remember that the rising crank edge at 115° (5° BTDC #2) is the reset point. The EMS keeps an internal counter called A Tooth that counts the number of crank teeth seen since the reset point. At that point, it is reset to 0.



    Just remember that for A Tooth, 1 crank signal edge = 1 tooth.

    Now, the EMS must convert A Tooth into an even pattern of six (Spark Teeth: 6, Fuel Teeth: 6) for use as injection / ignition timing references. These are counted in Fuel Tooth and Ign Tooth, based on A Tooth and configured via the table Crank Tooth Control.



    It's not necessary to cover every function, but in short they are:

    Value Function
    0 Do nothing.
    1 Process significant edge.
    2 Process alternative edge, used for crank firing.
    3 Force reset of A_Tooth, if loss of sync.
    4 Test for synchronisation
    5 Process significant edge and Test for synchronisation.
    6 Process alternative edge and Test for synchronisation.
    7 Reserved

    All you really need to worry about is function 5, which increments Fuel/Ign Tooth, and function 3, which forces a reset (we should never get to A Tooth: 12). In layman's terms: when we hit a crank edge, if the current A Tooth value is 0, 2, 4, 6, 8, or 10, increment Fuel/Ign Tooth.



    TODO: Actually explain how the sync happens. Cam Tooth, S Tooth, S Sync Tooth. Sync Early. Stat Cranking, Stat Sync. Crank Alt Options.
    Last edited by Intropy; 07-23-2012 at 09:03 AM.

    AEM s2 EMS | E316Gs | E85

  2. The Following 4 Users Say Thank You to Intropy For This Useful Post:


  3. #2
    Runs on alcohol. The car does too. Not Verified
    Join Date
    Sep 2010
    Owner Since
    1999

    Location
    San Francisco, CA
    Posts
    638
    Thanks
    18
    Thanked 49 Times in 35 Posts
    So here's the complete picture:

    

    Injector Phasing

    Once you get this, some spooky options make sense. We like to think of "0" as TDC #1, but as far as the EMS is concerned, "0" is 115°, or 5° BTDC #2.

    Injector firing order and timing is determined by the Injector Tooth X options. These correspond to the Fuel Tooth values depicted above. E.g., if Injector Tooth 1 = 0 as it does in the basemap, we are saying that we want to fire injector #1 when Fuel Tooth = 0 at 165°.

    Obviously, this is wrong. Injector #1 needs to fire much later when Cylinder #1 is in its intake stroke, around 4XX°. The other injectors will be off as well. So we need to retard all the injectors using the Injector Phasing option. In the basemap, this is set to 5 teeth, or 5 * 120° = 600° (remember 1 tooth = 120°). But that would mean Inj #1 opens at 165° + 600° = 765° (45°), which is still wrong!

    This is where AEM engineers made a decision that I don't really understand, but it is what it is and once you know about it, it's not a problem. There is also the Injector Advance map, which tells the EMS how much additional advance is required at higher RPMs. In the basemap, it is set to 0° at 0 RPM and increases from there. The maximum advance is 357°.

    The weird thing is that this value does not behave exactly like you might expect. First, it is injector "advance" so it is the opposite of injector phasing - higher values are more advanced, lower values are more retarded (heh heh). Furthermore, to fire Inj #1 at 45° like we thought, Injector Advance would need to equal 357°. If it is 0°, you need to add (retard) 357° to the Injector Phasing. So in this case, Injector #1 opens at 165° + 600° + 357° = 402°, which is thankfully where we want it.

    Why did they do it this way? I'm not really sure. Just remember it like this: If...
    Injector Tooth 1 = 0, and
    Injector Phasing = 0, and
    Injector Advance = 357, then Injector #1 fires exactly at 165° when Fuel Tooth = 0.

    Read more here: Injector Phasing Information
    Last edited by Intropy; 07-25-2012 at 05:42 PM.

  4. The Following User Says Thank You to Intropy For This Useful Post:


  5. #3
    Runs on alcohol. The car does too. Not Verified
    Join Date
    Sep 2010
    Owner Since
    1999

    Location
    San Francisco, CA
    Posts
    638
    Thanks
    18
    Thanked 49 Times in 35 Posts
    A Quick Illustration

    Here's a screen from AEMData showing this in action.



    You can see that A Tooth is counted and filtered to Fuel Tooth. Also displayed is Fuel Inj 1 Open, which is the location (in teeth) of the injector 1 event. It is about 1.84 or approximately 386° = 165° + (5 * 120°) + 340° (the 340° comes from the Injector Advance table which is not pictured but is 17° at this RPM, so add 357° - 17° = 340°).

    Do I really need to know all this?

    Nope. To actually tune injector phasing, it's really easiest to just log the Fuel Inj X Open channels and do it by feel. But you could do some really crazy things with this information, like changing your trigger wheels or syncing to valve events.
    Last edited by Intropy; 07-23-2012 at 09:01 PM.

  6. #4
    Banned J. Fast's Avatar
    Join Date
    Sep 2010
    Owner Since
    - O - SIX -

    Location
    Colorado, USA
    Posts
    2,711
    Thanks
    405
    Thanked 200 Times in 140 Posts
    Anyone seen my Etch-A-Sketch? I need to get this!

  7. #5
    Runs on alcohol. The car does too. Not Verified
    Join Date
    Sep 2010
    Owner Since
    1999

    Location
    San Francisco, CA
    Posts
    638
    Thanks
    18
    Thanked 49 Times in 35 Posts
    Thanks, I need a wiki so other people can edit it.

  8. #6
    Runs on alcohol. The car does too. Not Verified
    Join Date
    Sep 2010
    Owner Since
    1999

    Location
    San Francisco, CA
    Posts
    638
    Thanks
    18
    Thanked 49 Times in 35 Posts
    Ignition Timing

    Spark timing works just like injector timing, with only a few minor differences.

    First, notice that Ign Tooth and Fuel Tooth are not the same. Ign Tooth's "0" point is at 45°. Don't think too hard about this right now, just accept it as brute fact.

    Just like injector order and timing is determined by the Inj Tooth X options, coil order and timing is set in the Ign Tooth X options. They are listed here under "Coil Phasing":



    You'll notice a few things are different. First, they are not even values like the Inj Tooth options. That may seem a little weird, but remember that 1 tooth = 120°, so it's completely fine to have fractions of a tooth.

    The next thing you'll notice is because this is a waste spark ignition, we have paired coils 1 & 1B, 2 & 2B, and 3 & 3B. These are the same, i.e. 1 & 1B are both "Coil 1" and drive the same output, just at different times. As you would expect, the firing order is 1 - 2 - 3 - 1 - 2 - 3, corresponding to cylinders 1-6.

    Again, we have a global phasing option like Injector Phasing, which in this case is Ignition Sync. This is the option you adjust when you run the Ignition Timing Setup Wizard.

    Finally, we have the oh-so-familiar Ignition Map, which adjusts the timing relative to engine speed and load. The same odd behavior that applies to the Injector Advance map applies here. The maximum value is 72.6° of advance, so if this table is 0°, you need to add (retard) the spark timing by 72.6° when doing your calculations.

  9. #7
    Runs on alcohol. The car does too. Not Verified
    Join Date
    Sep 2010
    Owner Since
    1999

    Location
    San Francisco, CA
    Posts
    638
    Thanks
    18
    Thanked 49 Times in 35 Posts
    An Example

    So here's a real example from AEMData showing that this is all true:



    You can see that the car is basically idling (1000 RPM) and so the "timing" that we're all familiar with (Ign Timing) is 14.641°. In this state, Ign 1 Firing Loc is 5.26953 teeth. That number is the sum of the Ignition Sync option (3.652 in the base map) and the Ign Tooth 1 option (1.141 as seen above), along with the weird calculation based on the timing (72.6° - 14.641° / 120°) = .48299 teeth:

    3.652 + 1.141 + .48299 =~ 5.27
    Last edited by Intropy; 07-25-2012 at 06:53 AM.

  10. #8
    Runs on alcohol. The car does too. Not Verified
    Join Date
    Sep 2010
    Owner Since
    1999

    Location
    San Francisco, CA
    Posts
    638
    Thanks
    18
    Thanked 49 Times in 35 Posts
    TODO: 72.6° is not a hard max, can be chaged. Maybe talk about this.

  11. #9
    Runs on alcohol. The car does too. Not Verified
    Join Date
    Sep 2010
    Owner Since
    1999

    Location
    San Francisco, CA
    Posts
    638
    Thanks
    18
    Thanked 49 Times in 35 Posts
    This was a good question so answering publicly:

    If i'm reading the aem forum post correctly, does the injector phasing automatically start off retarded 357 degrees? And ign retarded 72.6 degrees?
    I'm not sure I would say "automatically", but yes, if Injector Advance = 0 and your Ignition Timing is 0°, then you would need to add 357° and 72.6° respectively.

    The formula in fuel teeth is:
    Fuel Inj X Open = Inj Tooth X + Inj Phasing + ((357° - Inj Advance) / (720° / Fuel Teeth))

    Or in degrees of the engine cycle:
    165° + (Inj Phasing / 6 * 720°) + (357° - Inj Advance)

    AEM Does it this way...?

    Injector Tooth 1 = 0, and
    Injector Phasing = 5, and
    Injector Advance(idle) = 0, then Injector #1 fires exactly at 402° when Fuel Tooth = 0

    Would the same function occur if it were like this?

    Injector Tooth 1 = 0, and
    Injector Phasing = 0, and
    Injector Advance = 120, then Injector #1 fires exactly at 402° when Fuel Tooth = 0
    Yes, you've got it. Except that fuel tooth does not equal 0 at that time, it equals 1.

    Just to do the work explicitly for anyone following along...

    Injector Tooth 1 = 0, and
    Injector Phasing = 5, and
    Injector Advance(idle) = 0, then Injector #1 fires at 402° (Fuel Tooth = 1 at this time)
    Formulas:
    Fuel Inj X Open = Inj Tooth X + Inj Phasing + ((357° - Inj Advance) / (720° / Fuel Teeth))
    Degrees in cycle = 165° + (Inj Phasing / 6 * 720°) + (357° - Inj Advance)

    Fuel Inj 1 Open = 0 + 5 + ((357° - 0) / (720° / 6))
    = 0 + 5 + 2.975
    = 7.975
    -6 (minus 6 to get us back in range)
    = 1.975

    So Fuel Tooth is 1 at this time, about to change to 2.

    In degrees...
    165° + (5 / 6 * 720°) + (357° - 0) = 1122°
    -720 (minus 720° to get back in range)
    = 402°

    Or...
    165° + 1.975 * 120° = 402°

    Injector Tooth 1 = 0, and
    Injector Phasing = 0, and
    Injector Advance = 120, then Injector #1 fires at 402° (Fuel Tooth = 1 at this time)
    Fuel Inj 1 Open = 0 + 0 + ((357° - 120°) / (720° / 6))
    = 0 + 0 + 1.975
    = 1.975

    In degrees...
    165° + (0 / 6 * 720°) + (357° - 120°) = 402°

    Or...
    165° + 1.975 * 120° = 402°

    These are all equivalent.
    Last edited by Intropy; 07-25-2012 at 08:29 AM.

  12. #10
    Runs on alcohol. The car does too. Not Verified
    Join Date
    Sep 2010
    Owner Since
    1999

    Location
    San Francisco, CA
    Posts
    638
    Thanks
    18
    Thanked 49 Times in 35 Posts
    TODO: this doesn't belong here but posting it before I forget

    AIT correction

    To the extent that it's possible, you want to tune your fuel map at a known, constant intake air temp. Keep in mind that with speed density you are estimating air intake from pressure and temperature. From the ideal gas law, you are estimating n from a known V and R and measured P and T:

    n = (PV)/(RT)

    If you tune parts of your map at different temps, your map will be off. Let's say you tune at temp T0, and now the temp is T1. Think about the relationship of n0 and n1 where:

    n0 = (PV) / (R T0)
    n1 = (PV) / (R T1)

    From this you can derive:

    n1 = (T0 / T1) n0

    So if T0 is your reference temperature and T1 is your measured temp, n0 must be multiplied by the ratio (T0/T1).

    In terms of the EMS, the table for this correction is Air Temp Fuel Trim. Because the values in this table are percentages, our ratio (T0/T1) needs to be multiplied by 100. E.g.,

    .5 * 100 = 50 (%)

    But wait, we're talking about a correction. In other words, if T0=T1, then T0/T1 * 100 = 100 (%). But if T0=T1, our correction should be 0%. So we just subtract 100 to yield the formula:

    Correction(T1) = ((T0/T1) * 100) - 100

    So if you tuned your map at 60 degrees F (288.7 K) and now it is 50 degrees F (283.2 K), theoretically you need a correction of approximately:

    ((288.7/283.2) * 100) - 100 = 1.94 %

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
The 3000GT/Stealth/GTO Web History Project
3000gt.com
3000GT / Stealth International WWWboard Archive
Jim's (RED3KGT) Reststop
3000GT/Stealth/GTO Information and Resources
Team 3S
3000GT / Stealth / GTO Information
daveblack.net
3000GT/Stealth/GTO Clubs and Groups
Michigan 3S
MInnesota 3S
Wisconsin 3S
Iowa, Nebraska, Kansas 3S
North California 3000GT/Stealth
United Society of 3S Owners
3000GT/Stealth/GTO Forums
3000GT/Stealth International
3000GT/Stealth/GTO Event Pages
3S National Gathering
East Coast Gathering
Upper Mid-West Gathering
Blue Ridge Gathering