Jason's proposed closed loop boost control strategy - Miata Turbo Forum - Boost cars, acquire cats.

Welcome to Miataturbo.net   Members

MEGAsquirt A place to collectively sort out this megasquirt gizmo

LinkBack Thread Tools
Old 07-14-2012, 02:25 PM   #1
Elite Member
Thread Starter
Join Date: Jul 2005
Posts: 6,454
Total Cats: 80
Default Jason's proposed closed loop boost control strategy

Branching off from another thread...

- There will be a 3D boost target table, with RPM and TPS as axes.

- Then a 3D "open loop table" of solenoid duty cycle %, with RPM and boost target as axes.

- Then the PID algorithm.

All the above are active all the time. Anytime a duty cycle needs to be sent to the solenoid.

Duty cycle always = open_loop_table_entry + PID, with a caveat on the 'I' (below)

This way the PID loop is only for handling transients and for steady state errors. To be more specific, the P+D handle transients, and the 'I' is for driving the steady state error to zero. Steady state error happens because the open loop table isn't perfect and because the open loop table doesn't account for other variables like temperature. In fact when tuning the open loop tables, one would keep Igain to zero, and the table entries adjusted so targets are reached.

During tuning, before turning on the I, Pgain and Dgain are adjusted for fast rise time and settling time with minimal overshoot. The 'I' is then turned on for reasonable response when there is steady-state error due to temperature or other changes. 'I' will introduce slight overshoots.

Do not allow I to be non zero during spoolup, and definitely not while the valve is pegged open to keep the wastegate closed. Wastegate will be closed at max duty% which is about 85% for most valves. This will merely cause lots of overshoot. 'I' should only be active once the wastegate is starting to open, which is when the wastegate can pressure exceeds the cracking pressure, which is shortly after when duty cycle (from table+P+D) starts to come down from the max value. Even with this strategy, there may be slight overshoots, if there was none while 'I' was zeroed, and there are further strategies to reduce this, if very little overshoots are tolerated...

One little detail; make sure in the path of generating the 'D' signal from the error (target - MAP), that there's effectively a total of 2 lopass filters ("lag" filters), else noise in the MAP signal will be amplified by the extraction of 'D'. This applies to both TPS (which generates target) and MAP.

The next big step is auto-tuning of the table entries. Whenever steady state is detected (say, 1 second dwell at higher RPMs, 2 second dwell at lower RPMs), a large I value will cause the relevant table entry to be modified, so that the I value next time around doesn't need to be so large. Remember the I corrects steady state error, and large ones come from wrong table entries. And there has to be some kind of auto smoothing in the table, for example, when changing an entry in a location in the table, all its immediate neighbors will get adjusted by half as much.
JasonC SBB is offline   Reply With Quote
Old 07-14-2012, 02:26 PM   #2
Elite Member
Thread Starter
Join Date: Jul 2005
Posts: 6,454
Total Cats: 80

More background:

Originally Posted by JasonC SBB

Now if only for boost control they added:

1) 3D table of solenoid duty cycle with RPM and boost target as the axes

Originally Posted by Reverant View Post
That's the default if you choose open loop. Otherwise it makes no sense in closed loop.
The system I describe is called "PID feedback with feedforward". Even Wikipedia says:

PID controller - Wikipedia, the free encyclopedia

The control system performance can be improved by combining the feedback (or closed-loop) control of a PID controller with feed-forward (or open-loop) control. Knowledge about the system (such as the desired acceleration and inertia) can be fed forward and combined with the PID output to improve the overall system performance. The feed-forward value alone can often provide the major portion of the controller output. The PID controller can be used primarily to respond to whatever difference or error remains between the setpoint (SP) and the actual value of the process variable (PV). Since the feed-forward output is not affected by the process feedback, it can never cause the control system to oscillate, thus improving the system response and stability.
Picture this. As a first assumption, the MS open loop system using a 3D lookup table, will produce target boost every time. However, 2 things spoil this:

1) transients - it takes time for the pneumatic wastegate actuator to fill and move to the target position (which is determined by the boost pressure and the duty cycle). And, an open loop system cannot, for example, keep the wastegate shut to speed up spoolup.

2) other variables which affect final boost, such as IAT, and any errors in the filling of said table

Which brings us to closed loop operation.

The idea is that the PID loop "finds" the correct duty cycle to hit the target. Yes the integrator term finds the exact duty cycle that hits the target, but as time approaches infinity - during steady state. The motor never really has a steady state, RPMs change, and TPS (boost target) changes. Also, "finding" the correct steady-state duty cycle takes time. You can't make this time very short by increasing the I gain arbitrarily because that causes overshoots and oscillations. If the required duty cycle changes as say, RPMs climb, there needs to be an error to begin with, to force the PID output to change the duty cycle. Again, response speed and accuracy will not be perfect.

If you combine the open loop scheme with PID:
Output = table value + PID
... then the duty cycle will *immediately* hit that which is required for steady state (PID doesn't need to "find" it), and then the PID takes care of the transients and any remaining errors.

The result is much better performance. There are 3 measures of performance:
- Spoolup time - wastegate should be shut until the very last moment and opens just so that it prevents overshoot
- Settling time - how quickly it reaches a new target within a certain error when the target is abruptly changed
- accuracy - how close it reaches target boost
- overshoot - how little overshoot there is

The performance shortcomings of the PID system in the MS will be evident as:

- overshoots when comparing say, a 4th gear spoolup run from 2000 RPM, vs. 2nd gear, and a very abrupt step-lift-step at 5500 RPM where the turbo spools very quickly. If you tune PID for best performance for one of the 3 conditions, you will get overshoot or sub-optimal response speed with the other 2.

- difficult tuning when you have a low-pressure wastegate (e.g. 5 psi) and a high boost target (e.g. 15 psi). Everyone will say "run a 10 psi can", which will make tuning a lot easier, but, the advantage of a low psi can is THROTTLE MODULABILITY. Your foot can easily command say 5 psi at half throttle, vs. when you have a 10 psi can it wants to hit 10 psi at half throttle.

- More difficult tuning with a small fast-spooling turbo

Check out my results here

However that's cheating a little, I have a local circuit implementing a fast local feedback loop - input is can gauge pressure target (aka wastegate position), the command coming from the ECU, and it targets the can gauge pressure with a gauge pressure sensor teed off from the line to the wastegate can. This speeds up my system performance even more, and significantly and makes PID tuning at the ECU easier.

Last edited by JasonC SBB; 07-14-2012 at 07:58 PM.
JasonC SBB is offline   Reply With Quote

Related Topics
Thread Thread Starter Forum Replies Last Post
Project Gemini - Turbo Civic on the Cheap Full_Tilt_Boogie Build Threads 58 Yesterday 10:04 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
Nuke Mars! Joe Perez Current Events, News, Politics 8 09-30-2015 05:41 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:13 PM.