Real-Time Torque Control and Industry 4.0 Integration of Industrial Hand Tools Using Artificial Intelligence
Abstract
In this study, a novel systenı has been develaped ta adapt legacy equipment widely used in industrial production lines ta Industry 4.0 standards. This research, which aims ta digitalize electro-mechanical hand tools used in critical assembly operations and integrate them with higher-level system software, presents an innovative approach based on the hybrid use of artificial neural networks and enıbedded systems. The develaped system can perform real-time torque level prediction by analyzing integrated data from multiple sensors, including voltage measurenıents, motor current readings, accelerometer data, and gyroscape measurements. The artificial intelligence component of the system consists of the integration of Long ShortTerm Memory (LSTM) models running on the server side and aptimized Multilayer Perceptron (MLP) models running on the embedded system. In tests conducted on a balanced dataset of 6000 samples, the LSTM model achieved an accuracy rate of 94.8%. Additionally, the embedded MLP model denıonstrated a 92.3% binary classification success with a response time lower than lOOms. The systenı integration implenıented using TCP/IP Open Protocol achieved network latency values below S0ms and successfully delivered 99.9% of data packets without loss ar corruption. The systrnı developed as a result of this study has denıonstrated that legacy equipment can be made compatible with Industry 4.0 with minimal hardware modifications, while automating quality control processes and establishing data-driven decision-malcing mechanisms. This approach stands aut as a cost-effective and scalable solution in industrial digital transfornıation projects.
1. Introduction
The Industry 4.0 transformation represents a critical paradigm shift in the digitalization and intelligent evolution of production systems. During this transformation process, the transition to data-driven decision-making mechanisms in production fields and the establishment of inter-equipment communication capabilities emerge as fundamental requirements. However, the inability of legacy equipment, which is still widely used in existing production lines, to adapt to this transformation constitutes a significant barrier in the industrial digitalization process.
The inability to acquire
• Manual execution of quality control processes
• Operator-dependent process control
• Inability to establish data-driven decision-making mechanisms
• Lack of real-time monitoring and intervention capabilities
This study aims to develop an innovative solution for upgrading legacy equipment ın industrial production lines to Industry 4.0 standards with minimal hardware modifications. The specific objectives of the project are as follows:
1. Implementation of artificial neural networks to enhance the intelligence of legacy electro-mechanical systems
2. Design of an optimized embedded system for real-time torque control
3. Establishment of integration with higher-level software systems (MES, ERP, ete.)
4. Automation of quality control processes
5. Provision of a brand-model independent, scalable solution.
1.1.Literature Review
The integration of legacy industrial hand tools into Industry 4.0 systems through artificial intelligence (Al) and embedded systems yields significant benefits. Particularly, the utilization of embedded controllers such as Raspberry Pi-based Embedded Smart Box enables legacy machines to acquire operational
in terms of real-time torque control in industrial hand tools, LSTM and embedded MLP models complement each other through their distinctive advantages in processing dynamic system behaviors and computational efficiency. LSTM networks demonstrate superior performance in capturing temporal dependencies and managing input sequence uncertainties, which is crucial for adapting to sudden changes in torque requirements during operation [6]. Conversely, embedded MLP models integrated into Model Predictive Control (MPC) frameworks enhance computational speed and optimize memory usage by enabling real-time implementation without complex online optimization [7]. The combination of LSTM's capability to predict long-term dynamics and MLPs' efficiency in executing control commands demonstrates enhanced torque tracking performance, as evidenced by reduced prediction errors in hydraulic systems [8]. This powerful synergy not only improves the transient response of control systems but also provides reliable performance under variable operating conditions [9] [10].
The process of integrating legacy equipment with Manufacturing Execution Systems (MES) and Enterprise Resource Planning (ERP) systems, while offering significant advantages, also presents certain challenges. The primary benefit of this integration is enhanced operational efficiency and
The synthesis of findings clearly indicates that the convergence of AI technologies and embedded computing systems generates substantial technological and operational benefits in modernizing legacy industrial assets for Industry 4.0 compatibility. This methodological approach to integration, specifically characterized by the complementary application of LSTM and MLP algorithmic structures, represents an economically prudent and sustainable mechanism for digital transformation, maximizing performance optimization while requiring minimal physical infrastructure alterations.
2. Methodology and Technical Details
The proposed methodology is constructed upon an integrated system architecture encompassing
Server systems, positioned as the central component of the architecture, serve as the primary platform where
The NGP panel is designed as an interface where human-machine interaction is optimized. This panel facilitates the monitoring of operational processes through realtime
The intelligent tightening unit constitutes the fundamental component at the operational level of the system. While this unit performs


The system architecture illustrated in Figure 1 visualizes the data flow and interaction among three fundamental components. The central server (server) system establishes bidirectional communication with the intelligent tightening unit through the NGP panel. The data flow from the server system to the NGP panel encompasses the transmission of work orders and sharing of computational models, while the flow from the NGP panel to the server facilitates the reporting of operational
the process based on the results. The secondary analysis process presents a parallel
The primary rationale for selecting the LSTM (Long Short-Term Memory) model in this system is based on the time series characteristics of screw tightening operations. The temporal variations in voltage, motor current, accelerometer, and gyroscope data during the tightening process constitute a sequential and interdependent
This integrated system architecture presents a cyclical and adaptive framework that enables the effective utilization of machine learning algoritms in industrial applications. Control points and feedback mechanisms ensure continuous system optimization and performance enhancement.
2.1.Data Collection and Dala Characteristics
The data collection process initiates with real-time


Data Characteristics
• Voltage: This parameter represents the instantaneous voltage drawn from the battery serving as the power source for the intelligent tightening device. Voltage values serve as an indicator of the device's energy utilization and performance, and are crucial for examining power fluctuations during the tightening operation.
• Motor Current: Motor current measurement reflects the instantaneous electrical current consumption of the intelligent tightening device's motor. This provides information about motor load and operational efficiency, and is utilized to evaluate the motor's power consumption and performance under mechanical load.
• Accelerometer Measurements (AC[X, Y, Z]): Accelerometer data encompasses instantaneous acceleration measurements detected by the intelligent tightening device along the X, Y, and Z axes in three-dimensional space. These acceleration data enable dynamic analysis of the device's position and movement, and are significant in identifying vibrations and impacts occurring during the tightening process.
• Gyroscope Measurements (GYRO[X, Y, Z]): Gyroscope data measures the rotational movements (angular velocity) of the device around the X, Y, and Z axes. These measurements are essential for understanding the device's rotational dynamics and are utilized to evaluate their effects on the precision and stability of the tightening operation.
• Target Variable (Label): Our target variable is the real-time value of torque applied by the drill ("Torque_Degree"). This value is labeled with data collected during different operational stages of the drill. Separate data files have been created for each operational stage and stored with nomenclature such as "stage_l.csv", "stage_2.csv". This labeling methodology has been implemented for a total of 12 different stages, with each file containing sensor readings associated with torque values for the respective stage. This configuration provides a systematic foundation for our machine learning model to learn and generalize torque stage predictions for each stage.
Each of these parameters has been collected to construct a comprehensive profile of the tightening operation and provide critical data points for optimization. The resulting dataset enables in-depth analysis of the device's mechanical and electrical responses d uring the tightening process.
2.2.Data Preprocessing
Our detailed examination of the dataset and experimental testing revealed that 'Voltage', 'Motor Current', 'X_AC', 'Y_AC', and 'Y_GY' values demonstrate significant influence on torque during the tightening process. in light of these findings, preprocessing steps were implemented to ensure our algorithms exhibit particular sensitivity to these values. Consequently, the precision of the artificial intelligence model used in torque stage prediction was enhanced, yielding more accurate results. in the current dataset, the similarity between data points detected at the 'first trigger' moment and values during idle state presents a significant challenge for the model's discriminative learning capacity. This situation necessitates appropriate handling of outliers and noise in the dataset. By adding a column indicating the 'first trigger' moment to the dataset, we aimed to explicitly mark these special moments and incorporate this information into the model's learning process. This approach has facilitated the model's ability to learn the distinction between trigger-moment and non-trigger-moment
The
The reliability of analyses in the dataset and the accuracy of the model's time series predictions depend on proper management of
2.3.Model Selection
Witin the scope of this research, various machine learning and deep learning models were evaluated to optimize compatibility with dataset characteristics and targeted objectives. Among the evaluated architectures, Long Short-Term Memory (LSTM) networks, Convolutional Neural Networks (CNN), and Artificial Neural Networks (ANN) emerged as prominent candidates. The LSTM architecture demonstrates superior performance in time series
CNN represents an architectural paradigm predominantly employed in image processing and classification tasks. Within the framework of this study, the CNN architecture was experimentally implemented specifically for feature extraction from unstructured
The implementation of ANN was evaluated specifically for its capacity to detect and model complex and non-linear relationships within the dataset. While the model offers comprehensive feature extraction and classification capabilities across both structured and unstructured



The model selection process was conducted in accordance with project requirements and dataset characteristics. The LSTM model was ultimately selected due to its demonstrated capability in learning long-term dependencies within temporally varying data structures.
2.4. Model Training Results and Assessment
The training phase was executed implementing three distinct neural architectures: Long Short-Term Memory (LSTM), Convolutional Neural Networks (CNN), and Artificial Neural Networks (ANN). Comparative analysis of training results demonstrated that the LSTM architecture achieved superior performance metrics and accuracy levels relative to alternative models. The training progression and model performance are visualized in Figure 4, which depicts the temporal evolution of both loss function convergence and accuracy metrics. Figure 5 presents the Receiver Operating Characteristic (ROC) curve analysis, providing a comprehensive evaluation of the LSTM model's classification performance across various discrimination thresholds.

Analysis of the confusion matrix visualization presented in Figure 6 reveals that the LSTM architecture demonstrates superior discriminative capabilities, characterized by minimized misclassification occurrences and enhanced performance equilibrium across classes. The quantitative accuracy metrics obtained during the training phase corroborate the LSTM model's superior performance, yielding the highest validation scores among the evaluated architectures. These empirical findings provide robust evidence supporting the selection of the LSTM architecture as the optimal methodological approach for time series analysis and torque stage prediction in this application domain. The model's balanced performance across classification categories further validates its efficacy in managing the inherent complexities of temporal sequential data in torque prediction tasks.

2.5. Embedded Software Development
The embedded software development process was configured for processing sensor data and predicting torque 'OK' or 'NOK' states utilizing the Multi-Layer Perceptron (MLP) model. Initial implementations leveraged pre-existing libraries such as TensorFlow; however, limitations in this approach became apparent through experimentation.
TCP/IP protocol represents a communication model enabling network-based data exchange for embedded systems. This protocol ensures reliable and sequential delivery of data to intended destinations. The implementation of TCP/IP in embedded systems facilitates functionalities such as remote monitoring, control, and configuration capabilities.
The communication between embedded systems and central control units via TCP/IP prominently features the sharing of work order status information. This information exchange enables the central control unit to monitor work order status in connected systems in real-time and intervene when necessary. The central control unit transmits work orders to embedded systems via TCP/IP protocol, encompassing task specifications and parameters. Embedded systems retum status information obtained during work order execution to the central control unit. These status updates may include information regarding successful task completion and error occurrence. Upon detection of any error or unexpected condition, embedded systems immediately transmit error notifications, enabling system administrators to implement rapid intervention and necessary corrective measures.
Open Protocol represents a widely adopted standard among industrial communication protocols, particularly in assembly lines and automation systems. The implementation of Open Protocol in TCP /IP communications ensures standardized interdevice communication, enabling interoperability among equipment from different manufacturers. This protocol facilitates operations such as work order transmission, status updates, and error management, establishing a more efficient communication environment and ensuring compliance with industrial standards, providing significant advantages in embedded software development processes.
Kalman fil ter technology was utilized to enhance sensor data accuracy and reduce noise effects. This approach enabled system operation based on more stable and reliable data by filtering random noise from raw sensor data. The Kalman filter provides precise and current state information, particularly in dynamic and uncertain environments, by effectively predicting temporal variations in sensor data. This methodology represents a critical component significantly improving the overall performance of the study.

Although machine learning libraries such as TensorFlow and TinyML theoretically present suitable solutions for embedded systems and production processes where rapid response times are critical, the expected performance and efficiency levels could not be achieved in practice. The implementation of these libraries in embedded systems led to unacceptable delays in critical parameters such as processing speed and response time, and memory management issues due to incompatibility with limited memory capacity. This situation created significant barriers to the effective execution of machine learning models in embedded systems, particularly adversely affecting system performance in production processes where processing time and speed are crucial. Consequently, the advantages promised by libraries such as TensorFlow TinyML failed to provide the expected benefits in resource-constrained environments and speed-critical applications.
The development of the customized MLP architecture encompassed the following steps (Figure 7):
1. Requirements Analysis: The processing capacity and memory utilization requirements of our embedded system were meticulously analyzed. This analysis enabled clear identification of system constraints and performance requirements.
2. MLP Architecture Design: An MLP architecture optimized for embedded systems was designed. This design incorporated the minimum necessary number of neurons and layers, minimizing memory usage and computational load while maximizing model prediction performance.
3. Software Optimization: The MLP model was implemented using low-level programming languages to operate directly on hardware within the embedded system. This approach minimized processor cycles and memory accesses while increasing processing speed.
4. Memory Management: Memory utilization in the embedded system was carefully managed to reduce the memory footprint of
5. Testing and Validation: The developed MLP model underwent comprehensive testing with real-world
The integration of the customized MLP architecture resulted in the following system improvements:
• Response Time: The system was accelerated to process sensor 
• Memory Optimization: The model was optimized to operate within the constrained memory spaces of embedded systems, thereby eliminating memory-related issues.
Given the inherent memory capacity limitations of embedded software systems, the computational process for torque stage degree prediction is implemented in a hierarchical upper-level system rather than the constrained embedded environment. When binary torque classifications ('OK' or 'NOK') are acquired from the embedded board and transrnitted to the superior system architecture, they are conveyed in conjunction with a temporal sequence of the five preceding values to facilitate LSTM algorithmic processing (Figure 8). This architectural decision optimizes resource allocation while maintaining the temporal sequence analysis capabilities essential for accurate torque prediction.

The adopted architectural approach successfully navigates the inherent constraints of embedded system memory and processing capabilities, establishing an efficient equilibrium between rapid response requirements and computational intensity. This methodological framework enables dual optimization of resource utilization and operational parameters, resulting in enhanced production process reliability and efficiency metrics. The implementation demonstrates the efficacy of hierarchical task distribution in managing complex industrial computing requirements.
3. Results
In this study, an innovative system was successfully developed to adapt legacy equipment used in industrial production lines to lndustry 4.0 standards. Following experimental studies and field implementations, system performance was evaluated across various parameters.
in the performance evaluation of artificial neural network-based models, the LSTM architecture demonstrated high success in torque stage prediction, achieving an accuracy rate of 94.8%. This result was validated through comprehensive testing on a balanced dataset comprising 6,000 samples. The optimized MLP model operating on the embedded system achieved a 92.3% success rate in binary classification while maintaining response times below l00ms. These performance metrics meet the speed and accuracy criteria required for industrial applications.
From a system integration perspective, the communication infrastructure implemented using TCP /IP Open Protocol operates with latency values below 50ms and achieves a 99.9%
The efficacy of the developed system in industrial applications was evaluated in terms of quality control process automation and real-time torque control. The modular system architecture, requiring minimal hardware modifications, distinguishes itself with adaptability to different brands and models. Integration with higher-level software systems (MES, ERP, ete.) was successfully achieved, opera tor dependency was miniınized, and process control was automated.
The system's compatibility with industrial protocols was tested and verified to operate seamlessly with various communication standards. Results obtained in the systematic management and tracking of work orders indicate that the system enhances operational efficiency in production lines. These findings validate that the developed system can serve as a cost-effective and scalable solution in industrial digital transformation projects.
All these findings obtained through experimental studies demonstrate that the proposed system can be successfully implemented in industrial applications and provides an effective solution for Industry 4.0 transformation. The consistent and high performance of the system across different parameters supports the industrial-scale applicability of the developed solution.
4. Discussion and Conclusion
This study presents an innovative approach to the integration of artificial intelligence and embedded systems in the Industry 4.0 transformation of industrial production systems. The system developed through experimental studies emerges as a cost-effective and scalable solution for the modernization of legacy industrial equipment. The findings demonstrate that the hybrid utilization of LSTM and MLP models achieves notable success in real-time torque control and process optimization.
The potential impact of this research in industrial applications is particularly noteworthy in terms of achieving digital transformation while preserving existing infrastructure. The developed methodology presents a holistic approach that addresses fundamental challenges encountered in the industrial digitalization process, beyond merely offering a technical solution. This approach provides a systematic framework that can serve as a reference in similar transformation projects and establishes a methodological foundation for future research.
In subsequent phases of the research, expansion of the system's functional capacity is planned. Within this scope, priority objectives include the implementation of predictive maintenance algorithms, development of energy consumption optimization modules, and enhancement of cybersecurity protocols. Interface developments aimed at improving user experience are also among the planned initiatives.
To enhance the system's industrial applicability, development of adaptation capabilities for different production processes is targeted. In this direction, integration of next-generation sensor technologies, implementation of alternative industrial communication protocols, and elevation of integration levels with loT platforms are planned. These developments are considered strategic steps that will enhance the system's applicability and effectiveness within the industrial ecosystem.
References
[1] Fan, Y. C., & Cha11g, J. Y. J. (2018). Embedded smart box for legacy machines to approach to I 4.0 in smart manufachıring. I11 MATEC Web of Confere11ces 0/ol. 185, p. 00027). EDP Scie11ces.
[2] Dini, P., Diana, L., Elhanashi, A., & Sapo11ara, S. (2024). Overview of AI-Models and Tools in Embedded IloT Applications. Electronics, 13(12), 2322.
[3] Chaurasia, A., Parashar, B., & Kautish, S. (2023). Artificial I11tellige11ce and Automatio11 for I11dustry 4.0. 111 Computatio11al Intellige11ce for Modern Busi11ess Systems: Emerging Applications and Strategies (pp. 357-373). Singapore: Springer Nahıre Singapore.
[4] Korodi, A., Nitulescu, I. V., Fülöp, A. A., Vesa, V. C., Demian, P., Braneci, R. A., & Popescu, D.(2024). Integratio11 of Legacy I11dustrial Equipme11t in a Building-Manageme11t System I11dustry 5.0 Sce11ario. Electro11ics, 13(16), 3229.
[5] Kwok, T. H., & Gaase11beek, T. (2023). A productio11 i11terface to enable legacy factories for industry 4.0. Engineering Research Express, 5(4), 045019.
[6] I11anc, E., Gurses, Y., Habboush, A., Yildiz, Y., & Annaswamy, A. M. (2023). Neural 11etwork adaptive co11trol with 1011g short-tem1 memory. arXiv preprint arXiv:2301.02316.
[7] Adhau, S., Patil, S., Ingole, D., & S011awane, D. (2019, December). Embedded implementatio11 of deep learning-based linear model predictive co11trol. 111 2019 sixth Indian co11trol confere11ce (ICC) (pp. 200-205). IEEE.
[8] Tcheumchoua, K. B., Nam, S., & Chung, W. K. (2022, October). Torque Co11trol of Hydraulic Pressure Servo Valve Drive11 Achıator with Deep Netıral Network. In 2022 IEEE/RSJ I11ternatio11al Co11fere11ce 011 I11telligent Robots a11d Systems (IROS) (pp. 12512-12519). IEEE.
[9] Shan, F ., & Li, B. (2023, October). Developme11t of virhıal motor i11tegrated state platfom1 based 011 data drive11 and LSTM. In Sixth I11ternatio11al Confere11ce 011 Computer Infom1atio11 Scie11ce and Applicatio11 Tech11ology (CISAT 2023) (Vol. 12800, pp. 1564-1570). SPIE.
[10] Mojica, F., Villasefior, C., Alanis, A. Y., & Ara11a-Daniel, N. (2019, November). Lo11g short-tem1 memory with smooth adaptatio11. In 2019 IEEE I11ternatio11al Auhının Meeting 011 Power, Electronics and Computing (ROPEC) (pp. 1-6). IEEE.
[11] Ma, C., & Molnar, B. (2019). A Legacy ERP System I11tegratio11 Framework based 011 Ontology Learning. In ICEIS (1) (pp. 231-237).