# Dynamic Simulation for MAS-Based Data Acquisition and Pre-processing in Manufacturing Using V-REP

Ricardo Silva Peres, Andre Dionisio Rocha, Jose Barata

► To cite this version:

Ricardo Silva Peres, Andre Dionisio Rocha, Jose Barata. Dynamic Simulation for MAS-Based Data Acquisition and Pre-processing in Manufacturing Using V-REP. 8th Doctoral Conference on Computing, Electrical and Industrial Systems (DoCEIS), May 2017, Costa de Caparica, Portugal. pp.125-134, 10.1007/978-3-319-56077-9_11. hal-01629566

HAL Id: hal-01629566

https://inria.hal.science/hal-01629566

Submitted on 6 Nov 2017

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Dynamic Simulation for MAS-based Data Acquisition
and Pre-processing in Manufacturing Using V-REP

Ricardo Silva Peres, Andre Dionisio Rocha and Jose Barata,

Centre of Technology and Systems (CTS) - UNINOVA, FCT Campus,
Monte de Caparica – 2829-516 Caparica, Portugal
{ricardo.peres, andre.rocha, jab}@uninova.pt
Faculdade de Ciências e Tecnologia – Universidade Nova de Lisboa,
Monte de Caparica – 2829-516 Caparica, Portugal

**Abstract.** With the advent of the Industry 4.0 movement, smart multiagent-based cyber-physical systems (CPS) are being more and more often proposed as a possible solution to tackle the requirements of intelligence, pluggability, scalability and connectivity of this paradigm. CPS have been suggested for a wide array of applications, including control, monitoring and optimization of manufacturing systems. However, there are several associated challenges in terms of validating and testing these systems due to their innate characteristics, emergent behavior, as well as the availability and cost of physical resources. Therefore, a dynamic simulation model constructed in V-REP is proposed as a way to test, validate and improve such systems, being applied to a data acquisition and pre-processing scenario as one of the key aspects of the interaction between a CPS and the shop-floor.

**Keywords:** Simulation, V-REP, Manufacturing, MAS, CPS, Data Acquisition.

# 1 Introduction

In recent years, the manufacturing field has been undergoing profound changes, in great part due to the developments in the information technologies fields, in regards particularly to Cloud Computing and the Internet of Things.

An evidence of that is the emergence of the Industry 4.0 movement [1], advocating the existence of highly interconnected, intelligent devices and the growth in the amount of data shared between them. This led to the emergence of several new solutions based on smart cyber-physical systems (CPS), focused on translating these characteristics into added value for the manufacturers.

The work detailed in the following sections is motivated by such a case, more specifically whether or not a smart CPS-based predictive maintenance system can improve productivity and reduce operation expenditures in Industry 4.0 systems. Playing a pivotal role in such an approach, the simulation of the data acquisition and pre-processing stage of these systems can be seen as a first step towards validating and measuring the potential impact that these solutions may have in real environments, being thus the focus of the research documented in the subsequent sections.
As such, the work detailed in the remaining sections is organized as follows. Subsections 1.1 and 1.2 contextualize simulation in regards to Smart Systems, and provide an overview of the related work in the current literature. Afterwards, Section 2 describes the simulation model, while Section 3 provides the details on a specific application case. Finally, Section 4 presents the discussion of the results obtained from the simulation environment, followed by some brief conclusions and description of future work in Section 5.

## 1.1 Simulation in Smart Systems

In the last few years the Smart Industrial Cyber-Physical Systems emerged as an important trend in the new manufacturing ecosystem. In this sense, there is a demand to support customization and the capability to learn and adapt the production systems in real time. This stems from the need to deal with disturbances and unpredictability in production, which lead into the development and research of very dynamic systems.

Consequently, the traditional simulation environments need to evolve in the same direction, otherwise the demonstration and validation of the added value presented by these new Smart Systems cannot be done. Hence, the simulation of these systems will allow researchers and developers of such solutions to improve and keep improving their own solutions and will also allow the migration of these solutions to real production environments.

## 1.2 Related Work

**Emergent Production Paradigms.** That evolution has brought new production paradigms such as evolvable systems [2], reconfigurable distributed processing, among others. In short, adaptive and reconfigurable systems, using optimization strategies to deal with unexpected events and adversities. The strongest branch of research lies on the multi-agent systems, MAS, with several implementations of solutions following these paradigms [3]–[6].

**Simulation in Self-Adaptable Manufacturing Systems.** In the current market and with the emergent needs faced by the manufacturing companies, such as mass customization, small sized batches, etc. simulation appears as a cost effective and valuable tool. Due to the current trends of distributed, intelligent control systems and/or reconfigurable manufacturing systems [7], [8] and all the associated distributed software or functionalities such as diagnosis [9], monitoring [10], among others, the traditional rigid simulation environments are not up to par to simulate these emergent systems with their inherent requirements.

These new proposed production paradigms [11]–[13] can be simulated and tested in two different stages, during the design and after the development. During the design of the solution it is often important to test and tune the algorithms and the behavior of the logic system. At this stage a software like Netlogo [14], [15] or AnyLogic [16] is capable to mimic the behaviors and results from the logic point of view, where the developers are more focused on the interactions and behaviors of
each distributed entity in order to validate and evaluate the overall behavior of the system.

After the development of the logic system, for instance the software responsible for abstracting a production line, it is important to mimic a real industrial line before deploying the technology in a production ready state. This previous assessment using simulation is not only important to validate the solution but also to demonstrate the expected results regarding the usage of these new solutions due to their partially unpredictable and non-deterministic components, based on self-organized and self-adaptable behaviors. Henceforth a new kind of simulation model with intelligent entities in the loop, capable of meeting these new requirements of adaptability and flexibility in run-time is required. With this goal in mind, V-REP [17] appears as an effective possibility to meet these new simulation needs, being based on a modular, distributed architecture and presenting high versatility and flexibility across a wide array of applications.

## 2 Simulation Model

Typically, one of the main goals when designing a simulation model is to maintain a balance between making it as close as possible to a real system and managing its complexity, so that it can be easily altered and experimented with. Despite not representing any concrete system, the model described in this section still abides by these principles, being however focused on providing useful data so that acquisition and processing systems can be quickly tested. Furthermore, another critical point in this modelling process was making sure that the model could be easily extendible to accommodate additional data sources (e.g. sensors and parameters), stations or functionalities, as well as dynamically changeable to cope with new conditions or parameters in run-time. The model itself consists in a simple production line, in which a conveyor belt transports parts from a source to a working station shared by two robots, as seen in Fig. 1.

<figure><img src="image_2.png" /><figcaption>Fig. 1. Overview of the Simulation Model</figcaption></figure>

Once the part has arrived at the station sensor, *robot1* performs a welding operation on it (see Fig. 3), followed by *robot2* picking it up and moving it to a storage box (*Pick and Place* operation, or P&P).
Model design entails a series of key steps, including the clear definition of the system boundaries, its actors, input variables and quantitative criteria or performance measures on the basis of which the performance of different configurations can be compared and evaluated [18]. For this model, the input parameters define the *velocity* for the conveyor belt, as well as for each of the robots. The meaningful data points to be extracted include each robot's *state* (e.g. picking, welding), *part presence* information from the source and station sensors, and finally force sensor information from the picking robot's gripper.

Therefore, the Key Performance Indicators (KPI) associated with measuring the performance of the system consist in the overall *Production Time*, and the *Cycle Time* of each robot. A summary of these inputs and outputs is provided in Fig. 2.

<figure><img src="image_3.png" /><figcaption>Fig. 2. Simulation Model - Inputs and Outputs</figcaption></figure>

In this instance the *Cycle Time* indicates the time it takes each robot to carry out its respective task on the part, while the *Production Time* represents the interval between the moment the part arrives at the workstation and the instant it is put into storage.

To construct such a model, the Virtual Robot Experimentation Platform (V-REP) was chosen [17], [19]. V-REP is a versatile 3D robot simulator based on a modular and distributed architecture, capable of concurrently simulating control, actuation, sensing and monitoring. Both the simulation environment and a close-up of the welding operation during simulation run-time can be seen in Fig. 3.

<figure><img src="image_4.png" /><figcaption>Fig. 3. Simulation Environment (a) and Process Close-up (b)</figcaption></figure>

The scene was built using two UR5 flexible robots (one coupled with an RG2 gripper and the other with a welding gun) and a simple conveyor with two part-presence sensors, one at the source and one at the workstation.

The simulation model was programmed using a collection of Lua scripts, each associated to its own scene object. These scripts are responsible for controlling the
system execution, with the resources communicating via signals using V-REP's own
API. These communications can be observed in **Fig. 4**.

<figure><img src="image_5.png" /><figcaption>Fig. 4. Robot interactions within the simulation model</figcaption></figure>

Furthermore, the simulator allows the connection of external clients with relative ease via V-REP's Remote API, which supports several programming languages including Java, C/C++ and Python.

In this context, Section 3 provides a detailed description of an application case in which this API was used in order to connect the simulation environment to an external MAS-based data acquisition and pre-processing CPS implemented in Java. This description is focused on the system modelling and communication aspects of the integration process.

## 3 Application Case

Industry 4.0 manufacturing systems typically comprise highly interconnected, modular and flexible intelligent components producing large amounts of data at often astounding rates. This makes data acquisition an essential stage in several applications, such as control, monitoring, preventive maintenance and energy optimization. Moreover, solutions proposed regarding these topics tend to rely on data mining and analysis techniques, which not only make it crucial for raw data to be extracted, but also preprocessed in order for it to be translated into a potential business advantage.
With this in mind, the MAS-based data acquisition and preprocessing CPS described in [10], [20] was instantiated in order to collect data from the simulation model and compute more complex values from the raw data readily available from the simulated shop floor.

Subsections 3.1 and 3.2 further specify the system modelling in the CPS and the integration aspects regarding the communication between both tools, respectively.

## 3.1 Modelling the System

The CPS proposed in [10] differentiates between two main types of agents for data acquisition, namely the Component Monitoring Agent (CMA) and the Higher-Level Component Monitoring Agent (HLCMA). The CMA and HLCMA are similar in the sense that both perform data acquisition and handle the preprocessing of raw data to generate more complex knowledge. However, they both operate at different abstraction levels, with the CMA handling a component/resource and the HLCMA being responsible for a subsystem (aggregation of components and/or other subsystems cooperating towards a common goal). As described in Section 2, the simulation model encompasses 3 resources (UR5#1, UR#2 and the Conveyor Belt), hence resulting in the agent topology detailed in Fig. 5.

<figure><img src="image_6.png" /><figcaption>Fig. 5. Agent Topology</figcaption></figure>

Agents are initially deployed in accordance to an XML blueprint file, which should be modelled in order to provide an accurate description of the system. This description is then interpreted by the MAS to understand not only the system topology in terms of available resources, but also regarding the relevant values to be extracted or calculated.

As an example, the *Cycle Time* relative to the welding operation can be represented in this XML file as:

```xml
<Timespan id="welding_time" source="agent">
  <TimespanMapping>
    <StartConditions>
      <StateValue id="welding" value="true"/>
    </StartConditions>
    <EndConditions>
```
<StateValue id="welding" value="false"/>
</EndConditions>
</TimespanMapping>
</Timespan>

## 3.2 Communication

As it can be seen in Fig. 5, each agent has a generic hardware communication interface that should be implemented for each application case, thus allowing the actual CPS to be generic and easily integrated into different scenarios independently from the underlying technologies and protocols. For this case the interface was implemented using V-REP's remote Java API, and allows data to be acquired by two different means, more specifically either periodically polling of relevant data, or subscription to data values on value-change events. For this application case, data acquisition follows the latter.

On V-REP's side, an additional script was developed in order to act as a server for the simulation data. On each pass the script polls the simulation data and checks if it has changed compared to the last value. If so, it sets up a signal with the new value so that it can be read by the CPS, acting similarly to what one can find for instance in an OPC-UA client-server subscription model.

# 4 Discussion of Results

In order to validate the repeatability of the simulation results, as well as the capability of the MAS to acquire raw data from the simulator and preprocess it accurately, five different runs were executed. Each simulation run was executed until twenty samples of the *cycle time* for each robot (*Welding* and *P&P*) as well as the *production time* for the line were extracted, thus resulting in a total of one hundred samples across all runs for each KPI. The results can be observed in Fig. 6.
<figure><img src="image_7.png" /><figcaption>Fig. 6. Timespans calculated by the MAS</figcaption></figure>

For each of the KPIs represented in Fig. 6, the standard deviation σ was calculated through:

$$ \sigma = \sqrt{\frac{\sum (x - \mu)^2}{N}}. \qquad (1) $$

The application of Equation 1 resulted in standard deviation values of 56.099ms, 49.639ms and 68.977ms for the Welding, P&P and Cycle Time variables, respectively. In order to measure the repeatability of the results, the coefficient of variation C_v of each KPI was calculated using:

$$ C_v = \frac{\sigma}{\mu}. \qquad (2) $$

Through Equation 2 each coefficient of variation was obtained, resulting in 3.07% for Welding, 1.45% for the Production Time and 1.70% for P&P. The coefficient of variation has been shown to be a good indicator of repeatability in non-negative datasets [21], as such these percentages suggest that the repeatability of the simulation results is reliable, with the extracted data presenting relatively low levels of variability.
# 5 Conclusion and Future Work

A dynamic and extendable simulation model was proposed for the validation of MAS-based CPS data acquisition and pre-processing solutions to be applied in the context of Industry 4.0.

The model was implemented in V-REP, a versatile and modular 3D robot simulator capable of concurrently handling the simulation of control, actuation, sensing and monitoring. This implementation consisted in a conveyor belt continuously transporting parts from a source to a workstation, where two UR5 robots would weld the part and then move it to a storage box.

An example of an application case was also shown, consisting in the integration of a MAS-based data acquisition and pre-processing CPS with the simulation environment, from which it extracted raw data such as robot states and calculated relevant KPIs, namely cycle times and overall production time. Through the analysis of the results it can be concluded that the simulation model implemented in V-REP presents reliable levels of repeatability with low degrees of variance in the collected data across different runs, hence possibly being a viable solution to validate these kinds of systems in the context of Industry 4.0.

Looking at the application of dynamic simulation for data acquisition and pre-processing as a first step, future work will include the extension of the simulation model to accommodate the testing of plug and produce and reconfiguration functionalities, aiming at providing a flexible environment to validate not only systems tailored for data extraction, but also other contexts such as shop floor control and optimization.

# References

1. J. Lee, B. Bagheri, and H. A. Kao, "A Cyber-Physical Systems architecture for Industry 4.0-based manufacturing systems," *Manuf. Lett.*, vol. 3, no. December, pp. 18-23, 2015.

2. R. Frei, J. Barata, and M. Onori, "Evolvable Production Systems Context and Implications," in *IEEE International Symposium on Industrial Electronics*, 2007. ISIE 2007, 2007, pp. 3233-3238.

3. A. D. Rocha, D. Barata, G. Di Orio, T. Santos, and J. Barata, "PRIME as a Generic Agent Based Framework to Support Pluggability and Reconfigurability Using Different Technologies," in *Technological Innovation for Cloud-Based Engineering Systems*, 2015, pp. 101-110.

4. J. Barbosa, P. Leitão, E. Adam, and D. Trentesaux, "Structural Self-organized Holonic Multi-Agent Manufacturing Systems."

5. A. W. Colombo, R. Schoop, and R. Neubert, "An agent-based intelligent control platform for industrial holonic manufacturing systems," *IEEE Trans. Ind. Electron.*, vol. 53, no. 1, pp. 322-337, 2006.

6. W. Lepuschitz, A. Zoitl, M. Vallée, and M. Merdan, "Toward self-reconfiguration of manufacturing systems using automation agents," *IEEE Trans. Syst. Man Cybern. Part C Appl. Rev.*, vol. 41, no. 1, pp. 52-69, 2011.

7. A. Rocha et al., "An agent based framework to support plug and produce," in *Industrial Informatics (INDIN), 2014 12th IEEE International Conference on*, 2014, pp. 504-510.
8. L. Ribeiro, J. Barata, M. Onori, C. Hanisch, J. Hoos, and R. Rosa, "Self-organization in automation - the IDEAS pre-demonstrator," in *IECON 2011 - 37th Annual Conference on IEEE Industrial Electronics Society*, 2011, pp. 2752-2757.

9. A. D. Rocha, P. L. Monteiro, and J. Barata, "An Artificial Immune Systems Based Architecture to Support Diagnoses in Evolvable Production Systems Using Genetic Algorithms as an Evolution Enabler."

10. A. D. Rocha, R. Peres, and J. Barata, "An agent based monitoring architecture for plug and produce based manufacturing systems," in *Industrial Informatics (INDIN), 2015 IEEE 13th International Conference on*, 2015, pp. 1318-1323.

11. P. Leitão and F. Restivo, "ADACOR: A holonic architecture for agile and adaptive manufacturing control," *Comput. Ind.*, vol. 57, no. 2, pp. 121-130, Feb. 2006.

12. P. Neves and J. Barata, "Evolvable production systems," in *IEEE International Symposium on Assembly and Manufacturing, 2009. ISAM 2009*, 2009, pp. 189-195.

13. A. Y. Koren, U. Heisel, F. Jovane, T. Moriwaki, G. Pritschow, G. Ulsoy and H. Van Brussel, "Reconfigurable Manufacturing Systems." [Online]. Available: http://www-personal.umich.edu/~ykoren/uploads/ReconfigurableManufacturing_systems_1999_keynot_e_paper.pdf. [Accessed: 08-Jun-2014].

14. J. Barbosa and P. Leitão, "Simulation of multi-agent manufacturing systems using Agent-Based Modelling platforms," in *2011 9th IEEE International Conference on Industrial Informatics*, 2011, pp. 477-482.

15. J. Barbosa and P. Leitão, "Modelling and simulating self-organizing agent-based manufacturing systems," in *IECON 2010 - 36th Annual Conference on IEEE Industrial Electronics Society*, 2010, pp. 2702-2707.

16. N. Zheng and X. Lu, "Comparative Study on Push and Pull Production System Based on Anylogic."

17. E. Rohmer, S. P. N. Singh, and M. Freese, "V-REP: A versatile and scalable robot simulation framework," *IEEE Int. Conf. Intell. Robot. Syst.*, pp. 1321-1326, 2013.

18. A. Maria, "Introduction to modelling and simulation," *Winter Simul. Conf.*, pp. 7-13, 1997.

19. M. Freese, S. Singh, F. Ozaki, and N. Matsuhira, "Virtual robot experimentation platform V-REP: A versatile 3D robot simulator," *Lect. Notes Comput. Sci. (including Subser. Lect. Notes Artif. Intell. Lect. Notes Bioinformatics)*, vol. 6472 LNAI, pp. 51-62, 2010.

20. A. D. Rocha, R. S. Peres, L. Flores, and J. Barata, "A multiagent based knowledge extraction framework to support plug and produce capabilities in manufacturing monitoring systems," *ISMA 2015 - 10th Int. Symp. Mechatronics its Appl.*, 2016.

21. A. Pryseley, K. Mintiens, K. Knapen, Y. der Stede, and G. Molenberghs, "Estimating precision, repeatability, and reproducibility from Gaussian and non-Gaussian data: a mixed models approach," *J. Appl. Stat.*, vol. 37, no. 10, pp. 1729-1747, 2010.