In the field of modern industrial control, proportional integral differential (PID) controller is one of the most widely used control technologies. It achieves precise adjustment of the system to achieve the desired control effect by means of three control parameters: proportional, integral and differential. With the development of automation technology, PID controller is used in a variety of industrial processes, such as temperature, pressure, flow and level control. In this article, we will introduce in detail how to apply PID control technology in Unionscience Technology's LicOS PLC/PAC products, and provide specific operational procedures and case studies.
Unionscience Technology is a leading provider of automation control solutions in China, and its LicOS PLC/PAC product series has a wide range of applications in the field of industrial automation. Combined with the powerful functions of LicOS and Smart Control programming and debugging software, users can easily achieve complex PID control.
一、What is PID control?
The PID controller regulates the system through the following three basic control actions:
proportional control(P):
A proportional controller adjusts the output based on the current error of the system (the difference between the set value and the actual value). The proportional gain (KP) determines the strength of the controller's response to the error. However, too high a proportional gain may cause the system to oscillate or even lose stability.
Integral Control(I):
Integral control adds up errors over time. Even a small error will cause the integral feedback to increase slowly. The integral feedback will continue to increase according to the time of integration (TN) unless the error is 0. Therefore, the purpose of the integral feedback is to keep the steady state error at 0. The steady state error is the difference between the process variable and the set point.
Differential Control(D):
Differential controllers adjust to the rate of error change, providing a response to rapid changes. The differential time (TV) determines the sensitivity of the differential control. Although differential control enhances system stability, it is sensitive to noise and may introduce instability.
Fig. PID controller
Usage Scenarios
PID controllers are used in a wide variety of applications, including industrial automation, environmental monitoring, medical equipment, agriculture, scientific research and aerospace, and emergency rescue.
II. How to use PID control in LicOS PLC/PAC?
Preliminary
Adding Util library files:
In the Smart Control software for LicOS, the PID function block is part of the Util tool library. Therefore, you need to add the Util library to the Library Manager before you can start using the PID control functions.
Steps: Double click Library Manager -> Add Library -> Show Advanced Libraries -> Search for "Util" -> OK.
Figure Add Library
Figure Search Util Library
Figure Util library added
PID Function Block Description The PID controller function block of the Util library is called from LicOS_PLC. the PID controller function library consists of:PD (FB)、PID (FB)、PID_FIXCYCLE (FB)
Figure LicOS Util PID controller function library
PID_FIXCYCLE (FB) Function Block
Function: PD (FB) is a proportional differential action controller, PID (FB) is a proportional integral differential action controller, but its cycle time will be related to the PLC task cycle time, PID _FIXCYCLE (FB) function block function and PID (FB) function block is similar to the difference is that the cycle time of their controllers is fixed, and is executed according to the set CYCLE time parameters.
The PID_FIXCYCLE (FB) function block is shown in the figure:
Figure PID_FIXCYCLE function blocks
PID_FIXCYCLE (FB) Function Block Pin Definition The PID_FIXCYCLE (FB) function block pins are defined as shown in Figure.
Figure PID_FIXCYCLE Function Block Pin Definitions
ACTUAL: Current Input Value, displays the current input value of the process analogue.
SET_POINT:Target setting value, the target value to be achieved by the controlled analogue quantity.
KP:Proportional gain factor.
TN:Points time in seconds.
TV:Differential time in seconds.
Y_MANUAL:Output value when controller is manual, Y output is equal to Y_MANUAL value when controller manual output is active.
Y_OFFSET:The output value is appended with an offset.
Y_MIN:PID control output value minimum limit.
Y_MAX:PID control output value maximum limit.
MANUAL:The controller manually controls the trigger bit.
RESET:The PID controller reset trigger bit outputs only the Y_OFFSET value when triggered, and the accumulated reset of the integral term is cleared to zero.
CYCLE:Controller cycle time setpoint in seconds.
Y:The PID controller regulates the output value.
LIMITS_ACTIVE:LIMITS_ACTIVE triggers TRUE when Y_MIN or Y_MAX triggers the output.
OVERFLOW:OVERFLOW is triggered to TRUE when the integral accumulation oversaturation overflows.
PID_FIXCYCLE function analysis
For example, with the temperature PID control example, first of all, the current value of ACTUAL mapping good analogue input, thermocouple temperature sensor input value, and then set the target heating target temperature SET_POINT, and then the proportionality coefficient KP, integral time TN, differential time TV according to the engineering debugging experience to set the adjustment to the appropriate value, MANUAL False, Y_OFFSET set to 0, Y_MIN set to 0 Y_MAX set to 100. OFFSET is set to 0, Y_MIN is set to 0 Y_MAX is set to 100. cycle time CYCLE is set to 0.01 S. At this time, when the PID controller is stabilised, it will output the heating amplitude of the heater to be adjusted automatically in order to stabilise the temperature to the set target value.
III. PID function block usage routines PID temperature control experiment configuration
Temperature control experimental platform site pictures, as shown in the picture show.
Figure PID temperature control actual measurement
LicOS Unionscience products are configured as shown.
Figure LicOS Unionscience Product Configuration
ST routines Note that the test execution of the PID function block is best performed with a separate Task task, with a cycle time of 25ms or more recommended. As shown in the figure.
Figure Routine Task Configuration
1.Define the relevant variables as shown.
Figure Routine Variable Definitions
2. PID function block call, as shown in the figure.
Figure PID function block call
3.Online test, the LAN1 IP address of the PLC tested in this routine is 192.168.20.80, and the programme is tested as shown.
Figure Successful online PID debugging of the routine
The analogue PID temperature control curve for this case is shown schematically in Fig.
Figure PID temperature control graphic curve
It can be seen that the set heating temperature of 38 degrees Celsius, PID controller function after the implementation of the measured temperature at 37.9 degrees Celsius, the error of about 0.1 degrees Celsius, and with the extension of time, the temperature error gradually reduced to 0.
IV. PID parameter adjustment method PID empirical adjustment method
In actual commissioning, an empirical value can be set roughly and then modified according to the adjustment effect.
Flow system:P(%)40--100,I(S)6--60
Pressure system:P(%)30--70, I(S)24--180
Liquid level system:P(%)20--80, I(S)60--300
Temperature system:P(%)20--60, I(S)180--600,D(S)30--180
The classic empirical test-piece mnemonic.
Parameter setting to find the best, from smallest to largest order.
Scale then integrate, and finally add the differentiation.
Curve oscillations are frequent, and the scale dial should be enlarged.
The curve floats around a big bend, and the scale dial is turned down.
The curve deviation is slow to recover and the integration time goes down.
The curve fluctuates over a long period of time, and the integration time is lengthened.
The curve is oscillating at a fast frequency, so let's bring the differential down first.
The differential time should be lengthened if the fluctuation is slowed by a large differential.
The ideal curve has two waves, high in the front and low in the back, four to one.
One look, two adjustments and more analyses, the quality of adjustment will not be low.
The curve variation of each parameter of PID regulation is shown in Fig.
Fig. Variation curve of PID regulation parameters
PID parameter Z-N adjustment method
J.G. Ziegler and N.B. Nichoks proposed two methods of rectifying PID parameters in 1942:
Attenuation ratio method:
The goal is to make the system have an oscillation decay ratio of 4:1, i.e., the amplitude of the oscillation is reduced to 1/4 of its original value in one cycle.
Stable Boundary Approach:
Increase the proportional gain until the system enters the critical oscillation state, measure the critical gain (Ku) and critical period (Pu) at this time, and then adjust the PID parameters according to the Z-N rectification method table.
Through the introduction of this article, I believe you have mastered how to apply PID control technology in Unionscience Technology's LicOS PLC/PAC products.LicOS products provide powerful features and flexible configuration options, making complex control tasks simple and efficient. Whether in the industrial, environmental monitoring, medical or agricultural fields, LicOS can provide stable and reliable control solutions.
In the increasingly competitive global industrial automation market, Unionscience Technology has always been committed to technological innovation and superior quality. We not only provide high-performance automation control products, but also customer-centric, to provide a full range of technical support and service. Unionscience Technology's LicOS PLC/PAC series products, through advanced control technology and easy-to-use software platform, to help customers improve production efficiency, optimise the control process, to achieve intelligent and digital transformation.
Just as the PID controller is known for its accuracy and stability, Unionscience Technology will also continue to move forward on the road of scientific and technological innovation, and we firmly believe that through our efforts and innovations, we will be able to bring our customers and society greater value and a broader future.