Tip: Click the “Chemical Workers Club” above to follow ↑ for more industry insights!
The 2nd Pharmaceutical and Chemical Production Process Control Summit Forum 2024 and Continuous, Automated Control and Optimization Technology Exchange Conference
Part One





-
It can bring the physical quantity that needs to be controlled close to the target.
-
It can “predict” the trend of this quantity’s change.
-
It can also eliminate static errors caused by heat loss, resistance, and other factors.
-
…

-
When the difference between the two is small, let the heater “lightly heat up.
-
If, for some reason, the temperature drops significantly, let the heater “exert a bit more effort to heat up.
-
If the current temperature is much lower than the target temperature, let the heater “full throttle heat up, quickly bringing the water temperature close to the target.



-
P thinks: I am already close to the target, I just need to heat lightly.
-
D thinks: The heating and cooling rates are equal, the temperature is stable, I don’t need to adjust anything.

Part Two
Xiao Ming received a task: there is a water tank that leaks (and the leak rate might not be constant), requiring the water level to be maintained at a certain position. If the water level is found to be below the required position, water must be added to the tank. After receiving the task, Xiao Ming kept watching the tank, but after a long time, he felt bored and went to read a novel, checking the water level every 30 minutes. The water leaked too quickly, and each time he checked, the water was almost gone, far from the required height. Xiao Ming changed to checking every 3 minutes, but the water hardly leaked each time, and he didn’t need to add water, making frequent checks futile. After several trials, he determined to check every 10 minutes. This checking time is called the sampling period. Initially, Xiao Ming used a ladle to add water. The faucet was over ten meters away from the tank, and he often had to run several times to add enough water. So, he switched to using a bucket, adding a whole bucket at once, reducing the number of trips and speeding up the water addition. However, he spilled water several times, wetting his shoes. Xiao Ming thought again: I won’t use a ladle or a bucket; I’ll use a basin. After several tries, he found it just right, not needing to run too much and not causing overflow. The size of this water addition tool is called the proportional coefficient. Xiao Ming also found that although the water wouldn’t overflow, it sometimes rose above the required level, still risking wetting his shoes. He thought of another solution: install a funnel on the tank, adding water to the funnel instead of directly into the tank to let it fill slowly. This solved the overflow problem, but the addition speed was slow and sometimes couldn’t keep up with the leak rate. So he tried different funnel sizes to control the water addition speed and finally found a satisfactory funnel. The time for the funnel is called the integral time. Xiao Ming finally breathed a sigh of relief, but the task’s requirements suddenly became stricter: the timeliness of water level control was greatly increased. If the water level was too low, he had to immediately add water to the required position without exceeding too much, or he wouldn’t get paid. Xiao Ming was troubled again! He finally thought of a solution: always keep a basin of spare water nearby. Once he noticed the water level was low, he would add a basin of water directly without going through the funnel, ensuring timeliness, but the water level sometimes rose too high. He then drilled a hole slightly above the required water level and connected a pipe to a lower spare bucket, so the excess water would leak out from the upper hole. The speed of this water leaking out is called the differential time.
Seeing several posts about sampling periods, I suddenly thought of this story. The differential analogy is a bit forced, but as long as it helps understanding, it’s fine. Hehe, it’s entry-level, and if it helps beginners understand PID, that’s enough.
Xiao Ming’s experiments in the story were done independently step by step, but in reality, the water addition tool, funnel diameter, and overflow hole size all influence the water addition speed, the amount of overshoot, and often require revising previous experimental results after later experiments.
People use PID control to pour half a cup of water from a kettle into a cup marked with a scale and then stop;
Set value: the half-cup scale of the cup;
Actual value: the actual amount of water in the cup;
Output value: the amount poured from the kettle and the amount scooped from the cup;
Measurement: a person’s eyes (equivalent to a sensor)
Execution object: the person
Direct execution: pouring water
Reverse execution: scooping water
(1) P Proportional Control
Is when a person sees that the amount of water in the cup has not reached the half-cup mark, they pour a certain amount from the kettle into the cup, or if the water in the cup exceeds the mark, they scoop a certain amount out of the cup. This action might result in not reaching half a cup or exceeding it slightly before stopping.
Explanation:
P proportional control is the simplest control method. Its controller output is proportional to the input error signal. When only proportional control is used, the system output has a steady-state error (Steady-state error).
(2) PI Integral Control
Means pouring a certain amount of water into the cup. If the water level in the cup does not reach the mark, continue pouring. Later, if the water level exceeds half a cup, scoop some out, and repeat until the water level reaches the mark.
Explanation:
In integral I control, the controller output is proportional to the integral of the input error signal. For an automatic control system, if there is a steady-state error after entering steady state, this control system is said to have a steady-state error or is simply called a system with steady-state error (System with Steady-state Error). To eliminate steady-state error, an “integral term” must be introduced into the controller. The integral term depends on the time integral of the error, and as time increases, the integral term increases. Thus, even if the error is small, the integral term will increase over time, pushing the controller output to increase and further reduce the steady-state error until it equals zero. Therefore, the proportional + integral (PI) controller can eliminate steady-state error once the system enters steady state.
(3) PID Derivative Control
Means that a person’s eyes observe the distance between the water level in the cup and the mark. When the difference is large, they pour a large amount of water from the kettle. When they see the water level approaching the mark, they reduce the amount poured, slowly approaching the mark until stopping at the marked level. If they can finally stop precisely at the mark, it’s zero steady-state error control; if they stop near the mark, it’s steady-state error control.
Explanation:
In derivative control D, the controller output is proportional to the derivative (i.e., the rate of change) of the input error signal.
In practical engineering, the most widely used control laws for regulators are proportional, integral, and derivative control, collectively referred to as PID control, also known as PID regulation. The PID controller has been around for nearly 70 years. It has become one of the main technologies in industrial control due to its simple structure, good stability, reliability, and ease of adjustment. When the structure and parameters of the controlled object cannot be fully mastered, or when no precise mathematical model can be obtained, and other control theory techniques are difficult to adopt, the structure and parameters of the system controller must rely on experience and on-site debugging to determine. This is when applying PID control technology is the most convenient. That is, when we do not fully understand a system and the controlled object or cannot obtain system parameters through effective measurement methods, PID control technology is the most suitable. PID control also includes PI and PD control in practice. The PID controller calculates the control quantity based on the system’s error using proportional, integral, and derivative calculations.

1. Proportional (P) Control
Proportional control is the simplest control method. Its controller output is proportional to the input error signal. When only proportional control is used, the system output has a steady-state error (Steady-state error).
2. Integral (I) Control
In integral control, the controller output is proportional to the integral of the input error signal. For an automatic control system, if there is a steady-state error after reaching steady state, this control system is said to have a steady-state error or is simply called a system with steady-state error (System with Steady-state Error). To eliminate steady-state error, an “integral term” must be introduced into the controller. The integral term depends on the time integral of the error, and as time increases, the integral term increases. Thus, even if the error is small, the integral term will increase over time, pushing the controller output to increase and further reduce the steady-state error until it equals zero. Therefore, the proportional + integral (PI) controller can eliminate steady-state error once the system enters steady state.
3. Derivative (D) Control
In derivative control, the controller output is proportional to the derivative (i.e., the rate of change) of the input error signal. Automatic control systems may experience oscillation or instability during the error correction process. This is due to the presence of large inertia components or delay components, which suppress the error, and their changes always lag behind the changes in the error. The solution is to make the effect of suppressing the error change “lead,” meaning that when the error approaches zero, the effect of suppressing the error should also be zero. This means that merely introducing the “proportional” term in the controller is often insufficient; the role of the proportional term is only to amplify the magnitude of the error, while what is currently needed is to add the “derivative” term, which can predict the trend of the error change. Thus, a controller with proportional + derivative can make the effect of suppressing the error control equal to zero, or even negative, in advance, thus avoiding serious overshoot of the controlled quantity. Therefore, for controlled objects with significant inertia or delay, a proportional + derivative (PD) controller can improve the dynamic characteristics of the system during the adjustment process.
When tuning PID parameters, having a theoretical method to determine the PID parameters is of course the ideal approach, but in practical applications, more often it is determined by trial and error.

Increasing the proportional coefficient P generally speeds up the system’s response and is beneficial for reducing steady-state error in cases of steady-state error, but too large a proportional coefficient may cause significant overshoot and oscillation, degrading stability.
Increasing the integral time I helps reduce overshoot and oscillation, increasing the system’s stability, but it also prolongs the time to eliminate steady-state error.
Increasing the derivative time D is beneficial for speeding up the system’s response, reducing the overshoot, and increasing stability, but it weakens the system’s ability to suppress disturbances.
During trial and error, the effects of these parameters on the system control process can be referenced, and the parameter adjustment should follow the order of proportional first, then integral, and finally derivative for tuning.
The tuning of PID controller parameters is the core content of control system design. It determines the size of the PID controller’s proportional coefficient, integral time, and derivative time based on the characteristics of the controlled process. There are many methods for tuning PID controller parameters, which can be broadly classified into two categories:
1. Theoretical Calculation Tuning Method
This mainly relies on the mathematical model of the system, calculating the controller parameters through theoretical calculations. The calculated data obtained by this method may not be directly usable and must be adjusted and modified through engineering practice;
2. Engineering Tuning Method
This primarily relies on engineering experience, directly conducting experiments in the control system, and is a simple and easy-to-master method that is widely adopted in engineering practice. The engineering tuning methods for PID controller parameters mainly include the critical ratio method, reaction curve method, and decay method. Each of these three methods has its characteristics, but they all involve experimentation and tuning the controller parameters according to engineering experience formulas. However, regardless of which method is used to obtain the controller parameters, they need to be adjusted and refined during actual operation.
Currently, the critical ratio method is generally used. The steps for tuning PID controller parameters using this method are as follows:
(1) First, pre-select a sufficiently short sampling period for the system to operate;
(2) Only add the proportional control element until the system exhibits critical oscillation in response to the input step, recording the proportional gain and the critical oscillation period at this time;
(3) Calculate the PID controller parameters using formulas under a certain control degree.
Setting PID parameters relies on experience and familiarity with the process, referencing measurement values to track and adjust the sizes of P, I, and D.
Common Mnemonics:
Find the best parameters from small to large in order;
First, set the proportional, then the integral, and finally add the derivative;
If the curve oscillates frequently, increase the proportional dial;
If the curve drifts around the large bay, decrease the proportional dial;
If the curve deviates and returns slowly, reduce the integral time;
If the curve fluctuates with a long period, increase the integral time;
Step 1: Tuning Proportional Control
Increase the proportional control effect from small to large, observing each response until obtaining a quick response with minimal overshoot.
Step 2: Tuning Integral Control
If the steady-state error cannot meet the requirements under proportional control, integral control must be added. First, reduce the proportional coefficient selected in the previous step to 50-80% of the original, then set the integral time to a larger value and observe the response curve. Then reduce the integral time, increase the integral effect, and adjust the proportional coefficient accordingly, repeating until achieving a satisfactory response and determining the parameters for proportional and integral.
Step 3: Tuning Derivative Control
If, after the above steps, PI control can only eliminate steady-state error but the dynamic process is unsatisfactory, derivative control should be added to form PID control. Set the derivative time TD=0, gradually increase TD, and adjust the proportional and integral times accordingly, repeating until achieving satisfactory control effects and PID control parameters.
Without a solid foundation, one cannot undertake delicate tasks. To master and apply PID, it is essential to learn the basic concepts to arm ourselves, with some concepts paired with commonly used expressions in practical engineering, starting with “Actual:”.
1. Controlled Quantity: The value reflecting the actual fluctuations of the controlled object. The controlled quantity often changes.
Actual: Commonly detected feedback value representation, such as yout(t).
2. Set Value: The set value of the PID regulator is the value people expect the controlled quantity to reach. The set value can be fixed or variable.
Actual: Manually set, often denoted as rin(t).
3. Control Output: The instruction sent by the PID regulator based on changes in the controlled quantity, commanding external execution structures to act according to its requirements, i.e., the entire regulator’s output. Note the distinction from the controlled quantity yout(t); these two are entirely different concepts, and people often confuse them.
Actual: The formula you often see, “u(t)=kp[e(t)+1/TI∫e(t)dt+TD*de(t)/dt]” includes u(t).
4. Input Deviation: The difference between the controlled quantity and the set value.
Actual: error(t)=rin(t)-yout(t).
5. P (Proportional): P represents the proportional effect, simply put, the input deviation multiplied by a coefficient.
Actual: kp, KP are the same.
6. I (Integral): I represents the integral, simply put, the integration of the input deviation.
Actual: ki.
7. D (Derivative): D represents the derivative, simply put, the differentiation of the input deviation.
Actual: kd.
8. Basic PID Formula: The tuning process of PID controller parameters is simply to first set the system to pure proportional action, gradually increase the proportional effect to produce equal amplitude oscillation, record the proportional action and oscillation period, then multiply this proportional action by 0.6 and appropriately extend the integral action.
KP= 0.6*Km
KD= KP*π/4ω or KD= KP*tu/8
KI= KP*ω/π or KI= 2KP/tu
KP: Proportional control parameter;
KD: Integral control parameter;
KI: Derivative control parameter;
Km: The proportional value when the system begins to oscillate, usually called the critical proportional value;
ω: The frequency during equal amplitude oscillation, with tu being the oscillation period. Here tuω =2π, not tuω=1. Those who have studied Fourier and Laplace transforms should understand why this is the case; we won’t delve deeper here.
9. Single Loop: A single loop is a PID control system with only one PID.
10. Cascade: When one PID is not enough, cascade means connecting two PIDs in series to form a cascade control system, also known as a dual-loop control system. In a cascade control system, the PID controller that adjusts the controlled quantity is called the main controller, while the PID that directly commands the actuator is called the secondary controller. The control output of the main controller enters the secondary controller as its set value. The main controller uses a single loop PID regulator, while the secondary controller uses an externally given regulator.
11. Positive Action
For the PID regulator, when the control output increases with the increase of the controlled quantity and decreases with the decrease of the controlled quantity, this action is called PID positive action.
12. Negative Action
For the PID regulator, when the control output decreases with the increase of the controlled quantity and increases with the decrease of the controlled quantity, this action is called PID negative action.
13. Dynamic Deviation
During the adjustment process, the deviation between the controlled quantity and the set value changes at any time. The deviation between the two at any moment is called dynamic deviation.
14. Static Deviation
After the adjustment stabilizes, the deviation between the controlled quantity and the set value is called static deviation. Eliminating static deviation is achieved through the integral action of the PID regulator.
15. Feedback
The adjustment action of the regulator shows that the controlled quantity begins to change from rising to falling, or from falling to rising, becoming feedback.
Source: Internet
Editor: Chemical Workers Club
Copyright Statement
Disclaimer: The copyright of the article belongs to the original author. If there are issues regarding the content, copyright, or other matters, please contact us for deletion! The content of the article reflects the author’s personal views and does not represent the position or support of this public account. This public account reserves the final interpretation rights for this statement.