SCDDS-core documentation

[SCDDS - Simulink Control Development & Deployment Suite] Copyright SPC-EPFL Lausanne 2022. Distributed under the terms of the GNU Lesser General Public License, LGPL-3.0-only.

Introduction

This repository contains a set of tools (a library) to develop real-time control systems in Matlab/Simulink, specifically for pulsed devices like tokamaks.

This code was developed at the Swiss Plasma Center at EPFL Lausanne, originally for use on the TCV tokamak , over the period 2008-2022.

In 2022 the library was refactored to be independent of TCV and suitable for use for any tokamak control system. These tools are now distributed in open-source (see license below) in the hope of contributing to a standardization of the way we define, test and deploy control algorithms across fusion devices.

If this library finds its use outside tokamaks or fusion devices, that would also be welcome.

Key features

The code consists of a set of functions and classes to define components of the control system. Usually, a matlab object (instantiation of a class) is associated with one (or more) Simulink models. The matlab object allows the user to perform common tasks for the Simulink model such as retrieving its parameters and signals (from a file or external parameter database), building it into an executable, or running (unit or integration) tests.

Various control system components are defined:

  • Architectural elements:

    Architecture illustration
    • algos: represenging functional blocks with algorithms.

    • wrappers: (running collections of algorithms), this is the unit that is normally compiled into an executable.

    • nodes: (collections of threads running on one computational node).

    • expcode: a representation of the entire control system, being a collection of nodes.

    Note

    It is not necessary to use all the components in this hierarcy, depending on the use-case, already using algos may be very useful.

  • Classes for testing all these components.

  • Interfaces to parameter and signal databases (like MDSplus) to load parameters and signals for a given experiment (shot).

  • Methods to programmatically define and trigger the compilation of components to C code and deployment to a real-time framework.

Use of the library

The normal use of this library consists of deriving classes for a specific instantiation of a control system.

For example the TCV control code is built using classes that derive from the superclasses from this library.

This library comes with a demo file (repository SCDDS-demo that contains a demo implementation of a simple control system, that is interfaced with an MDSplus database and deployed to the MARTe2 real-time control system. New users can first check out this demo.