Development of an advanced MES for the simulation and optimization of industry 4.0 process

. The concept of Industry 4.0 has been developed a lot from a theoretical point of view. However, the real applications on production lines remain few in number, due to the dif ﬁ culties of interoperability between the different production entities and also due to the lack of a control system adapted to the expected ﬂ exibility and to the management of the data generated. This article focuses on the development and deployment of a manufacturing execution system (MES) on a production system 4.0. The development stages of the system are explained in detail. The new functionalities and the expected level of performance impose a new logic in the design of advanced systems for controlling and optimizing production. Finally, a proof of concept of an MES was developed and tested on a new technology platform 4.0


Introduction
Today, companies involved in product development in the era of "Industry 4.0" must manage all the necessary information across the product lifecycle, in order to maximize the product-process integration [1]. To this end, new manufacturing systems are able to use advanced functionality to respond to customer demands on time. The flexibility of manufacturing systems applies not only to the physical entities of production, but also to its information and communication technology (ICT) infrastructure. Modern manufacturing systems are composed of cyberphysical systems (CPS) that control production processes through ICT infrastructure. In these systems, CPS controllers sense the status of production operations through the IIoT layer and can manipulate the process through local or centralized dialogue through the MES. Thus, the flexibility of production requires a scalable network architecture, a reconfigurable workshop and an intelligent control system, concepts whose definition is often variable and marked by a contextualized interpretation of the experts.
From this context, dominated by transdisciplinary technology and intrinsic complexity, often unrecognized and underestimated, was born the need to acquire a production platform 4.0 ( Fig. 1) which will be used, on the one hand, for the identification and analysis of technological barriers and on the other hand for the experimentation of modeling work on complex production systems 4.0 and their impact on design.
In its first version, the production platform 4.0 ( Fig. 1) was delivered with an operating mode close to 3.0 where it produced a small series of identical shock absorbers made up of 3 elements (piston, spring, and piston body). The PLC controls machines and robots without any interaction with its direct environment, the only accessible variable is the number of shock absorbers desired. In its current configuration, this production platform is representative of the way companies operate.
2 Transition to production systems 4.0 The objective is to develop a process of gradual transition towards the digitization of production, thus offering new functionalities in order to improve performance.
Based on the new functionalities targeted by the company, in terms of operational flexibility, integrated quality, decision autonomy, predictive maintenance, optimization of energy consumption and the desired level of portability, the idea is to propose a new production system model that defines and integrates a distributed system architecture, cyber-physical systems (CPS), connected technological bricks 4.0, a data storage and processing system and possibly materials that facilitate intra-workshop organ transfer operations. Obviously, the technological aspect is not the only factor of success, other factors such as the management of change, the development of skills, ... contribute to the outcome of such a project which marks a break in industrial practices.
In what follows, Section 2.1 presents a historical synthesis of the evolution of production systems through different periods. Section 2.2 is reserved for new concepts to be integrated into the modeling of production systems 4.0. Section 2.3 shows an initiative to model production systems 4.0. Chapter 3 is reserved for the development of MES systems taking into account advanced functionalities. Finally, chapter 4 will conclude this article.

Evolution of production systems
The production system is a complex system that transforms materials, energy, and knowledge into value-added products and services. Manufacturing has evolved from handcrafted production to mass production and even mass customization. With the introduction of technologies, manufacturing systems have evolved into flexible, reconfigurable and intelligent production systems [2].
Initially, machine tool automation began with the development of numerical control in the 1950s. CIM, computer integrated manufacturing, which emerged in 1970, was a response to manufacturing industries looking for technologies to integrate manufacturing in an overall management process. In the 90s, the CIM was widely distributed under a pyramidal representation of different hardware and software layers. This representation gives a global overview of the data flows which were limited because the sensor networks, the PLC networks, and the computer networks were different, unable to coexist on the same physical support. The base layer represents the different machines used in the manufacturing process. Computer-integrated manufacturing is seen as a system across administration, engineering, and manufacturing [3] where information technology contributes to production control.
The 2000s saw the massive deployment of enterprise resource planning (ERP) in the industry, which made it possible to plan and optimize the supply chain. 15 years later, there appears a complementary need for a link to ensure continuity between ERP data and workshop operations through a complete digital channel from the creation of the Production Order (PO) to obtaining the final product, as shown in Figure 2.
Today, universal communication networks, such as Ethernet and TCP/IP, are used to interconnect different automated manufacturing systems with organizational functions. As a result, the MESs which provide the functions of execution, control and monitoring of production are now evolving towards functions of supervision and optimization of production with full traceability of manufacturing information.
At the center of this Industry revolution, MES has created this missing digital link in the industrial ecosystem. Interfaced with all the connected means of production, it reacts instantly to production activities. MES is the central point of key run-time data, responsible for transmitting the right information at the right time, to both operators and machines. MES is progressing and benefiting from recent hardware and software technologies, particularly in terms of multi-source and multi-support interconnectivity, in order to digitize processes. From there was born the term of "Smart Manufacturing", the intelligent and connected production factory, where data becomes a strategic issue to be protected.
Today the occurrence of Cyber-physical Production Systems (CPPS) has radically transformed pyramid architectures into distributed architectures, allowing them to gain adaptability. CPPS is an extension of a CPS dedicated to an industrial production environment. The general principle is to say that a CPPS is broken down into two functional levels, as shown in Figure 3, right side. The low level manages advanced connectivity that provides real-time data acquisition from the physical world and feedback from the high level. The high level is characterized by remote entities for data collection and intelligent analysis, made possible by advanced connectivity. This  configuration facilitates the implementation of prediction agents that process data at the machine level to make short loop decisions.

Basic concepts for the modelization of production systems 4.0
Over the past 5 years, many researchers have published concepts that interfere, to varying degrees, in the modelization of production systems. Some are generic and can inspire us, others are dedicated to a particular situation or specific context. The superposition and interfacing of concepts generates an increased complexity that is not limited to technical constraints but also extends to the transdisciplinary conceptual modelization of advanced production systems.
In this sense, the German National Academy of Sciences and Engineering proposed a maturity index that defines the different stages of the development of Industry 4.0. Figure 4 shows an overview of the 3 key stages in the transition to Industry 4.0, from Schuh et al. [4].
The first step in the industry 4.0 transition process, defined as an "inventory", aims to collect and highlight company data in order to understand how production processes work. The second step, defined as "horizontal integration", is to optimize the process chain using conventional continuous improvement methods. Finally, the last step, defined as "Smart", aims to increase the production process of new features such as autonomy, flexibility, customization, etc.
In order to progress in these stages, certain key technologies of Industry 4.0 must be developed and implemented [5]. LU [6] agrees with the crucial role of technologies, such as cloud computing, Big Data/analytics, IIoT, and digital service platforms in projects relating to the digital transition to industry 4.0. The technological offer is abundant and the software solutions claim to cover all the needs of the business, hence the need for a rigorous approach in the choice of tools adapted to the needs and available resources.
As a preamble, we summarize in Table 1 the various major concepts that may intervene at different levels in the modelization process. The categorization shown in Table 1 is an initiative to bring together different concepts referenced in the literature in order to simplify understanding. These concepts are marked by a functional interdependence converging towards operational objectives in terms of flexibility, portability, autonomy, optimization...
The concept of cyber-physical systems consists of integrating computational processes with physical processes via networks [7]. Computing processes supervise physical processes via a network architecture, conversely, physical processes affect computing processes. The CPS transforms a machine into a connected entity that interacts with its environment by offering a service in the form of a manufacturing capacity. There is also the concept of cyber-physical manufacturing system (CPMS) which is an extension of the CPS dedicated to industrial manufacturing machines. Multi-agent systems (MAS), which are emerging as a new generation of intelligent engineering systems, could increase the autonomy of each CPMS by associating it with intelligent agents for interaction with other nearby machines.
Thus, each machine or workstation is represented by agents offering different transformation services to agents of the raw part type, for example. In this configuration, the workshop is an on-demand service offering. This is in line    12, 23 (2021) with the concept of the Smart Manufacturing Object (SMO) which refers to a principle whereby production resources are converted into smart manufacturing objects (SMOs) capable of sensing, interconnecting and interacting, with each other, to automatically and adaptively execute manufacturing logics.
All of this brings us to the notion of the architecture of the information system, which is essential for the orchestration of processes. The concept of Service Oriented Architecture (SOA) is a distributed architecture where stand-alone applications expose themselves as services, to which other applications can connect and use the services. Most SOA tools are tailored to business processes and do not have strict resource requirements. Coming from the IT world and adapted to the industrial domain, an SOA relies on a single and integrated communication channel, called the service bus [8] where different robots, machines and applications are available for the manufacturing process as shown in Figure 5. This architecture allows flexibility of flows, and facilitates the reconfigurability of production workshops.
However, even if SOA offers a concept intended to be distributed, the organization of services is generally done in a centralized manner and the interactions between the entities are synchronized and coupled [9], hence the emergence of a new concept event-driven architecture (EDA). In industrial applications, an event can be defined by information such as a change of state of a sensor or information at the end of the cycle of a manufacturing operation. An SOA is based on autonomous management of services based on events. Each department is able to react independently to published events, rather than being invited to do so by a central supervisor. Data associated with events must be immutable regardless of their reuse, including by other applications. EDA systems rely on 3 components, the event generator, the distribution channel, and the process of calculation or processing that should result in the production of an action. As a result, interactions in the production system change from a synchronized coupled mode to a decoupled asynchronous mode.
Connected sensors, cameras, or 3D scanners can complete the production installation and thus form a distributed IIoT architecture, this will result in a significant production of data. Big-data analytics (BDA) platforms are a response to the need to collect and analyze a considerable volume of varied information, coming from different protocols and communication channels. The operational interest consists in benefiting from remote intelligent computing in order to identify phenomenological interactions that may lead to future corrective actions on manufacturing processes or preventive maintenance. However, some data can be calculated at the edge of the network (EdC) in order to react in real-time.
The "digital twin" of the real system, considered as a virtual replica of real machines and operations, can operate on a Cloud Manufacturing (CdM) platform and offer a transdisciplinary collaborative work environment, in synchronous or asynchronous mode. Asynchronous mode (DTS), uses the virtual simulation capability to validate a production plan in terms of scheduling, flow, etc. Once the plans are validated in the cloud they will be integrated into the physical system. The synchronous mode (DDT) allows via ascending data to follow the operational performances, the machine conditions, the energy consumption, the quality of the product ... but also to control the production by actions descending towards the manufacturing workshop in real-time.
Based on the concepts defined and cited above, we propose an initiative for modelization production systems 4.0.

Modelization initiative of production systems 4.0
The approach we propose consists of analyzing the existing production system in order to superimpose on it a technological layer adapted to the desired functionalities and to the investment potential of the company. Before starting the transition process, we consider that the company already benefits from a CIM architecture (Fig. 6) which operates on a model close to 3.0, and that its manufacturing process has already been improved, in  particular through the use of Lean manufacturing. This starting point is crucial for a successful transition to advanced systems.
The transformation of the workshop involves 5 aspects. The material aspect, in particular through the acquisition of equipment for transfers between machines, integrated quality control, or additive manufacturing machines. Added to this, is the reconfiguration of existing machines in terms of controls in order to make them compatible with a connected production system. The second aspect concerns the superposition of an IoT layer, made up of sensors, cameras, and dedicated networks which should be interoperable with the existing network. We observe that the interconnection is also evolving, recent sensors and actuators that communicate via a TCP / IP protocol will be directly connected to the MES without going through the PLCs.
The third aspect concerns the acquisition of software, in particular to manage the workshop. In addition, there is the development of a specific digital management and industrialization environment to which the control functions will be transferred, without forgetting the software interfacing issues called upon to dialogue during the execution of a production plan. The 4th aspect concerns the computational capacities, remote or local, necessary to support a production system 4.0 equipped with advanced functionalities, in particular when using cameras with expectations of real-time responsiveness.
The 5th aspect concerns the programming of machines. In fact, in 3.0 processes, machine programs have a configuration dedicated to mass production. The machines become a single entity that ensures the smooth flow of a production plan. In contrast, in 4.0 processes each machine is a separate entity and can be considered as a CPS, or included in a CPS, connected, intelligent, and autonomous. This modularity at the workshop level leads us to design specific manufacturing programs for a modular, autonomous, adaptable, and reconfigurable production plan.
In conclusion, the modeling of production systems 4.0 explores different concepts with a view to interlocking them and constituting an integrated and intelligent system. The concepts interfere with different fields and expertise, their interoperability constitutes a major technical challenge. A large majority of the articles consulted evoke a multi-scale complexity that is not limited to the sole issues of method, interfacing, security and competence. It also concerns the industrial strategies pursued by the major designers of digital platform solutions and the manufacturers of 4.0 technology systems for positioning and leadership purposes.

Advanced manufacturing execution system (MES)
Following on from the modelization developed in Section 2.3, considered as a first-level generic model, we introduce below an approach of an evolved control system. Indeed, manufacturing systems 4.0 and their advanced functionalities demand to review the expectations of the control system. To this end, we will address the aspects of planning, modularity, digital twin and finally the architectural dimension of the system. The challenge for us is to redefine the new functionalities that a steering system should cover in terms of industrialization, optimization, design, etc. phases.

Planning
The planning phase of production operations is a crucial technical aspect which requires knowing, on the one hand, the production capacity of the production machines, this parameter is classic and not very variable, and on the other hand, to know the way in which the production operations are constituted and structured, this parameter is recent and was introduced recently by various works published in 2019 [10,11] by Prof. Urbas from TUD 1 University.
A production system can be defined as a set of modules linked by flows, whose function is to transform raw materials into a product. The overall flexibility of the production system follows logically from the flexibility of the modules and the flows that compose it, Figure 7. Modularity is not limited to change in the layout of the workshop, but it must be endowed with a flexible structure that allows to increase the production capacity or to integrate new functionalities [12].
In addition, Bloch [13]of the IAT 2 institute published in 2018 works in which he considers the issue of modularization of operations as an approach that meets the growing demands for flexibility in the manufacturing industry. It also addresses the issue of conventional control systems that do not properly support flexible production systems. Indeed, the interconnection of machines, robots, scanners, controllers, actuators, and sensors transform the "basic production operation" entity into modules that encapsulate machine programs but also information related to its operational environment. We retain here that "4.0" planning requires, on the one hand, upstream work to reconfigure the control-command systems of production machines. On the other hand, an encapsulation of basic operations to make them compatible with a production system 4.0.

Modularité
Modularity is a principle of Industry 4.0 and one of its essential functions [14]. Modular production systems offer the possibility of adapting and adjusting the production plan in a more comfortable and useful way. Modularity is defined as the shift from linear planning to agile planning that can adapt to changing circumstances and requirements, without the need for sophisticated reprogramming work. According to Ghobakhloo [15], who published in 2018 an article entitled "The future of manufacturing industry: a strategic roadmap toward Industry 4.0", modularity involves all levels of production, including the agile supply chain and flexible systems material flow. To this end, we have created several standardized parametric modules which represent all the production operations adapted to the potential of the 4.0 platform. The parametric dimension expresses a variability that allows the modules to adapt to the context. Modules can be defined in different ways, it all depends on the standardization sought. We have therefore chosen to group the modules into 5 categories, summarized in the first column of Table 2.
In order to generate a flexible production plan, we distinguish in our approach 2 types of production plans. The first so-called "initial" is a first projection which takes into account the constraints of inter-module anticipation. This first initial plan is not feasible as it is, it only gives a global overview and can be used if one wishes to distribute the manufacture of a product to other digitized and connected factories. In this perspective, this would mean that the components of a product can be manufactured in different remote and connected manufacturing units where the optimization of production will no longer be limited to the capacity and constraints of the platform 4.0 but will be extended to other digital production sites. In this future configuration, it would be necessary to share data in order to allow MES to interconnect and identify solutions for outsourcing the production of certain components.
The second so-called "optimized" production plan will be subject to the capacity constraints of the 4.0 platform and to the optimization criteria. To this end, the MES will propose several possible scheduling and flow scenarios to be adjusted according to the weighting of the optimization criteria. The criteria used are cost, time, or energy. The optimization can be single-objective or multi-objective, with the objective of generating a production plan that offers the best production time at the lowest cost, for example. Once the plan has been optimized, validated, and saved, the MES system can plan its execution taking into account the current production load. Indeed, the production data available in real-time should allow the MES to plan all the modules of the production plan on hold or, failing that, certain modules which can be manufactured. The digital twin, developed for piloting, may be of interest in this phase for the purposes of simulation and verification of the progress of manufacturing processes. The last point concerns the management of the production plan in dynamic mode, which will be discussed in the last section.

Digital twin
Cyber-physical models combined with other digital concepts have paved the way for the development of the digital twin [16]. The digital twin, also called "virtual replica" or "coupled model", which appeared in the 2000s, is beginning to fit into industrial practices with the prospect of considerable optimizations both in the simulation phase in "decoupled" mode and in the production management phase in "coupled" mode [17]. In an industry in full transformation, the digital twin allows for better crossfunctionality across the entire value chain, both internally and externally. The deployment of this technology is also accelerated by the deployment of IIoT and an adapted IT architecture. Sharing information through the digital twin between the different businesses involved offers a real advantage, especially in remote mode. The digital model of a product is built from the start of design, System information and physical knowledge are recorded and will come to interact with manufacturing processes. The coupled model offers real-time accessibility to process monitoring and machine status, due to the ubiquitous connectivity it becomes possible to activate commands via the digital twin. The decoupled model can be seen as a mirror image of the real production system, capable of simulating, in an immersive or virtual environment, the offline execution of a production plan. This mode allows engineers to interact with the various stakeholders involved in order to validate or optimize many parameters before going into real production.
In our case, the objective is to develop a digital twin coupled to the production processes of the platform 4.0 (Fig. 8). To this end, we have modeled the material elements of production and also the immaterial elements represented by various processes such as production modules, machine g-codes, robot trajectories… and their resources. The digital twin is simple in its description but complex in its deployment, for several reasons. The first lies in the modeling of material elements, which calls for advanced skills in the creation of virtual dynamic scenes that can show object kinematics and, for the most advanced models, a representation of phenomenological behavior. The second reason concerns the process of coupling the material elements to the immaterial elements via a digital platform, a network architecture and sensors that collect data. The third reason lies in taking into account the aging and changes in its physical clone.
The issue of digital twins, mentioned by many researchers in recent publications, including Malykhina and Tarkhov [16] who consider that the digital twin is the basis of the industry of the future, Xiang et al. [18] consider that the digital twin is a crucial and relevant research topic for the challenges of the industry of the future and finally Tao et al. [17] see the digital twin as a promising technology that will help make smart manufacturing 4.0 a reality. In the following section the digital twin of the platform will be presented in "interface 6" with a use coupled to the platform 4.0 or decoupled for simulation.

Management and manufacturing operations
Production management consists of ensuring the successive or simultaneous execution of manufacturing operations in accordance with the qualitative and quantitative requirements of customers. Management takes into account both the manufacturing modules and the necessary logistics in terms of tools, raw materials, maintenance, and the hazards that may arise during production. Industrialization, which is preparatory work, upstream of production, aims to define all the operations grouped into modules which will be implemented in a flexible production plan. To this end, the functionalities of the MES that we wish to develop should respond, mainly, to its ability to design a production plan from identified and recorded operations as well as to its ability to drive production through data. The Figure 9 summarizes the general and functional architecture of the MES where there are 6 interfaces. The 1st interface is dedicated to the supply of raw material or components necessary for the assembly of the finished product. This function is fairly standard in its operation and does not currently represent a challenge for us in terms of research. Note that the chain of operations necessary for the acquisition, management, and renewal of the stock of materials is managed in a conventional manner. Only the inventory status is recorded manually on the MES.
The second interface entitled "operations" is reserved for the definition of basic production operations. The implementation of basic operations in MES is organized in two stages. The first takes place on machine-specific systems, such as CAM tools dedicated to the generation of tool paths for CNC machining machines. Indeed, all the operations necessary for a product production plan are validated upstream. Then comes the second step, which consists of preparing their integration into MES through an encapsulation action in order to make them compatible with its operational environment. This process is based on advanced technical knowledge of the platform 4.0 and obeys specific codification in order to be identifiable in different interfaces. Production operations of the "standardized robot trajectory" type are interesting illustrative examples to mention. We have analyzed all the possible trajectories of the robots and we have succeeded in defining 33 trajectories that can be used in a combined way and thus cover all the needs in terms of transfer in the workspaces of the platform 4.0. This approach helps to increase the flexibility of operations and thus facilitates the design of a production plan by assembling standardized operations. Table 3 shows in the 2nd column an example of standardized production operations that can be requested in different production programs. The interest here is to identify or define all the operations necessary for manufacturing, controls, transfers, assembly, etc. which make it possible to ensure the production of a component, from the initial stock of raw until delivery of the manufactured and inspected part that could be recovered from the accumulation table. You will notice that the list of operations is displayed in a linear, unoptimized schedule, where the only objective is to verify the logical and consistent flow of production operations. In addition, some operations are interrelated by immutable prior art constraints to which the engineer should be attentive and report them at this stage.
Some operations may require a specific setting, such as the frequency with which we want to control the dimensional or geometric quality via the 3D scanner, characterized by a percentage vis-a-vis the overall number of parts to be produced. In the case where we observe a dimensional drift, we could vary this parameter so that it adapts to the acceleration of the drift, which allows us to optimize the use of the 3D scanner, which is computation-  ally intensive and time consuming. Another example that contributes to the flexibility of the platform is the stroke and shape of the fingers of the robot gripper, capable of gripping the part. Indeed, the typology of the different components that will be manufactured suggests that we maintain the "part grip" aspect as an input parameter for transfer programs. The 3rd interface entitled "industrialization" refers to the preparation of modules, where each module can group together, in a precise schedule, several operations from the previous phase. These modules can constitute a logical production operation or be dedicated specifically to a product. For various reasons, any module must be able to be simulated and executed. I cite the example of a specific recurring need for dimensional control of a component using the 3D scanner integrated into the platform. To this end, the engineer can develop a specific module which consists of using the robot to transfer the component to the rotating plate of the scanner, activate the scanner, recover the point cloud and finally transfer the component to a secure storage space. This interface allows production engineers to prepare modules by overcoming the issues of interoperability, robot programming, scanner control, etc. which provides a real advantage in productivity.
Based on the previous example, we can concretely illustrate the concept of manufacturing module. Several strategies can intervene in the definition of modules from the operations defined in the previous step. The first is to define modules that group together a minimum of operations under an identification that can be understood by the different people involved in development and production. The advantages are multiple, in real-time, this strategy increases the flexibility of production, in particu-lar by its ability to reorganize the production plan in order to avoid the occurrence of undesirable events on the platform. On the other hand, in deferred time, this strategy offers the possibility of enhanced optimization in the scheduling phase of production modules.
To this end, it can be seen in Table 4 that certain modules group together a single operation, for various reasons. The "Lathe machining À Pawn" module groups together a single "Prog_Tour_1" operation, specific to the machining of a precise component. This choice is justified by the importance of the operation and the need to make it visible in the production plan. The "presence control" module for the crude in the lathe chuck also groups together a single operation, this is justified by the frequency at which this module is requested, which is lower than the production rate of the components concerned. In general, it is the engineers' experience that makes the difference in the configuration of the modules, they anticipate production constraints and productivity requirements.
The second groups together a maximum of operations in order to facilitate visibility of the production plan, but may result in an increase in the number of modules to respond to different situations. The interoperation prior constraints make it easier to group them into a module; therefore, the parameterization of certain operations is transferred to the module which returns the value of the parameter to the operation concerned in the production phase.
Case 1 and Case 2 of Table 4 are two examples of modules that define a transfer of the workpiece from the chuck to the accumulation table by stressing the two robots. These two cases are distinguished, for one, by an additional "quality control" type operation of the machined In the end, we note that the grouping of operations into modules gives them more visibility and becomes explicit to users of MES systems. The 4th interface called "production plan" is dedicated to finalizing a production plan for a given product. The production engineer collects all the modules necessary for the execution of a given production order and imposes on some of the constraints of inter-module anticipation. In addition, some modules are configured, in particular the quality control modules, which must be activated in proportion to the number of components manufactured. In this phase, the MES should offer several options, the first consists of taking into account the constraints imposed by prior art and proposing all possible scenarios for scheduling production modules for a defined product. The Figure 10 illustrates a production plan for the manufacture of a Pawn organized into several possible flow scenarios, two of which are of particular interest to us. The first flow transfers the machined part from the lathe chuck to the 3D scanner, activates the scanner to measure and log dimensional deviations, then transfers it from the scanner to the conveyor.
The second flow transfers the machined part directly from the lathe chuck to the conveyor without going through the 3D scanner. The alternation between these two flows is conditioned by the frequency of dimensional control that one wishes to apply to a population of machined parts. This parameter, controlled by the MES in the "production control" phase, can be fixed or varied depending on the evolution of dimensional deviations observed over time.
The historization of dimensional deviations of machined parts from their CAD model is a real source of optimization to maintain production at an optimal rate. Indeed, this dynamic quality control makes it possible to limit the number of parts rejected for dimensional and geometric non-conformities. Concretely, we identify two actions that can be integrated and managed by the MES in real-time.
The 1st is characterized by an action, at the level of the "machining operation" module, of the type readjustment of the "depth of cut" parameter in order to compensate for the measured deviation and to approach the nominal value of the dimension, for example. The second action is characterized by a spacing of the inspection frequency of the machined parts, especially if it is observed that the drift is relatively stable and evolves in a regular manner. This action makes it possible to less mobilize the mobile robot and the 3D scanner for the manufacture of the "Pawns" component and potentially to reassign them to the manufacture of other components.
The second consists of optimizing the results from the first option, by confronting them with optimization criteria and objective functions, such as the minimization of the execution time of the production plan, the minimization of production costs or the minimization of energy consumption. The optimization can relate to a single criterion, single-objective, or to the combination of several criteria, multi-objective. Concretely, he uses digital methods to vary module parameters such as depth of cut, feed rate, robot speeds, etc. in order to identify the best configuration that optimizes the production plan. The MES, in the "production control" phase, can make them evolve to make them compatible with the workload plan being implemented. In this phase, the different scenarios of the production plans can be simulated using the digital twin which will be discussed in "interface 6".
The 5th interface called "piloting" is a logical continuation of the previous phase. The objective here is to prepare for the launch of production and to ensure that it is managed in real-time. In this interface, the production plans, selected and validated in the previous phase, will be loaded and positioned in order of priority execution. The MES manages the synchronization of production plans with the capacity load of the platform. In our approach, synchronization is carried out at the level of the modules, or grouping of modules, which make up the production plan, the interest is to bring operational flexibility to the level of the modules. In its preparation phase, the MES takes into account the load plan of each machine, scheduled shutdowns, stocks, initial scheduling, the availability of reference documents, the constitution of batches, etc. In its active phase, it takes into account the real-time balancing of flows, failures, measured deviations, contingencies, traceability and batch release, etc.
To this end, the MES developed here will be endowed with a level of autonomy and must therefore be able to make decisions based on ascending data almost in realtime. Thus, the ordering of modules, or grouping of modules, becomes dynamic and its updating depends on the one hand on the evolution of the situation in real-time and on the other hand on the hazards encountered.
Interface 6 entitled "Digital twin" (Fig. 11) can be used from interfaces 4 or 5. In fact, in the preparation phase "interface 4", it offers the advantage of visualizing in 3D the progress of a production plan in offline simulation mode, while the real platform continues to operate. The 3D simulation is a crucial step which makes it possible, on the one hand, to validate the various organization options or to check the ordering of the modules, and on the other hand to prevent any type of dysfunction, such as collisions, inconsistencies, flows, etc… which constitutes an advantageous decision support tool. In the "interface 5" production control phase, the digital twin finds its full potential. The ascending data of the physical objects of the platform, via the MES, are placed in their context, and make the digital twin evolve in real-time under the same conditions as the physical object. As a result, engineers benefit from a multi-view interactive 3D visualization of the manufacturing process.
3D objects can display local contextualized information such as performance, rate, machine status, progress, failure, etc. it thus becomes easy to access manufacturing data locally or remotely, which opens the way to new perspectives in telecollaboration terms, in particular on topics such as predictive maintenance, robotics, industrial IT, etc. In this activity, we distinguish three descending data flows that can trigger actions at the platform level. "Production orders" type data activated or manually scheduled, "anomaly management" type data activated remotely, and finally "specific measures" type data activated by the MES. The portability feature of the digital twin makes it easy to view, share and manipulate the platform's data streams.

Architecture
Based on expectations in terms of functionality, performance, and management, we are initiating a process of overall architecture design. As shown in Figure 12, the definition of a new architecture is built by a nesting of 5 spaces. The first is reserved for the design process which must integrate a certain variability at the level of some product parameters. Digital continuity between the design phase and that of the industrialization and production phases will allow simultaneous global optimization of the product and its manufacturing process. The idea behind this approach is that the data generated during the production phase has the possibility of changing some design parameters, via on-board or remote intelligence, with the perspective of maximizing or minimizing a single-objective or multiobjective function. Take the example of an objective function that aims to minimize energy consumption during the machining phase. To this end, the optimization can relate to the variation in cutting speeds but also to the geometric variation of the member so as to minimize its passage over the energy-consuming machine. The digital continuity between design and industrialization and production can generate a very promising global optimization context [19,20].
The second area is dedicated to the import and recording of standard parametric operations. Basic operations are generated by specialized skills through specific tools. Certain operations must be encapsulated in order to make them compatible with the platform's control and command system. Take the example of the transfer function, one of the functions mentioned in Table 2, provided by 33 trajectories that cover almost all of the platform's needs. These trajectories have been programmed with parametric attributes by a specialized skill in order to feed a library of standard trajectories, which can be used by operators according to their needs. All basic operations should be imported and listed in this space before proceeding to generate an initial production plan.
The 3rd space (in blue) consists of two functionalities which will interact with the digital twin of the platform 4.0 for different reasons. The first feature allows you to design a flexible production master plan from various predefined modules. This so-called initial plan orders operations in a configuration that does not take into account the limits of the 4.0 platform. The point here is to allow yourself the possibility of having some components manufactured on other remote and interconnected platforms. The second functionality allows you to launch and manage a production plan. From its initial version, the production plan is adapted to the configuration and load plan of the platform and may be subject to optimization. In the production phase, management consists of supervising the execution of all production sequences and reacting with appropriate actions in the event of undesirable events, with a feedback of data and performance indicators that can be viewed through the digital twin. The right-hand side shows schematically the production system, characterized on the one hand by production machines and equipment connected to the controller and on the other by IIoT sensors connected to a local computer. The mass of data generated, through the design, industrialization, and production phases are located in a data lake with a gateway to the cloud. This architecture allows for cross-integration of data, for simultaneous optimization of the product and the production process.

Conclusion
In conclusion, the previous sections have given us an overview of what a digitalized production system can be. The research work we are currently carrying out on the platform 4.0 will allow us to develop, experiment, and formalize structuring methods and recommendations that will facilitate the digital transition in the scope of industrial production. The work presented in this article shows that MES play a primordial role in intelligent manufacturing processes. They also demonstrate that the notion of operational flexibility must be taken into account in the design phase of the advanced production control system. The modeling that we carried out showed the relevance of our methodological choices and research orientations. The perspectives consist in developing the autonomy of the "piloting" function as well as multicriteria production optimization algorithms.