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

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.

******************************************************************************************************************************************************************************************************
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.

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.

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.

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.

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)

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.


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)

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.


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

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.



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.