Cascade PIDFB Function Block Packaging in XINJE PLC

Cascade PIDFB Function Block Packaging in XINJE PLC

The Cascade PIDFB function block packaging of XINJE PLC is an advanced control strategy widely used in industrial automation for precise control of complex processes. Below, combined with the provided ladder diagram screenshot, we will detail its main application scenarios and practical significance.

Cascade PIDFB Function Block Packaging in XINJE PLCIf you need to exchange and learn, you can scan the QR code to add WeChat Please add “study group” in the remarks to learn industrial control knowledge together The program is at the bottom of the article Unique contact: 15325623428 (same number for WeChat)

1. What is Cascade PID Control?

Cascade PID (Cascade PID) is a control method that uses two or more PID controllers in series:

  • Main Controller (Outer Loop) is responsible for setting the target value (SP) and outputs a “virtual setpoint” to the secondary controller based on the deviation between the main variable (such as temperature, pressure) and the setpoint.
  • Secondary Controller (Inner Loop) receives the output from the main controller as its setpoint, responds quickly, and adjusts the actuator (such as valves, motors, etc.).

2. Main Application Scenarios

1. Multi-variable Coupled Systems

  • For example: Boiler drum water level control
    • Main loop: Water level control
    • Secondary loop: Feedwater flow adjustment
  • When the steam load changes, the main loop adjusts the feedwater flow setpoint, and the secondary loop responds quickly to achieve stable regulation.

2. Processes with Significant Lag or Disturbance

  • For example: Reaction kettle temperature control
    • Main loop: Temperature control
    • Secondary loop: Heating power/cooling water flow control
  • External disturbances (fluctuations in feed temperature) are quickly countered by the secondary loop, avoiding impacts on the stability of the main loop.

3. Processes Requiring Fast Response

  • For example: Constant pressure water supply system
    • Main loop: Pressure control
    • Secondary loop: Pump speed or frequency converter frequency control
  • Can quickly respond to sudden changes in water usage, maintaining stable pipeline pressure.

4. Long Pipeline Transport Systems

  • For example: Combined control of flow and pressure in liquid transport
    • Main loop: End flow control
    • Secondary loop: Inlet pressure control
  • Prevents flow fluctuations caused by changes in pipeline resistance.

3. Significance of Using Cascade PIDFB Function Block

Significance Description
Improved Control Accuracy The main loop focuses on the final target, while the secondary loop handles dynamic changes, resulting in more precise overall control.
Enhanced Anti-disturbance Capability The secondary loop can quickly eliminate external disturbances (such as load changes, equipment fluctuations), protecting the stability of the main loop.
Accelerated Response Speed The inner loop acts quickly, responding immediately to external disturbances, reducing fluctuations in the main variable.
Simplified Debugging Difficulty The inner loop (secondary loop) can be tuned first, followed by the outer loop, optimizing in steps and reducing debugging complexity.
Enhanced System Stability Layered control avoids issues like integral saturation and overshoot, especially suitable for systems with large inertia.

4. Diagram Analysis (Based on the Provided Program)

M1 → Start Condition
│
├── TIC_3570_01 (Main PID)
│   Sp: Setpoint
│   Op: From TT_K35070_01.OUT_PUT
│   Output → As SP for TIC_3090_01
│
└── TIC_3090_01 (Secondary PID)
    Sp: Receives output from Main PID
    Op: Actual measurement (such as flow, pressure)
    Output → Analog_outputD → Control actuator (such as frequency converter, valve)

5. Recommended Configuration Points

Parameter Recommended Setting
<span>OUT_MAX</span>, <span>OUT_MIN</span> Set according to actuator range (e.g., 0~100%)
<span>Dead_Band</span> Set deadband to prevent frequent actions
<span>IntegralThreshold</span> Prevent integral saturation
<span>Control_Mode</span> Enable auto-tuning function (e.g., self-learning) in automatic mode
<span>Manual_mode_value</span> Fixed output value in manual mode

6. FB Function Block Packaging

Cascade PIDFB Function Block Packaging in XINJE PLCCascade PIDFB Function Block Packaging in XINJE PLC

IF NOT Mode THEN

error := Sp – Op;

IF Control_Mode THEN //Positive and negative action

error := -error;

END_IF;

//IF ABS ( error ) <=Dead_Band THEN //Integral separation

//error := 0.0;

//END_IF;

SAMPLE_TIME := 1;

REGION //Incremental PID calculation

P_term := Kp * ( error – last_error );

IF ABS ( error ) > Dead_Band THEN //Integral separation

I_term:= SAMPLE_TIME * Ti * error *0.2 ; //Only accumulate 20%

ELSE

I_term:= SAMPLE_TIME * Ti * error; //Integral normal output

END_IF;

IF I_term >= IntegralThreshold THEN //Integral limit

I_term := IntegralThreshold;

ELSIF I_term <= -IntegralThreshold THEN

I_term := IntegralThreshold;

END_IF;

D_term:=Td * ( error – 2 * last_error + prev_error ) / SAMPLE_TIME; //Derivative coefficient calculation

delta_output := P_term + I_term +D_term;

END_REGION

Analog_output :=Lastoutput+ delta_output; //Final output value

MAX_DATA_REALAY := 100;

MIN_DATA_REALAY := 0;

IF Analog_output >= MAX_DATA_REALAY THEN

Analog_output := MAX_DATA_REALAY;

ELSIF Analog_output <= MIN_DATA_REALAY THEN

Analog_output := MIN_DATA_REALAY;

END_IF;

prev_error := last_error;

last_error := error;

Lastoutput :=delta_output;

Analog_outputD := ( Analog_output – 0.0 ) / 100.0 * ( OUT_MAX – OUT_MIN ) + OUT_MIN;

ELSE

Analog_outputD := Manual_mode_value; //Output value in manual mode

I_term := 0.0;

END_IF;

7. Conclusion

Main Application Scenarios of Cascade PIDFB Function Block in XINJE PLC include:

  • Complex process control such as temperature, pressure, liquid level, and flow
  • Systems with significant lag or disturbance
  • Industrial scenarios with high requirements for response speed and stability

The core significance lies in:

  • Achieving “layered control” to enhance system robustness and dynamic performance
  • Significantly improving control quality, reducing overshoot and oscillation
  • Facilitating on-site debugging and maintenance, with strong adaptability

Cascade PIDFB Function Block Packaging in XINJE PLC1. Siemens 1200 and 200 Smart – MODBUS-TCP Communication and Open TCP Communication2. Siemens Incremental PID Algorithm with Integral Separation3. Powder Material Ratio Quantitative Weighing System Design – S7-1200 + Filtering Algorithm4. XINJE PLC Axis Initialization FB Block, Filtering FB Block, Random Number FB Block5. V90 Servo Message 102 + Auxiliary Message 750 Torque Control – Siemens 1200 PLC – Pure Technical Sharing6. Grate Sewage Treatment Control System Design – Siemens 1200 (MODBUS Communication, S7 Communication) Dual PLC Communication – Pure Technical Sharing7. Time Password Lock – Siemens 1200 – SCL Language (FB Block Packaging) Complete Version – Pure Technical Sharing8. Vertical Packaging Machine Control System Design – Application of Electronic Cam – Follow-up Cutting Flying Shear (Pure Technical Sharing)9. Custom Electronic Cam – Flying Shear (Rotary Cutting) – Pure Technical Sharing

Leave a Comment