ITT: MS3 1.4.0+ and Closed Loop EBC
#182
On a slightly different note, I'm struggling with overshoot from a quick throttle stab because the target boost jumps instantly to say 200kPa, but it's impossible for the turbo to achieve that, whereas if I go full throttle from really low revs, it can follow my target table and so it doesn't overshoot.
1800rpm tip in - target starts low and rises only with what is achievable, MAP follows closely.
3400rpm tip in - target jumps to 190kPa and MAP oscillates as a result.
It seems like the Megasquirt really needs a lag 3D table, whereby you tell you how quicky to ramp the boost target, eg at 3500rpm, 200kPa might take 0.8s, but at 5500rpm, it's only 0.3s, so at 3500rpm and 200kPa, it would ramp the target in over 0.8s and at 5500rpm it would ramp it in in only 0.3s.
How has everyone else dealt with this?
#184
Retired Mech Design Engr
iTrader: (3)
Join Date: Jan 2013
Location: Seneca, SC
Posts: 5,009
Total Cats: 857
I don’t have time tonight, but I will try to step you through. It”s not easy, but it can be done.
Correct Valve
Frequency Min Max Bias Delta Slider P I D
People laugh at my settings, but they work and I can give reasons why.
DNM
Correct Valve
Frequency Min Max Bias Delta Slider P I D
People laugh at my settings, but they work and I can give reasons why.
DNM
#185
So I have been playing with bias duty. I am new to this strategy and have been using the old closed loop method for years on ms2.(this is my first ms3x) Anyway I went thought my table and changed every cell to 0...did a pull, then 10...did a pull, etc. and this is what I have right now. I have not even begun to tune CL so please ignore the over shoot. My question is, I have all these 0 cells where I have not been able to get data yet under heavy load. Im hesitant to log driving around town and fill the 0 cells with random data from different gears. I guess my question is, how is everyone getting data for all the cells? Are yall just lowering your boost control target table and doing pulls in the same gear?I I have been doing all my pulls in 3rd gear(5speed,3.9) and it seems to be working will with 12 psi being my target. I think once I lower my max duty % and play with the PID controller, Ill be set!
#187
The only other option I think I have is to leave the cells at 0 and hope that "boost control lower limit Delta" can make up for the 0 cells by keep the valve shut till I get within my duty% cells with values and then transition to bias duty.
#188
I'm too drunk to answer properly.
But I'm sure you are overthinking it. There are way too many other factors causing errors. Gear, temps, where you started on your map when you hit the loud pedal. on and on.
Do not expect perfection from such an imperfect code. The software control of your EBC can only help like 5% and really only right at the knee of the curve.
But I'm sure you are overthinking it. There are way too many other factors causing errors. Gear, temps, where you started on your map when you hit the loud pedal. on and on.
Do not expect perfection from such an imperfect code. The software control of your EBC can only help like 5% and really only right at the knee of the curve.
#189
Retired Mech Design Engr
iTrader: (3)
Join Date: Jan 2013
Location: Seneca, SC
Posts: 5,009
Total Cats: 857
EDIT: 1.5.2, Beta 4
Scott Wilson, please go to Meet and Greet section and introduce yourself to the community.
But, in answer, in general, to your initial question, any kPa below your waste gate value will be reached with "0" Bias.
Now I will answer @Tran question about how I have come to my EBC Tune, along with some PID logs that demo:
In general, I think the biggest error is to try to use a "correct" bias table with CL EBC. It will not work, and this is why.
Observe the upper graph. TPS is pouched at about 2600 RPM. In this case, the Delta of 60 is always met, so the CL operates the whole time. Because punch, the target will be above the MAP. Since CL is active, Integral will rise. See the yellow trace in the 2nd graph (G2). This is a really extreme case because the CL was active for about 1.5 seconds before target was reached. Thus, there was a lot of time for the Integral to wind up. Now, for this point in time, the Bias table calls for about 30. By the white trace in G2, you can see that the Boost Duty was 45. So at that point, 30 Bias + 19 Integral - 2.5 Proportional is roughly the 45 BD. Can you imagine if one set the Bias to 45 to begin with? The increased Integral would give major overshoot.
Another thing that can be observed on this graph, is that just before MAP meets target, it's slope increased (the compressor is spinning up rapidly) At that point, notice the Derivative went negative, somewhat putting the brakes on (lowering the BD) to prevent overshoot.
Note, too, that even though the kPa delta was never above the 60 kPa threshold, the BD went to the 65 maximum setting based primarily on P + Bias.
This is my 2nd deviation from standard concepts. I do not use the Delta to force to maximum BD. I can get that from Proportional + Bias. I use it to prevent the turning on of the CL algorithm, and the start of the Integral contribution. Here is an example from the same log:
Note that at the punch, at a lower RPM that would require spool-up to hit target, for 0.3 seconds, the 60kPa delta opens the BD to 65 max. Then CL starts, we get a giant D kick (but who cards) Then I climbs with time (but only for 0.8 seconds) to "10". Meanwhile P drops as target is approached. MAPDot is low, so only a little negative D contribution. MAP settles gently to Target. Bias here is again about 30. With the .7P. 10I 0D, that sums roughly to the 40 BD.
I hit on this approach of lower Bias when we were having discussions about tuning hot and then overshooting in cold weather. I thought then to lower my bias to let the PID push up for hot, and down for cold. But at the starts, there is no push down. The output of the PID is always summed with the Bias to get the BD.
I'm going to load this and then continue, so I don't loose this work. Then I will add more.
Scott Wilson, please go to Meet and Greet section and introduce yourself to the community.
But, in answer, in general, to your initial question, any kPa below your waste gate value will be reached with "0" Bias.
Now I will answer @Tran question about how I have come to my EBC Tune, along with some PID logs that demo:
In general, I think the biggest error is to try to use a "correct" bias table with CL EBC. It will not work, and this is why.
Observe the upper graph. TPS is pouched at about 2600 RPM. In this case, the Delta of 60 is always met, so the CL operates the whole time. Because punch, the target will be above the MAP. Since CL is active, Integral will rise. See the yellow trace in the 2nd graph (G2). This is a really extreme case because the CL was active for about 1.5 seconds before target was reached. Thus, there was a lot of time for the Integral to wind up. Now, for this point in time, the Bias table calls for about 30. By the white trace in G2, you can see that the Boost Duty was 45. So at that point, 30 Bias + 19 Integral - 2.5 Proportional is roughly the 45 BD. Can you imagine if one set the Bias to 45 to begin with? The increased Integral would give major overshoot.
Another thing that can be observed on this graph, is that just before MAP meets target, it's slope increased (the compressor is spinning up rapidly) At that point, notice the Derivative went negative, somewhat putting the brakes on (lowering the BD) to prevent overshoot.
Note, too, that even though the kPa delta was never above the 60 kPa threshold, the BD went to the 65 maximum setting based primarily on P + Bias.
This is my 2nd deviation from standard concepts. I do not use the Delta to force to maximum BD. I can get that from Proportional + Bias. I use it to prevent the turning on of the CL algorithm, and the start of the Integral contribution. Here is an example from the same log:
Note that at the punch, at a lower RPM that would require spool-up to hit target, for 0.3 seconds, the 60kPa delta opens the BD to 65 max. Then CL starts, we get a giant D kick (but who cards) Then I climbs with time (but only for 0.8 seconds) to "10". Meanwhile P drops as target is approached. MAPDot is low, so only a little negative D contribution. MAP settles gently to Target. Bias here is again about 30. With the .7P. 10I 0D, that sums roughly to the 40 BD.
I hit on this approach of lower Bias when we were having discussions about tuning hot and then overshooting in cold weather. I thought then to lower my bias to let the PID push up for hot, and down for cold. But at the starts, there is no push down. The output of the PID is always summed with the Bias to get the BD.
I'm going to load this and then continue, so I don't loose this work. Then I will add more.
Last edited by DNMakinson; 06-08-2019 at 09:18 AM.
#190
Retired Mech Design Engr
iTrader: (3)
Join Date: Jan 2013
Location: Seneca, SC
Posts: 5,009
Total Cats: 857
Logs and Tune
EDIT: 1.5.2 Beta 4
I will show some other examples, all made with the same settings, but at various RPM, Various start points, Various TPSDot, various MAT temps (but no extremes as time of year.... 70 to 90 F).
This shows a punch from 4500 RPM. Spool is much faster. Still, some 60 kPa Delta delay in start of CL. Because MAPDot (fast spool) there is a large negative Derivative of -6. This helped hold the overshoot to below 3kPa. Here we only get 4 of I, and P drops fast as target is approached. Thus, at the time MAP hits target, we have 30 bias + 4 I + 1 P -6 D = 32 boost duty. Then, the P does it's job and goes negative, and then as the MAP drops below target, I moves back up to hold boost, which is its job.
This is a really fast spool at 5000 RPM. Again, D goes negative and, because the spool is fast, very little I windup. MAP settles right in.
Here is some throttle work to show how the P and I chase the target, and keep things pretty close.
My settings:
EDIT: My settings. I found that I needed high slider and P to get action. With these settings except no I or D, I got a touch of over shoot and then oscillation. As desired. Then I have found I need very little I, or the wind-up is crazy and un-controllable in 1.5.X FW. You can see how much "I" I get now, 5 - 20 BD worth, even with only a setting of 7 (and heavy slider). The D is high to get that dampening effect on fast spool. I am considering changing Delta to 55 to, I hope, eliminate the remaining overshoot that occurs under certain conditions.
Oh, and I mentioned Solenoid. I had a MAC valve that had the exit filter. With that, I noticed that spool was slow, and I surmised that it was due to the filter not allowing the pressure to escape. I pulled the filter and things were better, but not as fast spool than with the Waste Gate actuator left to atmosphere. So, I reverted to the older (EDIT)FM DIYAutotune valve and found it more responsive. I wonder if we are using too small a MAC valve? Just my experience.
So, the purpose of this all was to show that CL EBC can work well, but the Bias needs to be set low to allow it to work. I also believe, but have not proven, that even when MAT gets cold and lower BD is needed and spool is faster, that the same settings have a good chance of remaining valid, as the CL active time before target is reached will be short, which will result in lower "I" values and more negative "D" values; allowing still a smooth transition to target.
DNM
I will show some other examples, all made with the same settings, but at various RPM, Various start points, Various TPSDot, various MAT temps (but no extremes as time of year.... 70 to 90 F).
This shows a punch from 4500 RPM. Spool is much faster. Still, some 60 kPa Delta delay in start of CL. Because MAPDot (fast spool) there is a large negative Derivative of -6. This helped hold the overshoot to below 3kPa. Here we only get 4 of I, and P drops fast as target is approached. Thus, at the time MAP hits target, we have 30 bias + 4 I + 1 P -6 D = 32 boost duty. Then, the P does it's job and goes negative, and then as the MAP drops below target, I moves back up to hold boost, which is its job.
This is a really fast spool at 5000 RPM. Again, D goes negative and, because the spool is fast, very little I windup. MAP settles right in.
Here is some throttle work to show how the P and I chase the target, and keep things pretty close.
My settings:
EDIT: My settings. I found that I needed high slider and P to get action. With these settings except no I or D, I got a touch of over shoot and then oscillation. As desired. Then I have found I need very little I, or the wind-up is crazy and un-controllable in 1.5.X FW. You can see how much "I" I get now, 5 - 20 BD worth, even with only a setting of 7 (and heavy slider). The D is high to get that dampening effect on fast spool. I am considering changing Delta to 55 to, I hope, eliminate the remaining overshoot that occurs under certain conditions.
Oh, and I mentioned Solenoid. I had a MAC valve that had the exit filter. With that, I noticed that spool was slow, and I surmised that it was due to the filter not allowing the pressure to escape. I pulled the filter and things were better, but not as fast spool than with the Waste Gate actuator left to atmosphere. So, I reverted to the older (EDIT)
So, the purpose of this all was to show that CL EBC can work well, but the Bias needs to be set low to allow it to work. I also believe, but have not proven, that even when MAT gets cold and lower BD is needed and spool is faster, that the same settings have a good chance of remaining valid, as the CL active time before target is reached will be short, which will result in lower "I" values and more negative "D" values; allowing still a smooth transition to target.
DNM
Last edited by DNMakinson; 06-08-2019 at 09:19 AM.
#191
This is super helpful. I have not been using D at all and is probably my biggest issue. Thanks DNM.
I am using a 2 port internal wastegate actuator and 4-port MAC valve. I have found that with this setup I nearly always slam right into overboost. I'll go back to it with this new understanding of D.
I'm using this setup (not an external wastegate, an internal)
What is your wastegate MAC valve config?
Thanks!
I am using a 2 port internal wastegate actuator and 4-port MAC valve. I have found that with this setup I nearly always slam right into overboost. I'll go back to it with this new understanding of D.
I'm using this setup (not an external wastegate, an internal)
What is your wastegate MAC valve config?
Thanks!
#192
Yeah the PID controller is finally acting like a real PID controller. D is great for overshoot I have found that because D creates an immediate change in output%. Playing with P and D can effectively work together to reduce overshoot yet maintain quick response. To me if anything very little I gets used anymore because of the boost inital duty table. There is no longer as many changes over time rather imediate small changes based off of the inital duty.
In the old firmware I wouldn't even set an open loop table. I would just get my wg pressure close and use PI and hardly any D. I would use P for response and I to flatten my curve once spooled.
Naturally some overshoot is normal as with any PID controller has 3rd wave decay. So in order to get rid overshoot you have to sacrifice a small amount of response.
In the old firmware I wouldn't even set an open loop table. I would just get my wg pressure close and use PI and hardly any D. I would use P for response and I to flatten my curve once spooled.
Naturally some overshoot is normal as with any PID controller has 3rd wave decay. So in order to get rid overshoot you have to sacrifice a small amount of response.
#194
DNM that is a very stable and slow acting setup. Meaning, mine is so damn touchy that it just frustrates me. I want 9psi as needed and then up to 30psi at other times. So I really prefer the dual port actuator setup.
The bottom of those two graphics is how I used to do it, but I couldn't achieve the boost levels I wanted without getting a helper spring. So then I was at like 15psi-30psi range. Which doesn't allow the 9psi I want in 1st gear and so on.
Here's a question to anyone - isn't having an EBC just ultimately a boost leak? If you keep it pegged at 100% until the last moment (which is a guarantee for overshoot), it would prevent a boost leak. But most of the time I don't run it that way (more like 50%) and it is basically just a boost leak.
The bottom of those two graphics is how I used to do it, but I couldn't achieve the boost levels I wanted without getting a helper spring. So then I was at like 15psi-30psi range. Which doesn't allow the 9psi I want in 1st gear and so on.
Here's a question to anyone - isn't having an EBC just ultimately a boost leak? If you keep it pegged at 100% until the last moment (which is a guarantee for overshoot), it would prevent a boost leak. But most of the time I don't run it that way (more like 50%) and it is basically just a boost leak.
#196
I just wanted to say that savingtons method of preventing overshoot by lowering the max DC is working great for me. Even though my valve is fully open and operational at 96% I was hitting overboost protection even though my bias duty table was correct. Currently my Max bias duty is only 66% and I thought I would just experiment with savingtons method and see what happens. So I lowered my Max DC to 90% and the overshoot has decreased dramatically. I am no longer hitting overboost protection but I still have a small amount of overshoot. I am thinking I will lower this until I have just a little overshoot then dial in my PID controller. This way my controller won't have to work as hard controlling overshoot and can focus more on a flatter boost curve up top.
#197
Wow, great work DNN. Apologies for my tardy response, I hadn't seen this.
It's late here so I'll reply properly later, but I came back here (and hence only saw the replies) to ask whether anyone has considered just using closed loop with 0,0,0 set to the PID, such that it just uses the bias duty table.
This would let you get quicker spool by having the valve closed until near target and also let you have better interpolation if you're using boost by gear interpolation (as per DNN's instructions) or a rotary switch. Ie it makes more sense to interpolate between targets of 160kPa and 200kPa rather than duties of 10% and 30% since interpolating between the pressures should be much more linear.
Minor anecdote regarding internal wastegate setups, I'm using a GTX2860 IWG with some porting work (before it crept to 17psi wired open, now only 7psi). I was running the 4 port MAC and the twin port turbosmart IWG75 with a 7psi spring, but my tuner could not get on with it, saying that a 1% change in duty was adding 2psi, so he installed a 3 port MAC and connected it to the IWG75 as if it were a single port actuator. I later tuned the bias duty table and didn't see much difference, except that I lost 100-150rpm of threshold at the bottom end.
It's late here so I'll reply properly later, but I came back here (and hence only saw the replies) to ask whether anyone has considered just using closed loop with 0,0,0 set to the PID, such that it just uses the bias duty table.
This would let you get quicker spool by having the valve closed until near target and also let you have better interpolation if you're using boost by gear interpolation (as per DNN's instructions) or a rotary switch. Ie it makes more sense to interpolate between targets of 160kPa and 200kPa rather than duties of 10% and 30% since interpolating between the pressures should be much more linear.
Minor anecdote regarding internal wastegate setups, I'm using a GTX2860 IWG with some porting work (before it crept to 17psi wired open, now only 7psi). I was running the 4 port MAC and the twin port turbosmart IWG75 with a 7psi spring, but my tuner could not get on with it, saying that a 1% change in duty was adding 2psi, so he installed a 3 port MAC and connected it to the IWG75 as if it were a single port actuator. I later tuned the bias duty table and didn't see much difference, except that I lost 100-150rpm of threshold at the bottom end.
#198
DNM - I'm really excited to try this, but I'm curious about the low bias table concept. I wonder if you can go back to a "correct" bias table now that you've figured out how to get the PID controller to behave correctly (well done, BTW). I don't understand why you couldn't rely on P going negative when necessary, as opposed to strongly positive at the start.
#199
Retired Mech Design Engr
iTrader: (3)
Join Date: Jan 2013
Location: Seneca, SC
Posts: 5,009
Total Cats: 857
I’m certainly not an expert on PID Loops, but my understanding is that the feed-forward of the bias is independent of the PID and is a constant adder to the controller output. Therefore, the P (on a typical ideal PID) is a multiplayer to the Error, which is Set Point minus Process Variable. Therefore, regardless of the bias setting, the P term never goes negative until PV exceeds SP: in other words, until boost is above target.
So, in a stable system, where changes are slow, use a more exact bias, and lots of I. On a system like boost: use the bias to mimic the general shape of the system to make the job of the PID easier, but not do the whole job.
The negative of a low bias would seem to be on throttle lift, but with a positive throttle plate and the blow-off valve, one really does not need the controller to bring boost down. Plus, the heavy D term drives the DC down as well.
Thus, I”m hesitant to try that. As mentioned before, any I term will already be creating overshoot. And as explained here, P will only act after the overshoot has occurred.
EDIT: I can see some virtue in having more exact Bias at lower kPa targets, say 70% throttle. That would be a region where you would have less care with overshoot, and then the I would taper back to zero, leaving room for a stab from 70% throttle to 100%.
Also, you know you have the right proportions in the reduced bias table when, after a stab, the I is nearly constant, showing that the differential between your bias table and the actual %DC is a constant.
I will know more when I get the clutch changed and go back to full boost. At present, and the curves above, I am running lower targets than I was at one time. Those are running 185kPa. I was at a maximum of 210kPa at around 5700 RPM. Note that at 210, I was not triggering Overboost set at 215kPa.
The final real test will be a flat shift, where the boost is going to come back really fast (due to maintaining some level of spool-up and RPM is high). I don't think I have any of those above, but I did log some. I think that during the flat shift, the PID loop is inactive, thus the I gets zeroed out, thus the set-up works. I'll log one this afternoon.
DNM
So, in a stable system, where changes are slow, use a more exact bias, and lots of I. On a system like boost: use the bias to mimic the general shape of the system to make the job of the PID easier, but not do the whole job.
The negative of a low bias would seem to be on throttle lift, but with a positive throttle plate and the blow-off valve, one really does not need the controller to bring boost down. Plus, the heavy D term drives the DC down as well.
Thus, I”m hesitant to try that. As mentioned before, any I term will already be creating overshoot. And as explained here, P will only act after the overshoot has occurred.
EDIT: I can see some virtue in having more exact Bias at lower kPa targets, say 70% throttle. That would be a region where you would have less care with overshoot, and then the I would taper back to zero, leaving room for a stab from 70% throttle to 100%.
Also, you know you have the right proportions in the reduced bias table when, after a stab, the I is nearly constant, showing that the differential between your bias table and the actual %DC is a constant.
I will know more when I get the clutch changed and go back to full boost. At present, and the curves above, I am running lower targets than I was at one time. Those are running 185kPa. I was at a maximum of 210kPa at around 5700 RPM. Note that at 210, I was not triggering Overboost set at 215kPa.
The final real test will be a flat shift, where the boost is going to come back really fast (due to maintaining some level of spool-up and RPM is high). I don't think I have any of those above, but I did log some. I think that during the flat shift, the PID loop is inactive, thus the I gets zeroed out, thus the set-up works. I'll log one this afternoon.
DNM
Last edited by DNMakinson; 06-03-2019 at 08:18 AM.