Using Python Modules in Real-Time Plasma Systems for Fusion
Abstract
:1. Introduction
- Data flow management. This is the code that is involved in the movement of signals among the system components. Data originate from sensors (e.g., analog to digital converters), network interfaces and other software modules (e.g., the pre-elaboration of sensor data), then the signals are consumed by actuators, network interfaces and other software modules that perform the required real-time computations. For peripherals, software drivers are required and generally, a given software layer supervises all communication both inside (i.e., memory based) and outside (i.e., hardware interfaces and network communication) of the involved computers.
- Computation management. This is the implementation of the required feedback algorithms. For non-trivial systems, several computation modules are involved, which perform the pre- and post-processing of the data in addition to controlling the computations.
- It speeds up system implementation because I/O and communication functions are carried out by ready components, in most cases, which only require proper configuration. This also holds for computation components when a component is already available for a given computation block. In most cases, when a component is not available, the framework allows the integration of a new one, which is developed once and then reused when required.
- It improves the quality of the deployed system compared to that of a system that was developed from scratch because reused components have likely already been used and tested in other systems.
2. The Real-Time Framework
- Input/output (I/O) management. This is the interaction between the hardware devices that implement the system inputs (sensors) and produce the system outputs (actuators). For example, in fusion experiments, the inputs are electromagnetic sensors that discern voltages, currents and magnetic fields [17,18], which are acquired via ADC devices. The actuators are the power supplies for the coils that are used to generate the electromagnetic fields that are required to shape the plasma and, in particular, avoid any contact between the plasma and the container walls. The references to the power supplies are either analog, i.e., produced by a digital to analog converter (DAC), or sent directly via digital links between control systems and power supply controllers.
- Communication. This carries out the required data flows in real time among the involved components. Depending on the complexity of the real-time system, data communication is either limited to memory communication when systems are hosted on single computers or requires network communication when systems are distributed.
- Algorithm computation. This computes the actuator references based on the sensor inputs and current system states.
- I/O components (also called data sources), which implement hardware and communication interfaces;
- Computation components (also called generic application modules or GAMs), which implement the units of computation. Every GAM defines a set of inputs and outputs that can be connected to other components (data sources or GAMs) within the system configuration.
3. Test Case Descriptions
- A GAM for PID computation, which was already available in the MARTe2 toolkit;
- A Python wrapper GAM that was used to wrap a custom Python PID module, as described in Section 3 (the same wrapper GAM was also used in the second test case with a different target Python program).
- A data source for the ADC, which acquired a given input signal at a sampling rate of 2 MHz and delivered the acquired data in blocks of 2048 samples;
- A GAM that implemented the fast Fourier transform (FFT) of its inputs and was connected with the output of the data source (these two components cyclically exchanged arrays of 2048 float samples) and the overall real-time loop had a period of 1.024 ms as the cycle was synchronized by a 2 MHz ADC sampling clock;
- A Python wrapper GAM to wrap the Python FFT computation, which was carried out using Numpy, as described in Section 3 (this was the same wrapper GAM that was developed for the PID test case).
Python Integration
4. Performance Measurements
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
Abbreviations
ADC | Analog–Digital Converter |
DAC | Digital–Analog Converter |
FFT | Fast Fourier Transform |
FPGA | Field Programmable Gate Array |
GAM | Generic Application Module |
PID | Proportional–Integral–Derivative |
References
- Manduchi, G.; Luchetta, A.; Taliercio, C.; Rigoni, A.; Martini, G.; Cavazzana, R.; Ferron, N.; Barbato, P.; Breda, M.; Capobianco, R.; et al. The upgrade of the control and data acquisition system of RFXMod2. Fusion Eng. Des. 2021, 167, 112329. [Google Scholar] [CrossRef]
- Bettini, P.; Blanchini, F.; Cavazzana, R.; Marchiori, G.; Miani, S.; Soppelsa, A. Adaptive plasma current control in RFX-mod. Fusion Eng. Des. 2011, 86, 1005–1008. [Google Scholar] [CrossRef]
- De Tommasi, G. Plasma Magnetic Control in Tokamak Devices. J. Fusion Energy 2019, 38, 406–436. [Google Scholar] [CrossRef]
- Ambrosino, G.; Albanese, R. Magnetic control of plasma current, position, and shape in Tokamaks: A survey or modeling and control approaches. IEEE Control Syst. Mag. 2005, 25, 76–92. [Google Scholar]
- Castaldo, A.; Albanese, R.; Ambrosino, R.; Crisanti, F. Plasma Scenarios for the DTT Tokamak with Optimized Poloidal Field Coil Current Waveforms. Energies 2022, 15, 1702. [Google Scholar] [CrossRef]
- Maviglia, F.; Ariola, M.; De Tommasi, G.; Lomas, P.J.; Pironti, A.; Rimini, F.G.; Albanese, R.; Ambrosino, G.; Contributors, J.E. Improving the performance of the JET Shape Controller. Fusion Eng. Des. 2015, 96–97, 668–671. [Google Scholar] [CrossRef]
- Marrelli, L.; Abate, D.; Agostinetti, P.; Agostini, M.; Aprile, D.; Auriemma, F.; Berton, G.; Bettini, P.; Bigi, M.; Boldrin, M.; et al. Status of the RFX-Mod2 upgrade. In Proceedings of the 28th IAEA Fusion Energy Conference, Virtual Event, 10–15 May 2021. [Google Scholar]
- Lunardon, F.; Maistrello, A.; Gaio, E.; Piovan, R. Feasibility study of RFX-mod2 performance improvement by additional magnetic energy storage. Fusion Eng. Des. 2021, 173, 112791. [Google Scholar] [CrossRef]
- Berton, G.; Bernardi, M.; Dalla Palma, M.; Marcuzzi, D.; Pavei, M.; Peruzzo, S. Design of the new supporting structure for the passive stabilizing shell assembly of RFX-mod2. Fusion Eng. Des. 2021, 169, 112466. [Google Scholar] [CrossRef]
- Dalla Palma, M.; Berton, G.; Canton, A.; Cavazzana, R.; Gambetta, G.; Innocente, P.; Peruzzo, S.; Siragusa, M.; Spagnolo, S.; Spolaore, M. Design of the RFX-mod2 first wall. Fusion Eng. Des. 2020, 160, 111795. [Google Scholar] [CrossRef]
- Marrelli, L.; Cavazzana, R.; Bonfiglio, D.; Gobbin, M.; Marchiori, G.; Peruzzo, S.; Puiatti, M.E.; Spizzo, G.; Voltolina, D.; Zanca, P.; et al. Upgrades of the RFX-mod reversed field pinch and expected scenario. Nucl. Fusion 2019, 59, 076027. [Google Scholar] [CrossRef]
- Peruzzo, S.; Agostini, M.; Agostinetti, P.; Bernardi, M.; Bettini, P.; Bolzonella, T.; Canton, A.; Carraro, L.; Cavazzana, R.; Dal Bello, S.; et al. Design concepts of machine upgrades for the RFX-mod experiment. Fusion Eng. Des. 2017, 123, 59. [Google Scholar] [CrossRef]
- Marchiori, G.; Cavazzana, R.; Bettini, P.; Grando, L.; Peruzzo, S. Upgraded electromagnetic measurement system for RFX-mod. Fusion Eng. Des. 2017, 123, 892–896. [Google Scholar] [CrossRef]
- Pigatto, L.; Baruzzo, M.; Bettini, P.; Bolzonella, T.; Manduchi, G.; Marchiori, G.; Villone, F. Control System Optimization Techniques for Real-Time Applications in Fusion Plasmas. IEEE Trans. Nucl. Sci. 2017, 64, 1420–1425. [Google Scholar] [CrossRef]
- Bettini, P.; Finotti, C.; Grando, L.; Marchiori, G.; Specogna, R. Modeling of the magnetic field errors of RFX-mod upgrade. Fusion Eng. Des. 2017, 123, 518–521. [Google Scholar] [CrossRef]
- Bettini, P.; Grando, L.; Marchiori, G. Feasibility study of a local active correction system of magnetic field errors in RFX-mod. Fusion Eng. Des. 2015, 96–97, 649–653. [Google Scholar] [CrossRef]
- Marconato, N.; Cavazzana, R.; Bettini, P.; Rigoni, A. Accurate Magnetic Sensor System Integrated Design. Sensors 2020, 20, 2929. [Google Scholar] [CrossRef]
- Marconato, N.; Bettini, P.; Cavazzana, R.; Grando, L.; Marchiori, G.; Marrelli, L.; Peruzzo, S.; Pomaro, N. Design of the new electromagnetic measurement system for RFX-mod upgrade. Fusion Eng. Des. 2019, 146, 906–909. [Google Scholar] [CrossRef]
- Marchiori, G.; Finotti, C.; Kudlacek, O.; Villone, F.; Zanca, P.; Abate, D.; Cavazzana, R.; Jackson, G.L.; Luce, T.C.; Marrelli, L. Design and operation of the RFX-mod plasma shape control system. Fusion Eng. Des. 2016, 108, 81–91. [Google Scholar] [CrossRef]
- Albanese, R.; Villone, F. The linearized CREATE-L plasma response model for the control of current, position and shape in tokamaks. Nucl. Fusion 1998, 38, 723. [Google Scholar] [CrossRef]
- Abate, D.; Marchiori, G.; Bettini, P.; Villone, F. Modelling of RFX-mod2 tokamak equilibria with DEMO-like shape conditions and negative triangularity. Plasma Phys. Control. Fusion 2020, 62, 085001. [Google Scholar] [CrossRef]
- Abate, D.; Marchiori, G.; Villone, F. Modelling and experimental validation of RFX-mod Tokamak shaped discharges. Fusion Eng. Des. 2019, 146, 135–138. [Google Scholar] [CrossRef]
- Manduchi, G.; Fredian, T.W.; Stillerman, J.A.; Neto, A.; Sartori, F. Fast development of real-time applications using MDSplus and MARTe frameworks. Fusion Eng. Des. 2016, 112, 942–945. [Google Scholar] [CrossRef]
- Piron, C.; Manduchi, G.; Bettini, P.; Felici, F.; Finotti, C.; Franz, P.; Kudlacek, O.; Marchiori, G.; Marrelli, L.; Moret, J.M.; et al. Integration of the state observer RAPTOR in the real-time MARTe framework at RFX-mod. Fusion Eng. Des. 2017, 123, 616–619. [Google Scholar] [CrossRef]
- Piron, C.; Felici, F.; Faugeras, B.; Ferron, N.; Manduchi, G.; Marconato, N.; Meekes, C.; Piron, L.; Stancar, Z.; Valcarcel, D.; et al. Development of the RAPTOR suite of codes towards real-time reconstruction of JET discharges. Fusion Eng. Des. 2021, 169, 112431. [Google Scholar] [CrossRef]
- Manduchi, G.; Luchetta, A.; Taliercio, C.; Rigoni, A.; Sartori, F.; Neto, A.; Carannante, G. A portable control and data acquisition solution using EPICS, MARTe and MDSplus. Fusion Eng. Des. 2018, 127, 50–53. [Google Scholar] [CrossRef]
- Manduchi, G.; Barbalace, A.; Luchetta, A.; Soppelsa, A.; Taliercio, C.; Zampiva, E. Upgrade of the RFX-mod real time control system. Fusion Eng. Des. 2012, 87, 1907–1911. [Google Scholar] [CrossRef]
- Frigo, M.; Johnson, S.G. The Design and Implementation of FFTW3. IEEE Proc. 2005, 93, 216–231. [Google Scholar] [CrossRef]
- Harris, C.R.; Millman, K.J.; Van Der Walt, S.J.; Gommers, R.; Virtanen, P.; Cournapeau, D.; Wieser, E.; Taylor, J.; Berg, S.; Smith, N.J.; et al. Array programming with Numpy. Nature 2020, 585, 357–362. [Google Scholar] [CrossRef]
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Ferron, N.; Manduchi, G. Using Python Modules in Real-Time Plasma Systems for Fusion. Sensors 2022, 22, 6847. https://doi.org/10.3390/s22186847
Ferron N, Manduchi G. Using Python Modules in Real-Time Plasma Systems for Fusion. Sensors. 2022; 22(18):6847. https://doi.org/10.3390/s22186847
Chicago/Turabian StyleFerron, Nicolo, and Gabriele Manduchi. 2022. "Using Python Modules in Real-Time Plasma Systems for Fusion" Sensors 22, no. 18: 6847. https://doi.org/10.3390/s22186847
APA StyleFerron, N., & Manduchi, G. (2022). Using Python Modules in Real-Time Plasma Systems for Fusion. Sensors, 22(18), 6847. https://doi.org/10.3390/s22186847