Modeling and assessment of the energy state of the technological system of mechanical processing when creating digital twins

. An approach to the construction of digital twins of the technological system for turning low rigidity parts and the assessment of the energy state of the technological system is proposed in this article. The creating of the digital twin models by differential equations allows to excide a time-consuming procedure for training neural networks. The results obtained are transmitted to the energy state assessment block. Calculations are performed to determine the power consumption between the moving parts of the machine and the cutting process. To determine the energy, we use the Hamilton equations. The developed modeling technique and the results of computational experiments will provide an operational and resource-saving mode of production in the machining process.


Introduction
One of the current trends in modern mechanical engineering is the active introduction of digital technologies in production within the framework of the "Industry 4.0" concept [1]. Many researchers consider the digital twin one of the most promising technologies of the modern world. The digital twin is an ensemble of mathematical models that reflect various aspects of the processing process and the state of the elements of the technological system, including the workpiece, and exchange data with each other and with the physical prototype object in real time [2; 3].
The tasks that are solved when several models are used together for a processing technological system relate to the issues of diagnosing and determining the state of the technological system, managing and monitoring the machining process, and optimizing system parameters [4]. The objects of these processes are equipment, machine tool, cutting tool, workpiece, the process itself.

Methods of research
Traditionally, methods of mathematical physics are used to create digital models of physical objects. A difficult task of the physical object modeling is presented as a set of boundary value problems for ordinary differential equations and (or) differential equations [5] in partial derivatives, for example, for the Euler-Lagrange, Navier-Stokes equations.
Unfortunately, traditional approaches to solving such problems -grid methods and finite element methods [6][7][8] do not have a number of important properties necessary for constructing digital twins.
Another approach seems to be more promising, when an adaptive model is built for each element of the target object, which can be refined and rebuilt in accordance with the observational data on the object. Based on the collected information obtained from the real process and as a result of simulation, decisions are made to correct the operation, processing modes.

Design of a digital twin of the technological system of turning process
The creation of a virtual environment of the real technological process goes beyond simple modeling, since it is based on the kinematics of the machine tool and the real parameters of a computer numeral control (CNC).
The CNC machine tool is composed of many interacting parts, such as the spindle, cutting tools, feed system, hydraulic system, electrical control system, control system, etc. Therefore, a multi-domain method for constructing the digital model is needed. When using modeldriven diagnostics and prediction, an error will be detected in one component or in other parts that affect that component if a measured or calculated value is out of range. As shown in the Fig.1, the structure of the digital twin (DT) contains the physical space, the digital space and the connection between them.
• In the physical space, the operating state of the device is collected by the control system using various types of sensors, such as a temperature sensor, a pressure sensor, a speed sensor, etc.
• In the digital space, the DT consists of descriptive and intellectual models. The main function of the descriptive model is to describe the geometric, physical and electrical nature of the technological system. The intelligent model of the DT stores and analyzes data on the working state, and then makes a decision using a machine learning algorithm.
The digital twin is a complete, individual prototype of the entire system, a new era in modeling and simulation [9]. Currently, multi-domain modeling and simulation methods consist of a programming interface, high-level architecture (HLA) and UML (Unified Modeling Language). The DTs allow to test programs in a virtualized environment. The virtual CNC follows the actual programmed toolpaths exactly and also determines the actual cycle time. When connected to a virtualized machine that closely matches the kinematics, the DT provides accurate verification without interrupting the ongoing production process [10,11].
The process of turning on the machine is performed as a result of a complex interaction of an elastic system, cutting and friction processes, processes in drive motors for feeding and rotating the spindle [12,13], which is schematically shown in Fig. 2. The presence of closed loops in the above diagram is due to the force interaction of the elements of the dynamic structure of the machine through its elastic system. For example, the cutting force deforms the elastic system of the machine and causes a change in the relative position of the tool and the workpiece, which entails a change in the section of the cut. Corresponding changes in the cutting force are reflected in the amount of deformation of the system, etc.
When developing a mathematical model of the TS, considered as a control object, the connection between the elastic system of the machine tool and friction processes can be neglected.

Modeling and controlling a technological system
Nowadays, an adequate description of the functioning and assessment of the technological system (TS) state are considered the main problem of the study. Such models can only be developed with a comprehensive consideration of the structure, purpose and function of the TS with their characteristics. With a reasonable degree of certainty, initial information and known methods of analysis should be converted into information about opportunities (about the current situation and prospects), using adequate basic models and analysis tools that meet the accepted criteria, by this function. Only such an approach to the implementation of the function of basic models allows the formation of active targeted actions in the research process, which guarantees, with a high probability, obtaining predetermined results. The interaction algorithm is shown in Fig. 3.
This algorithm reflects the hierarchical structure of modeling and the strategy for studying the processes of TS functioning with the help of adequate models and analysis tools that meet the accepted criteria [14].

Development of a mathematical model of the TS of turning parts
The primary task is the developing of TS mathematical description, which operates in dynamic modes. When modeling, it is necessary to take into account the relationship of parameters that provide real results in conditions of processing accuracy, which in turn leads to the problem solving of optimal control and energy state assessment of the technological process.
The purpose of this part of the study is to determine the parameters of TS functioning in turning of low rigidity parts based on the model of an elastic dynamic system.
To achieve this goal, the design and structural diagrams of the TS and the dynamic model of the TS control are developed, shown in fig. 2 (a, b). [12]  Based on fig. 4 (a, b), using the Lagrange equation of the second kind [15], a mathematical model of the TS for turning non-rigid parts has been developed: Where Т, П -kinetic and potential energies of the system; Ф -dissipative Rayleigh function; ϕ i , ϕ̇i -generalized coordinate and velocity of the system; Qi -generalized forces.
We determine the kinetic and potential energies and the dissipative Rayleigh function of the considered TS: The members of the Lagrange equations are defined as partial derivatives with respect to displacements, velocities, time, and generalized force: Where j1, j2 -moments of inertia of rotating masses TS; After determining the terms of the Lagrange equations, taking into account the driving moment and the moment of resistance, we obtain a mathematical model in the form: From these assumptions it follows that with a sufficiently large engine power, the law of motion of its rotor ϕ 1 (t) can be considered independent of the change in the moment of resistance Мp and inertia j2. Then, with a known dependence ϕ 1 (t) system (2) writes in the form The first equation of system (2) serves in this case only to determine the driving moment at which the given law of uniform motion of the motor rotor is fulfilled, i.e., the motion of the machined shaft with the reduced moment of inertia j2 can be considered as consisting of the main motion 1  and additional motion with the speed с  , which usually has an oscillatory character.

Mathematical modeling and evaluation of the energy state TS
In the TS one of the important tasks is the selection of energy, which makes it possible to execute the real process of shaping parts. Let us imagine this as a correction of the power of the change in the energy state of the system | Ng -Nc |  р, Where Ng -is specified power of the cutting process; Nc -is a calculated value of cutting power;  (0< <1)-small value. Power analysis allows further evaluation of the energy state of the process of machining parts [17].
In paragraph 3, mathematical models of the functioning of the TS in the process of shaping a shaft of low rigidity, described by the Lagrange equation of the second kind, were considered and to determine the energy of these movements, we turn to the Hamilton equations.
The dynamic Lagrange equation of the second kind (1) can be transformed to another form, obtaining from them equations that are called canonical. The idea of transforming the Lagrange equations of the second kind to the canonical form is as follows. Equations (3) form a system of n second-order equations with respect to n functions q i (t). The order of this system is 2n. To reduce equation (1) to the canonical one, instead of the Lagrangian variables q i and q̇i, the canonical variables q i and p i , coordinates and momentum, respectively, were introduced.
Legendre transform of a function ( , , ) i i L q q t  by variables q i is the Hamilton function for systems operating in the potential field of forces [18]: in which the value In our case, in addition to potential forces, nonpotential forces act on the system and, introducing canonical variables, we obtain equation (7) Equation (8) is the Hamilton equation for a non-conservative system. Let us find the total time derivative of the Hamilton function using equations (7). We get the identity 1 1 Thus, the motion of the vehicle will be expressed by the Hamilton equations [16,19,20].

Experimental results
Substituting the values of the angular velocities   i and moments of the driving forces and into (3.14), we determine the energy state of the TS for processing low-rigidity shafts that satisfies the formulated conditions (5), (15). The values and graphic dependences of the TS energy state during processing were obtained (table 1, fig. 5).  The numerical Runge-Kutta method was used in the calculations. The iterative process continues until all conditions are met. Thus, the obtained optimal parameters of functioning TS and the shaft being processed are issued for printing and transferred for the design of the technological process and processing on the machine with CNC. For this the obtained data of the geometric and structural characteristics of the machined shaft, processing conditions, functioning parameters of TS are displayed on the CNC.

Conclusion
The creation of digital twins of the technological system for processing parts, using an appropriate mathematical model, allows to increase the accuracy of the dimensions and shape of the workpieces, improve the technical and economic indicators of processing and enhance reliability of the TS normal functioning.
Based on the obtained parameters of functioning and equations of energy states, a power balance and an algorithm for controlling the change in energy state of the TS are established, which permits to determine the distribution of power in the TS. Energy balance between the executive body and the cutting force in the process of turning allows to significantly reduce the cost of material and energy resources.