MS-II Closed Loop Boost Control - PID - Page 6 - 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-08-2011, 05:56 PM   #101
Junior Member
iTrader: (2)
 
Join Date: Mar 2008
Location: Irvine, Ca
Posts: 277
Total Cats: 23
Default

What firmware are you using? Some where along the way the pid control changed.
cjsafski is offline   Reply With Quote
Old 01-08-2011, 06:00 PM   #102
Elite Member
iTrader: (11)
 
Join Date: Feb 2009
Posts: 2,982
Total Cats: 10
Default

3.1
miatauser884 is offline   Reply With Quote
Old 01-08-2011, 06:13 PM   #103
Junior Member
 
Join Date: May 2007
Location: Columbia, MD
Posts: 248
Total Cats: 0
Default

The I term is what I'd suspect here. With I that high, I'd expect some oscillation.
muythaibxr is offline   Reply With Quote
Old 01-08-2011, 07:07 PM   #104
Elite Member
iTrader: (11)
 
Join Date: Feb 2009
Posts: 2,982
Total Cats: 10
Default

Quote:
Originally Posted by muythaibxr View Post
The I term is what I'd suspect here. With I that high, I'd expect some oscillation.
Would you also expect me to have to lower the D-term at the same time? I'm guessing I may be overcompensating with the D-term.

What range for the I-term would you expect to see. Lower by a few points, or 20 points?

The higher I made the I-term, the faster it seemed to ramp to the target. Lowering I seems to bring it to target slower.
miatauser884 is offline   Reply With Quote
Old 01-08-2011, 09:48 PM   #105
Junior Member
 
Join Date: May 2007
Location: Columbia, MD
Posts: 248
Total Cats: 0
Default

Yeah, most of the cars I have tuned boost on used something like 30 for I. P should be set to get you close to the target, then I should be set so it keeps you there. When you start using I you will probably have to increase P. With just P and I you should tune for some overshoot. Then add just enough D to kill the overshoot.

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

It was strange the way it worked. I tuned the P until it reached target. I expected it to ramp quickly, but it didn't. I actually though I had a leak. I then decided to play with I just in case it would make a difference. I started at 20, which had almost no improvement. I increased to 30 and noticed a much quicker ramp up to target. 45 and above provide very fast ramp up. With the I term above 90 it starts to overshoot the target.

Does D kill the initial overshoot, or tighten the oscillation around the target? I had to raise D because boost was oscillating slightly above and below the intended target.

I'll leave P and D alone, and start decreasing I in increments of 10.

Overall, I'm very happy. It's pretty good as is.
miatauser884 is offline   Reply With Quote
Old 01-09-2011, 12:02 AM   #107
Elite Member
 
Join Date: Jul 2005
Posts: 6,454
Total Cats: 80
Default

Some D allows more P which gives you the fast ramp. Without D lots of P will cause overshoot, ringing, or oscillation. The I allows the long term slow error to go away quickly.
JasonC SBB is offline   Reply With Quote
Old 01-09-2011, 12:12 AM   #108
Elite Member
iTrader: (11)
 
Join Date: Feb 2009
Posts: 2,982
Total Cats: 10
Default

Quote:
Originally Posted by JasonC SBB View Post
Some D allows more P which gives you the fast ramp. Without D lots of P will cause overshoot, ringing, or oscillation. The I allows the long term slow error to go away quickly.
1. Set Integral and Differential Gains to 0% - To make tuning the Proportional gain easier, set the Integral and Differential gains to 0%.
2. Set Proportional gain to 100% and slowly lower - While tuning Proportional gain, higher numbers mean slower boost climb and lower final boost. For safety, start with a very high gain (100% should be sufficient). Find the RPM that typically spools quickly, and fully and quickly depress the accelerator. Note how much boost is reached. If boost overshoots the target dramatically, increase the Proportional gain. Otherwise, reduce the Proportional gain and try again. Do this until boost reaches the target with a small amount of overshoot.
3. Tune the Integral Gain - The next step after the target is reached consistently is to tune the Integral gain. Starting from the RPM used to tune the P-gain, fully depress the accelerator and watch the boost as the engine climbs through the RPM range. As the engine accelerates through the rev range, the boost will probably creep away from the target. Keep increasing the I gain until the controller adequately maintains the target with minimal oscillation. It may be necessary to increase the P gain a bit after tuning the I gain since the two gains tend to counteract each other.
4. tune the Derivative Gain - Increase the D gain until the overshoot is minimized. Care must be taken when increasing the D gain as too much D gain can over-dampen the effects of the P and I gains.
miatauser884 is offline   Reply With Quote
Old 01-09-2011, 01:18 AM   #109
Junior Member
 
Join Date: May 2007
Location: Columbia, MD
Posts: 248
Total Cats: 0
Default

The reason for what is in bold is that I did not use the "ideal" form of PID. Because I made the PID output additive, I had to take the derivative of the PID equation.

The result is the behavior you see. Lower P makes the P part of the controller respond slower, allowing boost to climb faster.

I used the "type B" form of PID found here:

http://bestune.50megs.com/typeABC.htm

I used type C initially but that made the algorithm slow to respond to changes in target due to throttle movement since the P term did not contain the setpoint. I switched to type B to solve this.

Ken
muythaibxr is offline   Reply With Quote
Old 01-09-2011, 04:39 AM   #110
Supporting Vendor
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,441
Total Cats: 200
Default

Maybe less P to get rid of the oscillations? I usually have less than 25, depending on the turbo and whether it is internally or externally regulated.
Reverant is offline   Reply With Quote
Old 01-09-2011, 11:38 AM   #111
Elite Member
 
Join Date: Jul 2005
Posts: 6,454
Total Cats: 80
Default

Quote:
Originally Posted by djp0623 View Post
4. tune the Derivative Gain - Increase the D gain until the overshoot is minimized. Care must be taken when increasing the D gain as too much D gain can over-dampen the effects of the P and I gains.
too much D can cause undershoot.

Step 5. You can further increase P by adding some D which speeds up response further, without overshoot.
JasonC SBB is offline   Reply With Quote
Old 01-09-2011, 11:43 AM   #112
Elite Member
 
Join Date: Jul 2005
Posts: 6,454
Total Cats: 80
Default

Quote:
Originally Posted by muythaibxr View Post
The reason for what is in bold is that I did not use the "ideal" form of PID. Because I made the PID output additive, I had to take the derivative

I used the "type B" form of PID found here:

http://bestune.50megs.com/typeABC.htm

I used type C initially but that made the algorithm slow to respond to changes in target due to throttle movement since the P term did not contain the setpoint. I switched to type B to solve this.

Ken
What's wrong with type A? I use it and get this
. Left no D, right, with D
JasonC SBB is offline   Reply With Quote
Old 01-09-2011, 11:57 AM   #113
Elite Member
iTrader: (11)
 
Join Date: Feb 2009
Posts: 2,982
Total Cats: 10
Default

I'll start by reducing I, It is a difficult process for me since I am alone in the car. I have to log, pull over, log pull over, etc. The rough adjustments weren't so bad because I could make a few pulls in one log, as I started fine tuning it was one pull and analyze. I'm hoping to get a couple of runs in today.

I expect that I will have to increase P slightly after I am done reducing I.

What is more important? Initially tuning the target, or the stability of the curve (ie straight line)

Are you tuning P so that you hit target at the beginning of curve or that it is close across the entire curve?
miatauser884 is offline   Reply With Quote
Old 01-09-2011, 12:29 PM   #114
Elite Member
 
Join Date: Jul 2005
Posts: 6,454
Total Cats: 80
Default

I is what makes the boost reach target relatively gradually after the initial ramp up.

P is what gives you the rapid ramp and getting close to the target initially.

D allows more P without overshoot. Too much D gives you "undershoot" in the initial fast ramp - it ramps up quickly, then "pauses" before the target, then climbs more slowly. Without D. the P has to be low to prevent overshoot, and the response will be slow.

To get close initially, the open loop settings have to be close - i.e. in open loop, the table that tells the ECU the duty cycle vs. target boost (over RPM), has to be close. Any remaining error will be removed by the I. If the open loop table is off, the I will have a bigger error to correct. The purpose of the I, when the open loop table is close, is to make up for error in the open loop table due to other factors such as temperature.
JasonC SBB is offline   Reply With Quote
Old 01-09-2011, 12:32 PM   #115
Supporting Vendor
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,441
Total Cats: 200
Default

Jason, I'm pretty sure that the open loop table is not used at all in closed loop mode.
Reverant is offline   Reply With Quote
Old 01-09-2011, 02:01 PM   #116
Elite Member
iTrader: (11)
 
Join Date: Feb 2009
Posts: 2,982
Total Cats: 10
Default

I lowered the I-term from 90 down to 40 in increments of 10. This caused a much longer ramp to target. I did see less oscillation.

From what others have written, their appears to be multiple ways to get to an end result. In one word, sucks, would be the way I describe this.

The tuning instructions are essentially useless if you tune the p-term initially.

I followed the instructions, and this is what I saw.

Adjust P-term lower until it doesn't drastically overshoot the target. I reduced P until the overshoot was ~ 1 psi. Changing P by 1 point starts to make a big difference when you are close to target. At this point the boost ramped up so slow that I though I had a leak. I reverted to open loop to check.

I-term: I started with an I-term of 20 and increased until I had a fast ramp up. I-term of 45 gave fast ramp, but boos had a lot of oscillation. Increasing I too much caused an overshoot of the target. I had to adjust the P term by 1 point to compensate. I adjusted the I term until the oscillation around target was fairly small mainly less than 1 psi.

D-term. I then used the D term to try and tighten the oscillations further. It helped, but not across the entire time at target boost. It has a couple of initial oscillations, and then really tightens in on the target.

I reverted back to my initial settings. Next I will try to increase P-term. This will lower the initial target, but I'm hoping removing the initial overshoot will allow it to smoothly get to target with no oscillation. I probably won't get to it for a couple of days.

I find it very annoying that multiple people can have such different ratios of PID. I don't expect the same values to work on every system, but I would expect very similar ratios of PID.

I think we should compile a list of values associated with the type of EBC that is being used.
miatauser884 is offline   Reply With Quote
Old 01-09-2011, 03:04 PM   #117
Boost Czar
Thread Starter
iTrader: (61)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 72,908
Total Cats: 1,793
Default



P 32 I 39 D 56

19.5Hz

ARO Solenoid (same that DIY now sells, FM LINK Solenoid)
Braineack is offline   Reply With Quote
Old 01-09-2011, 03:29 PM   #118
Elite Member
iTrader: (11)
 
Join Date: Feb 2009
Posts: 2,982
Total Cats: 10
Default

[IMG][/IMG]

P 39 I 90 D 15

DIY solenoid

Still fine tuning
miatauser884 is offline   Reply With Quote
Old 01-09-2011, 06:16 PM   #119
Junior Member
 
Join Date: May 2007
Location: Columbia, MD
Posts: 248
Total Cats: 0
Default

Jason, we do not use the open loop table at all for closed loop, though I am planning to make that an option in ms3.

As far as my instructions go, that is how I have tuned basically every boost control setup on MS that I have tuned. Can I see your whole msq?

Also, lowering P will allow more overshoot. I term should be used only for holding a target. If you want it to spool faster, lower P considerably and bump up D a bit.

I may add the setting that lets you keep the wastegate closed until you are a certain distance from the target too.

Also, maybe I am missing it, but I do not see boost duty in the graphs you are posting.

Also, have you tried making the control interval a little longer?
Ken
muythaibxr is offline   Reply With Quote
Old 01-09-2011, 06:50 PM   #120
Elite Member
iTrader: (11)
 
Join Date: Feb 2009
Posts: 2,982
Total Cats: 10
Default

This is what it looked like with changing I to 45. In order for me to lower I, I would have to lower P as well. As P gets lower, does it take less I to make it spool faster?


Attached Files
File Type: msq 2011-01-08_16.43.11.msq (79.1 KB, 108 views)
miatauser884 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 12-15-2017 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 03:05 PM.