Page 1 of 3 123 LastLast
Results 1 to 20 of 42

Thread: How To: Idle Tuning a NGC PID Controlled Setup

  1. #1
    Senior Tuner
    Join Date
    May 2015
    Posts
    1,908

    How To: Idle Tuning a NGC PID Controlled Setup

    So...after about 3 hours of testing and manual tuning, about 25 tunes later I finally got a good grasp of just how the idle control system in the dodge system works. First of all, this guide is meant for those who try all the factory settings for the IDLE ETC control and still find themselves with an unstable and surging idle. ALWAYS try the factory settings first before going about changing anything, for most setups they will work ok or only need slight tweaking.

    Ok now onto the tuning. First of all, everyone should take 15min to read the following couple of links. While not the same as GM setups, the concept is already there and laid out OK, though I found in general research of a proportional derivative integral (PID) controlled setup the order of magnitude for each of the three adjustments is actually a little different.

    GM Link (read under each of the Proportional, Derivative, Integral sections about the High and Low settings, we don't have filters)
    https://www.hptuners.com/help/index...._tm_engine.htm

    The ol' Wikipedia:
    https://en.wikipedia.org/wiki/PID_controller

    Another helpful "tuning" link:
    http://www.expertune.com/tutor.aspx

    So after sifting through that info, you are still probably going, WTF did I just read?? Haha, I know I did after the first time. Let me try to explain it a little more simply, then go back and read Wikipedia link again, it makes the most sense for our application.

    Our System

    Dodge employs two PID controllers to handle getting rpms to your target rpm, one for timing advance and one using your throttle body, it uses both to get things under control. In standard setup, the timing advance PID controller is capped at a maximum of your PT timing table and can only go down from there. It will pull timing back as rpms go above desired idle down to your SPARK>ADVANCE>Min Spark TqRed or to the point where the torque the PCM calculates is being pulled hits the maximum allowed (more on this later), and will go up to a max of your PT timing table or to the point where the torque it is ADDING hits the max allowed in the tune when the rpms fall below desired idle.

    Throttle body PID controller has no such cap, it is all setup by the max/mins of the idle tables in the IDLE ETC tab. The throttle body PID controller will be your biggest influencer to a surging and hunting idle, it has the least amount of control and is the most sensitive to being out of tune.

    PID Basics

    Ok so now you understand you have two PID controllers, they compound each other and act the same way using two different adjustments, timing and throttle body (aka airflow). Easy way to understand the three aspects of the PID controller is as follows (from here on I will call each component just by P, I, or D):

    Proportional Gain: This is the most basic of the three, this is simply a table of how much torque to pull or add given a certain RPM error. It has very little chance of ever getting control of the idle on its own, BUT it is important to understand you HAVE to make the rpms overshoot to begin with, setting the edges of the table (1000 rpm error) too small will result in a sputtering slow rising rpm on startup and instant stall every time you come to a stop, or if it doesn't stall a HUGE swing up and down surging. If you simply removed all of this control you will almost never get the rpms to rise up to your desired idle. The strategy is to make it overshoot but then quickly using the I adjustments and then finally D adjustments get it to stabilize as quickly as possible.

    Integral Gain This is the next adjustment in the over and under error to start getting the idle to settle down. Think of this as the adjuster for HOW LONG the rpms were either above or below the desired idle, but also cares about just HOW much as well. So very fast surge happening within a half second of going above and below the desired idle will need a smaller integral adjustment than a very sloooowwww up and down surging that takes a full second to go from negative to positive. The NGC PCM doesn't really display the adjustment to us this way, it simply shows us an error rpm and amount of torque to remove or add just like the P table, but in concept it works the same way. The strategy in tuning this aspect is to make the PCM pull back on the P adjustments in opposite directions to start SLOWING down the over and under shoot of rpms. It also serves to fix the "offset" you couldn't fix during proportional. Basically you are going to find your up and down surging centers around a point lower than your desired idle, integral brings the entire curve upwards.

    Here is an example of the two in play...

    If the rpm error is -200rpms (Idle desired of 900 and rpms hit 700) the P adjustment says add +10ft/lbs of torque, it results in rpms flying up to +200rpms over idle to 1100 then P responds with -10ft/lbs to bring rpms back down, rpms fall back to 700rpms, starts all over again...the integral will say ok you over shot by 200rpms on the way up and down and it took about 0.50 seconds to complete the up and down, and with the same command of torque adjustment on the next cycle you are going to overshoot by 200rpms again, tone it back by 5ft/lbs and lets just add 5ftlbs but change the rate you apply the 5, apply it very fast but also dial it back quicker to 0 quicker once near target idle and go -5ftlbs on the way down quicker since P took so damn long to complete the last cycle. I is accumulative of the past errors, so have to be careful, if you command too much the "sped" up rate of the increase/decrease can cause the same overshoot. If done correctly the adjustments of both P and I will get smaller and smaller and eventually come close to zero.

    Derivative Gain This is the final adjustment, best way to think of D is it a predictor by studying the slope of the ups and downs over time as P and I work together to get the idle stabilized. So if on the first up and down the slope was 2, on the next it was 1, then the final it was close to 0, derivative will try to take those errors and adjust over the top of P and I so that you get the up and down of that third cycle pretty much right at the start, eliminating the up and down right at the start.

    Here is by far the best visual of how each function, notice in the legend the gain being changed (Kp is proportional, Ki is integral, Kd is derivative)

    https://en.wikipedia.org/wiki/PID_co...n_Animated.gif

    PID_Compensation_Animated.gif

    More to come.....
    Last edited by 06300CSRT8; 04-13-2016 at 03:21 PM.

  2. #2
    Senior Tuner
    Join Date
    May 2015
    Posts
    1,908
    Now onto the tuning side of things...

    I cannot caveat this all enough to point out that the rest of your tune must be pretty close or at least accurate to your understanding for this to really work. Most important is your injector settings, your throttle body airflow tables (if you have a larger than stock and don't know how to adjust it, best to leave it stock), and your VE table. Now I was faced with a hell of a surge from first fire up on this thing so VE tuning was near impossible. So I simply got it off idle and cruising and then slowed down to as close to idle while rolling to get some data and then just interpolated it out to the idle area. Same for the timing, I flat lined it all to 14* in all Idle cells to get it to settle down some.

    Other noteworthy point is we cannot log the proportional, integral, and derivative adjustments the PCM is doing. The spark adjustments can be logged but it isn't just the PID adjustments you will log, you will get any of the various spark modifiers through that data. I have made the request to the engineers, they put it on their queue with no ETA. I will show below how I got a glimpse of what the PCM is actually doing other ways.

    So to get started, you need to log your sick surging baby in its current state. I setup three maths and three graphs:

    Math 1: IDLE RPM ERROR: simply actual RPM minus desired idle RPM
    Math 2: IDLE TB ERROR: Here I figured out in my logs what TPS % was closest to my desired RPM, I then calculated a percent error from that TPS %. When you first setup the MATH you can start with 16.1% (0.161) and adjust later
    Math 3: IDLE TIMING ERROR: Same as the TB error, I took the spark advance I am commanding in my PT Base table in the idle area and just subtracted that from the spark advance reported, this will show me in degrees adjustment to spark. If you have a PID for spark adjustment, just use that instead, I didn't.

    PID Tuning Maths.JPG

    Here are the three graphs of the two new maths of IDLE TB ERROR and IDLE TIMING ERROR as well as a graph of just the TPS % itself, you will need all three.

    PID GRAPHS.JPG

    So now go out and with all your current settings as is that is causing the surging idle, and get a nice log of idle in park, then in drive, then in reverse, in three separate logs. Once done, first thing to do is figure out what TPS% is most correlated around your idle speed. If you look at your TPS graph, you will see an average TPS % right at the 0rpm error spot. This is the one to use in your MATH 2 you created. for me, the average was 16.1%. I always have to close and reopen the scanner once I amend a math formula for the graph to actually update. Here is my TPS % Graph, notice at the 840 desired RPM column TPS % average is 16.06%. Please note each time you revise your tune you should double check your average TPS % didn't change, mine did a lot. You should always update your MATH to match.

    TPS % Average Stock.JPG

    Now that you updated your MATH 2, take a look at your TB ADJ graph. Should look something like this, this is stock versus tuned.

    TPS % Average.JPG

    Starting to make more sense...as you can see on the stock tune when I was over desired idle rpm by 100rpms it closed the throttle body 1%, when I was 100rpms under, opened 9% and at 200rpms it shot to 13% more open. My car tended to always UNDER idle, error is much more negative than positive, this starts to explain why. My TB PID isn't doing enough or quickly enough when rpms fall below desired, then all the sudden shoots open and brings up the rpms, aka hello surge.

    Now look at my tuned TPS Error. As you can see its much tamer, there is very little adjustment until it hits the 200 rpms under mark then goes to 9% versus the 13% from the stock settings. My lower integral settings mean it doesn't act so quickly to get to its set point, as you look at stock you can see it adjusting at very small RPM errors, in the new tune its slowed down, doesn't start to really kick in until it sees about a 150rpm error and then quickly goes to 9% to correct, it catches the falling rpms well.

    Here are the three PID tables behind these adjustments, they are expressed in ft/lbs of torque. Here are my stock and tuned tables

    PID TB Tune 4.JPG

    The correlation here is as follows: first off the RPM error is opposite what you think in the tune, negative is above idle. So at +200rpms in each of these tables which is 200 rpms below desired idle, we see it commanded to add +4(P) +23(I) +0(D) for a total of +27ft/lbs which equates to about 9% of throttle body movement.

    In my updated tables, as you can see there are spots where I increased the proportional earlier on, but lowered my integral as it was overshooting. I still have room to go before I am back to stock values that originally did not work as the car still surges just a touch (+/- 100rpms) but its HUGELY better.

    So the million dollar question...how did I get to these new values. Here is the procedure...

    Set your proportional to half of stock (multiply by 50%).

    Zero out completely your Integral and Derivative Tables.

    It is going to start like a bag of ass, fair warning. What you are looking for is for the RPMs to get ABOVE your desired RPMs by 2-300rpms. Make sure you are connected and logging before you start the car. If you have a slow rising startup and feels sluggish to get up above your desired idle, add 10% to the entire table (multiply by 1.10) and keep trying until it does. From the get go it is going to surge like mad, 3-400rpms above and below desired idle, prob stall after a few surges. Don't give up. If you car isn't same strange anomaly, you are going to notice you are going to idle on average on the LOW side of your target RPM. This is normal and ok. You want to keep increasing your proportional amounts until the overall average stops rising. Ex. if you surge to 950 rpms and down to 500rpms on average, your midpoint is about 750rpms.

    Once you have a steady surge that cannot be raised up anymore, time to bring in your integral adjustment. start very slow, I took the stock table and took 10% of it (multiplied by 0.10). You want to increase in 50% increments until the idle finally after maybe 10-15 surge cycles levels out, even if only for a few seconds and starts to surge again. I then go about another 10% increments more until it starts to INCREASE the overall error positive or negative AND the average that you saw during just using the proportional stops rising, you should be able to raise it up to very close to your target rpms. At this point you have reached your max integral adjustment you can give it, I usually back it down about 15% from this point, and leave it there.

    Lastly, bring in your derivative. I started with 50% of the stock values, moved them up in 10% increments until I saw no increase to stability and actually started to surge more and never find a steady idle. I then backed it down about 15% from that setting.
    Last edited by 06300CSRT8; 04-13-2016 at 03:19 PM.

  3. #3
    Senior Tuner
    Join Date
    May 2015
    Posts
    1,908
    Here is my Spark Adj graph for the same log and spot:

    PID Spark Graph.JPG

    Same here, starting to make sense. As noted earlier, the spark PID controller CANNOT exceed my PT Base table. If you look anytime rpms were below desired, there is no spark adjustment at all, spark advance was sitting at 13* and not going any higher. when RPMs are above it pulls back timing. You can see at 100rpms over desired idle, it was pulling about 7.5 degrees. If you recall the rule, this cant exceed the Minimum Spark Torque Required table. For me, this is capped at 5 degrees minimum. I am commanding 13* in my PT base tune, so 13* minus 7.5* and it is basically hitting the cap at 5.5*.
    Last edited by 06300CSRT8; 04-13-2016 at 01:46 PM.

  4. #4
    Senior Tuner
    Join Date
    May 2015
    Posts
    1,908
    Still a work in progress, will continue to update as I can...spark tuning is next. Basics will be spark is ideal for smaller adjustments and can be quite aggressive without much harm, but needs to be controlled with a larger cam.

  5. #5
    Advanced Tuner
    Join Date
    Sep 2011
    Location
    Portland, OR
    Posts
    518
    Good info. Thanks!
    The spark pid can be used to tame a really choppy big cam idle. Works well.
    Y2K C5 A4 Coupe (10.78 @ 127) Cathedral port 6.2
    S476 L33 5.3 69 Nova 8.76 @ 158 Drive to the track street race car
    06 Cobalt SS bought new

  6. #6
    Senior Tuner
    Join Date
    May 2015
    Posts
    1,908
    Worth noting I got idle demanded torque in gear table and a new airflow factor table by ECT and RPM added in the last 3.0 update. Very useful to idle tuning. For most guys with stock settings you can simply lower and raise the commanded torque in the idle table to give more airflow/torque while in gear.

  7. #7
    Advanced Tuner
    Join Date
    Sep 2011
    Location
    Portland, OR
    Posts
    518
    Are you saying these are new tables in the editor?
    I'm not seeing them.
    Perhaps for your particular calibration only?
    Y2K C5 A4 Coupe (10.78 @ 127) Cathedral port 6.2
    S476 L33 5.3 69 Nova 8.76 @ 158 Drive to the track street race car
    06 Cobalt SS bought new

  8. #8
    Senior Tuner
    Join Date
    May 2015
    Posts
    1,908
    I am seeing them in my calibration, you may have to reread your tune after the latest download to see them, they popped right up for me though. Might only be visible on NGC3 CAN

  9. #9
    Potential Tuner
    Join Date
    Sep 2016
    Posts
    7
    I know this is an old thread, but here's my problem. I have a fairly large cam in my 5.7, and the airflow, spark and idle speed are all perfect, I get zero surging whatsoever in open loop. After I put it back to closed loop it surges and I'm sitting there watching my afr jump between 13.5 and 16.5 trying to get to stoich because of the misfires. Is there anyway to trick it into open loop at idle?

    Jared

  10. #10
    Senior Tuner
    Join Date
    May 2015
    Posts
    1,908
    Quote Originally Posted by 03bstrdram View Post
    I know this is an old thread, but here's my problem. I have a fairly large cam in my 5.7, and the airflow, spark and idle speed are all perfect, I get zero surging whatsoever in open loop. After I put it back to closed loop it surges and I'm sitting there watching my afr jump between 13.5 and 16.5 trying to get to stoich because of the misfires. Is there anyway to trick it into open loop at idle?

    Jared
    Hey bud - when you say your airflow is "perfect" how do you know that? Typically when the idle fueling becomes very unstable once closed loop gets enabled means you have TOO MUCH airflow. So think of it this way, you can achieve stoich with very low airflow but also very little fuel, and also with a lot of airflow and a lot of fuel. Both can yield stoich on your gauge, but one extreme or the other will drive the closed loop fueling nuts trying to compensate.

    Also complicating this whole problem is if you have too much airflow, IE the throttle body is open pretty far, the PIDs controlling the opening and closing of the throttle body to stabilize the idle will also be off, they come programmed from the factory to handle minute differences in airflow and rpms. If your base tune is off too far, they cant compensate and usually overshoot like mad.

    Coouple things to make sure of. First of all, log your throttle volts and airflow in a graph when in open loop. Compare this against your minimum airflow you have in your throttle body table, shouldn't have your min airflows any more than 20% LESS than these values. If youre higher to start then you've got an issue. If its way too low, raise them up.

    Next while still with close loop DISABLED but logging your AFR, work on your VE table. Odds are youre going to be rich, its counter intuitive, you would think "ok I gave it more airflow, now its going to need more fuel" but no, reason being is more air equals LESS vacuum which means youre higher in in the pressure ratio or aircharge row in your VE table which is ALWAYS higher and commanding more fuel as you move up. So plan to have to chop out 10-15% in the idle columns.

    After all that, turn closed loop back on and see where youre at.

  11. #11
    Advanced Tuner
    Join Date
    Feb 2016
    Posts
    431
    Closed loop with large cams is often a struggle as the engine doesn't like to run nice at 14.7 at low speed.
    Problem is some of the fuel is looping out the exhaust and making the sensor read rich.
    PCM leans the mixture to get the sensor happy but now the engine is too lean and dies.
    Throttle opens to revive idle speed, gives it fuel, revs climb, repeat repeat repeat.
    If you tune it open loop at 12.5-13:1 AFR, it probably idles perfect.
    Enable closed loop and surge surge surge....
    If cam is big, may be best to run open loop all the time...or forget the cam and fit a blower

  12. #12
    Tuner in Training
    Join Date
    Aug 2016
    Location
    USA
    Posts
    47
    Having a cam that only has abut 7-8" vacuum at 1150 rpm idle I completely understand the chasing your tail frustration your having. I've tried running a alpha N type idle mode but it won't have it for very long before various O 2 codes start lighting the dash up. I did have some success adjusting the transport delay tables a bit so you may try that. I have an 06 300 with the NGC3 and I'd be willing to say there's not one parameter I haven't changed trying to fix my issues. Of course I did all this with CMR so there were no explanations of ANY kind about what a table does or if it even applies to the particular vehicle your tuning and as 06300 says a LOT of them do just the opposite of what you think.
    I am so glad HP Tuners finally gave us some support and the fact that others are so willing to share their knowledge here. In CMR world it was all top secret because everyone wanted to be the "King Tuna" so it really set our community back as a whole IMO. Thanks for sharing guys :-)

  13. #13
    Tuner in Training
    Join Date
    Mar 2015
    Posts
    24
    What a great read. I learned a lot here guys that pertains to my combo. That I must say has come along very nice.
    FlatTop

  14. #14
    Potential Tuner
    Join Date
    Sep 2016
    Posts
    7
    You were right, I did have a bit too much airflow but also Spark correction was a big issue as well. My airflow was off by about 10%, My TPS is 13.3 at idle and it idles decent. However, it misfires at idle, so the 02s can't read the unburned fuel so it runs rich. In open loop the issue resolves itself and the idle is consistent. Is there a way to trick it into open loop at idle like you can on the GMs?

  15. #15
    Does anyone know how base idle spark is determined? On my 2006 Magnum SRT8 its not PT Base +/- Idle Torque Spark modifiers as stated in the OP. If I zero out the latter tables my Timing Advance is always significantly less than PT Base; usually by about 8 degrees. Once it sees any sort of Accelerator Pedal Position the Timing Advance and PT Base become equal, which to me indicates there's some hidden field somewhere. I do have Spark->Advance->Idle Spark tables, but they only have one value (set to -64) and changing it doesn't seem to do anything. The MBT (max) timing table is equal to the PT Base table.

    My problem isn't a surging idle, but a rough one. Timing at idle varies wildly, causing the car to feel like its missing when timing gets very low. I don't think its actually missing because AFRs and O2 voltages are steady.

    Thanks.
    Last edited by Grant; 10-26-2016 at 06:36 PM.

  16. #16
    Senior Tuner
    Join Date
    May 2015
    Posts
    1,908
    Idle spark modifiers are in units of torque not spark degrees, zeroing them out doesn't mean you won't still have the torque monitoring system pulling timing as your estimated torque is higher than desired.

    Iat spark and baro spark modifiers is where I would look next. But if you're throttle is moving around at all at idle then your airflows are still too far off for spark to make fine adjustments

  17. #17
    Senior Tuner
    Join Date
    May 2015
    Posts
    1,908
    When torque management is active (when you exceed the allowed difference) you'll be riding your min spark torque management table FYI

  18. #18
    Throttle voltage is steady at 0.16 to 0.17V. Idle RPM is fairly steady too; +/- 50 from target usually. Timing advance is just kept really low at idle, around 5-7 degrees usually, though it does spike up to PT Base if the RPMs drop enough. So my estimated idle torque is higher than desired, but what determines desired idle torque?

    IAT and Baro Spark don't seem to have any idle-specific settings? Except IAT Spark Idle Offset, which is zero. In any case I seem to be getting full PT Base everywhere except idle, and am not getting into any Baro or IAT spark modifiers.

    I just saw this:
    Worth noting I got idle demanded torque in gear table and a new airflow factor table by ECT and RPM added in the last 3.0 update
    I'm not seeing either of those tables, but I'm not sure they'd help as I'm working on P/N (and behavior doesn't change in D anyway).
    Last edited by Grant; 10-26-2016 at 11:54 PM.

  19. #19
    Senior Tuner
    Join Date
    May 2015
    Posts
    1,908
    If you post your tune and log, I can take a look. Just sounds like its adjusting based on torque and if your min spark tq red table is stockish, you're allowing it sometimes 20-30 degrees of adjustment from your PT base.

  20. #20
    Tuner in Training
    Join Date
    Apr 2014
    Posts
    47
    Thanks for taking the time to put this together!

    Heres another way of looking at PID's from Holley, this is how ive always thought of it:

    There are different ways to think about how a PID control loop works using mechanical analogues.



    You can think about the P Term as being like a spring. The further the measured value deviates from the target value, the more the P Term tries to “push back” to restore it. A low P Term is like a light spring: the restoring force will be low relative to the displacement. A high P Term is like a stiff spring: the restoring force will be high relative to the displacement.



    If you are familiar with heavy truck suspensions the I Term is much like the leveling valve on an air suspension system. It will slowly add or vent air to make sure that the suspension returns to a normal ride height when the load changes. It is slow enough that if you hit a bump and the suspension moves up temporarily it has a negligible effect, but the longer things are away from the target the more it builds up a restoring force. It may take a while but eventually it will build up enough force to get things into equilibrium at the setpoint. The I Term corresponds to how quickly this happens. A small I Term will take a long time to get things where they should be, and a large I Term will operate more quickly.



    You can think about the D Term as being like a damper or “shock absorber.” A shock absorber (without a gas preload force) is actually very easy to extend and compress if you are doing it slowly. If you try to do it very quickly you will see that it takes herculean strength. In a similar way D Term responds to how quickly the feedback (measurement) is changing. If the feedback is rapidly changing the D Term will “put the brakes on” to slow things down.



    Practically speaking, you can go overboard with high PID terms. You might be wondering what the downside is to having high PID terms, since they seem to do good things. Ultimately this is related to not being able to implement the system perfectly. Ideally the feedback mechanism would be accurate and fast, but all of the sensors we use have delays and noise on the signals. The ECU also cannot sample them infinitely fast or accurately. The actuators certainly have delays and nonlinearities. All of this combined means that with high enough gains things can get “out of phase” with reality. If this is too far from ideal, the effect of the controller output can actually make things worse and cause oscillation. This applies to the P and D terms. In theory the D Term would only contribute to stability, but it is more complicated because it responds to speed. Estimating speed is a rate-of-change calculation, which inherently harder to calculate quickly and accurately.



    The point of diminishing returns with the I Term relates to relative timescales. Using the suspension example you certainly wouldn’t want your truck to dump the air in the bags because a wheel drops down in a pothole going down the road. You intentionally want the I Term to not overreact to errors that are short in duration. An I Term that is too high (particularly when the P Term is too low) can cause low frequency hunting after step changes. Some amount of limit cycling may be unavoidable with “deadbands” in actuators, but the magnitude should be quite low. If you have a long overshoot of over 15% or so as a result of a large step change, consider reducing the I Term.