Xiaoming received the following task: There is a water tank that is leaking, and the rate of leakage is unpredictable, but the water level must be maintained at a certain position. Once the water level is found to be below the required position, water must be added to the tank.
At first, Xiaoming used a ladle to add water, but the faucet was more than ten meters away from the water tank, so he often had to run several times to add enough water. Then Xiaoming switched to using a bucket, adding a whole bucketful at a time. This reduced the number of trips and increased the speed of adding water, but he still overflowed the tank several times, accidentally wetting his shoes. Xiaoming then had another idea: "I won't use a ladle or a bucket, I'll use a basin!" After a few tries, he found it worked perfectly, requiring fewer trips and preventing overflow. This inspection time is called the sampling period.
At first, Xiaoming used a ladle to add water. The faucet was more than ten meters away from the water tank, so he often had to make several trips to fill it. Then he switched to using a bucket, filling it one bucket at a time. This reduced the number of trips and increased the speed of adding water, but he still overflowed the tank several times, accidentally wetting his shoes. Xiaoming then had another idea: "I won't use a ladle or a bucket; I'll use a basin!" After a few tries, he found it was just right—he didn't need to make many trips and the water wouldn't overflow. The size of this water-adding tool is called the proportional coefficient.
Xiao Ming discovered that although the water wouldn't overflow, it sometimes exceeded the required level, still posing a risk of getting his shoes wet. He then devised a solution: attaching a funnel to the water tank. Instead of pouring water directly into the tank, he poured it into the funnel, letting it add slowly. This solved the overflow problem, but the water adding speed slowed down, sometimes even lagging behind the rate of leakage. So he tried using funnels of different diameters to control the adding speed, finally finding a satisfactory funnel. The time taken to add water using the funnel is called the integration time.
Xiao Ming finally breathed a sigh of relief, but the task requirements suddenly became stricter. The timeliness of water level control was greatly increased. If the water level was too low, it had to be immediately added to the required level, and it couldn't be too high, otherwise he wouldn't get paid. Xiao Ming was in a dilemma again! So he racked his brains and finally came up with a solution: always keep a basin of spare water nearby. As soon as he noticed the water level was low, he would add a basin of water without using a funnel. This ensured timeliness, but sometimes the water level would be too high. He then drilled a hole slightly above the required water level and connected a pipe to the spare bucket below. The excess water would then leak out through the hole above. The rate at which this water leaks out is called the differential time.
In the story, Xiaoming's experiment was carried out independently step by step. However, the actual water-adding tools, funnel diameter, and overflow hole size all affect the water-adding speed and the amount of water level overshoot. After completing the later experiments, the results of the earlier experiments often need to be modified.
A person uses a PID controller to pour half a cup of water (marked with graduations) into a water glass from a kettle, then stops.
Setting value: Half-cup mark on the water glass;
Actual value: The actual amount of water in the cup;
Output values: the amount of water poured out of the kettle and the amount of water scooped out of the cup;
Measurement: The human eye (equivalent to a sensor)
Target: People
In progress: Pouring water
Counter-enforcement: Scooping water
1P proportional control means that when a person sees that the water level in the cup has not reached the half-cup mark, they will pour water from the kettle into the cup according to a certain amount, or when the water level in the cup exceeds the mark, they will scoop water out of the cup according to a certain amount. This action may cause the cup to be less than half-cup or more than half-cup before stopping.
Note: Proportional control (P) is the simplest control method. Its controller output is proportional to the input error signal. When only proportional control is used, the system output exhibits a steady-state error.
2PI integral control works by pouring a certain amount of water into a cup. If the water level in the cup is not marked, it keeps pouring. Later, if the water level exceeds half a cup, it scoops water out of the cup. This process is repeated until the water level reaches the mark.
Explanation: In integral-integral (PI) control, the controller's output is proportional to the integral of the input error signal. For an automatic control system, if a steady-state error exists after reaching steady state, the control system is said to have a steady-state error, or simply a system with 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 integral of the error over time; as time increases, the integral term increases. Thus, even if the error is small, the integral term will increase with time, driving the controller's output to increase and further reduce the steady-state error until it equals zero. Therefore, a proportional-integral (PI) controller can ensure that the system has no steady-state error after reaching steady state.
3PID derivative control is like observing the distance between the water level in a cup and the mark on the scale. When the difference is large, a large volume of water is poured from the kettle. As the water level approaches the mark, the flow rate is reduced, gradually approaching the mark until the water stops at the mark in the cup. If the water stops precisely at the mark, it's zero steady-state error control; if it stops near the mark, it's steady-state error control.
Note: In differential control D, the controller output is proportional to the derivative of the input error signal (i.e., the rate of change of the error).
In engineering practice, the most widely used regulator control law is proportional-integral-derivative control, abbreviated as PID control, also known as PID regulation. The PID controller has been around for nearly 70 years, and its simple structure, good stability, reliable operation, and convenient adjustment have made it one of the main technologies in industrial control. When the structure and parameters of the controlled object cannot be fully understood, or when an accurate mathematical model is unavailable, and other control theory techniques are difficult to apply, the structure and parameters of the system controller must be determined based on experience and on-site debugging. In this case, 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 most suitable. In practice, PI and PD control also exist. The PID controller calculates the control quantity based on the system error using proportional, integral, and derivative calculations.
►PID parameters
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 exhibits a steady-state error.
2-integral (I) control
In integral control, the controller's output is proportional to the integral of the input error signal. For an automatic control system, if a steady-state error exists after reaching steady state, the control system is said to have a steady-state error, or simply a system with 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 integral of the error over time; as time increases, the integral term increases. Thus, even if the error is small, the integral term will increase with time, driving the controller's output to increase and further reduce the steady-state error until it equals zero. Therefore, a proportional-integral (PI) controller can ensure that the system has no steady-state error after reaching steady state.
3-Differential (D) Control
In differential control, the controller output is proportional to the derivative of the input error signal (i.e., the rate of change of the error).
Automatic control systems may experience oscillations or even instability during error correction. This is because of components with significant inertia or delay, which, while suppressing error, always lag behind changes in the error itself. The solution is to make the error-suppressing effect "lead," meaning that when the error approaches zero, the error-suppressing effect should be zero. This means that simply introducing a proportional term in the controller is often insufficient, as it only amplifies the error amplitude. What's needed is a derivative term, which predicts the trend of error changes. Thus, a controller with a proportional-derivative (PD) term can make the error-suppressing control effect equal to zero, or even negative, in advance, avoiding severe overshoot of the controlled variable. Therefore, for controlled objects with significant inertia or delay, a PD controller can improve the dynamic characteristics of the system during adjustment.
Ideally, PID parameters should be determined theoretically during tuning. However, in practical applications, the parameters are more often determined through trial and error.
Increasing the proportional gain P generally speeds up the system response and helps reduce steady-state error when it exists. However, an excessively large proportional gain can cause the system to have a large overshoot and produce oscillations, thus worsening its stability.
Increasing the integration time I helps reduce overshoot and oscillation, thus increasing system stability, but it also lengthens the time required to eliminate steady-state error.
Increasing the derivative time D helps to speed up the system's response, reduce the system's overshoot, and increase its stability, but it weakens the system's ability to suppress disturbances.
During the trial and error process, the influence trend of the above parameters on the system control process can be referenced, and the parameter adjustment should be carried out in the following steps: proportional, then integral, and then derivative.
► Methods for tuning PID controller parameters
PID controller parameter tuning is a core aspect of control system design. It involves determining the proportional gain, integral time, and derivative time of the PID controller based on the characteristics of the controlled process. There are many methods for PID controller parameter tuning, which can be broadly categorized into two main types:
One method is the theoretical calculation tuning method. This method primarily relies on the system's mathematical model to determine the controller parameters through theoretical calculations. However, the calculated data obtained using this method may not be directly usable and must be adjusted and modified based on actual engineering practice.
Secondly, there are engineering tuning methods. These primarily rely on engineering experience and are performed directly in the testing of the control system. They are simple, easy to master, and widely used in practical engineering. Engineering tuning methods for PID controller parameters mainly include the critical proportional method, the response curve method, and the decay method. Each of these three methods has its own characteristics, but they all share the common feature of tuning the controller parameters through experimentation and then according to empirical formulas. However, regardless of the method used, the controller parameters obtained still require final adjustment and refinement during actual operation.
The critical proportional method is generally used now. The steps for tuning the PID controller parameters using this method are as follows: (1) First, select a sufficiently short sampling period to allow the system to work; (2) Add only the proportional control element until the system exhibits critical oscillation in response to the step input, and record the proportional gain and critical oscillation period at this time; (3) Under a certain degree of control, calculate the PID controller parameters using the formula.
Setting PID parameters relies on experience and familiarity with the process, referring to the curve of measured value tracking and set value, thereby adjusting the values of P, I, and D.
Commonly used mnemonic:
Find the optimal parameters by checking them in ascending order.
First the proportion, then the integral, and finally the differential is added;
The curve oscillates very frequently, so the scale plate needs to be enlarged.
The curve floats around the big bay, the scale dial is turned smaller;
The curve deviates from its recovery path, resulting in a slower integration time;
The curve has a long fluctuation period, and the integration time is further extended.
In my opinion, the setting of PID parameters should be determined based on both the specific circumstances of the controlled object and experience. P addresses amplitude oscillations; a larger P will result in larger amplitude oscillations but a smaller oscillation frequency, and a longer system stabilization time. I addresses the speed of action response; a larger I results in a slower response, and vice versa. D eliminates static errors; generally, D is set relatively small and has a relatively small impact on the system.
1. Setting Proportional Control
By gradually increasing the proportional control, observe the response for each iteration until a response curve with fast response and small overshoot is obtained.
2. Integral Setting Stage
If the steady-state error under proportional control does not meet the requirements, integral control needs to be added. First, reduce the proportional coefficient selected in the previous steps to 50-80% of its original value, then set the integral time to a larger value and observe the response curve. Then, decrease the integral time, increase the integral action, and adjust the proportional coefficient accordingly. Repeat this trial and error until a satisfactory response is obtained, and determine the parameters for proportional and integral control.
3. Tuning Differential Components
If, after the above steps, PI control can only eliminate steady-state error but the dynamic process is unsatisfactory, then derivative control should be added to form PID control. Initially, set the derivative time TD = 0, gradually increase TD, and simultaneously change the proportional coefficient and integral time accordingly. Repeat this trial and error process until satisfactory control performance and PID control parameters are obtained.
Disclaimer: This article is a reprint. If there are any copyright issues, please contact us promptly for deletion (QQ: 2737591964). We apologize for any inconvenience.