An EpicsDBGenerator program module for an accelerator excitation curve conversion system
The automatic conversion of excitation curve is realized through the EpicsDBGenerator program module, solving the problem of complex and error-prone excitation curve conversion in the prior art, and real-time conversion of power supply types and high system compatibility.
Patent Information
- Application Number
- CN202310672295.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-02
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2041-07-02
AI Technical Summary
In the prior art, the conversion process of the excitation curve is complicated and prone to errors, especially when the number of power sources, name or excitation curve fitting coefficient changes, it is necessary to manually rewrite the EPICS record file, resulting in huge workload and prone to errors.
Design an EpicsDBGenerator program module, which adopts Java application, is used to generate the DB files required by the IBConvert program, and realizes automatic conversion of current value (I) and magnetic field value (B), including the IBConvert program module and the EpicsDBGenerator program module, which is suitable for real-time conversion of DC power supplies, pulse power supplies with preset values, convex rail pulse power supplies without preset values, and pulse power supplies with floating power supplies.
Real-time conversion of different types of power supplies in large scientific devices is realized, with strong compatibility, simple installation and use, and reducing the complexity and error rate of manual operation.
Smart Images

Figure CN116520211B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of excitation curve conversion systems, and particularly to an EpicsDBGenerator program module for an accelerator excitation curve conversion system. Background Art
[0002] In the field of accelerators, magnetic fields are usually used to confine the motion of charged particles in a vacuum pipe. Depending on whether the charged particles move in a straight line or a circular motion and the different particle energies, the required magnetic field lines and magnetic field strengths are also different. The generation of various magnetic fields is achieved by providing the required current to the coil through a DC, AC, or pulsed power supply, and the excitation curve is obtained through actual magnetic measurements. What the power supply system can provide is the real-time current value I, while the magnetic field value B is used in the physical beam tuning software. Therefore, an IOC program is needed to convert I and B in real time to achieve the adjustment and monitoring of the running orbit of charged particles. The most important part of the design of the IOC program is the design of the runtime database - the EPICS record file. The logic and calculation formula for the mutual conversion of I and B are relatively complex, and there are many measurement coefficients that need to be brought into the formula for calculation. If the EPICS record file is written manually, the workload will be extremely large and it is easy to make mistakes. If the program logic or measurement data is changed, the EPICS record file needs to be rewritten completely. Therefore, it is particularly necessary to design a system that can generate EPICS records and achieve the automatic conversion of I and B. Since the principles of various accelerators are similar and the universality of this system is relatively strong, the program can be transplanted to other large scientific installations with only minor modifications. Summary of the Invention
[0003] In view of the technical requirements of accelerators, the present invention aims to provide an EpicsDBGenerator program module for an accelerator excitation curve conversion system that can achieve real-time conversion of DC power supplies, pulsed power supplies with preset values, pulsed bump power supplies without preset values, and pulsed power supplies with floating power supplies.
[0004] The technical solution adopted by the present invention is: an EpicsDBGenerator program module for an accelerator excitation curve conversion system. The system is used to convert the physically set magnetic field value into the current value required by the power supply or convert the current value of the power supply into the corresponding magnetic field value. The entire system includes two parts: the IBConvert program module and the EpicsDBGenerator program module. Among them, the IBConvert program is a standard EPICS software IOC and needs to run continuously to achieve real-time conversion of I and B. The EpicsDBGenerator program module is used to generate the DB files required by the IBConvert program. When the number of power supplies, names, and excitation curve fitting coefficients change, this program needs to be run to generate new DB files. The IBConvert program module is designed according to the EPICS specification and mainly includes the design of EPICS records and the design of functions for processing waveform data. The EpicsDBGenerator program module uses a Java application program to generate the DB files required by the IBConvert program. When the number of power supplies, names, and excitation curve fitting coefficients change, this program needs to be run to generate new DB files.
[0005] The IBConvert program module is a standard EPICS soft IOC and needs to run continuously to achieve real-time conversion of I and B.
[0006] The design of the EPICS records is carried out according to the classification of the power supply. The designed DB includes the following database files with the suffix.db: DC.db, PulseWithDC.db, InjectionBump.db,
[0007] Quadrupole.db, EnergyFactor.db, and iocAdminSoft.db.
[0008] The design of the function for processing waveform data uses the ArraySubroutine record of EPICS. Different C programs can be called through this record, and the conversion of waveform data is completed in the C program.
[0009] The EpicsDBGenerator program module is used to read the excitation curve coefficients saved in Excel and automatically generate the EPICSDB files for I and B conversion.
[0010] The beneficial effects of the technical solution adopted by the present invention are: the system of the present invention can be applied to large scientific installations, has strong compatibility, is simple to install and use, and can simultaneously achieve real-time conversion of DC power supplies, pulse power supplies with preset values, bump pulse power supplies without preset values, and pulse power supplies with floating power supplies. Description of the Drawings
[0011] Figure 1 is a schematic diagram of the logical connection structure of the present invention.
[0012] Figure 2 is a logical diagram of the conversion of the excitation curve of the DC power supply in the first embodiment.
[0013] Figure 3 is a logical diagram of the conversion of pulse waveform data in the second embodiment.
[0014] Figure 4 is a logical diagram of the conversion of the excitation curve of the floating power supply in the fourth embodiment Detailed Embodiment
[0015] As Figures 1-4 shown, an EpicsDBGenerator program module for an accelerator excitation curve conversion system is used to convert the physically set magnetic field value into the current value required by the power supply or convert the current value of the power supply into the corresponding magnetic field value in the accelerator. The entire system includes two parts: the IBConvert program module and the EpicsDBGenerator program module. Among them, the IBConvert program is a standard EPICS soft IOC and needs to run continuously to achieve real-time conversion of I (current) and B (magnetic field); the EpicsDBGenerator program module uses a Java application to generate the DB (runtime database) file required by the IBConvert program. When the number, name, and excitation curve fitting coefficient of the power supply change, this program needs to be run to generate a new DB file.
[0016] The IBConvert program module in the present invention is designed according to the EPICS specification, mainly including the design of EPICS (EPICS stands for "Experimental Physics and Industrial Control System", and the two basic mechanisms in the EPICS software system are channel access and distributed dynamic database) records and the function design for processing waveform data. Among them, the EPICS record is the core for realizing the I and B conversion. According to the conversion requirements in the technical protocol and the types of magnet power supplies, it can be divided into four types of power supplies: DC power supply, pulsed power supply with preset value, pulsed skew orbit power supply without preset value, and pulsed power supply with floating power supply. The design of the EPICS record is also carried out according to the classification of the power supplies. The designed DB files include: DC.db file, which is used to realize the I / B conversion of the DC power supply except for the floating power supply; PulseWithDC.db file, which is used for the I / B conversion of the pulsed power supply with preset value except for the quadrupole magnet pulsed power supply; InjectionBump.db file, which is used for the I / B conversion of the pulsed skew orbit magnet power supply without preset value; Quadrupole.db file, which is used for the I / B conversion of the quadrupole magnet pulsed power supply and its floating power supply; EnergyFactor.db file, which is used to realize the calculation related to the energy factor and parameter setting; iocAdminSoft.db file, which is derived from the software package devIocStats and is used to monitor the operation status of the IOC.
[0017] Example 1: I / B conversion for DC power supply
[0018] The DC power supply in this example includes MEBT (Medium Energy Beam Transport), HEBT (High Energy Beam Transport), and the ring DC power supply, excluding the floating power supply because the calculation method of the floating power supply is different. The magnetic fields of MEBT and HEBT need to consider energy correction. MEBT needs to use the rest energy of negative hydrogen ions, and HEBT needs to use the rest energy of protons. In order to facilitate the development of the JAVA program for generating the EPICS DB, the energy factor is also introduced for the magnetic field on the ring, but its value is always 1 and does not affect the calculation result.
[0019] Taking the DC power supply M:MG:HC01-PS as an example, the I / B conversion logic is as Figure 1 shown:
[0020] When performing the B->I conversion, first set the theoretical magnetic field value B-SET, calculate the actual magnetic field set value B-SET_Actual according to the energy factor Energy_Factor, and then calculate the current set value SetI according to the excitation curve fitting coefficient and send it to the power supply remote control program.
[0021] When performing the I->B conversion, first read back the real-time current acquisition value GetI at a certain period, such as 1 second (the period can be modified in st.cmd). Calculate the actual magnetic field acquisition value B_Actual based on the excitation curve fitting coefficients, and then calculate the theoretical magnetic field acquisition value B based on the energy factor Energy_Factor. For a magnet with independent power supply, the calculated theoretical magnetic field acquisition values include PID:B and MID:B, and their values are exactly equal. For the case where one power supply supplies multiple magnets, both PID:B and MID:B are calculated using the real-time acquired current value GetI. The difference is that PID:B is calculated using the average excitation curve fitting coefficients, and MID:B is calculated using their respective excitation curve fitting coefficients.
[0022] In this embodiment, when performing the I / B conversion, it is necessary to set the theoretical kinetic energy, actual kinetic energy, and the rest energy parameters of the particles for MEBT and HEBT. There are no special requirements for the setting order and timing.
[0023] Embodiment 2: I / B conversion for a pulse power supply with preset values
[0024] The pulse power supply with preset values includes dipole, quadrupole, sextupole, and correction iron pulse power supplies on the synchronous ring. Such power supplies need to convert the magnetic field preset values and the total magnetic field waveform data.
[0025] Taking the pulse power supply R:MG:VC01 as an example, the conversion of the preset values is exactly the same as the I / B conversion logic of the DC power supply in Embodiment 1, which will not be elaborated here. The conversion of the pulse waveform data is as Figure 2 shown.
[0026] When performing the B->I conversion, first calculate the preset current value SetI_Tmp, the effective length of the magnetic field waveform data BT-Length, and the magnetic field waveform data BT-SET based on the preset magnetic field value B-SET. Calculate 200,000-point current waveform data SetWaveI_Raw based on the excitation curve fitting coefficients, then set the effective data length SetWaveI_Out.NUSE output to SetWaveI according to BT-Length, and finally output the data in SetWaveI_Raw to SetWaveI according to the effective data length and trigger the power remote control program WFCreate to send down the waveform data.
[0027] When performing the I->B conversion, first read back the real-time current curve acquisition value GetWaveI at a certain period, such as 5 seconds (the period can be modified in st.cmd), and calculate the magnetic field waveform acquisition value BT according to the excitation curve fitting coefficient. For a magnet with independent power supply, the calculated magnetic field waveform acquisition values include PID:BT and MID:BT, and their values are exactly equal. For the case where one power supply supplies multiple magnets, both PID:BT and MID:BT are calculated using the real-time acquired current value GetWaveI. The difference is that PID:BT is calculated using the average excitation curve fitting coefficient, and MID:BT is calculated using their respective excitation curve fitting coefficients.
[0028] In this embodiment, when converting the magnetic field waveform data into current waveform data, it is necessary to first set the magnetic field preset value B-SET, then set the waveform effective length BT-Length, and finally set the magnetic field waveform data BT-SET. This setting order is determined by the need for SetI and BT-Length to participate in the operation and the program design logic. No matter which setting value is modified, it is ultimately necessary to re-set the magnetic field waveform data BT-SET for it to take effect.
[0029] Embodiment 3: I / B Conversion for the Convex Rail Pulse Power Supply without Preset Value
[0030] The two convex rail pulse power supplies on the synchronous ring have no preset value, and the conversion of the pulse waveform data is the same as the conversion method described in Embodiment 2, so it will not be repeated here.
[0031] In this embodiment, when converting the magnetic field waveform data into current waveform data, it is necessary to first set the waveform effective length BT-Length, and then set the magnetic field waveform data BT-SET. This setting order is determined by the need for BT-Length to participate in the operation and the program design logic. No matter which setting value is modified, it is ultimately necessary to re-set the magnetic field waveform data BT-SET for it to take effect.
[0032] Embodiment 4: I / B Conversion for the Quadrupole Magnet Pulse Power Supply and Its Floating Power Supply
[0033] The conversion method of the quadrupole magnet pulse power supply is exactly the same as that of the pulse power supply with preset value described in Embodiment 2, and the floating power supply is related to its corresponding main magnet power supply.
[0034] Taking the floating power supplies R:MG:QD01-FPS01 and R:MG:QD01-FPS02 as examples, the I / B conversion logic is as Figure 3 shown.
[0035] When the B->I conversion occurs, first, the total magnetic field value QD-PS:B-SET of the main pulse power supply should be set. The total current set value QD-PS:SetI is calculated based on the fitting coefficients of the average excitation curve. Then, according to this current and their respective fitting coefficients, the magnetic field value set values QD01-FPS01:B-SET_All of each main quadrupole magnet are calculated by back-calculation. After adding the magnetic field set value of the floating power supply, the new magnetic field value QD01-FPS01:B-SET_Total is obtained. Then, according to their respective fitting coefficients, the total current value is calculated. After subtracting the current value QD-PS:SetI of the main magnet power supply, the floating power supply current set value QD01-FPS01:SetI is obtained and sent to the power remote control program. The current value of QD01-FPS02 is obtained from QD01-FPS01 and always remains the same.
[0036] When the I->B conversion occurs, first, at a certain period, such as 1 second (the period can be modified in st.cmd), the real-time current acquisition values R:MG:QD-PS:GetI and QD01-FPS01:GetI of the main magnet power supply and the floating power supply are read back. After adding them, the total current acquisition value QD01-FPS01:GetI_Total is obtained. According to their respective excitation curve fitting coefficients, the total magnetic field acquisition value is calculated. After subtracting their respective main magnetic field acquisition values QD01:B, the magnetic field acquisition value QD01-FPS02:B of the floating power supply is obtained.
[0037] In this embodiment, the precautions for the excitation curve conversion of the main quadrupole magnet pulse power supply are the same as those described in Embodiment 2. When the floating power supply performs the excitation curve conversion, it is necessary to note that the preset value of the main magnetic field should be set first and then the magnetic field set value of the floating power supply. Since the MID of the floating power supply is the same as that of the main quadrupole magnet pulse power supply, the MID:B of the floating power supply is no longer converted.
[0038] In the present invention, when the pulse magnet power supply performs the excitation curve conversion, waveform data needs to be processed, that is, each magnetic field waveform data or current waveform data needs to be calculated according to the excitation curve fitting coefficients. In addition, the calculation methods for the pulse power supply with a preset value and the pulse power supply without a preset value during the I / B conversion are different. To achieve this function, the EPICS Array Subroutine (aSub) record needs to be used. Through this record, different C programs can be called, and the conversion of the waveform data is completed in the C program.
[0039] When installing the IBConvert program module in the present invention, the computer requirements are as follows: a physical PC, a workstation, or a virtual machine are all acceptable; the memory is at least 4G; the Linux operating system, preferably Redhat or Centos, with a version of 6.0 or higher; software version requirements: the EPICS base version is 3.14 or 3.15; the synApps version is 5.6 or higher.
[0040] The steps for installing the IBConvert program module are as follows:
[0041] S1. Unzip the IBConvert program package to any user directory as needed.
[0042] S2. Modify the IBConvert / configure / RELEASE file to specify the absolute installation paths of EPICS_BASE, AUTOSAVE, IOCADMIN, and CALC.
[0043] S3. Execute make clean&&make in the IBConvert directory.
[0044] When the present invention is used in conjunction with third-party software, after the IBConvert program module runs normally, it can be used in conjunction with third-party graphical software containing the EPICS channel access protocol, such as ControlSystem Studio (CSS), Open XAL software, etc. Here, Open XAL software is recommended. This software is an open-source, cross-platform pure Java program that can provide rich upper-layer application programs for accelerator physical beam tuning. Currently, this software is widely used in large scientific installations at home and abroad.
[0045] In the present invention, the usage method of the EpicsDBGenerator program module. The EpicsDBGenerator program module is used to read the excitation curve coefficients saved in Excel and automatically generate an EPICS DB file for I and B conversion. EpicsDBGenerator is developed using the Java language, and the compilation and running environment requires JDK7 or higher. The jxl package is used to read Excel tables. Therefore, the Excel file needs to be converted into a file with the suffix xls.
Claims
1. An EpicsDBGenerator method for an accelerator excitation curve conversion system, characterized in that: The described system is used to convert the physically set magnetic field value into the current value required by the power supply or convert the current value of the power supply into the corresponding magnetic field value. The entire system consists of two parts: the IBConvert program module and the EpicsDBGenerator program module. Among them, the IBConvert program is a standard EPICS software IOC and needs to run continuously to achieve real-time conversion of I and B. The EpicsDBGenerator program module is used to generate the DB file required by the IBConvert program. When the number of power supplies, names, and excitation curve fitting coefficients change, this program needs to be run to generate a new DB file. The described IBConvert program module is designed according to the EPICS specification, mainly including the design of EPICS records and the design of functions for processing waveform data. The EpicsDBGenerator program module is a Java application program used to generate the DB file required by the IBConvert program. When the number of power supplies, names, and excitation curve fitting coefficients change, this program needs to be run to generate a new DB file. The EpicsDBGenerator program module is used to read the excitation curve coefficients saved in Excel and automatically generate the EPICS DB file for I and B conversion.
2. The EpicsDBGenerator method for an accelerator excitation curve conversion system according to claim 1, characterized in that: The described IBConvert program module is a standard EPICS soft IOC and needs to run continuously to achieve real-time conversion of I and B.
3. The EpicsDBGenerator method for an accelerator excitation curve conversion system according to claim 1, characterized in that: The design of the described EPICS records is carried out according to the classification of power supplies. The designed DB includes the following database files with the suffix.db: DC.db, PulseWithDC.db, InjectionBump.db, Quadrupole.db, EnergyFactor.db, and iocAdminSoft.db.
4. The EpicsDBGenerator method for an accelerator excitation curve conversion system according to claim 1, characterized in that: The design of the function for processing waveform data uses the ArraySubroutine record of EPICS. Different C programs can be called through this record, and the conversion of waveform data is completed in the C program.
Citation Information
Patent Citations
Magnetic field stability control system and method
CN112996214A
Detector and program
JP2011149906A