Skip to content

4.1. SI: Intro to DINASORE

Eliseu Pereira edited this page Mar 5, 2024 · 10 revisions

Dynamic INtelligent Architecture for Software and MOdular REconfiguration - DINASORE - is a distributed platform that enables the reconfiguration of Cyber-Physical Systems (CPS). The DINASORE platform allows the implementation of Function Block (FB) based pipelines for sensor integration, data processing, and systems control. The FBs are implemented in Python and can be redistributed across the DINASORE nodes. The DINASORE uses the 4DIAC-IDE as a graphical user interface (GUI), implementing the IEC61499 standards.

Installation

DINASORE

For the DINASORE usage, you need first to install the following dependencies:

  • Python 3.8-3.10.11: Python version between 3.8 and 3.10.11 to execute DINASORE. Your Python environment should have the following packages installed: argparse. Additionally, to execute the machine simulator, you should install numpy and scipy python packages.

After, you can download the DINASORE project from GitHub (make sure you are on the dinasore-lite branch) and execute the unitary tests to check if everything is okay.

# clone the GitHub repository
git clone https://github.com/DIGI2-FEUP/dinasore.git --branch dinasore-lite

# move to the DINASORE folder
cd dinasore

# install the python dependencies
pip install numpy scipy argparse psycopg2

# execute the unitary tests
python tests/__init__.py

4DIAC-IDE

For the 4DIAC-IDE usage, you need first to install the following dependencies:

  • Java Development Kit (JDK).

After, you can download 4DIAC-IDE version 1.11.0 from https://www.eclipse.org/4diac/en_dow.php and execute it. If not available (or slow download) on the eclipse page, please download it from: https://drive.google.com/drive/folders/1BG9jSN6q5V6J5MTj7w3r6gF6OH6iEOvm?usp=sharing

Problem Description

The machine simulation model uses a state machine like the one in the following image. The state machine has IDLE, WORK, BREAK, and REPAIR states.

4diac-conf

The machine simulation model was implemented in a function block (FB), the MACHINE_SIMULATOR (presented at the bottom image). The FB simulates the machine state and generates sensorial data, for that the user can specify the following input variables:

  • PARAMS_DATA: Parameters used to generate the machine sensor data. This field has the following structure [((s0_norm_mean, s0_norm_std), (s0_anom_mean, s0_anom_std)), ..., ((sn_norm_mean, sn_norm_std), (sn_anom_mean, sn_anom_std))], where the sx_norm_mean and sx_norm_std are the mean and standard deviation of the normal value of the sensor, and the sx_anom_mean and sx_anom_std are the mean and standard deviation of the anomalous value of the sensor. Using this nomenclature, the user can specify between 1 and N sensors.
  • LIM_ANOM: Value between 0 and 1 that specifies when the anomalous behavior of the machine starts. The moment when starts the anomalous behavior of the sensors is calculated using the following formula: MTBF-(LIM_ANOM*MTBT).
  • PARAMS_MTBF: Parameters used to generate the time between the WORK and BREAK of the machine. This field has the following structure (mtbf_mean, mtbt_std), where the mtbf_mean and mtbt_std are the mean and standard deviation of the mean time between failures distribution. (in seconds)
  • PARAMS_MTTS: Parameters used to generate the time between the BREAK and REPAIR of the machine. This field has the following structure (mtts_mean, mtts_std), where the mtts_mean and mtts_std are the mean and standard deviation of the distribution used to simulate the reaction time (difference between failure and repair start) (in seconds).
  • PARAMS_MTTR: Parameters used to generate the time between the REPAIR and WORK of the machine. This field has the following structure (mttr_mean, mttr_std), where the mttr_mean and mttr_std are the mean and standard deviation of the mean time to repair distribution (in seconds).
  • DELAY: Simulation update rate (in seconds).

Usage

DINASORE

For the execution of the DINASORE, you need to run the following commands:

# command to execute the DINASORE
python core/main.py

4DIAC-IDE

  1. Import project: First, download the project (from this link: https://drive.google.com/file/d/14e3Ngy93qdnOYJ2KVlK5fG7iaHXDUaSH/view?usp=sharing) and extract it to the 4DIAC-IDE workspace. After, in the 4DIAC-IDE interface, select "File -> Import... -> Existing Projects into Workspace", then select the root folder of the extracted project and click Finish.

  2. Application window: The application window presents the function block configuration. Double-click "SINF_0App" on the left menu (System Explorer) to open it.

  3. System configuration window: The system configuration window shows the devices executing the DINASORE in the network or computer. Double-click "System Configuration" on the left menu (System Explorer) to open it.

  4. Deployment window: The function block configuration is deployed by right-clicking on the project ("SINF_0" on the left menu) and selecting deploy. Alternatively, you can open the deployment menu (by selecting on the top menu "Window -> Perspective -> Open Perspective -> Deployment"), and then select the project and click on Deploy.

  5. Monitor system & Watch: Monitor the function block configuration execution by right-clicking on the project ("SINF_0" on the left menu) and selecting Monitor System. Then, right-click the variable/event of the function block and select Watch (the current value of the variable/event will appear in yellow); you can monitor the entire function block by right-clicking on the function block instead of the variable/event.

  6. Trigger event: This option sends events to a particular function block from the 4DIAC-IDE. For that, you need to have a Watch active on the event you want to trigger, and after that, right-click on the event and select Trigger Event. You can start the simulation by triggering an event on the ON-OFF event of the PROD-MAN function block.

  7. Force variable: This option allows the modification of the value of one variable during the function execution. For that, you need to have a Watch active on the variable you want to modify, and after that, right-click on the variable and write the new value. Experiment to change the update rate of one of the machine simulators by forcing the variable DELAY of the MACHINE_SIMULATOR function block.

4diac-conf