Design and Implementation of PLC Control System for High and Low Temperature Shock Testing

High and low temperature shock testing is a key step in product reliability verification. Implementing automation control through Siemens PLC can significantly enhance testing accuracy and efficiency.

1. Hardware Configuration

Selection of PLC and Expansion Modules

Based on the control requirements of the high and low temperature shock testing system, the Siemens S7-1200 series PLC is selected as the control core, configured with CPU 1214C DC/DC/DC (14 points DI/10 points DO/2 points AI). To meet the temperature acquisition and control requirements, the following expansion modules are added:

  • SM 1231 8AI module: Used for acquiring signals from multiple temperature sensors

  • SM 1232 4AO module: Used for controlling the heater and refrigeration system

  • CM 1241 RS485 communication module: Connects the touch screen and temperature and humidity transmitter

I/O Point Allocation Table

| Address | Function Description | Type |

|——|———-|——|

| %I0.0 | System Start Button | DI |

| %I0.1 | Emergency Stop Button | DI |

| %I0.2 | High Temperature Chamber Limit Switch | DI |

| %I0.3 | Low Temperature Chamber Limit Switch | DI |

| %I0.4 | Sample Rack Position Detection | DI |

| %I0.5 | High Temperature Chamber Over Temperature Protection | DI |

| %I0.6 | Low Temperature Chamber Over Temperature Protection | DI |

| %I0.7 | Compressor Overload Protection | DI |

| %Q0.0 | High Temperature Chamber Heater Control | DO |

| %Q0.1 | Low Temperature Chamber Refrigeration Control | DO |

| %Q0.2 | Sample Rack Motor Forward Rotation | DO |

| %Q0.3 | Sample Rack Motor Reverse Rotation | DO |

| %Q0.4 | System Running Indicator Light | DO |

| %Q0.5 | Fault Alarm Indicator Light | DO |

| %IW64 | High Temperature Chamber Temperature Acquisition | AI |

| %IW66 | Low Temperature Chamber Temperature Acquisition | AI |

| %QW80 | High Temperature Control Output | AO |

| %QW82 | Low Temperature Control Output | AO |

Key Points of System Wiring

  1. The temperature sensors use PT100 thermistors, with a three-wire connection method to reduce the impact of line impedance.

  2. All control circuits are designed with independent fuse protection.

  3. The heater and compressor control are implemented through solid-state relays to avoid damage to the equipment from frequent start-stop operations.

  4. The emergency stop circuit uses hard-wired protection, not only controlled by the PLC.

2. Control Program Design

Program Architecture Design

The entire program adopts a hierarchical structure design, divided into the following main parts:

- OB1 Main Loop Program

  |- FC1 System Initialization

  |- FB10 Temperature Acquisition and Calibration

  |- FB20 High Temperature Chamber PID Control

  |- FB30 Low Temperature Chamber PID Control

  |- FB40 Sample Rack Position Control

  |- FB50 Test Cycle Management

  |- FB60 Alarm Handling

  |- FC100 Data Logging

Function Block Design

Taking the high temperature chamber PID control function block (FB20) as an example:

FB20 "High Temperature Chamber PID Control" // High temperature chamber temperature control function block

VAR_INPUT

    Actual_Temperature : REAL;    // Current high temperature chamber temperature

    Target_Temperature : REAL;    // Target temperature setting

    Enable_Control : BOOL;    // Control enable

END_VAR


VAR_OUTPUT

    Heating_Output : REAL;    // Heater output power (0-100%)

    Control_Status : BYTE;    // Status code: 0=Stopped, 1=Heating, 2=Temperature Stable, 3=Fault

END_VAR


VAR

    TemperaturePID : PID_Compact; // Using Siemens PID_Compact instruction

    Allowable_Error : REAL := 0.5; // Temperature stability determination error range

    Stability_Timer : TON;      // Temperature stability time timer

END_VAR


BEGIN

// Execute PID calculation when control is enabled

IF Enable_Control THEN

    // Configure PID parameters (only showing part of the key code)

    TemperaturePID.Setpoint := Target_Temperature;
    
    // Call PID controller

    "TemperaturePID"(

        Input := Actual_Temperature,

        Output => Heating_Output);
    
    // Temperature stability judgment logic

    IF ABS(Actual_Temperature - Target_Temperature) <= Allowable_Error THEN

        Stability_Timer(IN := TRUE, PT := T#30S);

        IF Stability_Timer.Q THEN

            Control_Status := 2; // Temperature is stable

        ELSE

            Control_Status := 1; // Stabilizing

        END_IF;

    ELSE

        Stability_Timer(IN := FALSE);

        Control_Status := 1; // Heating/Cooling

    END_IF;

ELSE

    Heating_Output := 0.0;

    Control_Status := 0; // Stopped state

    Stability_Timer(IN := FALSE);

END_IF;

END_FUNCTION_BLOCK

Status Control Design

The high and low temperature shock testing system adopts a state machine design pattern, with the main states including:

  1. INIT (Initialization): Initial check when the system is powered on

  2. READY (Ready): Waiting for start command

  3. HEATING (High Temperature Phase): Sample testing in the high temperature chamber

  4. COOLING (Low Temperature Phase): Sample testing in the low temperature chamber

  5. TRANSFER (Transfer): Sample moving between high and low temperature chambers

  6. COMPLETE (Complete): Test cycle completed

  7. ERROR (Fault): System abnormality

The state transition logic is implemented in FB50 (Test Cycle Management) to ensure safe and reliable state switching, avoiding dangerous operations such as transferring samples when the temperature is not stable.

3. System Debugging Methods

Step-by-Step Debugging Method

  1. I/O Point Testing: Check the wiring and signals of each input and output point one by one

  • Manually trigger input signals and observe PLC status indicators

  • Use the Force Table to control outputs and verify actuator actions

  • Single Module Function Testing: Test each functional module separately

    • Temperature acquisition module: Compare PLC readings with standard thermometer readings

    • PID control module: Manually set different temperature points and observe stability and overshoot

    • Sample rack movement module: Test positioning accuracy and overload protection function

  • Overall Joint Debugging:

    • Perform a single cycle test, manually confirm each state transition

    • Adjust PID parameters to achieve the best response speed and stability balance

    • Gradually increase the number of test cycles to verify long-term operational stability

    Parameter Tuning Steps

    For tuning the high and low temperature PID control parameters, the following steps are adopted:

    1. Initial parameter settings: Kp=1.0, Ti=20s, Td=10s

    2. Increase the proportional coefficient Kp until the system shows slight oscillation

    3. Appropriately increase the integral time Ti to eliminate static error

    4. Fine-tune the derivative time Td to improve dynamic response

    5. Verify control effects at different temperature segments, and set segmented PID parameters if necessary

    Abnormal Simulation Testing

    To verify the system’s fault tolerance, the following abnormal situations need to be simulated:

    1. Sensor failure: disconnection, short circuit, offset, etc.

    2. Actuator failure: heater or refrigeration system unresponsive

    3. Sample rack jam: motor overload during transfer

    4. Unexpected power outage: verify system state handling after power restoration

    4. Data Management and Storage

    Parameter Configuration Table

    The core parameters of the system are stored in the DB100 data block, configured as follows:

    DATA_BLOCK "System Parameters DB"
    
    { S7_Optimized_Access := 'TRUE' }
    
    VERSION : 0.1
    
    NON_RETAIN
    
       STRUCT 
    
          High_Temperature_Setpoint : REAL := 125.0;   // High temperature chamber target temperature (℃)
    
          Low_Temperature_Setpoint : REAL := -40.0;   // Low temperature chamber target temperature (℃)
    
          High_Temperature_Holding_Time : TIME := T#30M; // High temperature holding time
    
          Low_Temperature_Holding_Time : TIME := T#30M; // Low temperature holding time
    
          Cycle_Count : INT := 10;        // Shock test cycle count
    
          Temperature_Allowable_Error : REAL := 2.0;   // Temperature stability determination error (℃)
    
          Over_Temperature_Alarm_Value_High_Temperature_Chamber : REAL := 135.0; // High temperature chamber over temperature protection value (℃)
    
          Over_Temperature_Alarm_Value_Low_Temperature_Chamber : REAL := -45.0; // Low temperature chamber over temperature protection value (℃)
    
          High_Temperature_PID_Parameters : STRUCT         // High temperature PID control parameters
    
             Proportional_Coefficient : REAL := 2.5;
    
             Integral_Time : REAL := 80.0;
    
             Derivative_Time : REAL := 10.0;
    
          END_STRUCT;
    
          Low_Temperature_PID_Parameters : STRUCT         // Low temperature PID control parameters
    
             Proportional_Coefficient : REAL := 3.5;
    
             Integral_Time : REAL := 100.0;
    
             Derivative_Time : REAL := 25.0;
    
          END_STRUCT;
    
       END_STRUCT;
    
    END_DATA_BLOCK
    

    Operational Data Logging

    System operational data is recorded in the DB200 circular buffer, logging the following information:

    1. Timestamp: Key time points of the test

    2. Temperature Values: Real-time temperatures of high and low temperature chambers

    3. Control Output: Heating/Refrigeration power percentage

    4. Status Information: System working status

    5. Abnormal Records: Temperature deviations, equipment failures, etc.

    Data is saved to an SD card using the DataLog function of TIA Portal for subsequent analysis.

    5. User Interface Design

    Interface Layout Description

    The system uses a Siemens KTP900 touch screen, with the main interfaces including:

    1. Main Screen: Displays system status, current test progress, and high and low temperature chamber temperatures

    2. Parameter Settings: Configuration of test temperature, holding time, cycle count, etc.

    3. Manual Control: Manual operation interface for debugging and fault handling

    4. Alarm Page: Real-time display and historical alarm information

    5. Trend Graph: Real-time trend of temperature changes and control outputs

    Parameter Setting Description

    The parameter setting interface adopts a hierarchical permission management:

    • Operator: Can modify basic parameters such as test temperature and time

    • Engineer: Can access advanced settings such as PID parameters and alarm limits

    • Administrator: Can set permissions and system configurations

    All parameter modifications are subject to effective range checks to prevent misoperations that could lead to equipment damage or safety risks.

    Conclusion and Outlook

    The high and low temperature shock testing system is a core device for product reliability testing. This article provides a detailed introduction to the control scheme based on Siemens PLC, covering hardware configuration, program design, debugging methods, and human-machine interface. If you have any questions or experiences in actual projects, feel free to share!

    Leave a Comment