Integration of MARTe2 into the General Atomics Plasma Control System for Real-Time Simulink Model Execution and Parameterisation
This work presents the integration of the MARTe2 real-time framework into the General Atomics Plasma Control System (GA PCS) to enable the offloading of control algorithms from PCS to MARTe2. MARTe2 provides an interoperable, extensible, and configuration-driven environment that avoids the need for direct C or C++ programming, making it well suited for flexible control development. Within this project, a Simulink model has been embedded into the MARTe2 “co-processor” and subsequently incorporated into GA PCS, with full parameterisation consistent with PCS conventions. This allows operators to use one of the main control engineering tools and, to adjust model parameters—or even swap the model itself—directly from the PCS graphical interface on a per-shot basis. To support this integration, modifications and new MARTe2 features were developed. Notably, a UDP Source was implemented as a real-time thread blocker that flushes packet buffers and ensures only the latest data is processed, accounting for the higher operating frequency of PCS while maintaining synchronous operation. Additionally, a SimulinkWrapper GAM was extended to permit dynamic reset and modification of models and parameters without halting MARTe2 execution. Together, these developments demonstrate a practical path for incorporating advanced models into PCS through MARTe2, enhancing flexibility, usability, and real-time capability.