PID loop control and closed-loop control principle

Publisher:老王古玩店Latest update time:2023-09-27 Source: elecfansKeywords:PID Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Overview of PID loop control

PID controller is the most widely used closed-loop controller. It calculates the output of the controller according to the deviation between the given value and the measured value of the controlled object according to the PID algorithm, controls the actuator to adjust, makes the controlled object follow the given value, and makes the system stable. It automatically eliminates the influence of various interferences on the control process. PID stands for proportional, integral and differential.

ff3ff4e4-ebf2-11ed-90ce-dac502259ad0.jpg

There are three ways to implement the PID function in S7-200 SMART:

PID instruction block: Exchanges data through a PID loop table and only accepts real numbers between 0.0 and 1.0 (actually percentages) as valid values ​​for feedback, given and control output.


PID Wizard: Conveniently complete input/output signal conversion/standardization. PID instructions will be automatically called at the same time.


Program yourself according to PID algorithm

S7-200 SMART CPU can support up to 8 PID control loops (8 PID instruction function blocks). There is no specific limit on the number of PID control loops that can be programmed by yourself according to the PID algorithm, but we need to consider the impact of PLC storage space and scan cycle.

PID control is a negative feedback closed-loop control that can suppress disturbances caused by various factors within the system closed loop and make the feedback follow the given changes.


The PID control algorithm has several key parameters Kc (Gain), Ti (integral time constant), Td (differential time constant) and Ts (sampling time). In S7-200 SMART, the PID function is implemented through the PID instruction function block. The PID function block is executed at a fixed time (according to the sampling time), and the control quantity is calculated according to the given, feedback, proportional-integral-differential data at that time according to the PID operation rules.


Since PID can control many objects such as temperature and pressure, each of which is represented by an engineering quantity, there must be a universal data representation method that can be recognized by the PID function block.


The PID function in S7-200 SMART uses the percentage of the adjustment range to abstractly represent the numerical value of the controlled object. In actual engineering, this adjustment range is often considered to be consistent with the measurement range (range) of the controlled object (feedback).


The PID function block only accepts real numbers between 0.0 and 1.0 (actually 0%--100%) as valid values ​​for feedback, given and control output. If you use the PID function block directly for programming, you must ensure that the data is within this range, otherwise an error will occur. Others such as gain, sampling time, integral time, and differential time are all real numbers. Therefore, it is necessary to convert the actual physical quantity of the periphery to the data required (or output) by the PID function block. This is the so-called input/output conversion and standardization processing.


2. PID main parameters

Sampling time: The CPU must sample the feedback at a certain time interval to perform PID control calculations. The sampling time is the interval for sampling the feedback. Signal changes that are shorter than the sampling time interval cannot be measured. Too short a sampling time is unnecessary, and too long a sampling interval obviously cannot meet the occasions where the disturbance changes quickly or the speed response requirements are high.


Gain (Gain, amplification factor, proportional constant) The product of gain and deviation (the difference between given and feedback) is used as the proportional part of the controller output. It improves the response speed and reduces the error, but cannot eliminate the steady-state error. When the proportional action is too large, the stability of the system decreases. Integral time: When the deviation value is constant, the integral time determines the rate of change of the controller output. The shorter the integral time, the faster the deviation is corrected. Too short an integral time may cause instability. The length of the integral time is equivalent to the time required for the output change to be equal to the deviation value when the gain is "1" under the step setting, that is, the time for the output to change to twice the initial step deviation. If the integral time is set to the maximum value, it is equivalent to no integral action.

Derivative time: When the deviation value changes, the derivative action will add a spike to the output, which decreases over time. The longer the derivative time, the greater the change in the output. Derivatives increase the sensitivity of the control to disturbances, that is, the greater the rate of change of the deviation, the stronger the derivative control effect. Derivatives are equivalent to predictive adjustments to the feedback change trend. If the derivative time is set to 0, it will not work and the controller will work as a PI regulator.


Proportional adjustment: improve response speed and reduce error, but cannot eliminate steady-state error. When the proportional effect is too large, the stability of the system decreases. (Adjust individually from small to large)

Integral adjustment: Eliminate steady-state errors and slow down the dynamic response of the system. The smaller the integral time, the greater the integral effect and the faster the deviation is corrected. Too short an integral time may cause instability. (After adjusting the adjusted proportional gain to 50%~80%, reduce the integral time from large to small)


Differential regulation: Advanced regulation can predict the trend of error changes and suppress the control effect of errors in advance, thus avoiding serious overshoot of the controlled quantity. It can improve the response speed and stability of the system and amplify noise interference. For controlled objects with lag properties, differential links should be added.

ff54cbee-ebf2-11ed-90ce-dac502259ad0.jpg

1. Select PID Wizard from the Tools menu in Micro/WIN SMART 3. The S7-200 SMART CPU can support up to 8 PID control loops (8 PID instruction function blocks) 6. Gain: proportional constant Integral time: If you don’t want the integral effect, you can set this value to a large value (such as 10000.0) Derivative time: If you don’t want a differential loop, you can set the differential time to 0 Sampling time: The time interval between the PID control loop sampling the feedback and recalculating the output value

ff6c967a-ebf2-11ed-90ce-dac502259ad0.jpg

8. Unipolar: 0-27648 Bipolar -27648 to 27648 Temperature x10° is the temperature value of the PT100 thermal resistor or thermocouple °C represents Celsius °F represents Fahrenheit Select 20% offset: If the input is 4-20mA, select this option. 4mA is 20% of the 0-20mA signal, so select 20% offset, that is, 4mA corresponds to 5530, 20mA corresponds to 27648 11. Output type: You can choose analog output or digital output. Analog output is used to control some devices that require analog quantity, such as proportional valves, frequency converters, etc. Digital output actually controls the on and off state of the output point according to a certain duty cycle, which can control solid-state relays (heating rods, etc.)


12. Range: When it is unipolar, the default value is 0 to 27648. When it is bipolar, the value is -27648 to 27648. When it is 20% offset, the value is 5530 - 27648, which cannot be changed. 14. Alarm when the feedback value is 10% of the lower limit. 15. Alarm when the feedback value is higher than 90% of the upper limit. 16. Analog module error alarm. "EM0" is the position of the first expansion module.

ff87cabc-ebf2-11ed-90ce-dac502259ad0.jpg

18. You can choose to add PID manual control mode 20. The PID function block uses a 120-byte V zone address to perform control loop operations; and the input/output standardization program generated by the PID wizard also requires an operation data storage area. Make sure that the bytes starting from this address are not reused elsewhere in the program. 24. The wizard completes the generated subroutine 25. The wizard generates the data block

ffa4aea2-ebf2-11ed-90ce-dac502259ad0.jpg

The address of the data block needs to be configured to be retained after power failure. 4. PID instruction

ffbbc70e-ebf2-11ed-90ce-dac502259ad0.jpg

5. Programming

Use the PID Wizard to write a program to keep the temperature at a given value and tune the PID parameters

ffe4226c-ebf2-11ed-90ce-dac502259ad0.jpg

6. Download and debug

The download operation is not explained here.

1. Debugging instructions:

(1) Proportional gain: increases the adjustment speed and reduces the error, but cannot eliminate the steady-state error;

Reference methods can be adjusted individually from small to large

(2) Integral effect: Eliminate steady-state errors and slow down the dynamic response of the system. Too large an integral will affect the stability of the system. Adjustment reference method: Adjust the adjusted proportional coefficient to 50%--80%; from large to small, increase the integral effect

(3) Differential effect: advanced control, reducing adjustment time, and amplifying interference

Reference for adjustment method: Adjust individually from small to large, and adjust the proportion and integral accordingly to pursue the change rate of the adjustment deviation

(4) PID adjustment method: first turn off the integral and differential, adjust the proportion first, and then add the integral when the proportion is similar. Generally, the larger the proportional value, the faster the output result; the larger the integral value, the slower the output result; the differential is used when adjusting the temperature control, and it is generally not needed.

2. The given value, manual and automatic status, PWM output settings, etc. can be monitored and modified through the status chart.

But it can also be debugged through the PID control panel, as shown below:

[1] [2]
Keywords:PID Reference address:PID loop control and closed-loop control principle

Previous article:Analysis of ten common faults of servo motors
Next article:5 examples to help you get started with PLC step by step

Recommended ReadingLatest update time:2024-11-16 21:55

PID parameter definition based on MSP430 microcontroller
PID control is the most common control strategy. More than 90% of the control loops in industrial process control have PID structure. The reason why PID control is widely used is mainly because its algorithm is simple, easy to understand and implement in practice, and many advanced controls are based on PID control.
[Microcontroller]
PID parameter definition based on MSP430 microcontroller
Design of temperature control system for infant incubator based on fuzzy PID algorithm
Introduction Infant incubators are mainly used in clinical medical treatment of premature infants, low-birth-weight infants, critically ill infants or maldeveloped newborns. They play an important role in pediatric medical care and are indispensable medical devices in hospitals . Due to the special characteristics o
[Microcontroller]
Design of temperature control system for infant incubator based on fuzzy PID algorithm
Program of water tank temperature PID control system designed by C51 microcontroller, PID control program
This system is a microcontroller temperature control system based on PID. I found a complete program on the Internet and made the corresponding proteus hardware simulation according to his program, but It did not achieve the expected effect. It needs to be improved. The procedure is as follows: #include<reg51.h  
[Microcontroller]
Playing PID control with a single-chip microcomputer - from ideal PID control to advanced PID control_3
2.1.2 Software The advantage of using Keil C51 to develop MCS-51 microcontroller is that it is much easier, but the disadvantage is that you don't know assembly language. For me personally, I can pick up some of the C language that I almost forgot. Generally speaking, the difficulty involved in development with C51
[Microcontroller]
Playing PID control with a single-chip microcomputer - from ideal PID control to advanced PID control_3
What is a PID regulator? What are the three parts of a PID regulator?
What is a PID controller? PID regulator is an automatic control system based on the proportional-integral-differential (PID) control algorithm. It realizes automatic control by continuously adjusting the control quantity so that the output value of the controlled object gradually approaches the target value. PI
[Embedded]
PID algorithm adjustment C51 program (4)
typedef struct PID {         double        SetPoint;                // Desired Value         double        Proportion;                // Proportional Const         double        Integral;                // Integral Const         double        Derivative;                // Derivative Const         double     
[Microcontroller]
Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号