MEGAsquirt A place to collectively sort out this megasquirt gizmo

ITT: MS3 1.4.0+ and Closed Loop EBC

Thread Tools
 
Search this Thread
 
Old 05-15-2019, 07:35 PM
  #181  
Retired Mech Design Engr
iTrader: (3)
 
DNMakinson's Avatar
 
Join Date: Jan 2013
Location: Seneca, SC
Posts: 5,009
Total Cats: 857
Default

Originally Posted by Tran
I think I've found it. Need to activate "Internal_log_fields" logging in project properties.
Correct. Then, under SD card logging, move the ones over that you want. This only works with SD logging.

It it is helpful.
DNMakinson is offline  
Old 05-16-2019, 06:35 PM
  #182  
Junior Member
 
Tran's Avatar
 
Join Date: Jul 2017
Location: Sussex, England
Posts: 223
Total Cats: 46
Default

Originally Posted by DNMakinson
Correct. Then, under SD card logging, move the ones over that you want. This only works with SD logging.

It it is helpful.
Thanks for the info. Frustrating that it only works with SD though, since my MS3 Basic only downloads SD files super slowly, so it's difficult to drive up the road, pull over, analyse then go and have another go.

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?
Tran is offline  
Old 05-16-2019, 08:36 PM
  #183  
Junior Member
 
Mudflap's Avatar
 
Join Date: May 2017
Location: Louisville, Co
Posts: 466
Total Cats: 86
Default

Dealt with it? Man I hate the damn thing. I've given up. I only use open loop otherwise I risk blowing the whole affair up.

What is your setup for the wastegate?
Mudflap is offline  
Old 05-16-2019, 09:45 PM
  #184  
Retired Mech Design Engr
iTrader: (3)
 
DNMakinson's Avatar
 
Join Date: Jan 2013
Location: Seneca, SC
Posts: 5,009
Total Cats: 857
Default

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
DNMakinson is offline  
Old 05-19-2019, 02:31 PM
  #185  
Newb
 
Scott Wilson's Avatar
 
Join Date: Oct 2018
Posts: 18
Total Cats: 0
Default

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!

Scott Wilson is offline  
Old 05-19-2019, 05:45 PM
  #186  
Junior Member
 
Mudflap's Avatar
 
Join Date: May 2017
Location: Louisville, Co
Posts: 466
Total Cats: 86
Default

In OPEN loop, just set the duty table to all 10s and pull in 3rd gear. Then again with all 20s, etc. Then you will see what kpa you hit at that %duty. Then take all of that collected data and put it in the closed loop bias table.

Good luck!
Mudflap is offline  
Old 05-19-2019, 06:10 PM
  #187  
Newb
 
Scott Wilson's Avatar
 
Join Date: Oct 2018
Posts: 18
Total Cats: 0
Default

Originally Posted by Mudflap
In OPEN loop, just set the duty table to all 10s and pull in 3rd gear. Then again with all 20s, etc. Then you will see what kpa you hit at that %duty. Then take all of that collected data and put it in the closed loop bias table.

Good luck!
That's exactly what I did. You don't need to do it in open loop. You can do it in CL setup mode. It is the same thing when you fill the entire table with the same value. That's how I got the values I have now. If I do the same thing in open loop I'll end up with...if anything less accurate boost duty(table based off throttle% not kpa). That's the whole point of Setup mode. To set the bias table without PID control interference. It is just an output % at a certain rpm x kpa. I was able to get up to 55% before hitting overboost. Then I built my table and started adding duty % to the top of the map to maintain target. My question is simple, how is everyone building the lower portion of the map if I'm not able to reach that portion at 0% duty? Also I built this map in 3rd gear which has more load than 2nd. So if I build those lower cells based off of a different gear with less load I'm likely to overshoot my target and overboost when in a higher gear with more load or at a higher rpm with a turbo that's already spooled up. My point is at 0% my solenoid isn't even operating and I want it to operate in order to get the most response out of my turbo without overshooting. I'm afraid if I add too much duty % in my 0 cells without actually knowing the correlating kpa, it will cause a whole mess of issues when I start to use the PID controller.

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.
Scott Wilson is offline  
Old 05-19-2019, 06:39 PM
  #188  
Junior Member
 
Mudflap's Avatar
 
Join Date: May 2017
Location: Louisville, Co
Posts: 466
Total Cats: 86
Default

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.
Mudflap is offline  
Old 05-19-2019, 07:29 PM
  #189  
Retired Mech Design Engr
iTrader: (3)
 
DNMakinson's Avatar
 
Join Date: Jan 2013
Location: Seneca, SC
Posts: 5,009
Total Cats: 857
Default

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.

Last edited by DNMakinson; 06-08-2019 at 09:18 AM.
DNMakinson is offline  
Old 05-19-2019, 07:33 PM
  #190  
Retired Mech Design Engr
iTrader: (3)
 
DNMakinson's Avatar
 
Join Date: Jan 2013
Location: Seneca, SC
Posts: 5,009
Total Cats: 857
Default 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
Attached Files
File Type: msq
CurrentTune.msq (283.7 KB, 103 views)
File Type: msl
LOG1.msl (1.92 MB, 55 views)
File Type: msl
LOG2.msl (2.39 MB, 45 views)

Last edited by DNMakinson; 06-08-2019 at 09:19 AM.
DNMakinson is offline  
Old 05-20-2019, 12:04 PM
  #191  
Junior Member
 
Mudflap's Avatar
 
Join Date: May 2017
Location: Louisville, Co
Posts: 466
Total Cats: 86
Default

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!
Mudflap is offline  
Old 05-20-2019, 12:21 PM
  #192  
Newb
 
Scott Wilson's Avatar
 
Join Date: Oct 2018
Posts: 18
Total Cats: 0
Default

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.
Scott Wilson is offline  
Old 05-20-2019, 01:21 PM
  #193  
Retired Mech Design Engr
iTrader: (3)
 
DNMakinson's Avatar
 
Join Date: Jan 2013
Location: Seneca, SC
Posts: 5,009
Total Cats: 857
Default

I am using a 3 port valve. Was MAC briefly, but is now the old DIYAutotune version: HUMPHREY 310, connected like the top picture:
DNMakinson is offline  
Old 05-20-2019, 02:58 PM
  #194  
Junior Member
 
Mudflap's Avatar
 
Join Date: May 2017
Location: Louisville, Co
Posts: 466
Total Cats: 86
Default

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.
Mudflap is offline  
Old 05-24-2019, 06:38 AM
  #195  
Senior Member
iTrader: (1)
 
Bronson M's Avatar
 
Join Date: Feb 2015
Posts: 1,106
Total Cats: 217
Default

It's a very small amount of air escaping, non issue.
Bronson M is offline  
Old 05-26-2019, 08:59 AM
  #196  
Newb
 
Scott Wilson's Avatar
 
Join Date: Oct 2018
Posts: 18
Total Cats: 0
Default

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.
Scott Wilson is offline  
Old 05-27-2019, 07:49 PM
  #197  
Junior Member
 
Tran's Avatar
 
Join Date: Jul 2017
Location: Sussex, England
Posts: 223
Total Cats: 46
Default

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.
Tran is offline  
Old 06-02-2019, 11:49 PM
  #198  
Junior Member
 
Mudflap's Avatar
 
Join Date: May 2017
Location: Louisville, Co
Posts: 466
Total Cats: 86
Default

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.
Mudflap is offline  
Old 06-03-2019, 06:54 AM
  #199  
Retired Mech Design Engr
iTrader: (3)
 
DNMakinson's Avatar
 
Join Date: Jan 2013
Location: Seneca, SC
Posts: 5,009
Total Cats: 857
Default

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

Last edited by DNMakinson; 06-03-2019 at 08:18 AM.
DNMakinson is offline  
Old 06-03-2019, 08:00 PM
  #200  
Retired Mech Design Engr
iTrader: (3)
 
DNMakinson's Avatar
 
Join Date: Jan 2013
Location: Seneca, SC
Posts: 5,009
Total Cats: 857
Default

Well, the boost control is a little weak in this, but the reaction before and after the Flat Shift is consistent. That's all I have for now:
DNMakinson is offline  


Quick Reply: ITT: MS3 1.4.0+ and Closed Loop EBC



All times are GMT -4. The time now is 12:28 AM.