1. Closed loop control system PID

1. Closed loop control system PID

Please check with our enginner or sales what kind of PLC mode support PID function.

PLC can perform PID control and support PID self-tuning. Supports up to 8 PID controls

PID is a proportional integral derivative control algorithm for closed-loop control systems.

The PID controller calculates the output of the controller according to the PID algorithm based on the difference between the set value (given) and the actual value (feedback) of the controlled object, and controls the actuator to affect the changes of the controlled object.

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

According to the control requirements of specific projects, some of them may be used in practical applications, such as the commonly used PI (proportional integral) control, where there is no differential control part.

1.1. Instruction description

The PID function is implemented through the PID instruction function block. By executing the PID function block at regular intervals (based on sampling time), according to the PID operation law, the control quantity is calculated based on the given, feedback, proportional integral derivative data at that time.

The PID function block exchanges data through a PID loop table, which is opened in the D data storage area and has a length of 17 bytes. Therefore, each PID function block needs to specify 5 points when calling: PID control loop number, starting address of the control loop table (represented by D), PID set value, PID output (this address is related to the output type of the loop table, where 0 represents the output as a bit element and 1 represents a word element), and PID self-tuning sampling point setting.

1.2. Explanation of PID parameters

Circuit number:

The PID function block supports a total of 8 PID loops

Proportional parameter KP:

The output of the controller is proportional to the input deviation value. Once there is a deviation in the system, proportional adjustment immediately produces a regulating effect to reduce the deviation. Features: The process is simple and fast, with a large proportional effect, which can accelerate adjustment and reduce errors; But it reduces the stability of the system, causing instability and margin for error. The data type is a 32-bit floating-point number.

Integral time TI (ms)

The integration stage is mainly used to eliminate static errors, which refer to the difference between the output value and the set value after the system is stabilized. The integration stage is actually the process of accumulating deviations, adding the accumulated errors to the original system to offset the static errors caused by the system. The data type is a 32-bit floating-point number

Differential time TD (ms)

The differential signal reflects the change rule, or change trend, of the deviation signal, and makes advance adjustment according to the change trend of the deviation signal, thus increasing the rapidity of the system. The data type is a 32-bit floating-point number

PID control dead zone:

When the PID produces control effect, when the error is less than the dead zone value, the PID will stop calculating and maintain the previous state output, with a data type of 32-bit floating-point number.

Sampling time (ms):

This time is the refresh time for data input and PID output, which needs to be set differently according to the system and cannot be less than the scanning period. The data type is a 32-bit floating-point number.

Bottom limit/upper limit of given value:

he PID output is limited within this interval.

Direction:

A direction of 0 indicates PID reverse output (heating), while a direction of 1 indicates forward output.

Self tuning state:

0 indicates tuning completion, 1 indicates tuning in progress, and 2 indicates tuning failure.

Set the number of sampling points:

When using PID self-tuning (i.e. self-tuning state is 1), this value represents that if the PID has not been fully tuned within the set point, it will be judged as a failure (if set to K30, it means that if the PID self-tuning is not completed by the end of 30 sampling cycles, it will fail, self-tuning state position 2)

Output quantity:

When the output type is 0, this value represents the bit element turn-on time, and this value is invalid when the output type is 1.

PID input:

Sampling value storage address

PID output:

When this address is a bit element (ensuring output type is 0), the PID control variable is the positive pulse width of this element. When this address is a word element, the PID calculation result is output here

PID set value:

Set the final target value for PID

1.3. Explanation of PID parameters

PID can be manually or automatically tuned with PID parameters

1.3.1. Manual PID

Execute PID operation output based on user input parameters, or use self-tuning to complete PID parameter settings first

1.3.2. PID self-tuning

Prerequisite conditions

  1. The circuit for self-tuning must be in automatic mode (self-tuning state is 1)

  2. PID control can cause the system to oscillate near the set value

  3. Before performing self-tuning, the system needs to determine the following parameters (sampling time, high and low limits of the given value, PID direction, setting state to 1, output type, set value)

  4. If the system does not oscillate near the set value within N (N=number of self-tuning sampling points) sampling periods during the self-tuning period (with a tuning state of 1), then the tuning state is set to 2, indicating a tuning failure

Self-tuning process

Self tuning starts when the tuning status bit is 1 and the PID instruction is enabled. The system first compares the set value with the measured value. When the measured value is greater than the set value, the PID will output in the negative direction, generating the first zero crossing event. When the measured value is less than the set value, the PID will output in the positive direction, generating another zero crossing event. After completing 10 zero crossing events, the entire PID tuning sequence is sampled, and the system will automatically update the PID parameters, starting PID control. The PID tuning state will clear to 0, indicating that tuning is complete. The speed of peak to peak and zero crossing events of self-tuning process variables is directly related to the dynamic characteristics of the control process.

Reasons for PID self-tuning failure

  1. The system cannot generate 10 zero crossing events, such as insufficient power of the heater in the heating system to raise the temperature or inability to cool down the system

  2. The input signal or measurement value sampling is disordered, and the system cannot obtain the tuning sequence

  3. Parameter settings such as sampling time being too long or too short, unreasonable high and low threshold values, incorrect direction and self-tuning state settings, and failure due to insufficient sampling times