PID controller (proportional integral differential controller) is composed of proportional unit P, integral unit I and differential unit D ... By setting Kp, Ki and Kd. PID controller is mainly suitable for systems whose basic linear and dynamic characteristics do not change with time.
PID controller is a common feedback loop element in industrial control applications. The controller compares the collected data with a reference value, and then uses the difference to calculate a new input value. The purpose of this new input value is to make the data of the system reach or keep at the reference value. Different from other simple control operations, PID controller can adjust the input value according to historical data and the occurrence rate of difference, making the system more accurate and stable. It can be proved by mathematical methods that the PID feedback loop can maintain the stability of the system when other control methods lead to stability errors or repetitive processes.
The control loop includes three parts:
The measurement results obtained by the sensors of the system are determined by the controller and responded by the output device. The controller obtains the measurement result from the sensor, and then subtracts the measurement result from the demand result to obtain the error. Then the error is used to calculate the correction value of the system as the input result, so that the system can eliminate the error from its output result.
In a PID loop, there are three algorithms for this correction value, namely, eliminating the current error, averaging the past error, and predicting the future error through the change of the error.
For example, a water tank is supplying water to plants, and the water in this water tank needs to be kept at a certain height. Sensors will be used to check the water level in the water tank and obtain the measurement results. The controller will have a fixed user input value to indicate the required water level of the water tank, assuming that this value is to maintain 65% water. The output device of the controller will be connected to the water valve controlled by the motor. Opening the valve will fill the water tank, and closing the valve will make the water in the water tank drop. The control signal of this valve is the variable we control, and it is also the input of this system to keep the water quantity of this water tank fixed.
PID controller can be used to control any variable that can be measured and controlled. For example, it can be used to control temperature, pressure, flow, chemical composition, speed and so on. The cruise control function in a car is an example.
Some control systems connect several PID controllers in series or connect them into a network. In this case, the main controller can output the results of other controls. A common example is motor control. We often need the motor to have a controlled speed and stop at a certain position. Well, a sub-controller manages the speed, but the speed of this sub-controller is managed by the main controller that controls the position of the motor.
Associated control and series control are very common in chemical process control systems.
PID is named after its three correction algorithms. All three algorithms use addition to adjust the control value. In fact, most addition operations become subtraction operations, because addends are always negative. These three algorithms are:
Proportion-In order to control the current, the error value is multiplied by a negative constant p (representing proportion) and then added to a predetermined value. Only when the output of the controller is in direct proportion to the error of the system can P be established. The change of controller output is proportional to the deviation of input controller. For example, if the scale range of the controller of the electric heater is10 C and its preset value is 20°C, then it will output at10 C 100%, at15 C and at19.
Integration-control the past, the error value is the sum of the errors in the past period of time, and then multiplied by a negative constant I, plus a predetermined value. I find the average error between the system output result and the predetermined value from the past average error value. A simple proportional system will oscillate and change back and forth around a predetermined value, because the system cannot eliminate redundant correction. By increasing the negative average error ratio, the average system error value will always decrease. Therefore, eventually, the PID loop system will be set at a predetermined value.
Differential-to control the future, calculate the first derivative of the error, multiply it by a negative constant d, and finally add it to a predetermined value. The control of this derivative will respond to the change of the system. The greater the result of the derivative, the faster the response of the control system to the output result. This d parameter is also the reason why PID is called predictive controller. The d parameter is very helpful to reduce the short-term changes of the controller. Some slow practical systems may not need the d parameter. In more technical terms, PID controller can be called a filter in frequency domain system. This is useful in calculating whether a stable result will be achieved in the end. If the value is not selected properly, the input value of the control system will oscillate repeatedly, which may lead to the system never reaching the preset value.
Although different types of controllers have different structures and principles, there are only three basic control laws: proportional (P) control, integral (I) control and differential (D) control. These control laws can be used separately, but more often they are used in combination. For example, proportional (P) control, proportional integral (PI) control, proportional integral differential (PID) control, etc.
proportional control
Separate proportional control is also called "differential control". The change of output is proportional to the deviation of input controller, and the greater the deviation, the greater the output. In practical application, the size of the proportional band should be determined according to the specific situation. The control effect is too weak because the proportional band is too large, which is not conducive to the system to overcome the disturbance. The residual error is too large, the control quality is poor and there is no control effect. If the proportion is too small and the control effect is too strong, the stability of the system will become worse and oscillation will be caused.
For the controlled object with sensitive response and strong amplification ability, in order to improve the stability of the system, the proportional band should be slightly smaller; For the controlled object with slow response and weak amplification ability, the proportional band can be larger to improve the sensitivity of the whole system and reduce the residual accordingly.
Simple proportional control is suitable for occasions with small disturbance, small lag, small load change and low requirements, and a certain margin is left. Proportional control law is widely used in industrial production.
proportional plus integral control
Proportional control law is one of the most basic and widely used basic control laws, and its greatest advantage is timely and fast control. As long as there is deviation, the controller will control it immediately. However, the disadvantage that the residual error cannot be finally eliminated limits its independent use. The way to overcome the residual error is to add integral control on the basis of proportional control.
The output of the integral controller is proportional to the integration of the input deviation with time. The "integral" here means "accumulation". The output of the integral controller is not only related to the magnitude of the input deviation, but also related to the time when the deviation exists. As long as the deviation exists, the output will continue to accumulate (the output value will become larger or smaller), and the accumulation will not stop until the deviation is zero. Therefore, the integral control can eliminate the residual error. Integral control law is also called indifference control law.
The magnitude of integration time indicates the intensity of integration control. The smaller the integration time, the stronger the control effect; On the contrary, the weaker the control effect.
Although integral control can eliminate residual error, it has the disadvantage of untimely control. Because the accumulation of integral output is gradual, its control effect always lags behind the variation of deviation, so it is difficult to overcome the influence of interference in time and effectively, and the control system is difficult to be stable. Therefore, in practical application, integral control is not used alone, but combined with proportional control to form proportional integral control. In this way, we can learn from each other's strengths, which not only has the function of fast and timely proportional control, but also has the ability of integral control to eliminate residual. Therefore, proportional integral control can realize ideal process control.
Proportional integral controller is one of the most widely used controllers at present, which is mainly used in liquid level, pressure and flow control systems in industrial production. Because integral can eliminate residual error, make up for the defects of pure proportional control and obtain better control quality. However, the introduction of integration will make the stability of the system worse. The control system with large inertia lag should be avoided as far as possible.
proportional plus derivative contro
Proportional integral control is not ideal for the controlled object with time delay. The so-called "time delay" means that when the controlled object is disturbed, the controlled variable does not change immediately, but there is a time delay, such as capacity lag, when the proportional-integral control is slow and untimely. To this end, people imagine: can we make corresponding control actions according to the changing trend of deviation? Just like an experienced operator, he can change the valve opening according to the deviation (proportional effect), predict what will happen according to the speed of deviation change, control the excess in advance, and achieve "nip in the bud". This is the differential control law with "advanced" control function. The output of the differential controller depends on the speed at which the input deviation changes.
The differential output is only related to the change speed of deviation, and has nothing to do with the size and existence of deviation. If the deviation is a fixed value, no matter how big it is, as long as it remains unchanged, the change of output must be zero, and the controller has no control function. The longer the differential time, the longer the differential output duration, so the stronger the differential effect; On the contrary, it is weaker. When the differential time is 0, there is no differential control. Similarly, the choice of differential time also needs to be determined according to the actual situation.
The characteristics of differential control are: quick action and advanced adjustment function, which can effectively improve the control quality of the controlled object with large time delay; But it can't eliminate the residual error, especially for constant deviation input, and it has no control effect at all. Therefore, the differential control law cannot be used alone.
The combination of proportional and differential action is faster than simple proportional action. Especially for the object with large capacity lag, it can reduce the amplitude of dynamic deviation, save control time and significantly improve control quality.
PID control
The most ideal control is proportional-integral-differential control law. It combines the advantages of the three: it has timely and rapid proportional action, the ability to eliminate residual errors through integral action and the advanced control function through differential action.
When the deviation jumps out of the present, the differential immediate action suppresses this deviation jump; Proportion also plays a role in eliminating deviation and reducing deviation range. Because proportional action is a lasting and main control law, the system can be relatively stable. The integral action gradually overcomes the residual difference. As long as the control parameters of the three functions are properly selected, the advantages of the three control laws can be fully exerted and the ideal control effect can be obtained.
Debugging method editing
Adjustment of proportional coefficient
The adjustment range of the proportional coefficient p is generally 0. 1- 100.
If the gain value is 0. 1, the output of PID regulator becomes one tenth of the deviation value. If the gain value is 100, the output of PID regulator becomes a deviation value of one hundred times.
It can be seen that the larger the numerical value, the greater the gain effect produced by the proportion. In the initial adjustment, choose a smaller one, and then slowly increase it until the fluctuation of the system is small enough, and then adjust the integral or differential coefficient. Excessive p value will lead to system instability and continuous oscillation; Too small a value of p will slow down the system. The appropriate value should make the system sensitive enough but not too sensitive, and the delay of a certain time depends on the integration time.
Adjustment of integral coefficient
The integration time constant is defined as the time when the deviation causes the output to increase. If the integration time is set to 1 sec, the time required for the output to change 100% is 1 sec. During the initial adjustment, the integration time should be set longer, and then gradually reduced until the system is stable.
Adjustment of differential coefficient
Differential value is the rate of change of deviation value. For example, if the input deviation value changes linearly, a constant adjustment amount is superimposed on the output side of the regulator. Most control systems do not need to adjust the differential time. Because only systems with time delay need to attach this parameter. If this parameter is increased, the control of the system will be affected. If the ideal control requirements cannot be met by adjusting the proportional and integral parameters, the differential time can be adjusted. The coefficient is set to be small during the initial adjustment, and then gradually increased until the system is stable.
Parameter setting and editing
Parameter tuning of PID controller is the core content of control system design. According to the characteristics of the controlled process, the proportional coefficient, integral time and differential time of PID controller are determined. There are many methods for tuning PID controller parameters, which can be summarized into two categories: one is theoretical calculation tuning method. It mainly determines the controller parameters through theoretical calculation according to the mathematical model of the system. The calculated data obtained by this method cannot be used directly, and must be adjusted and corrected through engineering practice. The second is the engineering setting method, which mainly relies on engineering experience and is directly carried out in the test of control system. This method is simple and easy to master, and is widely used in engineering practice. The engineering tuning methods of PID controller parameters mainly include critical proportion method, response curve method and attenuation method. The three methods have their own characteristics, and the similarities are all through experiments, and then the parameters of the controller are adjusted according to the engineering experience formula. But no matter which method is adopted, the parameters of the controller need to be finally adjusted and improved in actual operation. At present, the critical proportion method is generally used. The steps of tuning PID controller parameters by this method are as follows: (1) First, preselect a sampling period short enough to make the system work; (2) Only add the proportional control link until the step response of the system to the input appears critical oscillation, and write down the proportional magnification and critical oscillation period at this time; (3) Under a certain degree of control, the parameters of PID controller are calculated by formula. [ 1]
In actual debugging, only an empirical value can be roughly set first, and then modified according to the adjustment effect.
For temperature system: P (%) 20-60, I (min) 3- 10, D (min) 0.5-3.
For mobile system: P (%) 40- 100, I (min) 0. 1- 1.
For pressure system: P (%) 30-70, I (min) 0.4-3.
Liquid level system: P (%) 20-80, I (min) 1-5.
Parameter adjustment finds the best order from small to large.
Proportion first, then integration, then differentiation.
The curve oscillates frequently, so the proportional reel should be enlarged.
The curve floats around Dawan, and the proportional band turns into a small pull.
The recovery of curve deviation is slow and the integration time is reduced.
The curve has a long fluctuation period and a long integration time.
The oscillation frequency of the curve is fast, and the differential is reduced first.
The dynamic difference is large and the fluctuation is slow. The difference time should be longer.
There are two waves in the ideal curve, which are 4 1 higher before and lower after.
At first glance, the quality of adjustment will not be low.
Adaptive control editing
First, figure out what adaptive control is.
In the production process, in order to improve product quality, increase output and save raw materials, production management and production process are always required to be in the best working condition. Therefore, an optimal control method called adaptive control is produced. In this control, the system is required to automatically adjust the system according to the changes of measured parameters, environment and raw material cost, so that the system is in the best state at any time. Adaptive control includes performance estimation (discrimination), decision and correction. It is the development direction of microcomputer control system. However, because the control law is difficult to master, there are still some problems to be solved in popularization.
Adding adaptive pid control has some intelligent characteristics, which can adapt to the changes of external conditions like biology.
Self-learning system, more intelligent.
Parameter setting and editing
Parameter tuning and realization of PID controller-manual information
Parameter tuning and realization of PID controller
Author: Huang Yourui, Qu
Press: China Science Press.
Release time: 20 10- 1- 1
Format: 16
Pricing: 39.00 yuan
Parameter tuning and realization of PID controller-brief introduction
This book is written by the author on the basis of years of in-depth research on the parameter tuning and realization of PID controller based on natural calculation. On the basis of absorbing many representative latest research achievements at home and abroad, this book focuses on the author's research achievements in this field, including: the parameter tuning method of PID controller; Parameter tuning of fractional PID controller: parameter tuning of multivariable PID controller based on QDRNN: FPGA implementation of digital PID controller: FPGA implementation of PID controller based on BP neural network: FPGA implementation of PID controller based on genetic algorithm: FPGA implementation of PID controller based on particle swarm optimization: basic program of main algorithm.
This book can be used as a reference book for teachers, students, researchers and engineers of automation related majors.
Parameter tuning and realization of PID controller
order
Introduction to Chapter 1
The second chapter is PID controller parameter tuning method.
The third chapter is the parameter tuning of fractional PID controller.
The fourth chapter is the parameter tuning of multivariable PID controller based on QDRNN.
The fifth chapter is the FPGA implementation of digital PID controller.
The sixth chapter is the FPGA implementation of PID controller based on BP neural network.
Chapter 7: FPGA implementation of PID controller based on genetic algorithm.
Chapter 8: FPGA implementation of PID controller based on particle swarm optimization.
appendix
refer to
Patents, Software and Hardware Editing of Proportional Product Differential Controller
IEEE Journal of Control Systems summarizes this, including the setting of the optimal controller parameters. Improve the method of PID differential and integral;
Patents, Software and Hardware of PID Control: Overview and Analysis of Current Technology, IEEE Control System, 2006 .[2]