MEGAsquirt A place to collectively sort out this megasquirt gizmo

MS-II Closed Loop Boost Control - PID

Thread Tools
 
Search this Thread
 
Old 01-27-2010, 03:26 PM
  #21  
Elite Member
iTrader: (1)
 
richyvrlimited's Avatar
 
Join Date: Jun 2006
Location: Warrington/Birmingham
Posts: 2,642
Total Cats: 42
Default

Dunno if this helps but for closed loop idle tuning Ken recommends barely any 'D' term, and if you can none at all.

D dampens the response, P is to get to target as fast as possible and I is to stop overshoot.
richyvrlimited is offline  
Old 01-27-2010, 03:39 PM
  #22  
Boost Czar
Thread Starter
iTrader: (62)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 79,493
Total Cats: 4,080
Default

I think my issue was staring with someone else's values. I'll start by increase P up until I've just hitting 15psi, probably need to be closer to 100, then I think I've always had I too high, so I'll start at 0 and go up and just do this **** right.

As far as D, I found it was also suggested to not be used for EGO as well:

+ PID Derivative (%) (egoKD): This predicts the future difference between the AFR target and the set-point, based on the rate of change of the error at present. The larger the derivative term, the more rapidly the controller responds to changes in the process's output. However, for relatively slow processes, lower numbers mean more stable output, and a value of 0 is typical for MegaSquirt® (i.e., don't use the derivative term at all).
Thoughts on altering the open and closed % values? I see references to doing this as well... Since I'm only looking for about 4psi above my wastegate pressure with low duty cycles I figured it could help.
Braineack is offline  
Old 01-27-2010, 03:56 PM
  #23  
Senior Member
iTrader: (2)
 
dc2696's Avatar
 
Join Date: May 2005
Location: Edmonton Ab, Canada
Posts: 1,202
Total Cats: 21
Default

No matter what I did to my ebc last year, it would fall off up top or super overboost, couldn't keep it consistant
dc2696 is offline  
Old 01-27-2010, 03:59 PM
  #24  
Boost Czar
Thread Starter
iTrader: (62)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 79,493
Total Cats: 4,080
Default

It shouldn't since I don't get boost creep, I can run my MBC at 15psi without trouble, but I really want to activate my hi/low switch again.

Well see after tonight. I'll have more time this weekend and actually get on a highway so i can **** around.
Braineack is offline  
Old 01-27-2010, 04:14 PM
  #25  
Elite Member
iTrader: (1)
 
richyvrlimited's Avatar
 
Join Date: Jun 2006
Location: Warrington/Birmingham
Posts: 2,642
Total Cats: 42
Default

Originally Posted by Braineack
I think my issue was staring with someone else's values. I'll start by increase P up until I've just hitting 15psi, probably need to be closer to 100, then I think I've always had I too high, so I'll start at 0 and go up and just do this **** right.

As far as D, I found it was also suggested to not be used for EGO as well:


Thoughts on altering the open and closed % values? I see references to doing this as well... Since I'm only looking for about 4psi above my wastegate pressure with low duty cycles I figured it could help.
I'd leave that till you've exhausted other options. a wider apart open and closed value will make the code more sensitive and vis-vesa
richyvrlimited is offline  
Old 01-27-2010, 04:26 PM
  #26  
Elite Member
iTrader: (11)
 
miatauser884's Avatar
 
Join Date: Feb 2009
Posts: 2,959
Total Cats: 11
Default

In to ride coat tails
miatauser884 is offline  
Old 01-27-2010, 08:45 PM
  #27  
Boost Czar
Thread Starter
iTrader: (62)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 79,493
Total Cats: 4,080
Default

really, no matter what I do it tapers off up top. I'm pretty sure I found the good P value.

Here's P=140 I=10 D=5



now P=130 I=10 D=5



so the number between those two should net reach my boost target the best, now. I lowered the P to get more boost, then added a bunch of I to help the boost drop:

P=110 I=80 D=5



if you overlay the logs, the boost after around 5000RPM drops off the the exact same amount. What's really odd is the Boost Duty % number might be completely different. Look at the difference between the top two, one averages 70% the other 30%.





So I mean, it's obviously working cause it is increasing boost over my wastegate, but it doesn't make a lick of sense to me. If I just crank up the MBC I can hold 15psi all day long...

Braineack is offline  
Old 01-27-2010, 10:31 PM
  #28  
Senior Member
iTrader: (2)
 
dc2696's Avatar
 
Join Date: May 2005
Location: Edmonton Ab, Canada
Posts: 1,202
Total Cats: 21
Default

Like I said, I ducked around all last summer with no sucess. I was advised to pickup an after market ebc but I Have no money for that fancy ****
dc2696 is offline  
Old 01-27-2010, 11:55 PM
  #29  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

Originally Posted by Braineack
really, no matter what I do it tapers off up top.
Doesn't the software ask you to enter a "base duty cycle" table, which it will deliver even with the PID turned off? The idea is to get some base duty cycle going that gets you close, then the PID will speed the response, get it spot on, and correct for variations in outside factors like due to engine and ambient temperature.
JasonC SBB is offline  
Old 01-28-2010, 02:34 AM
  #30  
Elite Member
 
Zaphod's Avatar
 
Join Date: Mar 2006
Location: Schwarzenberg, Germany
Posts: 1,553
Total Cats: 101
Default

@Brain - please post that at msextra.com I think Ken will be able to give you some advice.

Greets

Edit:
For comparsion:

That is how my setup looks with P=100 I=48 D=150 target is 165kPa



and with P=105 I=48 D=150 same target


Last edited by Zaphod; 01-28-2010 at 02:45 AM.
Zaphod is offline  
Old 01-28-2010, 07:18 AM
  #31  
Boost Czar
Thread Starter
iTrader: (62)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 79,493
Total Cats: 4,080
Default

Originally Posted by JasonC SBB
Doesn't the software ask you to enter a "base duty cycle" table, which it will deliver even with the PID turned off? The idea is to get some base duty cycle going that gets you close, then the PID will speed the response, get it spot on, and correct for variations in outside factors like due to engine and ambient temperature.

the DC% table grays out if you select closed loop, I'll try getting a DC% table setup and then switch it back and see how that reacts.
Braineack is offline  
Old 01-28-2010, 08:27 AM
  #32  
Boost Czar
Thread Starter
iTrader: (62)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 79,493
Total Cats: 4,080
Default

I set a DC% table, letting it target 40% below 5K and 60% above.

with p=140 i=120 d=5, it appears the code is working brilliantly.



As you can see, it hit around 40%DC and hit my target within .3psi, then started adding DC% where it hit 65% by the time I lifted. So it looks like it's really trying to do it's job but for some reason my solenoid isn't holding the boost up.

So I need to look into a few things, I know the wastegate can hold boost, I was hitting 17psi at redline last week. So either I plumbed my solenoid incorrectly, or there's some stupid setting that needs to be changed. The code is definitely closing the valve as i can easily go into overboost (17.5psi) if the P value is too low. So I'm wondering about this "inverted" value under boost control settings.

My valve, at least in MS-I, would run open at 0% and closed at 100%. If I put my DC% targets at 100% I would hit 20+psi at 4K.

So, in MS-II, the closed DC% value must be lower than the open DC% value in order to operate correctly. I have closed at 0% and open at 100%, and "inverted" selected for polarity.

But, it did an interesting thing when I tried just using DC% table, I had everything set to 0%, then 70% at 5K and 80% at 7K. I hit 15psi at 4800RPM, then it dropped off to 13psi as the DC% increased to 80%. This has me confused more. It's almost like it's working backwards, so I need to go out at lunch and try it with the polarity set as normal and see what happens.

Otherwise, if that doesn't work, I'll re-plumb my EBC and MBC and simply use the EBC for wastegate level of boost (fully open) and the MBC to run 15psi, which I was doing on my MS-I unit.
Braineack is offline  
Old 01-28-2010, 08:54 AM
  #33  
Senior Member
iTrader: (6)
 
TrickerZ's Avatar
 
Join Date: Jul 2007
Location: Cocoa Beach, FL
Posts: 850
Total Cats: 16
Default

I think you're right Brain, if you look at the Boost vs DC on all your graphs, it looks like it perfectly matches your loss of boost. Maybe they never coded it to work inverted.
TrickerZ is offline  
Old 01-28-2010, 09:09 AM
  #34  
Elite Member
iTrader: (11)
 
miatauser884's Avatar
 
Join Date: Feb 2009
Posts: 2,959
Total Cats: 11
Default

Originally Posted by Braineack
I set a DC% table, letting it target 40% below 5K and 60% above.

with p=140 i=120 d=5, it appears the code is working brilliantly.



As you can see, it hit around 40%DC and hit my target within .3psi, then started adding DC% where it hit 65% by the time I lifted. So it looks like it's really trying to do it's job but for some reason my solenoid isn't holding the boost up.

So I need to look into a few things, I know the wastegate can hold boost, I was hitting 17psi at redline last week. So either I plumbed my solenoid incorrectly, or there's some stupid setting that needs to be changed. The code is definitely closing the valve as i can easily go into overboost (17.5psi) if the P value is too low. So I'm wondering about this "inverted" value under boost control settings.

My valve, at least in MS-I, would run open at 0% and closed at 100%. If I put my DC% targets at 100% I would hit 20+psi at 4K.

So, in MS-II, the closed DC% value must be lower than the open DC% value in order to operate correctly. I have closed at 0% and open at 100%, and "inverted" selected for polarity.

But, it did an interesting thing when I tried just using DC% table, I had everything set to 0%, then 70% at 5K and 80% at 7K. I hit 15psi at 4800RPM, then it dropped off to 13psi as the DC% increased to 80%. This has me confused more. It's almost like it's working backwards, so I need to go out at lunch and try it with the polarity set as normal and see what happens.

Otherwise, if that doesn't work, I'll re-plumb my EBC and MBC and simply use the EBC for wastegate level of boost (fully open) and the MBC to run 15psi, which I was doing on my MS-I unit.
I have it set to normal open is 0% and closed is 100% I think the normal and inverted setting flips the duty percent settings. At least that is my experience i.e. inverted in my situation would make 0% high boost and 100% low boost.
miatauser884 is offline  
Old 01-28-2010, 09:21 AM
  #35  
Boost Czar
Thread Starter
iTrader: (62)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 79,493
Total Cats: 4,080
Default

Originally Posted by djp0623
I have it set to normal open is 0% and closed is 100%
When I tired that the code failed to work. It rapdly oscillated between 0% and 100% and I would overboost at like 3200RPM. When reading msextra.com it was suggested that closed must be a lower DC% than open and to use "inverted."
Braineack is offline  
Old 01-28-2010, 10:05 AM
  #36  
Elite Member
iTrader: (11)
 
miatauser884's Avatar
 
Join Date: Feb 2009
Posts: 2,959
Total Cats: 11
Default

I did notice this oscillation on my last log. I've only just started trying closed loop. It seemed to work for open loop. So you have inverted selected and 100% open 0% closed? I'll give it a try today and see what results I get on a datalog.
miatauser884 is offline  
Old 01-28-2010, 10:09 AM
  #37  
Boost Czar
Thread Starter
iTrader: (62)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 79,493
Total Cats: 4,080
Default

Originally Posted by djp0623
So you have inverted selected and 100% open 0% closed?
Yes, but on my logs it seems to be doing exactly the opposite as what I want, even using open-loop mode. On my valve more DC% = more boost. I'm going change it to normal and see what happens. Didn't get a chance to try it before I got to work.
Braineack is offline  
Old 01-28-2010, 10:17 AM
  #38  
Elite Member
iTrader: (11)
 
miatauser884's Avatar
 
Join Date: Feb 2009
Posts: 2,959
Total Cats: 11
Default

What happens if you select normal, but don't change your duty percents?


Do me a favor a post your settings along with your results.

We can have

Inverted: closed 100%, open 0%
Normal: open 0%, closed 100%

Inverted: open 100%, closed 0%
Normal : open 0%, closed 100%

With my current closed loop settings i was over-boosting like crazy, and noticed the duty cycle oscillations Normal : open 0%, closed 100%, In closed loop it seems like these settings represent low duty cycle % less boost, high duty cycle % high boost. I though my closed loop problems were do to an untuned PID
miatauser884 is offline  
Old 01-28-2010, 10:22 AM
  #39  
Boost Czar
Thread Starter
iTrader: (62)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 79,493
Total Cats: 4,080
Default

from ken:

The algorithm is designed such that 0% duty should mean higher boost (closed wastegate) and 100% duty should mean lower boost (open wastegate).
I wrote it in terms of the wastegate not the valve itself. If the wastegate is closed, you get more boost, and open you get less.

So higher number means less boost (100% means fully open wastegate), and lower number means more boost.
this is my problem. Therefore normal polarity should be correct.
Braineack is offline  
Old 01-28-2010, 10:25 AM
  #40  
Elite Member
iTrader: (11)
 
miatauser884's Avatar
 
Join Date: Feb 2009
Posts: 2,959
Total Cats: 11
Default

Originally Posted by Braineack
from ken:




this is my problem.
I read that as well, I thought keeping those settings and selecting inverted would make it so the duty tables were "normal" low duty low boost, high duty high boost. This did not seem to be the case. I then flipped the duty percent and left it as normal. Which seems to work for open loop, but obviously closed loop is more complex to control.
miatauser884 is offline  


Quick Reply: MS-II Closed Loop Boost Control - PID



All times are GMT -4. The time now is 12:35 PM.