Control Systems Theory - Boost Control Basics

Do It Yourself!

Control Systems Theory - Boost Control Basics

Postby loxxrider » Mon Sep 15, 2014 3:48 am

Controls Theory 101 - Boost Control Basics!

This is controls theory 101 tailored to the DIY t00ner and turbo enthusiast :drive:


The Concept

Many things we depend on in daily life are governed by some type of control system. Water faucets, light dimmers, or the electronics inside a computer are just a few examples. They all have an input that the user controls to achieve a desired output (water flow, light output, the output of a program).
Whenever control over a given system is desired, there are two basic ways to achieve this. One is called open loop control, and the other is called closed loop control. Both methods have their advantages and disadvantages. We will explore the basics of each.


******************************************************************************************************************************************************************************************************


Control Systems – No Controller

Our goal is to control boost pressure on a turbocharged engine. There are several ways to do this, but first let’s look at the turbocharger system without any form of external boost controller.

Consider the turbo system* as a one with a fixed output when at wide open throttle. We will assume that at wide open throttle, the turbo system (turbo, wastegate, etc.) will always supply 10 psi to the engine based on wastegate spring pressure. There is nothing we can do to affect this output without some kind of external controller other than changing the mechanical wastegate spring.

*Note, the turbocharger system itself is actually a closed loop control system with a mechanical controller (the wastegate). For the purpose of this discussion, we will just consider the turbo system as a separate, standalone process which we wish to control with various types of controllers.


Image



******************************************************************************************************************************************************************************************************


Control Systems - Open Loop Control

Of course, we would like to be able to control the boost pressure the turbo system supplies on demand. We can do so by acting on the it with an amplifier or modifier (pressure signal to the wastegate). In this case, we will achieve that with a solenoid (like an N75 valve) and a controller to tell the solenoid when and how to actuate.

*Alternatively, one could use a manual boost controller to modify wastegate pressure reference.

Image

In practice, we would input some value into the controller corresponding to the desired boost and the controller would output a pulse width modulated signal corresponding to the desired duty cycle of the solenoid. The solenoid would operate at the requested duty cycle which would then result in a pressure change in the wastegate pressure reference line. That change in wastegate reference pressure causes the wastegate to open or close by a certain amount, with the final result (output) being a new boost pressure.

The problem with open loop boost control is that if anything changes in the system, or if any external disturbance acts on the system, the output will change. For example, an engine at 3000 RPM requires the turbocharger to work a certain amount to create a given amount of pressure. This might correspond to 50% duty cycle of the solenoid. At a higher RPM, say 7000 RPM, the turbocharger will have to work much harder to make the same amount of pressure. The solenoid might now have to use 100% duty cycle to achieve the same pressure as at 3000 RPM.

Image

This isn’t the end of the world because we can set up reference tables to anticipate these types of external disturbances. Common examples are 2D tables for RPM vs. solenoid duty cycle or 3D tables for speed + RPM vs. solenoid duty cycle or gear + RPM vs. solenoid duty cycle.

Image

That’s all well and good, but there are so many other factors which can affect the turbo system like wind resistance, temperature, fuel type, and more! It would be extremely time consuming, complicated, and probably near impossible to get the desired boost in all conceivable conditions. For some users, this is acceptable, but with more robust and sophisticated boost control algorithms just a few keystrokes away, there is no need for compromise!



******************************************************************************************************************************************************************************************************




Control Systems - Closed Loop Control

A closed loop control system is one in which the system is capable of receiving feedback from it’s output. That is, the system is “aware” of its performance and can correct for any deviation in the desired output. There is no need to use tables to anticipate changes from an external disturbance of any kind. The system will detect the disturbance and make changes to offset it’s effects.

Image

The closed loop controller is concerned with the error between the desired signal (target boost) and the actual signal (actual boost) from the reference sensor (MAP sensor in this example). The type of closed loop controller will dictate exactly how the system reacts, but in general, a greater error between desired and actual will illicit a greater response from the system.



Control Systems - Closed Loop Control - P Controller

The simplest kind of closed loop controller is called a proportional controller. A proportional controller measures the error, or e(t), between the desired set point and the actual output of the system.

e(t) = Desired - Actual

The controller then uses this error to send out a control action (M) to the actuator or solenoid which is proportional to the magnitude of the error.

M = Kp * e(t)

Image

For example, if we set the desired boost to be 15 psi and the turbo system only produces 10 psi, the proportional controller will calculate the error in boost to be 5 psi and will multiply this error by a proportional control constant "Kp“. This value is the one the user would “tune” to determine how much influence the controller has over the system. If Kp has been selected prudently, the system will send a strong control action to bring the actual boost up to the desired boost as quickly as possible, but will steadily reduce control action as the actual boost gets closer to the desired boost (error --> 0).

In a perfect world, the value of Kp would be arbitrary and a proportional controller would be all we need to have the system respond to our commands perfectly and instantaneously. Here, a perfect world means one in which the system has no mass, there is no lag time, etc. The controller would have to be able to react to disturbances instantaneously and the system would be able to respond to commands from the controller instantaneously as well. Of course, that kind of system would require either infinite power or zero mass. Because real world systems have some “mass” and lag time, the value of Kp is important!

Think of the size of the turbo as one form of mass and lag in our system. A larger turbocharger may require more control action from the system to get to its set boost point than a small one.


A very large value of Kp would act to make a given system respond very quickly to even the smallest error, either above or below the set point. A small Kp would act much more slowly and subtly on the system, possibly never driving the error to zero. Here are some examples of how different values of Kp might affect a closed loop control system with a proportional controller. The first shows Kp too high, the second is Kp too low. One (1) is always the target output.

Image

Image

Notice that with a large value of Kp, the system responds quickly and reaches the target magnitude (set point) of 1. However, it oscillates about the target magnitude significantly before settling out.

With a small value of Kp, the system is more sluggish to respond (has a slower rise time) and does not reach the set point or target magnitude. The system requires more control input to reach this value.

Acceptable control is typically not achievable with a P-only closed loop controller for these reasons.




Control Systems - Closed Loop Control - PI Controller


When the system does not reach it’s target value after some time, the difference between the set point and actual system output is called steady-state error. A proportional-integral controller, or PI controller, addresses steady state error by adding a term to the control output equation which integrates or “adds up” the error over time. This accumulated error term will help drive steady state error to zero.

A PI controller sends out a control action (M) to the actuator or solenoid which is composed of a term which is proportional to the magnitude of the error and one which is proportional to the integral of the error (sum of the error over time).

M = Kp * e(t)+ Ki *∫e(t)

Image

As you can see in the left-hand figure, adding an integral term helps the control system drive the error to zero over time. At ~t=5, the system output is below the target so there is some error present. As time continues to ~t=9, the summation of the error over time causes the controller to illicit more control authority driving the error to almost zero.

However, like Kp, Ki can cause oscillation in the system and can even cause the system to become unstable. Too much Ki, especially in combination with too much Kp will result in a system output which is undesirable.

Image

Image

Some systems may work well with a PI controller depending on response criteria and system dynamics, but typically too much oscillation is present for the response to be considered acceptable.




Control Systems - Closed Loop Control - PID Controller

In order to reduce oscillation in the system, a damping term must be added to the control equation. Dampers resist system output proportionally to the change in output per change in time. The mathematical equivalent to this is a derivative.

A PID controller sends out a control action (M) to the actuator or solenoid which is composed of a term which is proportional to the magnitude of the error, one which is proportional to the integral of the error (sum of the error over time), and one which is proportional to the derivative of the error (change in error over time).

M = Kp * e(t) + Ki * ∫e(t) + Kd * de(t)/dt

Image

When adding Kd into the controller, it is immediately obvious. Oscillation is reduced significantly, even with small values of Kd. The first plot shows an initial pass as a PID controller. Some overshoot and oscillation is still present however. To help damp the oscillation out, more Kd can be added. If too much is added, the system response will be sluggish. The second plot shows an example of this where the system output does not even reach the target magnitude. However, you can clearly see the Ki term “pulling” the output up to the target value over time.

The last plot shows a very well-tuned PID controller response. Rise time is minimal as are oscillations. There is always a balance between impacting rise time and reducing oscillations when adjusting Kd (or any other control term for that matter), but a balance of Kp, Ki, and Kd which satisfies all response requirements of rise time and overshoot should easily be arrived upon.

Image

Image

Image

In any case where the desired response is not achievable through PID tuning, the problem is with the physical limitations of the system. More power, less mass, or stronger components may be required to achieve the control goals.
Last edited by loxxrider on Sat Oct 25, 2014 4:32 pm, edited 6 times in total.
-Chris

'91 Audi 200 20v - Revver/BAT project
'91 Audi 200 20v Avant
'01 Anthracite M5
'90 M3
'85 Euro 635csi
'12 X3
E34 530i (maybe rear-mount soon)
User avatar
loxxrider
 
Posts: 6642
Joined: Feb 27, 2013
Location: Jupiter, FL / Somewhere, PA

Re: Control Systems Theory - Boost Control Basics

Postby PRY4SNO » Mon Sep 15, 2014 6:20 am

Nice... keep going. This is good stuff.
Find me on Instagram @pry4sno

|| 2010 Golf Sportwagen TDI /// #farmenwagen
|| 2002 Dodge Ram 2500 24vt 4x4 #bertancummins
|| 1992 80 quattro 20v /// Eventual AAN'd Winter Sled
|| 1990 Coupe quattro /// Because Racecar
User avatar
PRY4SNO
 
Posts: 2430
Joined: Mar 3, 2013
Location: Edmonton, AB

Re: Control Systems Theory - Boost Control Basics

Postby chaloux » Mon Sep 15, 2014 7:33 am

Nice, looking fwd to part 2!
Matt

18 Silverado 1500 work pig, roof rack and tonneau cover
11 Jetta sedan TDI DSG, rear muffler delete
GONE :( 87 4ktq - 4 FOX SNAKES

Image
User avatar
chaloux
 
Posts: 3167
Joined: Feb 27, 2013
Location: Muskoka, Ontario, Canada

Re: Control Systems Theory - Boost Control Basics

Postby loxxrider » Wed Sep 24, 2014 7:23 am

Part 2 is taking a little while. Why? Well, I'm getting a little deep into it. In an effort to make it relevant to boost control and to maybe help you guys get usable PID gains right off the bat, I am going to attempt to model our turbo systems using log data to back out a linear plant model. If I fail at that, then I will just post a simplified version :D


The first thing I need to think about here is what data to collect for estimating the plant model. We need to specify input and output data for the "black box" plant model of the turbo system. I think it is pretty obvious what the output is, boost! The input is a bit more complicated because there are actually multiple inputs. I think we can simplify it a bit and say the inputs are the boost control solenoid's duty cycle, and RPM. We know the turbo can only spool so fast and boost so much for a given RPM, and a given boost control duty cycle. Unfortunately, this system is not linear, but we can work around that a bit as long as there is sufficient data. Let me see what I can come up with...
-Chris

'91 Audi 200 20v - Revver/BAT project
'91 Audi 200 20v Avant
'01 Anthracite M5
'90 M3
'85 Euro 635csi
'12 X3
E34 530i (maybe rear-mount soon)
User avatar
loxxrider
 
Posts: 6642
Joined: Feb 27, 2013
Location: Jupiter, FL / Somewhere, PA

Re: Control Systems Theory - Boost Control Basics

Postby elaw » Fri Sep 26, 2014 6:49 am

This is cool... it seems like you really know your stuff!

I'd be interested in getting your thoughts on a subject that surprisingly (to me) never gets discussed...

It seems like whenever people talk about boost control with engine-management systems, the discussion goes as if the ECU controls the wastegate directly, which is not the case in setups like most of ours where there's a frequency valve between the compressor and the wastegate.

What these systems really do, and I think this is part of what makes boost control so tough, is vary the gain of what already is a closed-loop system. With the wastegate diaphragm chamber connected directly to the turbo compressor, you basically have a "P-only" controller: the higher the pressure generated by the compressor, the farther the wastegate opens. Adding a frequency valve controlled by an ECU doesn't put the ECU directly in control of the wastegate, but rather it modifies the amount of compressor pressure required to open the WG. Or in other words, it modifies the gain of that "P-only controller". So really what you've got is one controller regulating the gain of another.
Be alert! America needs more lerts.
Eric Law
'12 A4Q completely boringly stock
'90 80Q with AAN and Megasquirt
'97 Saab 9000 Aero: sold 5/2017, sorely missed
User avatar
elaw
 
Posts: 853
Joined: Jan 6, 2014
Location: MA, USA

Re: Control Systems Theory - Boost Control Basics

Postby loxxrider » Fri Sep 26, 2014 11:55 am

elaw,

You are spot on about the turbo system without the WGFV being a closed loop system already. I mentioned that in "Control Systems - No Controller" above. Very good observation and it was one that I hadn't really considered up until I really got thinking about how the WGFV really controls the system. I'm not sure that it's a true P-only controller though. I think it has some natural damping associated with it making it more like a PD controller. I will have to think more about this.

You are correct that we have a controller modifying the gain of another one. That means we actually have a kind of cascade controller. However, you can model the wastegate as part of the "black box" plant as a whole. Things are simplified significantly when doing this, but it is still possible to identify and design the control system effectively this way.


I think I may just do a generic write-up here about closed loop control for now, but I am still really hoping to be able to model the system we have here. I may need to reach out for some help though. So far I have been able to identify the transfer function(s) of the plant by using MATLAB's system identification tool. I'm very close to being able to model it, but I'm not sure of how to implement the plant data since it is a multiple input, single output (MISO) system. I get two transfer functions out of the system identification tool. One describing how one input affects the output, and another for the way the other input affects the same output. How to draw this in the block diagram is where I'm stuck.
-Chris

'91 Audi 200 20v - Revver/BAT project
'91 Audi 200 20v Avant
'01 Anthracite M5
'90 M3
'85 Euro 635csi
'12 X3
E34 530i (maybe rear-mount soon)
User avatar
loxxrider
 
Posts: 6642
Joined: Feb 27, 2013
Location: Jupiter, FL / Somewhere, PA

Re: Control Systems Theory - Boost Control Basics

Postby GTJeff » Fri Sep 26, 2014 1:46 pm

Chris,

I also took control theory as a mechanical engineering student like 16 years ago but I haven't had to do a Laplace transform, Z transform or model a system in MATLAB since so I won't be much help with your question.

Modeling the system and tuning the modeled system would be a great place to start if we were starting from scratch. We are not trying to determine the control parameters for sending a rocket to the moon for the first time or for the Aeirolons on a super secret experimental fighter jet's for its first flight. There is lots of experience in this area of boost control.

I think it would be better for the average Joe to explain the basics of PID control, explain what control parameter values work well with VEMS, and explain how varying the parameters might affect system stability, rise time and overshoot.

Jeff
GTJeff
 
Posts: 101
Joined: Apr 8, 2013

Re: Control Systems Theory - Boost Control Basics

Postby loxxrider » Fri Sep 26, 2014 9:41 pm

Thanks Jeff, that's basically what I'm shooting for. Getting some usable parameters out of it will be a challenge and an added bonus of I can do it. Either way, I'll get the basics of up here :)
-Chris

'91 Audi 200 20v - Revver/BAT project
'91 Audi 200 20v Avant
'01 Anthracite M5
'90 M3
'85 Euro 635csi
'12 X3
E34 530i (maybe rear-mount soon)
User avatar
loxxrider
 
Posts: 6642
Joined: Feb 27, 2013
Location: Jupiter, FL / Somewhere, PA

Re: Control Systems Theory - Boost Control Basics

Postby loxxrider » Sat Oct 25, 2014 4:25 pm

Closed loop control information added to the first post. Do not skip straight to the PID section to understand how it all works! Reading through the entire closed loop control section will be much more beneficial.


Please let me know if there is anything that you'd like clarified or expanded upon. This is just a basic introduction to closed loop control theory. We could go much further in-depth with the math involved, modeling systems, or tweaks we can use in VEMS like integral limits, but I'll leave that for another day.
-Chris

'91 Audi 200 20v - Revver/BAT project
'91 Audi 200 20v Avant
'01 Anthracite M5
'90 M3
'85 Euro 635csi
'12 X3
E34 530i (maybe rear-mount soon)
User avatar
loxxrider
 
Posts: 6642
Joined: Feb 27, 2013
Location: Jupiter, FL / Somewhere, PA

Re: Control Systems Theory - Boost Control Basics

Postby ChrisAudi80 » Sat Aug 27, 2016 9:25 am

I have read this like 10x now and slowly starting to understand.

The piggyback I used before was a PI type controller, I think. I was ass backwards though. [I] (aka sensitivity) was was selected first, then [P] (aka gain IIUC).
96 S6 auto
95 80Q AEB VEMS
ChrisAudi80
 
Posts: 875
Joined: Mar 3, 2013
Location: Bangkok, Thailand

Re: Control Systems Theory - Boost Control Basics

Postby loxxrider » Sat Aug 27, 2016 10:09 am

Let me know if there is anything you need me to explain. I'd be happy to help.
-Chris

'91 Audi 200 20v - Revver/BAT project
'91 Audi 200 20v Avant
'01 Anthracite M5
'90 M3
'85 Euro 635csi
'12 X3
E34 530i (maybe rear-mount soon)
User avatar
loxxrider
 
Posts: 6642
Joined: Feb 27, 2013
Location: Jupiter, FL / Somewhere, PA

Re: Control Systems Theory - Boost Control Basics

Postby ChrisAudi80 » Tue Aug 30, 2016 1:14 am

loxxrider wrote:Let me know if there is anything you need me to explain. I'd be happy to help.


Thanks man. You are helping a lot already. Really appreciate it.
When it comes to boost control on the AEB, it is quite easy with the stock K03. I have P set to 40, I and D to 0. I control boost by refDC right now, it's working just fine. Boost target 200kpa is hit almost all the time. Just small deviation as you can see from my logs.

Will probably need to play more with PID when getting a bigger turbo. :D
96 S6 auto
95 80Q AEB VEMS
ChrisAudi80
 
Posts: 875
Joined: Mar 3, 2013
Location: Bangkok, Thailand


Return to DIY Write-ups

Who is online

Users browsing this forum: No registered users and 1 guest