Adaptive Controller (AC)

General Description

The AIAC solution enhances machines with intelligence and autonomy, minimizing human errors by automating complex tasks. Once the AIAD identifies an anomaly in the machine, the AIAC solution adjusts the controller to accommodate the new state, ensuring efficient operation.

Usage Viewpoint

Use Model

AI_AC_Usage_Diagram.drawio.png

Description

Environment configuration:

  • Define Process: which process are we going to control? We need a model that reproduces its behavior. For this task the best scenario is that the engineer and the supervisor work together in the definition of it. So, the design criteria of the engineer and the performance criteria of the supervisor can be put together.

  • Define algorithm corresponds to specify which will be the AC algorithm to use. Whereas the process variables refer to which variables are we about to control. Depending on the objective we may need different variables to control/monitor.

Training:

  • Monitor Training Process: the supervisor should be responsible for monitoring the learning process.

  • In the definition of the reward function, the supervisor should ensure that the chosen control parameters are adequate for the system. In every training we aim to find the optimal conditions, and whether the process is optimal or not is defined by the reward function.

  • The process targets vary according to the process to be realized by the operator, as it changes along the supply chain. That is why the operator and supervisor should work together on the definition of the reward function.

Deployment:

  • The monitorization of the process variables is a continuous task. Maybe the selected controller or model is not as suitable as thought and the system should be disconnected to prevent any damage. This should be identified by the operator to avoid any potential issues.

  • The evaluation of the performance is also continuous, the operator should also take care of how the system is performing. This should be carried out together with the supervisor, so the reward function, previously defined, is accomplished. The reward function is done by the two of them, therefore the performance evaluation too.

  • Once the learning is complete and successful, the controller parameters should be updated to those determined by the RL.

Home page

Home Page.png

Model

Model.png

Configuration

Configuration.png

Deployment

Deployment.png

Training results

Training results.png

Usage activity diagram

The following image demonstrates the interaction between the different tasks and roles. No pilot distinction is made as these are the same independent of the use case. This diagram illustrates the dynamic flow of interactions, offering a representation of the activities executed by the solution and providing a clear understanding of the activities executed using the AIAC solution.

AI-AC_Usage-Activity.png

Functional Viewpoint

AI-AC_FCD.drawio (2).png

Functional description

  • What: The main feature of this component is to adapt the controller to the conditions of the machine, so its capacity is kept at its best performance.

  • Who: Process Engineer. C&I Engineer. Operator.

  • Where: Edge Tier

  • Why: Be able to control the machine under faulty scenarios

Input and output data for each component

Define Configuration

  • Inputs:

    • Machine: machine in which the solution is deployed.

    • Components: every subset of elements that define the machine.

    • Variables: each process variable that exist in the use case. Variables such as: speed, current, pressure, flow, temperature, …

    • Dependencies: relation between components and process variables. They define which process variables have a direct effect in a specific component.

    • Tool: if there are different tools

    • Process: if there are different processes carried out by the same machine.

    • Objective: which variable should be controlled/optimized.

  • Outputs:

    • Machine configuration file: its extension may vary depending on the machine in which will be deployed. Its format will be standardized independently of the solution, and it could be a JSON or xml file.

Load/Train Model

  • Inputs:

    • Machine configuration file generated.

    • Training data: set of data gathered from a database or uploaded from a csv file.

    • Algorithm parametrization: the desired algorithm should be parametrized according to the process selected.

    • Control variables definition- the controller output and the variable to be controlled should be defined.

    • Model trained and generated during training phase: in the case the model was already trained we only need to load it.

  • Outputs:

    • Trained Model: once the training process has finished, a model could be downloaded from the frontend to be used as an input for the evaluation process. Model file extension is yet to be defined.

Controller Training

  • Inputs:

    • Training data: set of data gathered from a database or uploaded from a csv file.

    • Algorithm selection and parametrization: the desired algorithm must be selected, from a list, and parametrized.

    • Normal thresholds: if the controller inputs should be kept within a given interval.

    • Reward function definition: reflect the system’s desired behaviour.

    • AI-AD: starting point of a detected anomaly. The status of the machine should be considered in the controller training.

  • Outputs:

    • Statistics of the controller training (Q function loss, policy loss, state, action, reward): the data gathered during the training, to analyse the training behaviour (if needed)

    • Trained policy: the controller itself, which maps the states with the actions to be taken.

    • Buffer: the parameters optimized during the training are saved, to maintain the possibility to start a new training from a certain point and not from the beginning.

    • AI-MP: send the controller policy or the control outputs, depending on the machine requirements.

Load Trained Controller

  • Inputs:

    • Controller trained and generated during training phase, from a list.

  • Outputs:

    • Statistics of the controller training (Q function loss, policy loss, state, action, reward): the data gathered during the training, to analyse the training behaviour (if needed)

    • Trained policy: the controller itself, which maps the states with the actions to be taken.

    • Buffer: the parameters optimized during the training are saved, to maintain the possibility to start a new training from a certain point and not from the beginning

    • AI-MP: trained controller policy.

Reward Function Evaluation

  • Inputs:

    • Controller Parameters: the desired policy structure where hyperparameters are to be optimized.

    • AI-AD: starting point of a detected anomaly, so the controller can adapt to it.

  • Outputs:

    • Rewards: The rewards received by the agent at each state-action pair during training, indicating the success or failure of actions taken.

    • Policy: The learned policy or strategy for selecting actions based on states, which guides the agent’s decision-making process.

Software requirements

Software Component

Description/Role

Required Version/Configuration

Dependencies

Linux OS or Windows OS

Operating system needed to use the tool

Ubuntu 22.04 / Windows 10 Pro

N/A

Docker

Build, share and run containers

latest

N/A

Lifecycle

AI-AC_Lifecycle.png

This sequence diagram illustrates the flow of interactions between the User, Frontend, Backend and Data/Files objects during the main processes. Login into the AIDEAS platform, parametrize a connection to an external database, parametrize the anomaly detection and perform it.

Objects

  1. User: Represents the user interacting with the application.

  2. Frontend: Represents the user interface and the presentation layer.

  3. Backend: Represents the application logic and the server layer.

  4. Database/Files: Represents the data or file storage layer.

Implementation Viewpoint

Description of implementation Component:

AI-AC is a toolkit that adapts the controller in case of a faulty scenario.

Technical Description of its Components:

  • Dependencies:

    • Development Language: - Python

    • Libraries: NumPy, Matplotlib, Pandas, SciPy, Keras, Py Torch, TensorFlow

    • Container: Docker

    • Database need: MongoDB

  • Interfaces:

    • User Interface: Yes, REACT

    • Synchronous/Asynchronous Interface: RESTful APIs

    • Network/Protocols: HTTP/HTTPS

    • Data Repository: MongoDB

  • Requires:

    • Other AIDEAS Solutions: trigger of an anomaly in the machine behavior from the AI-AD solution.

Solution architecture

AI_AC.drawio.png

AI-AC’s backend will be developed in Python using the most common libraries used in data science and machine learning, such as: NumPy for array and matrix processing, Pandas for data analysis and processing and SciPy, PyYAML, Py Torch and TensorFlow for training and evaluating machine learning models and Reinforcement Learning algorithms. AI-ACs frontend will be developed in REACT, which is a JavaScript library, Redux will be used to manage the application state. Both, backend and frontend, will be communicated over a RESTful API using HTTPS protocols. The API could be tested using tools such as Postman. Docker, which is a platform to build, deploy, run and manage containers, will be used to package everything the software needs to run.