Multi-scale modelling of manufacturing systems using ontologies and delta-lenses

The adoption of digital technologies in manufacturing enables intelligent dynamic control approaches, at the cost of increased design complexity. In this paper, ontologies and delta-lenses are exploited to enable multi-scale models of a manufacturing system to map digital models at different scales and let data ﬂ ow according to the level of ﬁ delity. A work ﬂ ow is designed to assess the capability of models with a lower level of details to approximate the behaviour of the original system, through the application of a hybrid delta-lens. The approach is illustrated with a user case and applied to an industrial case, aiming at deciding the positions of sensors in an assembly line. © 2021 The Authors. Published by Elsevier Ltd on behalf of CIRP. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/)


Introduction and problem statement
The adoption of digital technologies in the industry has enabled a wide range of new solutions for the management and control of manufacturing systems. Specifically, the availability of enabling technologies like sensors, internet of things, cloud computing and system integration, usually labelled as industry 4.0, has brought the possibility of implementing intelligent dynamic control approaches [1]. At the core of these approaches is the Digital Twin, intended as the coupling of a real system, its digital counterpart, a set of models and algorithms to support decisions, a continuous flow of data coming from the field and a control bus to actuate the decisions in the real system [2].
The benefits derived from this class of approaches have to cope with the capability and effort to collect and store data from the manufacturing system and to harmonize information coming from different sources with different sampling rates and levels of detail. Indeed, the selection of the level of details (i.e. fidelity) in a digital model is fundamental because it is related to the trade-off between the needed accuracy and the cost/effort to collect data (e.g. installation of sensors and communication networks) and run elaborations (e.g. optimization, performance evaluation, simulation, planning, etc.) in the scope of the Digital Twin. In addition, methods and algorithms included in the Digital Twin typically need heterogeneous data with different level of details.
The integration of data sources and the interoperation of digital tools lead to the need of multi-scale modelling of manufacturing systems where complex phenomena are represented at different scales exploiting data with heterogenous resolutions. This concept has been exploited in different areas, e.g., production planning [3], gaining further relevance with the use of multi-fidelity models, i.e., multiple coupled models, with different levels of accuracy/complexity according to the available data and/or intended use [4]. Low-fidelity models (LFMs) are obtained by reducing the details of a high-fidelity model (HFM) associated with a real system [5], enabling rapid analyses and lower computational loads, at the cost of a possible reduced accuracy.
Multi-scale modelling in a dynamic context, like a manufacturing system, asks for mechanisms to automatically map digital models at different scales and let data seamlessly flow between models according to the level of fidelity of the models and provides a consistency check for these mappings. This paper proposes an approach for multi-scale modelling of manufacturing systems aimed at the definition of a multi-fidelity surrogate model (MFSM) [5], exploiting information coming from a simplified model of a manufacturing system, together with its mapping to the full-scale model, to reconstruct the state of the real system. The proposed approach integrates formal methodologies like ontology-based modelling with delta-lenses [6] that are presented in Section 2, whereas the overall approach is detailed in Section 3 through an exemplary user case. A specific focus is given to reverse map the information related to an LFM back to a HFM grounding on an automatic generation of rule-based transformations.
With respect to manufacturing systems, an application is demonstrated in Section 4 for selecting where to apply sensors that can monitor the parts flowing through an assembly line. Different configurations of the sensors trigger different low-fidelity models of the original system. Delta-lenses are then used to enrich the information obtained by the sensors to reconstruct the flow of parts in the real system and to verify if the reconstructed information is consistent with its characteristics and behavior. In practical terms, this approach provides a way to select among different configurations of sensors, those providing the most reliable information to support the decisions.

Ontology-based modelling of manufacturing systems
The relationship between a low-fidelity and the related highfidelity model is generally based on two main criteria, simplification (e.g. elimination of a component or specific behaviour) and aggregation (e.g. merging components). Without loss of generality, this work focuses mainly on the aggregation criterion [4]. The ability of smoothly switching from a high-fidelity to a low-fidelity model (and vice versa) is a key enabler to further spread the use of advanced methodologies and tools that would take advantage of reduced models while preserving an accurate representation of reality. To guarantee the consistency between models with different fidelity a proper knowledge representation is needed. Semantic Web and ontologies can be exploited to enhance data representation and integration while supporting engineering workflows [7]. In particular an ontology-based representation may enable both the definition of highand low-fidelity models, together with relations among them to explicitly define the enforced aggregations and simplifications.
Herein, the adopted factory data model [8] is a modular OWL ontology based on technical standards, as represented in Fig. 1 with corresponding prefixes listed in Table 1. Production resources composed of a manufacturing system like machine tools (fa:MachineTool) and buffers (fa:BufferElement) are defined as classes subsuming abstract classes (i.e. IfcElement, IfcProduct, Ifc-Object) that are characterized by basic relations. Therefore, elements of a manufacturing system can be described in terms of decomposition (ifcext:decompo-sesObject), assignment (ifcext:has-AssignedObject) and connection (ifcext:isConnectedToElement) relations. E.g., a workstation (fa:Machi-neTool) can be decomposed by input/output conveyors (ifc:Transpor-tElement), a working position (fa:BufferElement) and cutting tool (fa: Tool). In turn, a conveyor can be decomposed by buffer positions (fa: Buffer-Element) ordered in sequence thanks to connection relations.
Production resources can be assigned to an operation (ifc:IfcTask) and characterized by the number of parts that can be hosted, e.g. number of servers (fa:MachineServerN) of a machine or capacity (fa: BufferCapacity) of a buffer. In turn, operations are characterized by a task time (ifc:IfcTaskTime) and precedence relations (ifcext:isPredeces-sorToProcess). Thanks to the adopted data model it is possible to flexibly and iteratively define aggregations of production resources, thus enabling a consistent multi-scale representation within a single model. Digital tools can take as input the desired level of details while providing an output that is placed in the scope of the multi-scale model. However, even though ontology helps to represent different levels of details, the transformation between levels is poorly supported by native OWL reasoning, based on the open-world assumption that does not fit engineering applications [9].

Delta-lenses
Delta-lenses are mathematical structures under the umbrella of category theory [6] to capture the fundamental aspects of synchronisation between a pair of systems with different granularity. The goal of such synchronisation is to coherently propagate updates in one system to another, and vice versa. From an engineering standpoint, a lens constitutes a dual mapping between two systems S (source) and V (view), allowing to focus on a V2S, perform some analyses and then have the occurred changes reflected in S. As shown in Fig. 2, a lens S Ð V consists of a get: S!V and a put: S £ V'!S' function, where the get extracts a view (V) from a source (S) and put updates the source S according to a given view update V' producing a new source S'.
Delta-lens [10] is a type of lenses introducing an inter-model, called delta, to specify the commonalities and differences between two models, together with a dual-delta propagation which inputs and outputs deltas between V and S. Two more functions dget and dput are also defined. The dput: V ' £ S! S ' is a backward mapping translation which takes a delta (Δ V ) in the view V and produces a delta (Δ S ) in the source S, obtaining S'. It also considers the initial state of the source model as its second argument to recover information missing in the view. The dget function translate Δ S in the source S to Δ V in the view V.
A major advantage of the use of delta-lenses is the possibility to compose multiple lenses among systems with different level of details, as shown in Fig. 2. This enables multi-scale modelling making the transitions between different models efficient and easy to manage even in complex cases (multi-level modelling and nesting of lenses), as the behaviour of the lens structure is predictable and only the very first delta needs to be computed.

Multi-scale modelling using ontologies and delta-lenses
The combined use of ontology-based modelling and delta-lenses can support multi-scale modelling of manufacturing systems. Grounding on what is described in Section 2.1, a coherent structure of models with different levels of details can be defined. Thus, for each pair of models with a higher (HFM) and lower level of fidelity (LFM), a delta-lens structure HFM Ð LFM can be defined, according to  the characteristics of the LFM: a) the LFM is a sub-set of the HFM and there is a unique dput function for a given get function (one-to-one); b) the LFM is an abstraction of the HFM and many dput functions are possible for a given get function (one-to-many), unless the mapping is defined by additional rules. The definition of an LFM of a manufacturing system through multiple aggregations lead to the latter case, therefore a hybrid delta-lens structure is typically defined. The associated get function is automatically defined in terms of decomposition relations (ifcext:decomposesObject) between the HFM and the LFM. The same set of relations supports the definition of the dput function, incorporating additional backward mapping rules specified by the user. In the proposed framework, the dput serves for three main purposes: 1) propagate the Δ V occurring in the LFM into the HFM and vice versa; 2) evaluate the performance of the deltalens checking the resulting changes in the HFM (S ' ) for any violation of structure integrity or data constraints and assess the viability to reconstruct the behaviour of the HFM; 3) use the retrieved full information as an input to generate a solution of the backward mapping.

Multi-scale modelling and elaboration of monitoring data
The proposed multi-scale approach (Section 2.3) can be applied to several business processes related to manufacturing systems, ranging from system design to manufacturing execution. Herein the general approach is customized for an application case related to the collection and elaboration of monitoring data coming from sensors installed in a manufacturing system.
The high-fidelity model (HFM) of the reference manufacturing system consists of connected resources (machines and buffers) with the maximum level of details. Consistently with the ontology data model, buffers are characterized in terms of capacity c j and transport time t j , while machines in terms of number of servers k j and service time s j . A low-fidelity model (LFM) can be a partition of the HFM with resources clustered in mutually exclusive groups.
Raw monitoring data provided by sensors are log of events describing how parts flow through the system. Events can be defined as 4-tuple (t, pid, rid, etype), where t is the timestamp, pid is the id of the part, rid is the id of the resource where the part is hosted, and etype is the type of event (i.e. entry or exit).
The positioning of sensors determines an LFM of the original system. Indeed, the interfaces between clusters in an LFM can be interpreted as the position of sensors monitoring the flow of parts, since the log of events provides an incomplete description of what happens inside a cluster in terms of flow time of a part at each resource and exact number of parts hosted by a resource. The log of events is generated by real sensors during manufacturing execution, but could be similarly generated by a simulator during the design phase. Fig. 3 shows an example of an assembly system that is jointly represented as a HFM (i.e. machines M1-M7 and buffers B1-B6) and a LFM (i.e. clusters of aggregated resources A1-A5). For instance, a log of events associated with the LFM can tell if at a given time a part is in cluster A4, but cannot decide if it is hosted by B4, M5, B5 or M6. The capacity of buffers in HFM ranges between 4 and 10.

Implementation of hybrid delta-lens
The multi-scale approach consists of the following steps. Step1: the get function is established by generating an aggregation map from the HFM to the LFM thanks to the structural link provided by decomposition relations (see Section 2.1).
Step2: the deltas on the LFM are generated from the associated log of events. For each time T i , the delta Δ L T(i) is the difference between the current (T i ) and last (T (i-1) ) status of LFM, that is Δ L T(i) = dif X (L T(i-1) , L Ti ) where X is a positional-based alignment strategy, matching an object in the LFM at T i to that of T (i-1) .
Step3: the dput function takes the changes on LFM (Δ L T(i) ) as input to generate changes on the HFM (Δ H T(i) ) thanks to information on aggregated resources provided by the HFM together with a backward scheduling calculation. For example, whenever a part enters or exits from A4 (Fig. 3), backward scheduling estimates if parts are located on B4, M5, B5 and M6, while exploiting knowledge derived from the HFM in terms of capacity c 4 and transport time t 4 for B4 (c 5 and t 5 for B5), and number of servers k 5 and service time s 5 for M5 (k 6 and s 6 for M6).
Step4: the output of the dput function is a reconstructed highfidelity log of events.

Performance evaluation
The performance of the hybrid delta-lens is evaluated according to three criteria: 1) the possible violation of mathematical properties of the delta-lens; 2) errors and violation of constraints and structural integrity on both the LFM and HFM; 3) the difference between the result of the estimated backward mapping and the actual high-fidelity data; this criterion is typically evaluated only during the design phase when the actual high-fidelity log can be generated via simulation. For criterion 1, a set of delta-lens laws (including PutGet, GetGet, and identity law [11]) are used. For criterion 2, the maximum capacity of the hosting object (machine or buffer) at each time T i , and the minimum possible flow time are verified. According to structural integrity, also the precedence of visited buffers/machines is verified. With respect to criterion 3, the actual high-fidelity log and the reconstructed high-fidelity log are compared in terms of the difference between the estimated T' i and actual T i of each part on each buffer/ machine; moreover, for each T i , the difference between estimated number of parts N' Ti is compared with the actual number of parts N Ti on each buffer/machine.
For each resource j, jDj j is the mean absolute difference between the estimated and actual number of parts in the whole log; jDj tot is the sum of the jDj j for all the resources j and it is intended to measure the global magnitude of the average errors resulting from application of the dput function. In a similar way, given sðDÞ j the standard deviation of the difference between the estimated and actual number of parts in resource j, s tot is their sum over all the resources in the system, thus it is aimed at measuring the global variability of the estimation error. Finally, D LB UB indicates the minimum and maximum deviation between estimated and actual number of parts over all the resources in the system. With reference to the system in Fig. 3, a total of 511 LFMs with different aggregations have been evaluated and the results for a subset of them are shown in Table 2, where columns id, card and aggregation specify the identifier of the LFM, the cardinality (i.e. number of resources after aggregation) and the operated aggregations using round brackets, respectively. The LFM in Fig. 3 (id 508) reduces the resources in the model (5 instead of 13) with jDj tot close to zero parts and a maximum estimation error of §1 part. A model with the same cardinality but different aggregations (id 509) entails a worse performance, with jDj tot = 6.08 parts and a maximum estimation error of §7 parts, similar to the performance of model 510, having the lowest cardinality. These results demonstrate that it is possible to assess the  approximation of an LFM, thus constituting a valuable tool for selecting the best LFM according to requirements related to accuracy.

Industrial case
The proposed approach has been exploited to support the design and user phase of monitoring and control methods in an automatic assembly line producing slides for drawers for the furniture market [8] with 26 workstations and 21 buffers (Fig. 4).
The first engineering problem is designing where sensors should be placed to monitor the system. A discrete-event simulator was employed to generate the full log of events for the HFM by intercepting entry/exit events of parts at all production resources. The log for an LFM is derived from the full log by deleting events that could not have been caught because of resource aggregation, thus emulating the lack of a sensor.
Following the approach described in Section 3, different positions of the sensors result in corresponding LFMs. To cope with the infeasibility of enumerating and assessing all the possible LFMs, an iterative approach is used. Starting from the HFM, LFMs are generated by aggregating three consecutive resources. All LFM options are evaluated in line with what is described in Section 3.2 and the one demonstrating the best performance in terms s tot is further processed by operating additional aggregations. This sequence is iterated multiple times to identify the LFM with lower cardinality (i.e., a reduced number of sensors) able to correctly estimate the actual state of the HFM. For each iteration (i), Table 3 reports the number of alternative LFMs evaluated (n), the cardinality (card), the incremental aggregation operated on the best LFM selected and its performance (jDj tot , s tot , D LB UB ). At the end of iteration n.14 the number of sensorized resources is reduced by about 60% (from 47 to 19) with jDj tot = 0.008 parts, s tot = 0.312, and a maximum estimation error of (À1, 1). The best candidate LFM of the next iteration would significantly increase the estimation error. The sequential steps of the search are shown in Fig. 5 where the red points represent the best LFMs for each iteration (see Table 3), highlighting that the performance of LFMs with the same cardinality can be considerably different.
An additional advantage of the approach is related to the user phase of the assembly line, when installed sensors monitor the system according to the selected LFM. The corresponding delta-lenses developed at the design phase can be exploited to elaborate monitoring data and derive a surrogate model providing reliable information with a higher fidelity, e.g., estimating the number of parts in unmonitored parts of the system to support the implementation of release control policies [8].

Conclusions
This paper demonstrated how ontology-based approaches coupled with delta-lenses support multi-scale modelling of manufacturing systems. Further development will address the definition of more complex and customised dput functions, as well as test the nesting of delta-lenses for more levels of aggregation. The Huddersfield team would like to acknowledge the funding support from the ESPRC: EP/ S001328, EP/P006930/1 and EP/R024162/1

Declaration of Competing Interest
No conflict of Interest.