MS-II Closed Loop Boost Control - PID - Page 10 - Miata Turbo Forum - Boost cars, acquire cats.

Welcome to Miataturbo.net   Members
 


MEGAsquirt A place to collectively sort out this megasquirt gizmo

Reply
 
 
 
LinkBack Thread Tools
Old 01-12-2011, 11:33 AM   #181
Junior Member
 
Join Date: May 2007
Location: Columbia, MD
Posts: 248
Total Cats: 0
Default

Quote:
Originally Posted by JasonC SBB View Post
Bingo. That right there explains the behavior described. It's not because it's type B vs. A. (which only matters when the target is changing). That you implemented the derivative (delta CO), also doesn't matter.
Which behavior are you saying it describes, because I don't think it describes what anyone else has said they're having problems with yet. The main problem described as I see it is slow ramp to target boost. The problem is probably a combination of things, such as using 0 for closed duty, too high of a P term combined with not enough D term etc... We'll see but I'm confident that I can solve the problems with just proper PID tuning since I and many others have managed to do that on other engines. IIRC we've got a few people who have got their PID tuned to the point where they spool to target boost in ~0.5 sec. One of those guys was the one asking for options to slow down spool, or slew the target up slower because his car came with a crappy transmission, and he broke a couple of them with the fast ramp.

Quote:
So you're essentially initializing I to be = P, and the CO at "closed" 'gate.
I is actually initialized to 0 correction. As is P explicitly in the code. Neither of them does anything until the error is determined. CO is initialized at 0 most of the time. The user can already set what it is initialized to by setting what "closed" means. I was just trying to say that it's important for the user to actually figure that out because then faster spool is possible if the wastegate doesn't have to travel through a duty that essentially does nothing before having an effect.

Quote:
A potential issue I see, is massive overshoot when the driver, while at WOT at some high RPM, quickly lifts then floors it again - the turbine will still have a lot of RPM, and the PID will be initialized at 0 duty / closed wastegate. This test was a benchmark for me while tuning my AEM + D circuit. It'll show to a lesser extent at a fast upshift at redline. I tolerate 0.5 psi.
That could only happen theoretically if the driver lifts enough to get back out of boost (like a complete lift), but in practice, I've seen quite a few datalogs that don't have that problem because while in boost, when the driver lifts, the wastegate ends up getting opened completely before closing once out of boost. The P term does that because the target just suddenly changed.

Ken
muythaibxr is offline   Reply With Quote
Old 01-12-2011, 04:08 PM   #182
Elite Member
 
Join Date: Jul 2005
Posts: 6,454
Total Cats: 80
Default

Quote:
Originally Posted by muythaibxr View Post
Which behavior are you saying it describes,
Your description, not others' problems.

Quote:
I is actually initialized to 0 correction. As is P explicitly in the code. Neither of them does anything until the error is determined. CO is initialized at 0 most of the time.
I wasn't clear. What I meant was that your calcs is the same as doing a "normal" PID wherein the I output is initialized to -P, so that the sum, CO, is zero. (or 20 if that's where the solenoid starts to affect boost)

Quote:
That could only happen theoretically if the driver lifts enough to get back out of boost (like a complete lift),
Correct.

Quote:
but in practice, I've seen quite a few datalogs that don't have that problem because while in boost, when the driver lifts, the wastegate ends up getting opened completely before closing once out of boost. <due to D>
Yes but if done quickly enough the turbo shaft still has a lot of RPM.
JasonC SBB is offline   Reply With Quote
Old 01-13-2011, 12:20 PM   #183
Junior Member
 
Join Date: May 2007
Location: Columbia, MD
Posts: 248
Total Cats: 0
Default

Quote:
Originally Posted by JasonC SBB View Post
Your description, not others' problems.
OK, so again, I don't see where there's a problem. In practice, many have gotten the algorithm to spool their turbos quite fast. Additionally, I'm willing to work with local guys at making it better, first by helping tune, and second by adding code if necessary.

Quote:
Yes but if done quickly enough the turbo shaft still has a lot of RPM.
I would want to see a datalog to be sure that this particular issue is really a problem.. For the ones I have tuned it hasn't been since the P term sees the change in target when the driver lifts, and essentially fully opens the wastegate, which causes the turbo to slow down enough that overshoot when the throttle is applied again isn't a problem.

I'm open to making changes to the algorithm if they'll really help, but only if they're necessary.

Ken
muythaibxr is offline   Reply With Quote
Old 01-13-2011, 03:12 PM   #184
Elite Member
 
Join Date: Jul 2005
Posts: 6,454
Total Cats: 80
Default

In the absence of open loop tables I agree.
JasonC SBB is offline   Reply With Quote
Old 01-17-2011, 07:41 PM   #185
Elite Member
iTrader: (11)
 
Join Date: Feb 2009
Posts: 2,982
Total Cats: 10
Default

Update: I've started to do a few pulls to retune my boost control following the correct procedure. I running into the problem where it takes a long time to get up to target because i'm tuning P only with no I-term. If I make the I=1, will that be enough for it to start trying to ramp up more quickly? I like doing pulls in 5th gear (6 sp), is there anything wrong with doing them in fourth? I changed P from 37 to 35 and really didn't see much of a change other than it took longer to reach target. It overshoots by almost 1 psi, the oscillates with an amplitude of about .5 psi around target.

I guess the real question is: Would it be better to initially tune with a small value for I while adjusting the P value? Then start the procedure we discussed earlier for adjusting I and D
miatauser884 is offline   Reply With Quote
Old 01-18-2011, 11:25 AM   #186
Junior Member
 
Join Date: May 2007
Location: Columbia, MD
Posts: 248
Total Cats: 0
Default

I'm thinking that we might want to do this in stages to get everything right for you. I think you're going to need a lot less P and a bit more D to get the kind of spool you want.

I would go ahead and tune your I term to get you to and keep you at the target without overshoot or oscillation.

Then gradually lower P and raise D until it starts spooling quicker.

I would raise D in smaller increments than you lower D.

Ken
muythaibxr is offline   Reply With Quote
Old 01-18-2011, 12:44 PM   #187
Elite Member
iTrader: (11)
 
Join Date: Feb 2009
Posts: 2,982
Total Cats: 10
Default

Quote:
Originally Posted by muythaibxr View Post
I'm thinking that we might want to do this in stages to get everything right for you. I think you're going to need a lot less P and a bit more D to get the kind of spool you want.

I would go ahead and tune your I term to get you to and keep you at the target without overshoot or oscillation.

Then gradually lower P and raise D until it starts spooling quicker.

I would raise D in smaller increments than you lower D.

Ken
That's what I was trying to do. I thought

stage one was: lower P until you get 1-2 psi overshoot?
stage two: increase I until target is maintained
stage three: increase D until overshoot is gone.

I really want to continue tuning P first, but it appears that it needs some minimum value of I so that it tries to ramp to target in a reasonable amount of time.

Currently it takes so long to ramp to target that i am exceeding the speed limit by a significant margin.

If I start tuning I and P at the same time, I'm afraid I will not find the optimum value of P ( P will end up being too high).

Maybe when tuning P we all need to start with and I value of 10-20.

Here is my current plan: Increae I just enough to get some spool back. Continue to lower P until it overshoots target by 1-2 psi. By being less aggressive with I, it should minimize I's overshoot contribution to P.

Increase I until target is maintained

Then adjust D to decrease overshoot.

Possibly adjusting P a little along the way.
miatauser884 is offline   Reply With Quote
Old 01-18-2011, 12:54 PM   #188
Elite Member
 
Join Date: Jul 2005
Posts: 6,454
Total Cats: 80
Default

You can try testing boost control in 3rd gear 5000 RPM with left foot braking to maintain speed/rpm.
JasonC SBB is offline   Reply With Quote
Old 01-18-2011, 02:18 PM   #189
Elite Member
iTrader: (11)
 
Join Date: Feb 2009
Posts: 2,982
Total Cats: 10
Default

Quote:
Originally Posted by JasonC SBB View Post
You can try testing boost control in 3rd gear 5000 RPM with left foot braking to maintain speed/rpm.
I'll try it, sounds like a plan.
miatauser884 is offline   Reply With Quote
Old 01-18-2011, 05:37 PM   #190
Junior Member
 
Join Date: May 2007
Location: Columbia, MD
Posts: 248
Total Cats: 0
Default

Yeah, I think the P term is just too high.. When I last tuned someone's boost control, a P term of 9 was enough to make it hit the target (in less than a second) and then only overshoot slightly. Once I added some I term, I had to raise the P-term to 30+ to help the overshoot. I raised it to there and then began removing P term and adding D term until it spooled quickly with little or no overshoot.

We may also want to figure out what duty actually causes boost to change using open loop. I'm talking about do a run at 0%, watch how fast it spools, do a run at 5%, does that affect spool rate? If not, try 10%, etc. until you find the duty that affects spool rate. Once you find that, set the "closed duty" to that and retune PID. This should allow you to set better PID numbers and get a better spool rate with PID engaged.

Ken
muythaibxr is offline   Reply With Quote
Old 02-13-2011, 06:10 PM   #191
Elite Member
iTrader: (11)
 
Join Date: Feb 2009
Posts: 2,982
Total Cats: 10
Default

I've done some tuning the past couple of days,a nd I still feel that tuning PID is not straight forward. The I-term especially. I adjusted P until I got a couple of PSI overshoot. I increased I-term until it maintained target pretty consistently. This got me an I-term of 105 iirc. Then I tuned the D term. Then, for kicks I reduced the I-term to 45. Results were good. What's the deal? There has to be an upper limit for I-term that beyond it doesn't help much.

With all of than said. I think my main issue is an unported internal WG. I think my graph will only get so stable.

This graph is with a P-23, I-45, and D-160

If I'm cruising at 4k rpm in 5th (6sp) and do a pull. It goes from 0-17psi in 1s and ~400rpm.

If I want to deal with 2psi of overshoot I can make the ramp up curve look almost vertical.

I am going to bump the I-term to 50 and see if I notice the curve stabilize.

Some of the best results came from just adjusting the "control interval" I've got it set to 23ms.

At what point does raising the D-term stop doing anything. I haven't taken it higher than 160. I have to make very large D-term adjustments to lower P-term

miatauser884 is offline   Reply With Quote
Old 02-14-2011, 09:37 AM   #192
Boost Czar
Thread Starter
iTrader: (61)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 72,892
Total Cats: 1,792
Default

Does your turbo make +215kPa at wastegate? there are spots the EBC is fully open and it's still making a ton of boostl...
Braineack is offline   Reply With Quote
Old 02-14-2011, 10:12 AM   #193
Elite Member
iTrader: (11)
 
Join Date: Feb 2009
Posts: 2,982
Total Cats: 10
Default

It'll creep to almost 15psi on WG only. It just takes a long time to get there. I don't think that I'm going to mess with PID anymore. The curve looks pretty good.
miatauser884 is offline   Reply With Quote
Old 02-14-2011, 10:23 AM   #194
Supporting Vendor
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,441
Total Cats: 198
Default

It looks like it could spool a little sooner, when (rpm) did you floor it?
Reverant is offline   Reply With Quote
Old 02-14-2011, 10:39 AM   #195
Boost Czar
Thread Starter
iTrader: (61)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 72,892
Total Cats: 1,792
Default

looks like he hit it around 4000RPM. Nice linear boost increase, but I agree, the valve is opening slightly before the target it hit...but I doubt it's really negating spool.
Braineack is offline   Reply With Quote
Old 02-14-2011, 11:44 AM   #196
Elite Member
iTrader: (11)
 
Join Date: Feb 2009
Posts: 2,982
Total Cats: 10
Default

4000rpm is when I hit it. It only takes 1 second to get to 17psi. I don't know how much faster I can make it spool. Decreasing P-term one point starts to get me a 1psi overshoot. I'm wondering if this is the nature of the beast with an unported interanl WG. I'm not sure how high you can go with D-term before you aren't doing anything.

I pulled quite a bit of timign while doing this. If I noticed any bobble of the oil pressure gauge I pulled .5 degrees. I kept doing this until I didn't see any major movement. I'm not sure how good of a knock dectector the oil pressure gauge actually is, but I feel like I have a very safe tune.
miatauser884 is offline   Reply With Quote
Old 02-14-2011, 12:17 PM   #197
Boost Czar
Thread Starter
iTrader: (61)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 72,892
Total Cats: 1,792
Default

you want a little overshoot, then it leveling off.
Braineack is offline   Reply With Quote
Old 02-14-2011, 12:28 PM   #198
Elite Member
iTrader: (11)
 
Join Date: Feb 2009
Posts: 2,982
Total Cats: 10
Default

In that case, I can lower P a point or two.

What happens when you reach the limit of the MAP sensor? I've upped the bosot to 19psi and I think the regular sensor is good until 21psi.
miatauser884 is offline   Reply With Quote
Old 02-14-2011, 12:29 PM   #199
Boost Czar
Thread Starter
iTrader: (61)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 72,892
Total Cats: 1,792
Default

the MS will continue to fuel at the peak load row. sensor is good for 22.5psi.
Braineack is offline   Reply With Quote
Old 01-31-2012, 01:30 AM   #200
Senior Member
iTrader: (3)
 
Join Date: Sep 2011
Location: Plano TX
Posts: 595
Total Cats: 2
Default

OK I read most of this long thread. It seems like the preferred method for tuning changed with firmware. What is the best tuning method with the newest 3.2.1 firmware. Mine does not make the target no matter what I do.
I have
closed o
open 100
and outputs inverted

is that right.
90 Turbo is offline   Reply With Quote
 
 
Reply

Related Topics
Thread Thread Starter Forum Replies Last Post
Project Gemini - Turbo Civic on the Cheap Full_Tilt_Boogie Build Threads 59 Yesterday 09:00 PM
Another Cast Manifold Corky Bell Prefabbed Turbo Kits 18 11-22-2016 10:01 PM
Going back to stock. Need some 1.6 parts. Trent WTB 2 10-01-2015 01:15 PM
Time to start learning and play with tuning The Gleas MEGAsquirt 3 10-01-2015 10:30 AM
Bad head gasket or ? shooterschmidty Engine Performance 8 09-30-2015 11:28 PM


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -4. The time now is 01:37 AM.