Adaptive Controller¶
1. Product Description¶
1.1 Solution Overview¶
The AI-AC Adaptive Controller solution enhances machines with intelligence and autonomy, minimizing human errors by automating complex tasks. Using field data, AIAC develops a twin digital model of the machine, in which a controller is trained to optimize the machine process. With this approach the user wiil be able to, for example:
- Train a model that emulates a real machine.
- Train a Reinforcement Learning controller to optimize the machine tasks.
1.2 Features¶
This AIDEAS Adaptive Controller offers following features:
- Import Data: this feature allows the user to read data from CSV and files.
- Data Validating and Preprocessing: this feature validates the training data imported by the user and ensures that the data is in correct format before feeding it into the model.
- Machine Configurator: this feature allows to define the machine configuration, selecting the desired components and associated variables.
- Create and Export Models: this feature allows the user to choose between different model training algorithms, to choose the most appropriate to obtain an accurate relationship of the actual inputs/outputs.
- Create and Export Controllers: this feature provides an adaptive controller algorithm, which trains user-defined models and parameters, controls the systems and optimizes them.
- Obtain Controller Evaluation: this feature analyses and evaluates the controller's performance.
- Export Data: this feature sends the data to the Machine Passport and facilitates the user the possibility to export it directly.
1.3 Prerequisities¶
• Technical Specifications¶
The AI-AC solution is fed with data that provides information about the status of the machine. Among this information we can find specific machine’s associated variables, such as control inputs or internal states. This information is needed to determine whether the machine control inputs need to be modified due to its performance or if it is operating optimally.
The AI algorithms for the AI-AC solution have been selected from the scikit learn library. Supervised learning methods such as NN, Gaussian Regression, Lasso Regression and Ridge Regression. For the adaptive controller a self-made Fuzzy Gaussian Controller has been designed, which is based on a user-defined input and output set and predicts an optimal output. The models files can be saved, under MinIO storage, to the backend of the solutions as a pkl file to be used with the new data. At the moment, solution’s outputs are only displayed in the UI.
The backend of the AI-AC is developed using python and FLASK as the framework of the API server. The backend provides the API endpoints with which the frontend can communicate to, send requests, and calculate the results.
The frontend of the solution is developed in REACT.
For deployment, docker is used since it is the most widely used containerization solution. Docker also makes it easy to deploy the packaged application into the runtime environment and is widely supported by deployment tools and technologies.
For internal storage a MinIO server is used. MinIO is a High-Performance Object Storage.
• Technical Development¶
This AIDEAS Solution has the following development requirements:
- Development Language: Python and Javascript.
- Libraries: Numpy, Pandas, PyYAML, sklearn, XGBoost, Scikit-Learn, Pickle.
- Container and Orchestration: Docker.
- User Interface: React, PrimeReact, Redux.
- Application Interfaces: RestAPI.
- Database engine: MongoDB, Min.io.
• Hardware Requirements¶
AI-AC can run on any platform that supports Docker Containers.
• Software Requirements¶
Docker Desktop (Windows, Mac, or Linux)
npm (for frontend deployment)
• External Dependencies¶
MongoDB (optional, for external data storage)
MinIO (for object storage)
2. Installation¶
2.1 Environment Preparation¶
The application can be found in the following link:
| Resource | Location |
|---|---|
| Last release (v.1.0.0) | Gitlab Project |
Being the repository files and folders structure as follows:
AI_AC
|-- orchestration
| |-- docker
| |-- docker-compose.yml
|
|-- subsystems
|-- backend
| |-- Dockerfile
| |-- requirements.txt
| |-- src/public
| |-- config.yml
|
|-- frontend
| |-- Dockerfile
|
|-- ai_ac_files
2.2. Step-by-Step Installation Process¶
The Docker container of the application can be installed and launched following the next steps:
- Install the Docker application.
- Dowload the zip folder or clone the repository from this link: Gitlab Project.
- Open the "subsystems/backend/src/public/config.yml" file.
- Replace the predefined Min.io's connection values. Theese are the values the application will use everytime the application is opened. As shown below, the user will have access to these parameters through the application, and will be able to change them for the duration of that session.
- Save and close the file.
- Open a terminal in the folder "orchestration/docker".
- Write `docker-compose up --build -d`.
- Configure the application:
3. Initial Configuration¶
3.1. First Steps¶
The application will open in its home screen. The tabs navigation widget is placed in the left, and the available tabs are:
- HOME
- Dashboard → Tab in which an introduction of AI-AC is displayed and from which the other tabs can be accessed too.
- Help → Tab with guidelines.
- AI-AC
- Model → Tab in which models can be trained.
- Controller → In this tab a trained model is used to train a controller.
- Deployment → In this tab the deployment of a trained controller is done into a physical machine.
The tabs "Model", "Controller" and "Deployment" cannot be accessed if not logged in. The login can be done by clicking in the top-right user button. A gitlab user is needed.
Model¶
In the Model screen the following actions can be performed:
- In model building tab, upload a CSV or XLSX file by clicking on Choose tab under introduce a file.
- If there already exist a trained model, upload the pickle file by clicking on Choose tab under upload a model.
- Click on Delete, to delete the model from MinIO.
- If a dataset has been uploaded, in the model building configuration section, select the model's inputs, output, and control parameters from the corresponding tabs.
- Once the model variables have been defined, select the regression methods. As many methods as the user decides can be chosen.
- To compare the chosen methods, specify the evaluation methods to provide several indicators for analyzing the precision of the models.
- Once everything is set, click the `Submit` button to start the model training process.
- After the model is trained, a plot comparing the test output and the prediction will be displayed.
- If the user considers it a good model, it can be saved as a pickle file by indicating its name and clicking on save model. The model will be saved on MinIO.
Controller¶
In the Controller screen the following actions can be performed:
- Select a model in which the controller will be trained. A list of saved models will be displayed.
- If there already exists a trained controller, it will be displayed in a list under select a controller.
- Click on Delete, to delete the selected model and controller from MinIO.
- Under Controller Training Configuration section, the initial values of the Kp and Ki gains of the PI controller can be set. Furthermore, the RL learning parameters can be salected, such as the learning rate and discount factor.
- The targets of the controller have to be defined. These will be the values considered for the precision of the controller. An initial condition of the reference variable must to be set, along with the maximum and minimum limits of the controller signal.
- Once everything is set, click the `Submit` button to start the controller training process.
- After the controller training is finished, a plot containig the training results will be displayed. Also, a reward plot will be shown to analyze the controller training process.
- If the user considers it a good controller, it can be saved as a pickle file by indicating its name and clicking on save controller. The model will be saved on MinIO.
Deployment¶
In the Deployment screen the following actions can be performed:
- Select a controller which will be deployed into the machine.
- Click on Delete, to delete the selected controller from MinIO.
- The deployment communication is carried out via MongoDB, therefore the server IP, DB, username, port, input/output collection and password has to be provided.
- The targets of the controller have to be defined. These will be the values considered for the precision of the controller.
- The time format corresponding to the time zone the controlller will be displayed has to be set.
- Once everything is set, click the `Deploying` button to start the controller deployment process.
- If the user considers it a good controller, it can be saved as a pickle file by indicating its name and clicking on save controller. The model will be saved on MinIO.
Results Overview¶
Model Tab¶
Given a Machine Configuration file, in the Results Overview screen the results can be visualized, contextualized within the machine in which the solution is applied.
The following illustration shows the process of choosing an XLSX file with field data and the selection of all the input/output parameters of the process. Three regression methods have been chosen: Lasso, Decision Tree, and Linear Regression. Three evaluation methods have been chosen: MSE, RMSE, and Mean.

After the parameters have been set, by clicking on Submit, the model training is performed and a table with the selected evaluation indicators is shown for each regression method chosen.

The prediction for each regression method chosen can be seen in a plot. In the figure below, the prediction for Decision Tree is shown. The predicted output is temperature, and the comparison between the prediction and the test set is plotted. On the bottom left-hand part of the screen, the model can be saved.

Controller Tab¶
First, a trained model is selected, "pama1". If there already exists a trained controller, one should select it. In this example, we will train a new one. The PI controller gain initial values are specified, along with the RL algorithm learning gain. We want the temperature to reach 30º from an initial value of 23º. The maximum and minimum values the controller inputs can take are 1000 and 100, respectively. The training starts by clicking the Train Controller button.

Once the training is finished, the controller results, i.e., inputs, outputs, and controller gains are shown in a plot. This is shown in the following figure. The control signals are maintained within the max and min values defined previously. One can interactively play with the plot, displaying certain signals, zooming, and taking screenshots.

In order to see the evolution of the controller training, a Reward Function Evaluation graph is added, where the controller states are shown.

Deployment Tab¶
The deployment requires a controller saved in a pickle file. This controller is selected in the Deployment tab.
The communication between the controller and the machine is done via MongoDB. Therefore, every specification to make that connection has to be done beforehand. In the following figure, a communication is done with AIAC DB, with the specified input and output MongoDB collection. The input collection is the communication with the machine's sensors, where the status of the machine is sent to the controller. In the output collection, the controller sends the control signals to the machine.

Once the communication between the machine and MongoDB is established, the Deploying button has to be clicked to start the control of the machine. A plot is shown with real-time monitoring of the variables, as shown below:

4. General Queries¶
4.1. Installation and Configuration Contact (If Service Provided)¶
For installation and configuration support, users should refer to the official GitLab project or the associated organization (IKERLAN).
4.2. Support¶
Company |
Website |
Logo |
|---|---|---|
IKERLAN |
|
4.3. Licensing¶
The solution is licensed under AGPLv3 or PRIVATE licensing models.
Pricing and licensing details are available upon request.
Subject |
Value |
|---|---|
Payment Model |
Quotation under request |
Price |
Quotation under request |
5. User Manual¶
The use of the application's user interface is optional, and so, the backend of the application can be accessed through API requests. In the following sub sections those API requests and the frontend are described.
5.1. Glossary of Terms¶
– COMPLETE –
5.2 API Documentation¶
| Resource | GET | POST | PUT | DELETE |
|---|---|---|---|---|
| /models/<user_id> | Supported | Supported | Supported | Supported |
| /models/<user_id>/upload_data | Supported | |||
| /models/<user_id>/upload_model | Supported | |||
| /controller/<user_id> | Supported | Supported | Supported | Supported |
| /controller/<user_id>/controller_info; | Supported | |||
| /deployment/<user_id> | Supported |
- /models/<user_id>
- GET → Get a list of the available model names existing under MinIO folder, which is specified in config.yml file.
- POST → Obtain prediction data from the chosen data set and model.
- PUT → Store selected model under MinIO folder, which is specified in config.yml file.
- DELETE → Deletes the selected model's pickle file under MinIO folder, which is specified in config.yml file.
GET obtain available models
GET response type:
[{
"id": 0,
"name": "myModel.pkl"
}, {}, {}, ...]
POST obtain predicted data
POST response type:
[{
"graph": ["prediction"{"x": [], "y": []}],
"Regressors": ["RMSE":[],"MSE":[],"mean":[]],
"Selector": "name",
}]
PUT request type:
{
"username": "ikerlan",
"filename": "modelName.pkl"
}
DELETE request type:
{
"username": "ikerlan",
"filename": "modelName.json"
}
- /models/<user_id>/upload_data;
- POST → Obtain field data from the chosen file (.xlsx or .csv).
POST obtain experimental data from file
POST response type:
[{
"id": 0,
"name": "myData.xlsx"
}, {}, {}, ...]
- /models/<user_id>/upload_model;
- POST → Upload selected model under MinIO folder, which is specified in config.yml file.
POST uploads a model
POST response type:
[{
"id": 0,
"name": "myModel.pkl"
}, {}, {}, ...]
- /controller/<user_id>
- GET → Get a list of the available controller names existing under MinIO folder, which is specified in config.yml file.
- POST → Trains a controller with the user defined configuration.
- PUT → Store selected controller under MinIO folder, which is specified in config.yml file.
- DELETE → Deletes the selected controller's pickle file under MinIO folder, which is specified in config.yml file.
GET obtain available models
GET response type:
[{
"id": 0,
"name": "myController.pkl"
}, {}, {}, ...]
POST obtain predicted data
POST response type:
[{
"time": "[]",
"variable1": "[]",
"KI_values": "[]",
"KP_values": "[]"
}]
PUT request type:
{
"username": "ikerlan",
"filename": "controllerName.pkl"
}
DELETE request type:
[{
"username": "ikerlan",
"filename": "controllerName.json"
}]
- /controller/<user_id>/controller_info;
- GET → Returns controller's output variables.
GET request type
[{
"id": 0,
"name": "myController.pkl"
}, {}, {}, ...]
- /deployment/<user_id>
- POST → .
POST request type
[{
"time": "[]",
"variable1": "[]",
"KI_values": "[]",
"KP_values": "[]"
}]
