3113 views|2 replies

1

Posts

0

Resources
The OP
 

The soul of negative feedback, summary of PID algorithm, you will understand it in one article! [Copy link]

This post was last edited by alen5306 on 2023-12-8 22:32
Mathematical Model of PID
In industrial applications, PID and its derivative algorithms are one of the most widely used algorithms and are well-deserved universal algorithms. If you can master the design and implementation process of the PID algorithm, it should be enough for general R&D personnel to deal with general R&D problems. What is valuable is that among many control algorithms, the PID control algorithm is the simplest and the control algorithm that best reflects the feedback idea. It can be called a classic among classics. Classics are not necessarily complicated. Classic things are often simple and the simplest.
The general form of the PID algorithm
The PID algorithm controls the controlled quantity through the error signal, and the controller itself is the sum of the three links of proportion, integration and differentiation. Here we stipulate (at time t):
1. Input quantity is
2. The output is
3. The deviation is
The output of the PID controller is:
Digital Discretization of PID Algorithm
Assuming the sampling interval is T, at the Kth T moment:
Deviation=
The integral part is expressed in the form of addition, that is:
The differential link is expressed in the form of slope, that is:


The formula after discretization of PID algorithm:


can be expressed as:

Where:
Proportional parameter: The output of the controller is proportional to the input deviation value. Once the system has a deviation, the proportional control will immediately take effect to reduce the deviation.
Features: The process is simple and fast, with a large proportional effect, which can speed up adjustment and reduce errors; however, it reduces system stability, causing instability and residual errors.
Integral parameters: The integral link is mainly used to eliminate static error. The so-called static error is the difference between the output value and the set value after the system stabilizes. The integral link is actually a process of accumulating deviations. The accumulated error is added to the original system to offset the static error caused by the system.


Differential parameter: The differential signal reflects the changing law of the deviation signal, or the changing trend. According to the changing trend of the deviation signal, advance adjustment is performed, thereby increasing the rapidity of the system. The basic discrete representation of PID is as above. The current representation belongs to position PID. Another representation is incremental PID. From the above expression ,
it can be easily obtained: Then:


The above formula is the incremental expression of the discretized PID. It can be seen from the formula that the incremental expression result is related to the deviation of the last three times, which greatly improves the stability of the system. It should be noted that the final output result should be: output = + incremental adjustment value.

Purpose
The importance of PID should be self-evident. It is the most widely used algorithm in the field of control. The purpose of this article is to show the algorithm process through an example and explain the following concepts:
(1) Briefly describe what PID is? Why is PID needed? What role does PID play?
(2) Understand the role of P (proportional link): basic proportional link.
Disadvantage: Produces steady-state error.
Question: What is steady-state error and why does steady-state error occur?
(3) Understand the role of I (integral link): eliminate steady-state errors.
Disadvantage: Increased overshoot
Question: Why can integration eliminate steady-state errors?
(4) Understand the role of D (differential link): increase the inertial response speed and reduce the overshoot trend
Question: Why can overshoot be reduced?
(5) Understand the functions of each proportionality coefficient
What is PID and why do we need it?
The following is the overall block diagram of PID control, and the process is described as follows:
Set an output target, and the feedback system returns the output value. If it is inconsistent with the target, there is an error. PID adjusts the input value according to this error until the output reaches the set value.
Question: Then why do we need PID? For example, if I want to control the temperature, can’t I monitor the temperature value? Should I stop when the temperature value is reached?
We must first talk about our goal here, because all our control is nothing more than wanting the output to reach our settings, that is, if we set a target temperature value, then what kind of temperature change do we want?
For example, if the target temperature is set to 30 degrees, the goal is nothing more than to achieve Figure 1 and hope that it can reach 30 degrees quickly and without jitter.
Now everyone should understand that if the temperature is stopped when it is reached, it may work if the requirements are not high, but it will definitely not meet the requirements of Figure 1, because the residual heat will continue to rise after the temperature is reached. And the temperature itself will also dissipate heat through the air.
Response target of system output

In summary, the reason why we need PID is that ordinary control methods cannot make the output reach the set value quickly and stably.


The following is a brief summary of the control characteristics of various commonly used control laws:
(1) Proportional control law P: The P control law can overcome the influence of disturbances more quickly. It acts on the output value more quickly, but it cannot stabilize at an ideal value. The undesirable result is that although it can effectively overcome the influence of disturbances, there will be residual errors. It is suitable for occasions where the control channel lag is small, the load changes are not large, the control requirements are not high, and the controlled parameters are allowed to have residual errors within a certain range. For example: the water level control of the cold and hot water pools in the pump room under the Jinbiao Public Engineering Department; the oil level control of the intermediate oil tank in the oil pump room, etc.
(2) Proportional-integral control law (PI): Proportional-integral control law is the most widely used control law in engineering. Integral can eliminate the residual error based on the proportion. It is suitable for occasions where the control channel has a small lag, the load changes little, and the controlled parameters do not allow residual errors. For example: the heavy oil flow control system of the F1401 to F1419 guns in the heavy oil reversing room at the main line kiln head; the oil supply pipe flow control system in the oil pump room; the temperature control system of each zone of the annealing kiln, etc.
(3) Proportional differential control law (PD): Differential has a leading effect. For control channels with capacity lag, the introduction of differential to participate in the control has a significant effect on improving the dynamic performance indicators of the system when the differential term is properly set. Therefore, for occasions where the time constant or capacity lag of the control channel is large, the proportional differential control law can be selected to improve the stability of the system and reduce dynamic deviations. For example: heating type temperature control, component control. It should be noted that for those areas with large pure lag, the differential term is powerless, and in systems where the measurement signal has noise or periodic vibration, differential control is not suitable. For example: the control of the glass liquid level in a large kiln.
(4) For example, the integral differential control law (PID): The PID control law is an ideal control law. It introduces integration on the basis of proportion to eliminate the residual error, and then adds differential action to improve the stability of the system. It is suitable for occasions where the control channel time constant or capacity lag is large and the control requirements are high, such as temperature control, component control, etc.
In view of the role of the D law, we must also understand the concept of time lag, which includes capacity lag and pure lag. Among them, capacity lag usually includes: measurement lag and transmission lag. Measurement lag is a kind of lag caused by the slow response of the detection element, such as thermocouples, thermal resistors, pressure, etc., which needs to establish a balance during detection. Transmission lag is a control lag caused by sensors, transmitters, actuators and other equipment. Pure lag is relative to measurement lag. In industry, most pure lags are caused by material transmission, such as: the glass liquid level in the kiln. It takes a long time from the action of the feeder to the detection of the nuclear liquid level meter.
In short, the selection of control law should be based on process characteristics and process requirements. It is not to say that PID control law has better control performance under any circumstances. It is unwise to use it regardless of the occasion. If you do so, it will only increase the complexity of other work and bring difficulties to parameter setting. When the PID controller still cannot meet the process requirements, other control schemes need to be considered. Such as cascade control, feedforward control, large lag control, etc.
The setting of the three parameters Kp, Ti and Td is the key issue of the PID control algorithm. Generally speaking, only their approximate values can be set during programming, and the optimal values are determined through repeated debugging when the system is running. Therefore, the program must be able to modify and memorize these three parameters at any time during the debugging stage.
Digital PID Controller
(1) Discretization of analog PID control law
(2) Difference equation of digital PID controller

Self-tuning of parameters
In some applications, such as the general instrument industry, the working object of the system is uncertain, and different objects must use different parameter values. It is impossible to set parameters for users, so the concept of parameter self-tuning is introduced. The essence is to find a set of parameters for the new working object through N measurements when it is used for the first time, and remember them as the basis for future work. There are three specific tuning methods: critical proportionality method, attenuation curve method, and experience method.
1. Critical Proportion Method (Ziegler-Nichols)
1.1 Under pure proportional action, gradually increase the gain until equal parasitic oscillation occurs. The PID controller parameters are obtained based on the critical gain and critical period parameters. The steps are as follows:
(1) Connect a pure proportional controller to the closed-loop control system (set the controller parameter integral time constant Ti = ∞ and the actual differential time constant Td = 0).
(2) Set the controller proportional gain K to the minimum, add a step disturbance (generally by changing the given value of the controller), and observe the step response curve of the controlled variable.
(3) Change the proportional gain K from small to large until the closed-loop system oscillates.
(4) When the system exhibits continuous equal-amplitude oscillations, the gain at this time is the critical gain (Ku), and the oscillation period (the time between peaks) is the critical period (Tu).
(5) The PID controller parameters are obtained from Table 1.
Table 1

1.2 When using the critical proportionality method to adjust the control parameters, the following points should be noted:
(1) When using this method to obtain the equal-amplitude oscillation curve, the control system should be operated in the linear region, and the control valve should not be in the extreme state of opening and closing. Otherwise, the continuous oscillation curve obtained may be a "limit cycle". From the concept of linear system, the system has long been in divergent oscillation.

(2) Due to the different characteristics of the controlled object, the controller parameters obtained according to the above table may not always obtain satisfactory results. For objects without self-balancing characteristics, the controller parameters obtained by the critical proportionality method often make the attenuation rate of the system response too large (ψ>0.75). For high-order isochoric objects with self-balancing characteristics, the system response attenuation rate is mostly too small when the controller parameters are adjusted by this method (ψ<0.75). For this reason, the controller parameters obtained above should be corrected online for the specific system during actual operation.

(3) The critical proportionality method is suitable for process control systems with small critical amplitudes and long oscillation periods, but some systems do not allow stability boundary tests for safety reasons, such as boiler drum water level control systems. There are also some single-capacity objects with large time constants. When using pure proportional control, the system is always stable. For these systems, the critical proportionality method cannot be used to adjust the parameters.

(4) It is only applicable to high-order objects above the second order, or first-order objects with pure lag. Otherwise, under pure proportional control, the system will not oscillate with equal amplitude.

1.3 If the static gain KP=△y/△u of the controlled object is obtained, the gain product KpKu can be regarded as the maximum open-loop gain of the system. It is generally believed that the scope of application of the Ziegler-Nichols closed-loop test tuning method is:
(1) When KpKu > 20, a more complex control algorithm should be used to achieve better regulation effect.
(2) When KpKu < 2, some control strategies that can compensate for transmission delays should be used.
(3) When 1.5 <KpKu< 2, the PID controller can still be used in situations where the control accuracy requirement is not high, but Table 1 needs to be corrected. In this case, it is recommended to use SMITH predictive control and IMC control strategies.
(4) When KpKu<1.5, the PI controller can still be used in situations where the control accuracy requirement is not high. In this case, the differential effect is of little significance.
2. Attenuation curve method

The difference between the attenuation curve method and the critical ratio method is that the closed-loop setpoint disturbance test uses attenuated oscillation (usually 4:1 or 10:1), and then uses the test data of the attenuated oscillation to obtain the controller's tuning parameters according to the empirical formula. The tuning steps are as follows:
(1) Under the pure proportional controller, set the proportional gain K to a smaller value and put the system into operation.
(2) After the system is stable, make a set value step disturbance and observe the system response. If the system response decays too quickly, reduce the proportional gain K; otherwise, increase the proportional gain K. Until the system shows a 4:1 decay oscillation process as shown in the following figure (a), record the proportional gain Ks and the oscillation period Ts at this time.
(3) Using the Ks and Ts values, calculate the controller parameter settings according to the empirical formula given in the following table.
(4) The 10:1 attenuation curve method is similar, except that Tr is used in the calculation.
Several points must be noted when using the attenuation curve method:

(1) The given interference cannot be too large. It should be determined according to the production operation requirements. Generally, it is around 5%, but there are exceptions.
(2) The given interference can only be added when the process parameters are stable, otherwise the correct setting parameters cannot be obtained.
(3) For fast-responding systems, such as flow, pipeline pressure, and small-volume liquid level regulation, it is difficult to obtain a strict 4:1 attenuation curve. Generally, when the adjusted parameter fluctuates back and forth twice to achieve stability, it is approximately considered that the 4:1 attenuation process has been achieved.
(4) When commissioning, first set K to a smaller value, reduce Ti to the set value, gradually increase Td to the set value, and then increase K to the set value (if Td is quickly increased to the set value under the condition that K = set value, the output of the controller will change dramatically).
3. Empirical setting method

3.1 Method 1A:
(1) Determine the proportional gain
Make the PID pure proportional regulation, set the input to 60%~70% of the maximum value allowed by the system, gradually increase the proportional gain from 0 until the system oscillates; then, gradually reduce the proportional gain from this time until the system oscillation disappears, record the proportional gain at this time, and set the PID proportional gain P to 60%~70% of the current value.

(2) Determine the integral time constant
After the proportional gain P is determined, set a larger initial value of the integral time constant Ti, then gradually reduce Ti until the system oscillates, and then, gradually increase Ti until the system oscillation disappears. Record Ti at this time, and set the PID integral time constant Ti to 150%~180% of the current value.

(3) Determine the integral time constant Td. The integral
time constant Td generally does not need to be set, and can be 0. If it needs to be set, the method is the same as that for determining P and Ti, and 30% is taken when there is no oscillation.

(4) The system is loaded and then fine-tuned to the PID parameters until the requirements are met.
3.2 Method 1B:
(1) PI regulation
(a) Under pure proportional action, gradually reduce the proportionality from a larger value until periodic oscillations begin to occur (the measured value oscillates regularly around the given value). When periodic oscillations occur, gradually widen the proportionality until the system is fully stable.
(b) Next, gradually shorten the integral time until oscillations occur. This indicates that the integral time is too short and should be slightly extended until the oscillations stop.

(2) PID regulation
(a) Under pure proportional action, find the starting point.
(b) Increase the differential time to stop the oscillations, then adjust the proportionality slightly smaller to cause oscillations to occur again, increase the differential time to stop the oscillations again, and repeat this operation until the oscillations cannot be stopped even though the differential time is increased. The optimal value of the differential time is obtained. At this time, adjust the proportionality slightly larger until the oscillations stop.
(c) Adjust the integral time to the same value as the differential time. If oscillations occur again, increase the integral time until the oscillations stop.

3.3 Method 2:
Another method is to first take a certain value of Ti from the table range. If differentiation is required, take Td = (1/3~1/4) Ti, and then try to match δ, which can also meet the requirements quickly. Practice has proved that by appropriately combining the values of δ and Ti within a certain range, a curve with the same attenuation ratio can be obtained. That is to say, the reduction of δ can be compensated by increasing Ti, and it basically does not affect the quality of the adjustment process. Therefore, in this case, it is also possible to determine the order of Ti, Td and then δ. And it may be faster. If the curve is still not ideal, Ti and Td can be used to make appropriate adjustments.

3.4 Method 3:
(1) In actual debugging, you can also roughly set an empirical value first, and then modify it according to the adjustment effect.
Flow system: P (%) 40--100, I (minutes) 0.1--1
Pressure system: P (%) 30-70, I (points) 0.4-3
Liquid level system: P (%) 20--80, I (points) 1-5
Temperature system: P (%) 20--60, I (points) 3--10, D (points) 0.5--3
(2) The following formula is used for setting:

Step disturbance is thrown into the closed loop, and the parameter setting depends on the curve; first throw the proportion and then the integral, and finally add the differential;
the ideal curve has two waves, and the amplitude attenuation is 4 to 1; if the proportion is too strong, it will oscillate, and if the integral is too strong, the process will be long; if
the dynamic difference is too large, add the differential, and if the frequency is too fast, the differential will drop; if the deviation from the fixed value is slow, the integral effect will be strengthened.

4. Parameter setting of complex regulation system Take the cascade regulation system as an example to illustrate the parameter setting method of the complex regulation system. Since there are two sets of parameters, the main and the auxiliary, in the cascade regulation system, there are mutual connections and influences between each channel and loop. Changing any parameter of the main and auxiliary loops will affect the entire system. Especially when the time constants of the main and auxiliary objects are not much different, the dynamic connection is close, and the work of setting parameters is particularly difficult.

Before setting the parameters, the design purpose of the cascade regulation system must be clarified. If the main purpose is to ensure the regulation quality of the main parameters and the requirements for the auxiliary parameters are not high, the setting work will be easier; if the requirements for both the main and auxiliary parameters are high, the setting work will be more complicated. The following introduces the two-step parameter setting method of "auxiliary first and then main".

Step 1: Under stable working conditions, close the main loop, set the main controller proportionality to 100%, the integral time to the maximum, and the differential time to zero. Use the 4:1 attenuation curve to adjust the sub-loop, and find the proportional gain K2s and oscillation period T2s of the sub-loop.

Step 2: Consider the sub-loop as a link of the main loop, and use the 4:1 attenuation curve method to adjust the main loop, and find the main controller K1s and T1s.

According to K1s, K2s, T1s, and T2s, calculate the main and sub-loop parameters of the cascade control system according to the empirical formula in Table 2. Put the sub-loop parameters first, and then put the main loop parameters. If a satisfactory transition process is obtained, the tuning work is completed. Otherwise, appropriate adjustments can be made.

If the time constants of the main and sub-objects are not much different, there may be a risk of "resonance" when adjusting according to the 4:1 attenuation curve method. At this time, the sub-loop proportionality or integral time can be appropriately reduced to achieve the purpose of reducing the oscillation period of the sub-loop. Similarly, increase the main loop proportionality or integral time in order to increase the main loop oscillation period, increase the ratio of the main and auxiliary loop oscillation periods, and avoid "resonance". This will result in reduced regulation quality.

If the main and auxiliary object characteristics are too similar, it means that the determined solution is not appropriate, and the regulation quality cannot be improved entirely by parameter setting.
Practical application experience:
One is to use the digital PID control algorithm to adjust the speed of the DC motor. The solution is to use a photoelectric switch to obtain the pulse signal generated by the rotation of the motor. The microcontroller (MSP430G2553) calculates the motor speed by measuring the frequency of the pulse signal (the specific frequency measurement algorithm is a direct measurement method, timing 1s to measure the number of pulses, the measurement error itself can be 0.5 turns plus or minus), the measured speed is compared with the given speed to generate an error signal to generate a control signal. The control signal is controlled by adjusting the duty cycle through PWM, that is, adjusting the output analog voltage (equivalent to 1-bit DA, what if a 10-bit DA is used for analog adjustment? Will the effect be much better?), this experimental control capability has a certain range, and can only be controlled between 30 rpm and 150 rpm. When the given value (the speed given in the program) is higher than 150, the actual speed can only be maintained at 150 rpm, which is the maximum control capability of this system. When the given value is lower than 30 rpm, the DC motor shaft is actually not rotating, but due to the large error value, the speed will increase rapidly, and then stop rotating, and it will go back and forth like this, and the control effect cannot be achieved.
According to actual measurements, the speed steady-state accuracy is within plus or minus 3 revolutions, and the control time is 4 to 5 seconds. The experiment was only carried out to this extent, and the thinking and analysis also remained at this depth.
The second is to use the digital PID control algorithm to adjust the position of the DC reduction motor. The solution is to use a precision potentiometer that rotates coaxially with the motor to measure the position and angle of the motor rotation. The measured angle and position are compared with the given position to generate an error signal. Then the position error signal is converted into a PWM signal through a certain relationship (this relationship is purely formulated and improved based on imagination and experimental phenomena). The PWM signal as a control signal first generates an analog voltage U for the DC reduction motor. U is used to control the torque of the DC reduction motor (not very clear). The torque generates acceleration, acceleration generates speed, speed changes position, and the output is a position signal. Therefore, the DC reduction motor should be system modeled and analyzed, and the approximate system transfer function of the DC reduction motor should be simulated. Then, the PID parameters can be adjusted based on this function.
In both experiences, I was not particularly clear about how to adjust the PID parameters. There was no particularly clear theoretical guidance and experimental steps, and the compilation and analysis of the results were not timely enough, resulting in the depth and degree of the experiments not achieving the ideal results.

How to understand the PID algorithm visually?
Xiao Ming received such a task:
There is a water tank that is leaking (and the leakage rate is not necessarily fixed). The water level is required to be maintained at a certain position. Once the water level is found to be lower than the required position, water must be added to the water tank.
After receiving the task, Xiao Ming stayed by the water tank. He felt bored after a while and went to his room to read novels. He checked the water level every 30 minutes. The water was leaking too fast. Every time Xiao Ming came to check, the water was almost gone, far from the required height. Xiao Ming changed to check every 3 minutes. As a result, the water didn't leak much every time, so there was no need to add water. Coming too frequently was useless.
After several tests, it was determined that the inspection should be done every 10 minutes. This inspection time is called the sampling period.
At first, Xiao Ming used a ladle to add water. The faucet was more than ten meters away from the water tank, so he often had to run several times to add enough water. So Xiao Ming changed to using a bucket to add water. He only added one bucket at a time, so he ran less times and added water faster.
But the tank overflowed several times and his shoes got wet accidentally several times. Xiao Ming used his brain again and thought, "I don't use a ladle or a bucket, I use a basin. After several times, I found that it was just right. I didn't need to run too many times and the water would not overflow. The size of this water-adding tool is called the proportional coefficient.
Xiao Ming also found that although the water would not overflow, it would sometimes exceed the required position and there was still a risk of getting shoes wet. He thought of another way and installed a funnel on the water tank.
Each time you add water, don't pour it directly into the water tank, but pour it into the funnel and let it slowly add in. This solves the overflow problem, but the speed of adding water is slow, and sometimes it can't keep up with the speed of leaking.
So he tried changing the funnels of different sizes to control the speed of adding water, and finally found a satisfactory funnel. The time of 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 improved. Once the water level was too low, water must be added to the required position immediately, and it could not be too high, otherwise he would not be paid.
Xiao Ming was in trouble again! So he started to think, and finally he came up with a solution. He always put a basin of spare water next to the water. Once he found the water level was low, he would pour a basin of water into it without going through the funnel. In this way, timeliness was guaranteed, but the water level would sometimes be much higher.
He drilled a hole a little above the required water surface, and connected a pipe to the spare bucket below so that the excess water would leak out from the hole above. The speed at which the water leaked out is called the differential time.
Taking a pool water level as an example, we can make a rule:
The water level is divided into several sections: super high, high, relatively high, medium, relatively low, low, and super low;

Then divide the trend of water level fluctuation into several sections: very fast, fast, relatively fast, slow, and stop, and distinguish between positive and negative trends;
The output is divided into several sections: super large, large, relatively large, and tiny.
When the water level is at the middle value and the trend is stagnant, no adjustment is made;
When the water level is at the middle value and the trend is changing slowly, it is also possible not to adjust it temporarily;
When the water level is high and the trend changes slowly, it is enough to output a small adjustment amount;
When the water level is at the middle value and the trend changes rapidly, the output is adjusted to a greater extent...
As mentioned above, we need to develop a control rule table, and then develop parameters to determine the boundary values of the water level section, the boundary values of the fluctuation trend, and the boundary values of the output amplitude.

Proportional control (P) is the simplest control method. The output of the controller is proportional to the input error signal.
Depending on the device, the proportional band is generally 2-10% (temperature control).
However, if only P control is used, the offset (steady-state error) mentioned below will be generated, so integral control (I) is generally added to eliminate the steady-state error.
The relationship between the proportional band and the proportional control (P) output is shown in the figure. Example of setting using the MVp calculation formula
Off set

In proportional control, when the error stabilizes at a certain value after a certain period of time, the error at this time is called steady-state error (offset).
When only proportional control is used, different steady-state errors will appear depending on the load changes and the inherent characteristics of the equipment.
The reason for the steady-state error is that the intersection of the load characteristic and the control characteristic curve is inconsistent with the set value.
If the proportional band is small, it will not be generated. To eliminate the steady-state error, we set the manual reset value (MR) to eliminate the control error.
Manual reset
As mentioned earlier, proportional control alone cannot eliminate steady-state errors.
To this end, by making MR (manual reset value) variable, the output of the regulator can be freely adjusted. By manually operating the output by an amount equivalent to the offset, it can be matched with the target value.

This is called manual reset, and the proportional controller is usually equipped with this function.

In actual automatic control, it is not practical to manually reset each time an offset occurs. The integral control function described later can automatically eliminate steady-state errors.
To this end, by making MR (manual reset value) variable, the output of the regulator can be freely adjusted. By manually operating the output by an amount equivalent to the offset, it can be matched with the target value.
This is called manual reset, and the proportional controller is usually equipped with this function.
In actual automatic control, it is not practical to manually reset each time an offset occurs. The integral control function described later can automatically eliminate steady-state errors.
The so-called integral control (I) is to automatically change the output when a steady-state error occurs so that it is the same as the output of the manual reset action, thereby achieving the purpose of eliminating the steady-state error.

When there is an error in the system, integral control is performed. The output of the regulator will change at a certain speed according to the size of the integral time. As long as the error exists, the output will continue.
Definition of integral time:
The integral time is the time it takes for the integral term and the proportional term to contribute equally to the controller's output, that is, for the integral action to repeat the proportional action.
The function of differential control (D) is to predict the future change trend of the error signal through the rate of change of the error.
By providing a leading control action, derivative control can stabilize the controlled process.

Therefore, it is often used to offset the unstable tendency produced by integral control.
By providing a lead control effect, differential control can stabilize the controlled process.
Therefore, it is often used to counteract the unstable tendencies produced by integral control.

Definition of derivative time:
When the input quantity changes continuously at a certain rate, the derivative term and the proportional term contribute equally to the output of the controller, that is, the time it takes for the derivative action to repeat the proportional action is the derivative time.

How to use it in practice?
Let's look at a real-life example. In winter, when taking a hot bath, you need to drain the cold water for a while because there is a section of cold water in the water pipe and the water heater also needs a heating process. After this period of time, when the water temperature is somewhat close to the target value, start adjusting the faucet to adjust the ratio between cold and hot water and the water output, and then slowly fine-tune it. If you feel that the temperature is not suitable during the bathing process, adjust it a little bit. This process is actually the PID algorithm process. The reason why we fine-tune is that the speed of change of the water temperature does not match the speed of my adjustment. There is a lag effect. We need to adjust a little bit, wait a while and feel the temperature again. If it is not enough, adjust it a little bit again, and feel it again. This process is called the PID algorithm. It can also be said that the lag effect is the reason for introducing PID.
Can I find what I lost? Yes! But when I found the button, I found that the clothes were gone. This is the hysteresis effect.
Negative feedback systems all have hysteresis effects, but why do op amps and power supplies never mention PID algorithms? This is because the hysteresis delay time of such systems is very short. If this delay is taken into account, negative feedback introduces a 180-degree phase, and the delay just introduces a 180-degree phase, it is entirely possible to cause oscillation. The problem is that if this delay time is short enough, its resonant frequency point is relatively high. Taking the op amp as an example, the resonance point caused by adding delay and negative feedback is 10MHz, but the frequency response of this op amp is 1MHz, so it is impossible to cause oscillation at 10MHz, because the frequency response characteristics of this chip are only 1MHz. Our commonly used linear power supply IC, such as the LDO in the SOT23 package, will output an oscillating waveform if no capacitor is added to the output. Relatively speaking, the hysteresis effect of the power supply IC is larger than that of the op amp. However, because the power supply is generally connected to a large capacitor at the back, its frequency response characteristics are very low, close to DC 0Hz, so when there is a capacitor, it cannot oscillate.
In the field of industrial control, such as temperature, the hysteresis effect is very serious, often at the level of mS or even 10mS. If negative feedback is used directly, strong oscillation will inevitably occur due to the asynchrony between excitation and feedback. Therefore, in order to solve this problem, we need to introduce the PID algorithm to realize the negative feedback control of such systems with serious hysteresis effects. We take the example of high-frequency induction heating equipment heating workpieces from room temperature 25 degrees to 700 degrees as an example:
1. 25~600 degrees, 100% full power to heat the workpiece. This is because the temperature difference is too large. Full power is required in the early stage to heat it to a temperature close to the target temperature. The reason why 600 degrees is considered is because of the hysteresis effect. If the setting is too high, it will stop when it is close to 700 degrees, but in fact, the temperature will exceed 700 degrees. Of course, 600 degrees is an empirical value. The following temperature points are all empirical values based on actual conditions.
2. Above 600 degrees, turn on the P algorithm. P determines the size of the negative feedback based on the error between the measured value and the target value. P algorithm formula: Feedback = P*(current temperature - target temperature). However, because negative feedback is based on the existence of errors, the P algorithm leads to a problem that it can never reach the desired value: 700 degrees. Because at 700 degrees, the feedback value is gone. The activation of the P algorithm further approaches the target temperature. Assuming that it can reach 650 degrees in steady state, even if there is a delay caused by the hysteresis effect, it will not exceed 700 degrees by much.
3. When the steady-state limit of the P algorithm is reached near 650 degrees, such as 640 degrees, another algorithm should be started to solve the limit error caused by the P algorithm, that is, the I algorithm. The I algorithm is to eliminate the error value caused by the P algorithm. After all, what we want is 700 degrees, not 650 degrees. The I algorithm, in essence, is to obtain a driving value corresponding to 700 degrees, and then use this driving value to replace the P algorithm. So how do we get this driving value? The only way is to accumulate all the previous errors and finally get an expected value, which is the driving value we want. Because as long as there is an error with the target value, then these error values are accumulated and then feedback controlled, and the target value can be approached step by step. This is like if the water temperature is not high enough, add a little hot water, and if it is not high enough, add more, so that the desired water temperature can always be reached. It is worth noting that the I algorithm cannot be connected too high, and must be intervened in the later stage of the P algorithm, otherwise it is easy to accumulate too much. At this time, an error threshold can be introduced. For example, if the error is 60, it should be treated as 6, and if the error is 50, it should be treated as 5, so as to eliminate large error values. The specific decision will be based on the project situation.
4. When the I algorithm heats the workpiece temperature to a temperature very close to the target temperature, the adjustable range is very small. The last little bit of micro-movement makes each adjustment not too large. This is the D algorithm. The D algorithm is essentially against drastic changes, so it is suitable for reaching the target temperature.
Summarize:
The PID algorithm is not complicated, but at present, many people have problems because they do not understand the conditions for using these three. All three factors are used from the beginning of heating, and the results are predictable. The P algorithm is used when the temperature is close to the target value, the I algorithm is used when the P algorithm reaches the steady-state limit, and the D algorithm is used when it reaches the target value. In actual projects, the D algorithm is generally not used and the effect is not great. If you have to find a corresponding object in reality, then taking the switching power supply as an example, the TL431 reference power supply comparator can be considered as P, the output filter capacitor C is I, and the output filter inductor is D, and the two are completely equivalent. Their respective application operating points can be considered as follows: assuming the target temperature is 700 degrees, 600~800 degrees: P algorithm; 640~760 degrees: I algorithm; 690~710 degrees: D algorithm. The specific value is subject to the experiment, and the data is for reference only.
Finally, here is the most common interpretation of PID: When we design something, we usually make a sample first. This sample is close to what we want, but the details are not in place. This is P. There are differences in the sample, so it needs to be modified and approximated. This is I. Once it is finalized, no modifications are allowed. Even if modifications are required, they are limited. This is D.
(Article source: Electrical Knowledge Classroom Image source: Electrical Knowledge Classroom)
The copyright of this article belongs to the original author. If there is any infringement, please contact us to delete it.

10a48897b375ede0770eebf16ffeff3c.png (413 Bytes, downloads: 0)

10a48897b375ede0770eebf16ffeff3c.png

22bf16605da8e70fc3483da961d35bdb.png (382 Bytes, downloads: 0)

22bf16605da8e70fc3483da961d35bdb.png

202a63877a913b02a5c5a47e42dcc079.png (399 Bytes, downloads: 0)

202a63877a913b02a5c5a47e42dcc079.png

06a0d329815b83a9dd4985cc0f4c99d9.png (3.09 KB, downloads: 0)

06a0d329815b83a9dd4985cc0f4c99d9.png

Latest reply

I have learned a lesson. I can only study this control tutorial slowly. Thank you for sharing.   Details Published on 2024-1-18 11:38
 
 

1025

Posts

0

Resources
2
 

classic!

It is worth learning to do process control!

Personal signatureچوآن شـين
 
 
 

24

Posts

0

Resources
3
 

I have learned a lesson. I can only study this control tutorial slowly. Thank you for sharing.

 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Featured Posts
WAN Acceleration - Wide Area Network Optimization Technology and Application Analysis

Wide Area Network ( WAN ) bandwidth is expensive, so most users can only have limited WAN bandwidth. On the contrary ...

Three steps to troubleshoot ADSL

As the most cost-effective and effective means of broadband access, ADSL has become a familiar term to netizens and has ...

Basic knowledge for hardware engineers

Purpose: Based on practical experience and actual projects, you will understand and master the most basic knowledge to b ...

Brief analysis of the functional block diagram of the MSP430 series microcontroller

This post was last edited by tiankai001 on 2018-12-6 16:55 This content is originally created by EEWORLD forum user tian ...

Open Source eBook: Computer Science from the Bottom Up

537107 The philosophy of the book Computer Science from the Bottom Up is: In short, what you are reading is intended to ...

A lightweight and precise positioning algorithm based on multiple inertial measurement units (LSM6DSOX)

552861 552864

Please ask a MicroPython question

This post was last edited by jqn on 2021-10-27 16:10 How do I change the softi2c statement of micropython to i2c? i2c ...

View Circuit-ADC and System (1)

Viewing Circuits - ADC and System (1) There are many ADCs on the market, and the prices of different ADCs vary greatly ...

[BoLiu BL606P audio and video development board] 1. Environment construction and HelloWord Demo operation

Thanks to EEWorld and Pingtou Ge for providing the . I was lucky enough to get the opportunity to review it again. 1. Ha ...

I get off work at 10 o'clock. I am almost autistic.

This post was last edited by Nubility on 2024-4-23 00:11 I get off work at 10 o'clock, get home at 11:30, take a shower ...

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list