My Megasquirt adventures over the years

-
This is some really great info. Thanks for sharing.

Question, when tuning the open loop idle, did you find your idle RPM would vary during normal driving?

It's been a while since I had it open loop, but I do think I remember it moving around a little bit. That might have also been one of the reasons I started working on the closed loop idle.

How much is yours varying? I think one of the tricky parts with the open loop setup is that it only references coolant temperature to control the IAC. I think MAT has some effect on that as well, though maybe less so if the correction curve is set up well. So your coolant might be at 180 degrees or something in the middle of winter with an IAT of 40 degrees, or the middle of summer with an IAT of 140 degrees. On a smaller scale, it could be like exiting off the highway where you've been running fairly steady state for a while and might have stable IAT values, but as you drive through town in more stop and go conditions, that IAT rises.

I was really struggling with my idle after I installed my A/C because I was getting a lot of surging. I finally got a dashboard set up so that I could watch the IAC position while things were running and it helped me better understand what was going on. Long story short, my target IAC position and my starting position were so far off that the PID control was having a hard time getting things settled. I probably could have kept playing with the numbers to get it there eventually, but I found it easier to just fix my starting position to be closer to where it wanted to settle. I still get a little surging if I turn A/C on real soon after starting the car, but it's typically pretty stable within a few minutes of running.

So speaking of IAC starting position, that might also be what could be causing an issue. I'll probably go over it more when I get to the startup/idle settings tab, but there is a setting for the IAC to "use last position" or "use table". I don't recall if that's only when you choose closed loop or not though. Regardless, I'd suggest making a gauge/readout that displays the IAC position and checking it as you drive around and notice your idle changing. If the IAC position is the same all the time but you're getting rpm changes, I'd wonder if maybe it's a throttle linkage issue like the blades aren't closing all the way? If the IAC position is moving around, then it's more just a case of figuring out what setting is causing that and seeing if you can update and tune it.
 
It's been a while since I had it open loop, but I do think I remember it moving around a little bit. That might have also been one of the reasons I started working on the closed loop idle.

How much is yours varying? I think one of the tricky parts with the open loop setup is that it only references coolant temperature to control the IAC. I think MAT has some effect on that as well, though maybe less so if the correction curve is set up well. So your coolant might be at 180 degrees or something in the middle of winter with an IAT of 40 degrees, or the middle of summer with an IAT of 140 degrees. On a smaller scale, it could be like exiting off the highway where you've been running fairly steady state for a while and might have stable IAT values, but as you drive through town in more stop and go conditions, that IAT rises.

I was really struggling with my idle after I installed my A/C because I was getting a lot of surging. I finally got a dashboard set up so that I could watch the IAC position while things were running and it helped me better understand what was going on. Long story short, my target IAC position and my starting position were so far off that the PID control was having a hard time getting things settled. I probably could have kept playing with the numbers to get it there eventually, but I found it easier to just fix my starting position to be closer to where it wanted to settle. I still get a little surging if I turn A/C on real soon after starting the car, but it's typically pretty stable within a few minutes of running.

So speaking of IAC starting position, that might also be what could be causing an issue. I'll probably go over it more when I get to the startup/idle settings tab, but there is a setting for the IAC to "use last position" or "use table". I don't recall if that's only when you choose closed loop or not though. Regardless, I'd suggest making a gauge/readout that displays the IAC position and checking it as you drive around and notice your idle changing. If the IAC position is the same all the time but you're getting rpm changes, I'd wonder if maybe it's a throttle linkage issue like the blades aren't closing all the way? If the IAC position is moving around, then it's more just a case of figuring out what setting is causing that and seeing if you can update and tune it.
It only fluctuates 100-200RPM and its very random. I'm sure its the IAC. I've been considering swapping over to closed loop idle.

I like what you have done with the table switch on the fuel map and I'm considering doing the same since I do a fair amount of highway driving. Admittedly, I also need to work on the heat soak enrichment. Honestly, the car runs great and I've really haven't messed with the tune much in a while.

The strange thing is the hemi seems much more sensitive to heat soak than my small block did. However, on the small block, I was using a TMAP sensor mounted directly to the aluminum throttle body. On the Hemi, the IAT is in the intake tube.
 
It only fluctuates 100-200RPM and its very random. I'm sure its the IAC. I've been considering swapping over to closed loop idle.

I like what you have done with the table switch on the fuel map and I'm considering doing the same since I do a fair amount of highway driving. Admittedly, I also need to work on the heat soak enrichment. Honestly, the car runs great and I've really haven't messed with the tune much in a while.

The strange thing is the hemi seems much more sensitive to heat soak than my small block did. However, on the small block, I was using a TMAP sensor mounted directly to the aluminum throttle body. On the Hemi, the IAT is in the intake tube.

Yeah, the table switch thing really came about mostly because of trying to make sense of having the two different spark tables. Realistically you could probably get away with splicing the two tables into one if you were more careful about it, but I noticed on the highway in overdrive gears especially that I could get up there in load and start touching cells you'd normally reserve for "power" instead of cruise. I think this setup might simplify acceleration enrichment tuning as well because it kind of builds the extra fuel into the table swap instead of having to link it to pedal rate of change, though hard to say. I haven't really found anything in HP Tuners that looks like acceleration enrichment outside of that one power enrich table, but it might be buried in there somewhere.

I would suggest really looking into the MAT/CLT correction table for your IAT issue. The primary goal of that table as I understand it is to model the "heat soak" of the air as it travels through the intake, which is why it is linked to a "flow" value. I say "flow" because the units are just load x rpm, so it's not actually mass flow in the truest sense of the unit, but has the same effect (high load and low rpm would flow similar mass as high rpm and low load). At the lower flow rates the air stays in the intake longer and has more time to heat up, so with your IAT that far away from the intake valve, it would make sense you're probably actually running hotter in practice than your sensor would say.

The MS is a little limited here though, at least compared to how HP Tuners deals with different temperature effects. The main discrepancy between the two is that I'm not sure the MS can pull fuel relative to coolant temp, or at least I haven't tried it yet. The MS only really cares about coolant temp for warmup enrichment, so it wants the table to end at 100%, or no correction. I'm not sure if it will even accept values less than 100. It wants to do all of the temperature correction in the air density table, which is MAT based. The MAT/CLT correction table basically just adds some percentage of your coolant temp to your air temp value, which pushes you further to the right on the air density correction table. In practice this might be enough, though the way the tables are set up in HP Tuners doesn't quite work that way. In theory I think you might be able to get in some extreme situations where this doesn't work as well, but I need to run some numbers and do some more comparisons to better understand. HP Tuners links fuel enrichment/enleanment to both IAT and CLT through the whole range of temperatures the engine is expected to run in via tables vs the simple curve setup the MS uses. In practice the tables tend to look more like curves anyway though, so maybe it's less important than I think.

I'm sure they must model temperature change through the intake somehow in the OEM setup, but I haven't figured it out yet (nevermind, the CLT table includes rpm and MAP, so that would be similar to how the MS models it). There is a field for the intake volume you can change, so that might be one variable that's involved. The air density correction curve they use doesn't follow the ideal gas law either, so maybe it's baked into that to some degree. I'm still trying to decide if I think the ideal gas law makes sense for the application to begin with. It's just pv=nRT, so the thought is if the pressure changes, the temperature changes in relation to it. The struggle I have with that is the assumption that the volume is constant. I wonder if that's why you can set the intake volume on HP Tuners. However, the intake isn't a closed system. We tend to think of air as only going into the intake, but ultimately speaking the throttle body can let air in or out, so it's not a closed system. If the temperature goes up in the intake, in theory it could push air backwards and out of the throttle body, which would sort of invalidate the ideal gas law assumption. But we're also talking pretty dynamic situations, not static, so lots of assumptions going on.
 
So I think I might have misunderstood how the MAT/CLT correct curve works on the MS. Based on this article at least (Tuning the MAT / IAT Correction Table to eliminate Heat Soak), it actually subtracts a portion of the coolant temp from the air temp instead of adding it. They are taking the approach that the sensor is heat soaking and the air isn't. I'll have to think about my setup a little more on this one. I was thinking I had a backwards problem where my car runs lean at idle when cold, but then rich at idle while hot, even though it runs closer to 14.7 while actually driving. If it added CLT to MAT it would push the mixture leaner, but having just driven my car for lunch, I'm actually seeing it idle pretty lean when hot instead of rich. So the CLT/MAT correction curve would make more sense if it was pulling that temp back to richen the mixture up a bit. I guess maybe that could help my cold starts too if it's running lean there. I may try to follow along with their little guide of doing the scatter plot to see what I get.
 
So I think I might have misunderstood how the MAT/CLT correct curve works on the MS. Based on this article at least (Tuning the MAT / IAT Correction Table to eliminate Heat Soak), it actually subtracts a portion of the coolant temp from the air temp instead of adding it. They are taking the approach that the sensor is heat soaking and the air isn't. I'll have to think about my setup a little more on this one. I was thinking I had a backwards problem where my car runs lean at idle when cold, but then rich at idle while hot, even though it runs closer to 14.7 while actually driving. If it added CLT to MAT it would push the mixture leaner, but having just driven my car for lunch, I'm actually seeing it idle pretty lean when hot instead of rich. So the CLT/MAT correction curve would make more sense if it was pulling that temp back to richen the mixture up a bit. I guess maybe that could help my cold starts too if it's running lean there. I may try to follow along with their little guide of doing the scatter plot to see what I get.

Actually, I don't know anymore. Reading through the TunerStudio manual, it sounds much more direct of a function than how that article describes it. Maybe I just need to run some numbers through the formula they give and see what comes out the other end. The TS reference makes it sound like putting 100% in as a value would have the system use the coolant temp as the MAT value in calculations, and 0% would use only the MAT sensor reading. The formula makes it sound like using 100% would subtract the CLT sensor value from the MAT sensor value.

I tried messing with it briefly the other day when I was sitting idling waiting for something, but it didn't seem like it was having any effect. Will have to play with it some more and try to get a better feel for it.
 
I just went searching through the MS source code to try to figure out what is actually going on with that correction factor and it's fairly simple. The curve basically just tells the computer whether to use the MAT/IAT sensor value or the CLT sensor value for the air temp in the fueling calculation. So 0% means full MAT and 100% means full CLT.

My next question is whether you can use negative values or not. I don't think you can, but I need to double check. The main thought process there boils down to where your air temp sensor is. If your temp sensor is outside of the engine bay and reading true ambient conditions, this curve gets pretty easy to use. The lower the air flow, the closer it is to coolant temp by the time it hits the intake valve. Where it gets trickier is if your temp sensor is in the engine bay/intake. I need to see if I can get a thermocouple or something in my intake to confirm this, but the theory is that the sensor body heats up with the engine itself and reads higher than it should due to heat soak, to the point that the airflow around it isn't enough to bring it back down to ambient. So in that case, you'd want to subtract some amount from your MAT reading. In theory you can do that if the curve lets you use negative values, but I have a gut feel that it won't let you.
 
Last edited:
Do you have any advice on how to set up a MS3 gold box to control spark only? I found one for a great deal and was going to use it on my stroked 6.1 hemi, that I am putting in my 70 plymouth duster race car.
 
Spark only is a little different, but I'd think you could basically set it up like it was running the fuel as well and just ignore any of those settings. I don't think they have a spark only option like they do with the fuel only setup, but as long as you can get a good crank (and preferably cam as well) signal into the box, I don't see why it couldn't do it.
 
Having "mostly read" this, I honestly can't believe you had so many problems and are digging into some of these tables so much. I've had MS3 Pro on my 340 for 10 years a month from now. With multi-port, coil near plug, cam and crank with sequential injection and spark. It was very very easy to get it "good enough" and not have many quirks straight from the beginning.

Almost all tuning I did was in the VE table, Spark Table, IAC table (IAC target with temperature) and the PID. My car basically just works and other than occasionally surging when you tip in an extremely small amount at a low speed with the clutch out, I can't complain. Even got 21 mpg doing 75 on the way to power tour and 19 average on the trip.

My car has all GM sensors other than the crank sensor (Ford Ranger) and the Cam sensor (5.2 magnum distributor base). I understand some of the things about the Dodge specific sensors and all that but for example you can send injectors out to be flow tested if you don't know.

For the A/C I just use the A/C idle up to add 150 rpm. The PID is able to deal with any deviations and gets to the target fairly quickly with "Engine States" known. Heat soak doesn't seem to bother mine whatsoever anymore. I had too much prime at high temperature, which is how I dealt with it, it acted like it was flooding.

I am even using overrun fuel cut, controlling the fans, controlling the reverse lockout for the T56...I have ground speed control included as well.
 
Do you have any advice on how to set up a MS3 gold box to control spark only? I found one for a great deal and was going to use it on my stroked 6.1 hemi, that I am putting in my 70 plymouth duster race car.
My opinion is you'd hook it up like you were going to do it with fuel and then just not connect any of the injector wires. I don't think it would care too much honestly.
 
Alright, time for the dangerous stuff, ignition settings:

1755380594363.png


This can be really simple and really complicated both, depending on your setup and what development has already been done by Megasquirt users. In the case of my 2006 5.7, it's pretty straightforward. The main things you set up in this initial window are the triggers the system will use to determine crank (and potentially cam) position. In the case of my early 5.7, the crank uses a tone/reluctor wheel with 32 teeth (though spaced in such a way that there would normally be 36 teeth). There are some missing teeth on there and there are also some "doubled" teeth (reference picture below).
1755380968115.png

This is what the 36-2+2 refers to. It's a "36" tooth ring with 2 missing teeth and two "double" teeth. You can see them on the picture above. The missing and doubled teeth are positioned at specific places on the crankshaft to help the computer know where TDC is. This actually simplifies a fair portion of the rest of the settings as those values are sort of "baked in" so they don't have to be manually set. The trigger angle setting you can follow the tooltip on. With the 36-2+2 wheel you can leave it at zero. I believe the later Hemi used a 60-2 wheel. They would likely be a similar setup, but I can't say for sure as I haven't messed with one. The tooltips do a pretty good job of walking you through and there is a good amount of info on the internet from people that have set up the MS on the later Hemis to get you going in the right direction.

The "skip pulses" setting basically just ignores the first number of pulses the sensor sees when you first crank the key. I guess the idea here is to let the sensor settle and to get clean pulses. This probably matters more if you have a VR style sensor compared to a hall effect one. Hall sensors tend to have pretty clean square wave signals while VR sensors produce more of a varying amplitude sine wave, so it might take a couple teeth going past before the signal is high enough to read on them.

Pretty much all of the settings here I got from this link: How to MegaSquirt Your Chrysler Hemi Engine. It's a good resource and helps with these settings, though it doesn't necessarily explain the "why" on a lot of them too much, so just be aware.

I can't really speak to what the ignition input capture setting affects, other than that you're either reading the rising edge of your crank sensor signal or the falling edge. There is some note about how it could affect things on the tooltip, the primary one I could see is just that the offset you might get if you are reading on the wrong edge could very slightly affect your timing. Like if the tooth is clocked in such a way that the front of it is at TDC and you are reading the falling edge, you would in theory be some amount of degrees or fractions of a degree off of that.

The spark output setting is one of the more important ones on this page. I believe it defines more or less "how" the coils are fired. In the case of my sequential setup, I'm using the MS3X spark outputs, which are 5v logic level signals. So to fire a coil, the signal goes from low to high. If you have it backwards, the coils would stay energized most of the time instead of only during the dwell period, which would be pretty bad for them.

The number of coils setting could potentially be a little confusing if you look at the options. Wasted spark is an option, which the really early 5.7s did, but not in the way that this setting means it. "Wasted spark" here would more generally mean you have half as many coils as you have cylinders, so each coil has to run two cylinders. The early 5.7s still had 8 coils, but were just wired in such a way that they sparked two cylinders at once, so you'd still want "coil on plug" here. I think "wasted COP" just fires each coil twice (once before power stroke and once during exhaust), but I'm not actually sure. I guess you could do that, but I didn't see a reason to.

Spark hardware for me was the MS3X since I'm using those outputs to drive my coils. This comes down to how you build your board.

Cam input is where your cam sensor is wired up, fairly straightforward.

The "flip polarity" setting on the cam input I believe has to do with the way the cam trigger wheel is built. In the case of the crank trigger, the teeth are "positive" relative to the rest of the wheel. On the cam wheel for the early 5.7s at least, it's a bit different:
1755382401165.png

On these, there are windows for the different cylinder. However, that means the rest of the wheel is solid, so when the sensor is looking at it, you'd see a "high" signal most of the time and it would drop to a "low" when a window goes by. I believe that is where this inverted setting comes into play. If you had a tooth style sensor instead, you would probably leave it as normal polarity.

The values on the right side of this setting window are generally about setting up your coils. The fixed advance box can be used to force an ignition advance so you can check your settings with a timing light, though you can also sort of do that via the spark table later. "Use prediction" is actually kind of a neat setting that factors in how your engine is accelerating to the timing calculations. So if your rpms are rising really quickly, it might advance the timing just a tiny bit more to try to get the spark at the number you actually have in the table. I believe this is actually how some of the misfire monitors work on modern engines as well. Sometimes, if you put a lightweight flywheel on a car, the ECU actually sees the faster acceleration and jerk of the crank sensor between teeth and thinks there was a misfire. Just something I found interesting.

Cranking dwell and advance are just that. You can give your coils a little extra juice during cranking to get some more spark, potentially. This is kind of like how the old ballast resistors worked. During cranking you would actually feed the coil 12v for a hotter spark, but once you let off the key the signal would go back through the ballast resistor and drop the voltage so the coil wasn't worked as hard. It's probably not that important on COP setups, though I still have mine set a touch higher because I think that was the default. Dwell type we can leave at standard, this is mostly for some other spark systems and modules out there. You can also set up the dwell via a table if you wanted to change the value through varying engine conditions. Again, this is probably more useful on a single coil setup where you might have limited dwell time at higher rpms or if you needed more dwell at low rpm for idle or something like that. If you don't use a table, the next settings are the fixed dwell values you want. This is another reason I was trying to hunt down a factory tune, though in the end it didn't help. I have struggled to find any real information on the stock 5.7 coils. I know they are good and generally even regarded to be better than a lot of the aftermarket replacements, but the very limited information I ever found on them was not much help. I found one guy that was doing dwell studies on coils with a scope to show when they were hitting saturation and what kind of spark energy they provided, but for some unknown reason he was only running them at 6v or something like that, so I didn't think the information was as useful. For the time being I've stuck with the "default" value of 3ms. The spark duration value is how long it takes the spark to actually happen. You could also think of this as "coil discharge time". I believe this is used as a safeguard of sorts for high rpm situations where you might not have enough dwell time between ignition events. So in our case it could something like "I need 3ms to charge and 1ms to discharge, but I only have 3.5ms between ignition events", so it would drop the dwell time so it's not trying to charge the coil up again while it's still firing. Or at least I'm pretty sure that's how that is meant to work. For COP setups, it's probably not super important because each coil has a good amount of time between sparks, but for a single coil distributor setup it could matter more. If you run high enough rpm I guess it could matter with COP too, though I forget just how high it would have to be before you'd see any issues.

Spark hardware latency I can't really say much about other than what it sounds like. It would help account for any kind of lag you might have in the system, like maybe if you were running an MSD box using the MS as a trigger and the MSD box had some kind of delay in it you needed to account for. Or not, I really don't know enough about it.

Spark trim is a novel option, though I don't have enough sensors on my car to know if it would be useful. It basically lets you alter timing per cylinder as needed to address any issues you might have. This is usually more of a fuel problem (which you can do individual injector trims as well like if you had a lean cylinder). Spark could be used in a similar way where maybe you'd want to pull a degree or two on a leaner cylinder. The knock section later can actually do this automatically as well, though it would mean you'd have to be knocking for it to trigger vs hard coding it here if you knew you had one cylinder that was always a problem.
 
Having "mostly read" this, I honestly can't believe you had so many problems and are digging into some of these tables so much. I've had MS3 Pro on my 340 for 10 years a month from now. With multi-port, coil near plug, cam and crank with sequential injection and spark. It was very very easy to get it "good enough" and not have many quirks straight from the beginning.

Almost all tuning I did was in the VE table, Spark Table, IAC table (IAC target with temperature) and the PID. My car basically just works and other than occasionally surging when you tip in an extremely small amount at a low speed with the clutch out, I can't complain. Even got 21 mpg doing 75 on the way to power tour and 19 average on the trip.

My car has all GM sensors other than the crank sensor (Ford Ranger) and the Cam sensor (5.2 magnum distributor base). I understand some of the things about the Dodge specific sensors and all that but for example you can send injectors out to be flow tested if you don't know.

For the A/C I just use the A/C idle up to add 150 rpm. The PID is able to deal with any deviations and gets to the target fairly quickly with "Engine States" known. Heat soak doesn't seem to bother mine whatsoever anymore. I had too much prime at high temperature, which is how I dealt with it, it acted like it was flooding.

I am even using overrun fuel cut, controlling the fans, controlling the reverse lockout for the T56...I have ground speed control included as well.

Honestly, I probably make it sound worse than it is. I was actually basically in the same boat as you, though I went through the MS upgrade path instead of starting with all the bells and whistles from the get go. I could have really just left it alone after I did the MS3X upgrade and got it running and never worried about it again, but I wanted to make it act as much like an OEM computer as I could. The car always felt just a little less smooth than the other modern Hemis in the family fleet that I've driven. I was mostly just writing all of this stuff up because I found it interesting and wanted to share everything I had learned over the years. I also basically get 1.5-2 hours of tuning time in every day as I drive to work and back, so it's just been free research time to try out new things and really get things dialed in.

I know at this point I'm chasing that last 5% or something like that in efficiency and general "good running" stuff. My latest commute numbers have got me at ~22-23 mpg door to door round trip, which is probably more like 25 mpg highway and 18-20 mpg in town, depending on traffic. The whole thing just also feels like it runs much smoother. The main "issues" I've had have just been my AFR numbers floating around as the ambient conditions change. The car still runs fine and if I didn't have the gauge to look at I'd probably never know any better. Mostly just trying to really dial it in for fun now.

I also started with literally zero tune in my car. I bought the MS2 used, so I didn't have any kind of base tune to start with and had to learn from scratch.
 
Honestly, I probably make it sound worse than it is. I was actually basically in the same boat as you, though I went through the MS upgrade path instead of starting with all the bells and whistles from the get go. I could have really just left it alone after I did the MS3X upgrade and got it running and never worried about it again, but I wanted to make it act as much like an OEM computer as I could. The car always felt just a little less smooth than the other modern Hemis in the family fleet that I've driven. I was mostly just writing all of this stuff up because I found it interesting and wanted to share everything I had learned over the years. I also basically get 1.5-2 hours of tuning time in every day as I drive to work and back, so it's just been free research time to try out new things and really get things dialed in.

I know at this point I'm chasing that last 5% or something like that in efficiency and general "good running" stuff. My latest commute numbers have got me at ~22-23 mpg door to door round trip, which is probably more like 25 mpg highway and 18-20 mpg in town, depending on traffic. The whole thing just also feels like it runs much smoother. The main "issues" I've had have just been my AFR numbers floating around as the ambient conditions change. The car still runs fine and if I didn't have the gauge to look at I'd probably never know any better. Mostly just trying to really dial it in for fun now.

I also started with literally zero tune in my car. I bought the MS2 used, so I didn't have any kind of base tune to start with and had to learn from scratch.
I would basically just datalog and make a nice smooth curve after using the megalog viewer tool. Then you turn on EGO and give it enough authority and turn the PID controller and that should find the AFR number you want quite quickly on it's own. It does in my case.

I have mine tuned to run quite rich at cruise (never more than 15.1:1) and idle rich due to the moderately large cam. I got a lot of smoothness by adding timing at low load.
 
I'll cover a couple different tables at once in this post. Most of it is pretty straightforward and some of it I don't even really bother with.

1755384677029.png


The dwell battery correction works kind of similar to the injector dead time I talked about earlier. Basically, the lower your battery voltage, the longer it takes the coils to charge. Pretty sure these are just the default numbers. I couldn't find anything like this in the HP Tuners file (or anything about the coils at all for that matter).

The cold advance table is basically just what it sounds like. You can add some extra timing based on the coolant temp to help it out, or even pull timing if needed. HP Tuners does have something similar to this, though they do it as a full table instead of just a curve:
1755385141505.png


It also looks like they are only using it as a retard at elevated temperatures, not so much any kind of advance at cold temps (the cold spark table is all zeros). You could build the ECT hot spark into this MS setting, though I haven't yet. I kept the default values for now, though I might try the factory setup. I do drive in a climate where it could get cold enough to hit some of those lower values, but I won't know if it makes a difference until then.

The MAT based timing retard table is similar, but just references the air temp instead of the coolant temp. HP Tuners does have this as well, though again, in table form instead of a curve. They have both a hot and a cold table as well:
1755385407200.png

It's a bit tricky though because each table is only referenced to a single temperature (86 and 194, respectively). I'm sure it probably interpolates between the two, but it does make it a little more challenging to try to translate that into MS format. I'd probably just try to focus on your main operating area, which in my case would be cruising around 1700 rpm and maybe 50% load (highway driving).

I haven't had to mess with noise filtering with my hall effect style sensors. They tend to be pretty clean outputs and less susceptible to electrical interference. They do recommend running shielded cable for them regardless, though I don't think I am on either of my sensors at the moment. Your installation may vary, but I haven't used it, so I'm of limited help here.
 

I would basically just datalog and make a nice smooth curve after using the megalog viewer tool. Then you turn on EGO and give it enough authority and turn the PID controller and that should find the AFR number you want quite quickly on it's own. It does in my case.

I have mine tuned to run quite rich at cruise (never more than 15.1:1) and idle rich due to the moderately large cam. I got a lot of smoothness by adding timing at low load.

That's basically how I started, but I wanted to remove my reliance on EGO control as I had a sensor that was getting flaky. My car has been through way too many tunes at this point, but I can say my latest setup with good injector values and a pretty dialed in VE table barely needs any more than 5% correction at any point. It drives noticeably smoother because it's not chasing its tail trying to constantly adjust the AFRs.
 
Now we can get into some of the fun stuff, knock sensors and knock control. Disclaimer alert, I'm using an internal knock module for this. There are a couple of different ways you can implement knock sensing, but I went this route because I wanted the additional control it could offer. You can get some other external knock sensing modules that have stuff like digital (knocking or not) or analog (level of knock) outputs, but they lack the "knowledge" of where the engine is in its cycle when sensing. The internal module can work hand in hand with the MS to determine which cylinder is knocking so you can do individual cylinder trims and stuff like that.

1755386145052.png


The main setup is actually pretty straightforward with the internal module. You have two primary control strategies, "safe" and "aggressive". Safe will prevent the timing from returning to the full original value until you have left the region knock occurred in (though you would go back to the original timing when you return to that area). Aggressive will let the timing return all the way to the original commanded value. Both setups will pull a fixed amount of timing at the first detection of knock, then gradually feed the timing back in. "Safe" always stays one step back from the original when feeding the timing back.

I have the individual cylinder monitoring and control turned on because I figured why not? You pretty much have to have an internal module to be able to do this though.

The detection section is where you set up rpm and load limits and how many knocks it has to hear before it starts pulling timing. Pretty straightforward. I have mine set a couple hundred rpm above my idle, though I could probably drop that. Generally speaking I let it listen "everywhere" and wait for 2 counts before it does anything, just in case I get a false positive somewhere.

The next section is where you set the timing retard when knock is detected. The main value here is the retard coarse step size. That's how much timing you want to pull when knock is first detected. I pulled most of these values from HP Tuners:
1755386719921.png

The OEM setup is a little more sophisticated and has short and long term knock values, similar to short and long term fuel trims for fueling. So if you have consistent knocking at one spot on the table, it will always pull timing there, even before it hears knock. The MS doesn't have this feature (aside from you manually adjusting your spark table). The fine step size value in the MS is how much to reduce timing if it hears knock again after timing has already been pulled.

The recovery portion of the settings determines how it starts feeding the timing back in after knock goes away. Again, my values I mostly pulled from HP Tuners. The recovery advance setting at the end is how the MS determines you are in a different area of the table. It says if the commanded timing from the spark table is this value different from where you were operating, you're likely in a different enough part of the table to reset the knock control. I couldn't really tell you where my 3 value came from, it just felt okay. Would probably make more sense to look at your table and see how it changes from cell to cell. At WOT I think I only go from maybe 16 to 20 degrees, so 3 may actually be a little too high for me because it would mean any knock on the low end would reduce timing most of the way through a WOT pull.

The curve on the right lets you set sensitivity in various engine operating regions. The general idea being that higher rpm is going to create more "noise" in the sensors (they are basically just microphones and are measuring vibration). The 60% value I got mostly from research on the MS forums. HP Tuners does kind of have this, but I don't know how to translate it to the MS.
1755387304079.png

I don't have a good way to measure these values "internally" in the MS. HP Tuners exposes it as a "raw" voltage signal from the sensor, but I'm not sure if this is truly raw or amplified. The MS "knock %" output is a filtered value based on a window (settings coming up) that takes into account the signal level over a portion of time. I don't know that "100%" means 5V or 3V or whatever. I have asked if there was a way to expose the raw signal value in the MS logs, but since the sensors go into the knock module and the MS just talks with the module via a serial interface, I don't think it's that easy. I could make the assumption that Dodge is using a 0.5-4.5V kind of approach and call 2.196 roughly 49%, but you can set individual gains on each cylinder and the sensors, so it's more a case of apples and oranges I think.

Speaking of sensor setup and gains, that's the next window:

1755387683412.png


This is where you set up which sensor goes to which cylinder and the sensitivity, as well as the general frequency range you want to listen for. Starting at the top, the knock frequency is driven by the bore size. I don't know the actual formula used, but it kind of makes sense. The piston is slapping back and forth, so a larger bore is going to do it at a lower frequency than a smaller one (I think). I used an online calculator for my value. You have to pick from a dropdown of present values, so just pick whatever is closest, it won't necessarily be exact. The integrator time constant corresponds with the frequency you pick (or should at least, I feel like they should link these together). Just sort of a general measurement theory thing. If you want to listed for a particular frequency, you need a high enough sample rate to catch that frequency or not confuse other frequencies for it. This was another math formula to get this number. I got it off the MS forums. There is a really good discussion there about knock sensor theory and setup I'd advise reading through. Number of sensors is just what it sounds like. The Hemi has one on each bank. I think the monitor per cylinder option here carries over from the last menu, so you can change it at either to change both.

The gain and sensor section is where you set which sensor goes with which cylinder and any tuning you need to try to get all the signals level. The goal behind setting gain has to do with the fact that the sensors are not necessarily the same distance from each cylinder, so a vibration caused in a cylinder far from the sensor might not show up as strongly as one right next to it. Based on the sensitivity settings in HP Tuners, it actually looks like they are pretty even, though almost too even. It seems odd that cylinder 1 is the odd man out while all the others are the same, and I'm still not sure exactly where the measurement comes from, so hard to say.

The advice given on the forums is to log your data and adjust the gains as necessary to try to bring them all into line at similar overall levels. The caveat being your engine needs to be in good shape to the point that you trust nothing is wrong to begin with while setting these. If you had a noisy lifter or rocker arm or something on one cylinder, you could be masking it by setting the gain too low, so just something to consider.

The other curves are for setting the window in which you want to listen for knock and the sensitivity based on coolant temp. The general idea with the latter being that a cold engine might be "noisier" while things warm up. Probably more noticeable on forged internal setup where the pistons might have greater clearances until warm. The window curve I struggle with some. HP Tuners has these values, but they gave me some problems when I tried to use them. Another theory thing, but generally speaking the idea is that knock only occurs after TDC and in the initial phase of the power stroke. The knock module listens during this window and more or less integrates the total amount of "noise" to generate the knock percentage (at least I'm pretty sure that's what the chip is actually doing, I read some of the datasheet but didn't get that deep into it). The HP Tuners values seem to bias that window a bit later and longer (assuming the 10 value means after TDC, not before). The advice on the MS forums is the default values I have of 0 degrees for the starting point up to 35 degrees after. I tried the HP Tuners values, but was getting constant knock triggers that didn't make sense. Even at idle I was triggering knock, and I spent an afternoon with my dad listening to everything we could with a stethoscope and I never came up with anything. I set the values back to default and haven't had any issues since, so it's also possible the OEM setup is doing something a little different or using a different integrating chip or something.
 
Lastly, we have the main course, the spark tables. Not much to say about these, it's your ignition timing based on rpm and load (or in distributor speak you can sort of think of it as vacuum advance on one axis and mechanical advance on the other):

1755388762983.png


This is another one I set up with table switch (more on that later) to mimic the OEM "cruise" vs "WOT" settings, seen in HP Tuners here:
1755388824864.png


HP Tuners does have even more tables relating to spark, but MS doesn't really have direct comparisons. The other tables in the OEM setup are more ultimate upper and lower limits for spark, which the MS is more hard coded for as single numbers. I think the maximum ATDC limit (seen as negative values in the tables) is something like 10 degrees and the maximum you can set somewhere I believe. I think by default it's something like 40-50 degrees BTDC (positive values in the tables).

There is one feature that I have not found in the MS yet that kind of surprises me. The OEM setup has tip-in spark, which is kind of like an "accelerator pump" for ignition, though it pulls timing instead of adding. The goal of it being to reduce "burst knock", or knock caused by the abrupt transition of timing between the two tables. I think other controllers have a feature like this too, so it surprises me a bit that the MS doesn't have an option for it yet, though it very well could be added at a later date (one of the nice things about the MS, it's always being updated to add new features). You could kind of bake in some form of tip in, though probably only in limited regions. So for instance, you could pull the timing pretty low at high load and low rpm, which is really only even seen on a hard throttle stab and not while cruising, though those numbers are already pretty low in the table now and can't go much lower.

I did tweak my low rpm values just a tad to help out with idle and my cam. One bit of advice that is often given is to have the timing on your lowest rpm cells around idle be just a tad higher than the next row over. That way, if your idle sags for some reason, like fans kicking on or some extra load, the timing helps boost it back up.

So that's enough blabbering for another day. At this point we've got the basics set up for fuel and spark. Next up is startup and idle, which you can spend a lot of time tuning as well, depending on your needs. I'm planning to do a little more math work to see what I can incorporate from HP Tuners into my current tune as I've had a couple of issues with hot starts since I updated my injector settings and added my A/C. It's definitely better than it was, but it could still use some work to be a little cleaner.
 
I just went searching through the MS source code to try to figure out what is actually going on with that correction factor and it's fairly simple. The curve basically just tells the computer whether to use the MAT/IAT sensor value or the CLT sensor value for the air temp in the fueling calculation. So 0% means full MAT and 100% means full CLT.

My next question is whether you can use negative values or not. I don't think you can, but I need to double check. The main thought process there boils down to where your air temp sensor is. If your temp sensor is outside of the engine bay and reading true ambient conditions, this curve gets pretty easy to use. The lower the air flow, the closer it is to coolant temp by the time it hits the intake valve. Where it gets trickier is if your temp sensor is in the engine bay/intake. I need to see if I can get a thermocouple or something in my intake to confirm this, but the theory is that the sensor body heats up with the engine itself and reads higher than it should due to heat soak, to the point that the airflow around it isn't enough to bring it back down to ambient. So in that case, you'd want to subtract some amount from your MAT reading. In theory you can do that if the curve lets you use negative values, but I have a gut feel that it won't let you.

So one other interesting thing I saw while looking through the HP Tuners settings was that you have the option of picking an IAT or a MAT for your sensor as a drop down within the engine settings. So I'm guessing that they must have different formulas depending on which option you pick. I also read over the Viper PCM training manual that covers the old SBEC and JTEC computers as it has some good information on how the sensors work and the calculations they use. Interestingly enough, at least on those older computers they say the IAT doesn't really have too much effect on things and that the CLT sensor is basically the most important sensor in the engine when it comes to determining fueling, so I'm thinking they must lean that way on the estimated air temp.
 
Been a little while since the last update, but I've also been digging into the OEM setup some more on the HPT tune to try to better understand some of the stuff in the next section, startup/idle.

1757787008216.png


We'll start off with the cranking stuff to get things started (literally and figuratively). The fields here are fairly straightforward, though this is where things can start getting more unique for different builds. Some of what I have I tried to glean from the OEM stuff, other parts are more or less just the default MS settings or stuff I have just guessed and checked on over the years of my tunes. The MS does fuel calculations differently based on whether you are cranking or running, which is what the cranking RPM field sets. Below this rpm, the MS uses the cranking fuel calculations, above it would be where it's running off the VE tables. The "real" way to determine this number would be to disconnect your injectors/ignition and just crank your engine over while watching the rpm to see what it runs at, then set it a little higher than that. I think my engine cranks around 250 rpm, but I'm not sure I've actually ever checked this before. The flood clear value provides a way to shut off fuel while cranking if you think you've flooded it. If the throttle is above this value while cranking, it cuts all fuel delivery.

The other settings can be more of a "see what works best for your setup" kind of thing. Batch fire during cranking will fire all the injectors at once instead of one at a time if you are set up in sequential mode. The tooltip indicates this could be good for cold climates or maybe if you had something like throttle body injection where the injectors are further from your ports and might not atomize as well. The taper curve is interesting and something I only recently started to understand after looking over the OEM HPT tune. This setting causes less and less fuel to be injected the longer you crank the engine, presumably to help prevent flooding. HPT calls this "Startup base PW":
1757787467037.png

The counts axis here I am assuming is "ignition events for any given cylinder". You can see as the counts value goes up, the PW drops. HPT has this relative to temperature, but the MS doesn't have that capability. I did some Excel comparisons and picked a bit of an average to develop the table I have in my tune currently.

The fuel pulse rate sort of depends on your injectors. If you have really large injectors, the small pulse widths that it might command for starting may not get you enough fuel. Changing this from "every event" to "alternate events" doubles the fuel injected, but does it every other ignition event, so you get larger pulse widths, but less of them to keep the overall fueling the same. The blended curves are for dual fuel setups I believe, but I am not super well versed on them.

The priming pulse and matching delay can be used in a couple of different ways. As I have it set up now with zero delay, it's intended to be a fairly short pulse to clear any air out of the injectors at first key on since it opens them at the same time as the fuel pump turns on. Some of the older OEM Dodge computer actually used this as an initial intake "wetting" pulse to get some fuel on the walls to start atomizing. If you wanted to use it like that, you'd probably want to set a short delay so the pump has some time to build pressure before the first squirt. The priming pulse table I mostly left alone as far as I can recall. Since I'm using it more as a "clean out air" function than a "wet the intake", I could probably just flat line it all the way across.

Ignore MAT correction during ASE will probably be driven by your IAT/MAT sensor placement more than anything. This setting would effectively ignore your IAT/MAT sensor value during the ASE phase, though I'm not sure what value it would use in its place (more on ASE shortly). ASE count units just gives you the option to run a set number of engine cycles (so rpm based) or for a fixed amount of time. This could be useful as well if you have sensor heat soak issues probably as you could set it for a fixed time to give things a chance to stabilize.

The cranking pulse curve is the real bread and butter here and what determines how much fuel to inject during the cranking phase. This is a more direct fueling equation as all it really cares about is the coolant temperature. The main caveat is the value that is uses is a little less intuitive. The values you enter are a percentage of the "required PW" value that is determined for you engine way back during the initial settings configuration (it's how much fuel is required in theory to achieve you stoichiometric ratio given your engine and injector size). So if that value was 15ms, a 100 in the cranking pulse % table would mean "inject for 15ms". I had to do a little math using the HPT table to get to this, though I'm still not 100% sure how the "startup inj PW scalar" value in HPT works or affects things. I mostly just took the HPT table and divided it by my required fuel value to get my curve. So far it has been working great. The car starts reliably every time on something like the 3rd revolution (same amount of time from key twist to start in nearly all conditions I've tried so far, which are admittedly limited).
 
Next up is the one I've been having a harder time trying to get the MS to emulate the OEM on, which is warmup related stuff.

The OEM setup is slightly more sophisticated than what the MS offers, and there's one particular feature I with the MS had which was rpm based warmup enrichment. The main three tables are the warmup enrichment (WUE), afterstart enrichment (ASE), and the ASE taper:
1757788826326.png

Warmup enrichment is pretty straightforward and can sort of be thought of as the choke on a carb. It is a multiplier that adjusts fuel based on coolant temp. The big thing here is your last value in the table must be 100%, which is a bit of a departure from the OEM as well. The base OEM table looks something like this:
1757789013941.png

Though this doesn't quite tell the full story. This one is more directly an AFR (technically FAR since it's 1/AFR) target modifier. So whatever your AFR target is (say 14.7:1), this adds to it to richen the mixture up. However, this isn't the only OEM table that does that. Buried in the Speed Density section under airflow, there is also an ECT modifier table:
1757789187864.png

However, this one is rpm based, which is something I with the MS implemented (it probably could with custom code, but that's beyond my abilities right now). So the first one is a blanket enrichment that adds fuel based on temp, but the second table adds or subtracts fuel based on rpm. This is a tiny bit similar to the IAT/CLT blend curve I talked about before, but unfortunately you can't really make them do the same thing. I have an issue with my current tune where when cold, it idles lean, but cruises rich. Once warmed up, it idles fine (or even a bit rich) and runs nominally. With the OEM kind of table setup I could add extra enrichment at lower rpm that trails off as it heats up, but for now it's just something I have to deal with and try to figure out.

Going back to the MS settings, afterstart enrichment (ASE) is a fuel adder that runs immediately after start for a set duration. The ideal being that an engine often needs a little extra fuel after initial start to get things all settled and running more steady state. I don't really recall where my numbers came from. I think they started off mostly as the default MS values, but I know I had some issues originally with my car running fine for a few seconds, then falling on its face and dying. I played with some stuff here to give it some extra fuel until it could stabilize the rpm and settle down, which helped a bit, but I think my problem ultimately rested with my idle control setup. I haven't found anything in the OEM tune at the moment that looks like this, so not sure if there is a parallel there or not. The ASE taper curve defines how long you want to inject that extra fuel, though I believe the fuel tapers duriing the taper as well if that makes any sense. So if you started at something like 20% with a 2 second taper, it wouldn't inject 20% extra fuel for 2 fuel seconds, but rather 20% fuel initially that would taper down to 0 over 2 seconds in a linear way.

TunerStudio does have a WUE "autotune" feature, though I think there are a couple of caveats that go with it. Firstly, if you have a rowdier cam that gives you unstable AFR readings at idle compared to cruise, I think it would overcompensate on the warmup. Similarly, you need to have your VE table and idle control pretty well dialed in so everything is already running nice and smoothly for it to adjust better.
 
Which brings us to the next big point, idle control:
1757789952600.png


There's a lot going on here, but that's because the MS can handle several different methods of idle control devices. If you are running drive by wire (DBW), I'm not exactly sure how the MS deals with that. It has some functionality for DBW in limited capacity, but I haven't played with it. Some DBW throttle bodies might still have IACs built into them, though I'm guessing there are some that do not. These menu are more for dedicated idle valves of some variety, whether that be an on/off style high idle valve, a PWM controlled valve, or a stepper style. I have a stepper style iAC on my throttle body, so that's how these settings are configured in the screenshot.

There are two primary ways to do the idle control as well. A "simple" method that just links the IAC position to the coolant temp, and a closed loop setup that will actively try to achieve a target rpm. I started off with the simple setup and it worked okay, but as I added electric fans and other accessories that could drag the idle down when they came on, I moved to a closed loop setup to give me a more stable idle.

The main idle control window is where you will set up what kind of valve you have and how it operates. In my case it's stuff like how long each step takes, how many steps it has, and whether to keep a small current on it to hold the position. PWM valve and on/off high idle valves will have different settings.

The closed loop idle settings window is the main one where I've spent my time, though you wouldn't even touch if you leave it with the "simple" control method. The settings here let you further refine your control range and the main PID values that go into controlling the motor to achieve the idle rpm you want. There are some other novel things you can do with an idle valve as well here like opening it all the way during WOT for that little extra bit of airflow. The big one I found was the "use last value or table" setting that helped me out. I had some problems with a surging idle that would usually settle eventually, but could take some time. I tried adjusting the PID settings several different ways to see if I could get rid of the oscillation, but never found values that worked on most conditions effectively. What I learned when looking at some data logs was that my IAC position was starting way off from where it would usually settle, which meant the PID would have to be really strong to get it to move that many steps that quickly, but that would make it overly sensitive once I was closer to where I wanted to be. I changed the values in the initial values table to be closer to where it would tend to settle and suddenly my surging idle more or less went away. Now I only had to adjust maybe 5-10 steps to get where I wanted instead of 30-40, which made it easier to set the PID a little "looser" to allow for the moderate lope my cam has.

The target rpm table is pretty self explanatory and you can set as you see fit. Mine is somewhat pulled from the OEM HPT tune with a couple of tweaks to suit my preferences:
1757790805404.png

There are a bunch of different tables in HPT that seem to be something like idle targets. I used this particular one as my starting point and adjusted it a little bit to work with my cam and A/C. My car idles pretty happily around 650 rpm warm with a 50 rpm swing either way for the cam. With A/C and electric fans that might kick up to more like 750-800.

The coolant based crank steps table is what sets the IAC position during cranking. There is a semi-equivalent table in HPT, but I haven't figured out a good way to translate this yet:
1757790984467.png

The OEM setup works off of airflow, which is something I don't have an easy way to calculate. You can calculate airflow based off of rpm and VE of an engine, but I don't know what my VE is while cranking and I don't know what IAC position corresponds to what amount of airflow. Dodge instruments and measures this stuff during engine development, so they know what throttle position corresponds to what amount of airflow, and with it being a DBW based system, they can more directly command those values. Without a flow bench and a motoring dyno, I'm kind of just guessing. So far the values I have in my table seem to "just work". I think they are mostly default MS values. In the heat they have done fine. We'll see how they do once the temps drop this winter and if I need to adjust them.

The A/C settings panel is where you can do compressor clutch control stuff if your car is equipped with A/C. I finally got my system installed, so I've been playing around in here some. Most of it is pretty straightforward (what input is the A/C on switch on, what output to control the compressor with, etc.). You can set some compressor safeties here like minimum engine rpm to engage and maximum rpm to run at as well as doing a cutout during WOT to free up every little bit of horsepower. The main settings I played with here were the idle up related ones that add extra idle target rpm and IAC steps to "jump start" the idle when the compressor first kicks on. My current setup feels much more like a factory car where the A/C will cycle on and off pretty seamlessly aside from the idle increase you can hear.
 
There are some other interesting features I've been playing around with in the idle menus that I need to dig into some more.
1757791505388.png

The Idle VE settings let you set up a smaller resolution VE table that the MS will use once it determines the engine is in the "idle" state. You could use this to get better resolution in idle. So for instance, on my main VE table, I go from 600 to 800 rpm in my rpm columns, and the MS will just linearly interpolate between those values. With the idle VE table, you could instead set it up to be 600 to 800 in 4 discrete steps in case you have a less linear increase in fuel demand. I've tried playing with this as I have some pretty big AFR swings in my idle, but only 4-6 cells on my main VE table that it tends to idle in. I'm not sure it's made a huge difference, but it could be handy for you.

Idle advance I plan to play with some more in the future. The OEM setup has something similar to this, though they implement in a little differently. They use a "torque based" idle setup where they target a particular engine torque instead of rpm directly. The idle advance table is similar to the idle VE table in that you can get increased resolution in your idle conditions for timing. Additionally, you can also have the MS add or pull timing to help maintain a target idle rpm. So kind of like closed loop IAC control, but instead for timing. I'm planning to try giving this a shot to see if it can further help the occasional idle surge I'm getting. The OEM setup alludes to stuff like this as "idle torque spark" settings:
1757791924634.png

I believe these are just PID tuning values that are used to adjust spark as necessary to maintain a desired torque. Some other systems call this "spark scatter" where it lets the spark float around at idle to try to maintain a fixed idle rpm. I've been trying to dial in my VE tables first before digging into these, but I plan to play around with them in the near future to see what they can do.
 
-
Back
Top Bottom