Mastering Core Technologies of Electron Accelerator Control: A Must-Read for Siemens PLC Engineers

The control system of the electron accelerator requires high precision and reliability. Proper application of Siemens PLC can achieve efficient and stable control, enhancing the performance of the accelerator and the quality of experiments.

1. Hardware Configuration

Selection of PLC and Expansion Modules

The core of the electron accelerator control system uses the S7-1500 series high-performance CPU, such as the CPU 1517F-3 PN/DP, which has excellent computing performance and multiple communication capabilities. The expansion modules mainly include:

  • Analog Input Module: SM 531, 16 channels, 16-bit resolution, used for collecting multiple sensor signals

  • Analog Output Module: SM 532, 8 channels, used for controlling actuators

  • Digital I/O Module: SM 521/522, used for status monitoring and switch control

  • Technology Module: TM Timer, high-precision timing control, accuracy up to μs level

I/O Point Allocation Table

| Address | Function Description | Signal Type |

|——|———|———|

| %I0.0-%I0.7 | Device Status Monitoring | BOOL |

| %I1.0-%I1.5 | Safety Interlock Signals | BOOL |

| %I2.0-%I2.3 | Emergency Stop Circuit | BOOL |

| %IW64-%IW78 | Voltage Feedback of Each Accelerator Section | INT |

| %IW80-%IW94 | Current Feedback of Each Accelerator Section | INT |

| %IW100-%IW110 | Temperature Monitoring Point Data | INT |

| %Q0.0-%Q0.7 | Control Device Start/Stop | BOOL |

| %Q1.0-%Q1.5 | Indicator Light Control | BOOL |

| %QW64-%QW78 | Voltage Control Output | INT |

| %QW80-%QW94 | Current Control Output | INT |

Key Points of System Wiring

  1. Use shielded twisted pair cables for analog signals, with single-point grounding to reduce interference

  2. Separate wiring for high-voltage control signals and low-voltage signals to reduce coupling

  3. Redundant wiring design for critical safety signals to ensure reliability

  4. All I/O terminals are equipped with surge protection devices to enhance anti-interference capability

2. Control Program Design

Variable Definition Specification

Follow the ISA-88 standard naming convention, using the format “Device_Function_Type”:

// Variable naming example

"ACC_Voltage_PV"    // Actual value of accelerator voltage

"ACC_Current_SP"    // Set value of accelerator current

"ACC_Status_Run"    // Accelerator running status

"VAC_Pressure_AL"   // Vacuum alarm

Program Architecture Design

Adopt a modular layered design, the main program structure is as follows:

  • OB1: Main loop, calls various function blocks

  • OB30: Cyclic interrupt, executed every 100ms, used for data collection

  • OB35: Cyclic interrupt, executed every 50ms, used for control algorithms

  • OB82: Diagnostic interrupt, handles module faults

  • OB86: Communication interrupt, handles network faults

Function Block Design

Accelerator Voltage Control Function Block (FB10)

FUNCTION_BLOCK "ACC_Voltage_Control"

TITLE = "Accelerator Voltage Control"

{ S7_Optimized_Access := 'TRUE' }

AUTHOR : Siemens_Expert

VERSION : 0.1


VAR_INPUT

    Voltage_SP : Real;    // Set value of voltage (kV)

    Enable : Bool;        // Enable control

    Manual_Mode : Bool;   // Manual mode

    Manual_Value : Real;  // Manual set value

END_VAR


VAR_OUTPUT

    Voltage_Out : Real;   // Output value

    Status : Byte;        // Status word

    Error : Bool;         // Error flag

    ErrorID : Word;       // Error code

END_VAR


VAR

    PID_Ctrl : "PID_Compact";  // PID controller instance

    Ramp : "Ramp_Function";    // Ramp function instance

    Limit_High : Real := 50.0; // Upper limit

    Limit_Low : Real := 0.0;   // Lower limit

    Gain : Real := 1.0;        // Gain

    prev_enable : Bool;        // Previous cycle enable state

END_VAR


BEGIN

    // Check for rising edge of enable signal

    IF #Enable AND NOT #prev_enable THEN

        // Rising edge of enable, initialize output

        #Ramp.SetStartValue(#Voltage_Out);

        #Ramp.SetTargetValue(#Voltage_SP);

    END_IF;

    #prev_enable := #Enable;
    
    // Mode selection

    IF #Manual_Mode THEN

        // Manual mode

        #Voltage_Out := #Manual_Value;

    ELSIF #Enable THEN

        // Automatic mode, enable ramp and PID

        #Ramp.Execute(IN := #Voltage_SP);

        #PID_Ctrl.Setpoint := #Ramp.Out;

        #PID_Ctrl.Execute();

        #Voltage_Out := #PID_Ctrl.Output;

    ELSE

        // Not enabled, output set to zero

        #Voltage_Out := 0.0;

    END_IF;
    
    // Limiting processing

    IF #Voltage_Out > #Limit_High THEN

        #Voltage_Out := #Limit_High;

        #Status.%X1 := TRUE; // Set upper limit flag

    ELSIF #Voltage_Out < #Limit_Low THEN

        #Voltage_Out := #Limit_Low;

        #Status.%X0 := TRUE; // Set lower limit flag

    ELSE

        #Status.%X0 := FALSE;

        #Status.%X1 := FALSE;

    END_IF;
    
    // Error handling

    #Error := #PID_Ctrl.Error;

    #ErrorID := #PID_Ctrl.ErrorID;

END_FUNCTION_BLOCK

Status Control Design

Use a state machine pattern to manage the accelerator’s operating status, with the main states including:

  1. STANDBY: Standby state, device powered on but not running

  2. INITIALIZING: Initializing, performing self-check and parameter loading

  3. VACUUM_BUILDING: Establishing vacuum state

  4. PREHEATING: Preheating state

  5. ACCELERATING: Accelerating state

  6. RUNNING: Normal running state

  7. FAULT: Fault state

  8. EMERGENCY_STOP: Emergency stop state

State transitions are triggered by conditions to ensure the system operates according to the predetermined process.

3. Communication Network Architecture

Fieldbus Selection

PROFINET is used as the main fieldbus, with the following advantages:

  • High-speed real-time performance, communication cycle can reach 1ms

  • Supports redundant topology, improving system reliability

  • Integrated diagnostic functions for easy fault location

  • Supports standard Ethernet protocols for easy integration with upper-level systems

Remote Communication Solutions

Data exchange with upper-level SCADA systems is achieved through an OPC UA server, with main data including:

  • Accelerator operating status

  • Real-time values of key parameters

  • Historical data queries

  • Remote control commands

Network Security Considerations

  1. Adopt a zoned network design, strictly isolating control networks from office networks

  2. Key devices are protected by firewalls

  3. Remote access uses VPN encrypted tunnels

  4. Regularly update firmware and security patches

  5. Implement account permission management and operation auditing

4. System Debugging Methods

Step-by-Step Debugging Method

  1. I/O Point Testing: Verify input and output signals one by one

    // I/O test program snippet
    
    #Test_Output := #Test_Input;  // Loop test
    
    #Signal_Value := "ACC_Voltage_PV";  // Read actual value
    
    
  2. Communication Link Testing: Verify communication between devices

    // Communication test program
    
    "Comm_Test_DB".Status := "Device_Partner".Status_Word;
    
    IF "Comm_Test_DB".Timeout > 0 THEN
    
        "Comm_Test_DB".Error := TRUE;
    
    END_IF;
    
    
  3. Unit Function Testing: Verify the independent functionality of each function block

    // Function block unit test
    
    "Test_DB".Voltage_SP := 10.0;
    
    "Test_DB".Enable := TRUE;
    
    "ACC_Voltage_Control"(
    
        Voltage_SP := "Test_DB".Voltage_SP,
    
        Enable := "Test_DB".Enable
    
    );
    
    
  4. Integrated Function Testing: Verify overall system functionality

    // System startup test sequence
    
    CASE #System_State OF
    
        0:  // Initializing
    
            #System_State := 10;
    
        10: // Vacuum establishment
    
            IF "VAC_Pressure_PV" < "VAC_Pressure_Threshold" THEN
    
                #System_State := 20;
    
            END_IF;
    
        20: // High voltage startup
    
            "ACC_Power_Enable" := TRUE;
    
            #System_State := 30;
    
        // More states...
    
    END_CASE;
    
    

Parameter Tuning Steps

  1. Set initial PID parameters (empirical values)

  2. Perform step response tests, recording system responses

  3. Adjust PID parameters based on response curves

  4. Repeat tests until desired performance is achieved

5. Operation Interface Design

Interface Layout Description

The HMI interface is designed based on the WinCC unified platform, mainly including:

  1. Main Control Interface: Displays overall system status, core parameters, and control buttons

  2. Parameter Setting Interface: Used to adjust various operating parameters

  3. Trend Curve Interface: Displays historical trends of key parameters

  4. Alarm Interface: Displays current and historical alarm information

  5. Diagnostic Interface: Used for system fault diagnosis

Parameter Setting Description

Design a hierarchical parameter management system, categorized by operational permissions:

  • Operational Level Parameters: Daily operating parameters, adjustable by operators

  • Engineer Level Parameters: Performance tuning parameters, require engineer permissions

  • System Level Parameters: Core control parameters, require administrator permissions

Each parameter is set with upper and lower limits and rate of change restrictions to prevent misoperation.

Operation Monitoring Description

Provides rich visual monitoring functions:

  1. Real-time data displayed in numerical and trend graph formats

  2. Key statuses visually represented with colors and icons

  3. Device operating time statistics and maintenance reminders

  4. Real-time calculation of energy consumption and performance metrics

The PLC control system for the electron accelerator is a complex and precise engineering project. Proper hardware selection and software design are key to achieving high-performance control. Feel free to share your experiences or ask questions in the comments!

#Siemens#PLC#Programming#ControlSystem

Leave a Comment