Industry 4.0 Application in Manufacturing for Real-Time Monitoring and Control

: Modern manufacturing aims to reduce downtime and track process anomalies to make pro ﬁ table business decisions. This ideology is strengthened by Industry 4.0, which aims to continuously monitor high-value manufacturing assets. This article builds upon the Industry 4.0 concept to improve the ef ﬁ ciency of manufacturing systems. The major contribution is a framework for continuous monitoring and feedback-based control in the friction stir welding (FSW) process. It consists of a CNC manufacturing machine, sensors, edge, cloud systems, and deep neural networks, all working cohesively in real time. The edge device, located near the FSW machine, consists of a neural network that receives sensory information and predicts weld quality in real time. It addresses time-critical manufacturing decisions. Cloud receives the sensory data if weld quality is poor, and a second neural network predicts the new set of welding parameters that are sent as feedback to the welding machine. Several experiments are conducted for training the neural networks. The framework successfully tracks process quality and improves the welding by controlling it in real time. The system enables faster monitoring and control achieved in less than 1 s. The framework is validated through several experiments.


I. INTRODUCTION
Modern manufacturing aims to reduce downtime and track process anomalies to make profitable business decisions.This ideology is strengthened by the introduction of Industry 4.0, the fourth industrial revolution.It aims at continuous monitoring of high-value manufacturing assets [1,2].This article reports an Industry 4.0 application developed and implemented on a welding process.Welding leads to the joining of discrete materials into one component.This attribute makes quality assurance in welding essential.Conventionally, weld quality is determined by post-weld tests.These tests may be destructive or nondestructive; however, they are time-and capital-intensive and are performed offline [3].Instead, a network of sensors can be engaged for indirect monitoring, thereby creating a closed-loop feedback system from the sensory data [4].Industry 4.0 has brought network connectivity into manufacturing [5].It aims at telemonitoring, i.e., to transmit data to remote/cloud servers enabling the Internet of Things (IoT) [2].This article presents an Industry 4.0-enabled framework for continuous monitoring and feedback-based real-time control of an advanced welding technique named friction stir welding (FSW).In the following, the theory of FSW process is discussed first, and then state of the prior research is elaborated.The major contributions of this work are presented next.
FSW joins materials by frictional heating, mechanical deformation, and stirring [6].It involves a nonconsumable tool mounted onto the spindle of the welding machine.The rotating tool plunges into base materials, generating frictional heat and deforming the base materials plastically.Later, it travels over the weld joint line stirring the plasticized material.This fuses the materials, and a weld joint is formed.Because FSW does not melt the base materials, it is recommended for soft alloys such as aluminum, magnesium, and the like materials in both similar and dissimilar configurations [7][8][9][10].This welding process has multiple applications in ship building, railways, aerospace, and automobile sectors.Owing to the vast range of applications, real-time monitoring of the process is essential to ensure quality of the welds.
The prior research in this regard reports strategies developed for monitoring the welding process.Methods were devised to classify defective and defect-free welds using information derived from acoustic emission (AE), and longitudinal and transverse force signals [11,12].A few works presented methods to localize welding defects using AE, axial force, power, and spindle torque signals [12][13][14][15][16][17][18].Information derived from AE signal was also utilized in detecting voids in the weld joint line [19,20].A significant change in the energy of the signal was observed for welds with and without voids.Prior research also communicates about offline prediction of weld quality using features computed from force, spindle, and feed motor current signals [21].The outputs include prediction of ultimate tensile strength (UTS) and yield strength of welded samples.In addition to the data-driven methods proposed for weld quality prediction, prior research also presents use of data obtained from the physics-driven model to predict the weld quality.Grain size of the welded samples was predicted using strain, strain rate, and temperature modeled in a neural network [22].Grain size prediction was also achieved using a thermomechanical model with the same set of inputs, i.e., strain, strain rate, and temperature [23].While these studies present methods to judge the weld quality after the weld is fabricated, they do not provide a requisite measure that can be taken to avoid rejection of the weld.In other words, the prior research cites methods to monitor the welding process; however, they overlook the control action required to reduce the rejection or improve a weld in real time.
To address this challenge, a few authors proposed controlling the plunge depth (p) of the tool considering axial force as a feedback signal [24,25].The plunge depth marks the penetration of the tool's shoulder into the base metals to ensure a proper contact between them.A proportional integral derivative (PID) controller was employed for this task.A PI controller was implemented where rotational speed maintained the temperature [26].However, PID controllers do not perform well in uncertainties and often have a narrow range of stability.Nonlinearity exists in FSW, because the process involves transient events.The heat generated during welding process is influenced by speed at which the tool is rotating and also the linear speed of the machine bed.Increasing rotation of the tool or lesser linear speeds lead to excessive deformation of base metals.Thus, the reaction of the base metals to these movements decreases.Contrary, the reaction force increases if the tool rotation is insufficient or welding occurs at higher linear speeds.Therefore, these events are not steady and might change with fluctuations in the welding parameters.Hence, an adaptive PID controller was utilized to control welding speed by taking force as a feedback signal [27].The control systems tracking plunge depth of the tool may be unstable, leading to sudden tool plunging or withdrawal, resulting in welding defects [6].FSW is governed by welding speed and tool rotational speed which decide the amount of frictional heat and plastic deformation of the base materials.Hence, controlling both is crucial for the welding process.Besides, these studies rely on a single sensor, which may form a threat to the IoT systems.In this regard, data from multiple sensors were collected for real-time control of FSW [28].Discrete wavelet transform was applied on the signals to locate the welding defects and predict the weld quality using wavelet features.The developed framework was executed on a cloud server, which had a processing time of 8.53 s per batch of data for weld monitoring and control.This article presents an enhanced and accurate system that monitors and controls the welding process.Specifically, the analyses and results demonstrate meaningful information derived from the as-received signals and welding parameters in contrast to the wavelet coefficients.It also demonstrates the application of an edge device in addition to a commercial cloud server that reduces the computational time.Following are the major contributions of this article: • Application of as-received raw signals in FSW process for accurate prediction of UTS using a deep neural network (DNN).A high coefficient of determination, R-squared = 0.9999, is achieved by the deep learning model with a mean absolute error (MAE) of 0.10 only.Process control happens via the cloud server.With this improved framework, the feedback to the welding machine is achieved in less than 1 s.Thus, reliability and security are higher.
Base materials in FSW are placed side by side on the machine bed without any gap using suitable fixtures.The materials' surface may have undulations at the mating edge or inhomogeneity.Applications of FSW involve joining large structures.However, it is impossible to check their integrity.Besides, problems may occur in the welding machine.These may deviate the welding speed or tool rotational speed.Therefore, it is essential to monitor and control the process continuously.The remainder of the paper is organized as follows.Section II discusses the experimental details and the signals acquired during welding process.It also presents the monitoring and control system developed in this work.The results obtained from the analyses and justifications are presented in Section III.Results of the test experiments that validated the developed system are also presented in this section.Finally, the conclusions are presented in Section IV.

II. MATERIALS AND METHODS
This section lists the details of the welding experiments conducted for understanding the domain knowledge of FSW process.It also discusses sensor data collection and analytics.Following is the Industry 4.0 framework developed in this work.

A. TEST MATERIAL AND POST-WELD STUDY
Figure 1 depicts a schematic diagram of the welding process with workpieces fixed on the machine bed in a butt-joint configuration.The rotating tool (shown in black color) plunges into the workpieces (shown in blue color) resulting in frictional heating and plastic deformation of the workpieces.It is followed by the translation of the tool leading to the transport of plasticized material from one side to the other.For the present work, weld joints were fabricated on a numerically controlled FSW machine (WS004, ETA Bangalore).This machine operates in a displacement-controlled mode, wherein the plunging position is fed to the machine as an input, along with welding speed (v) and tool rotational speed (ω).The test material is an aluminum alloy, AA6061, measuring 100 × 80 × 3 mm.H13 steel-alloy tool was used to weld test plates in butt joint.The tool had a flat shoulder of 18 mm diameter, a conical-shaped pin of 6 and 4 mm top and bottom diameters, with a pin length of 2.7 mm.
The experimental combinations (ω and v) are mentioned in Table I.A full factorial approach was carried out, where each value of ω was combined with each value of v resulting in 42 experiments.During the experiments, the tool plunging depth (p) was kept constant for all the experiments.The value was 0.2 mm, and it ensured a proper contact between the tool and workpieces.The post-weld study determined the UTS of 42 welds.
Tensile test was performed as per ASTM-E8 standard, where a subsize specimen was selected.The test was performed in a universal tensile testing machine (Instron, 8862) at 1 mm/min strain rate.The UTS values obtained for the 42 welded samples are shown as a scatter plot in Fig. 2.
All the experimental observations are also listed in Table II along with the selected welding parameters.The UTS of the base material was 270 MPa.In the 42 welded samples, the highest UTS value was obtained as 249.3 MPa with the parametric combination of 1000 rpm (ω) and 200 mm/min (v).The lowest UTS value was 146.2 MPa with the parametric combination of 600 rpm (ω) and 200 m/min (v).It was observed that there is an increase in the UTS value when ω takes a lower value of 600 rpm, while v keeps increasing, starting from 40 mm/min to 100 mm/min.However, as the v value increases beyond 150 mm/min, the UTS values decrease remarkably.This is due to the poor material flow, which signifies that the available heat was insufficient for deforming the material plastically.The welded sample (ω = 600, v = 150, and ω = 600, v = 200) had several surface defects, and thus, lower UTS.
Further, a few experiments were also conducted at 500 rpm; however, the fabricated welds had several surface defects.Thus, the range of parameter selection was restricted to 600 rpm.For the other parametric combinations, for instance, at a higher value of ω, i.e., 2600 rpm, the UTS of the welds which are fabricated with different values of v is said to increase.In comparison to other values of ω, 2600 rpm is the highest, which indicates that frictional heat availability at this value would have been the highest as compared to other values.A few experiments were repeated for ensuring the results.

B. SENSING AND DATA COLLECTION
The welding machine is integrated with multiple sensors such as speed sensors for capturing the variation in v and ω, a load cell for capturing axial force (F z ) and spindle torque (M z ), and a power sensor for recording the total power (P) consumed during welding.The speed sensors installed on the machine are encoders that record rotational speed of the spindle and linear speed of the machine bed.The load cell is of strain gauge type, and a Hall effect-type power sensor was integrated externally.As communicated, the weld joints are created because of the pressure exerted by the tool resulting in heat and deformation.Therefore, Fz forms a crucial variable.In the event of any disturbance in the process, Fz is expected to vary.With variation in Fz, the torque experienced by the spindle will also vary.Therefore, these data were captured during welding experiments.Likewise, the power consumed by the welding machine would differ for a faulty setting.For FSW, welding defect is a fault which might occur because of improper settings.The details about the working principle of strain gaugetype load cell and Hall effect-type power sensor can be read from the cited work [29].For data collection, a virtual instrument (VI) consisting of a time-controlled 4:1 multiplexer was built.The VI refers to a logic circuit designed to select one of the several input lines to a common output line.Figure 3(a) shows the circuit of the multiplexer utilized in this study.The truth table and Boolean logic expression are shown in Fig. 3(b).
The data from the force, torque, and power sensors together with a marker value are inputs to the multiplexer.The marker signifies the completion of one complete set of data.The output from the multiplexer is linked with the input of the transmission control protocol (TCP) write block.From here, the data is sent to the next block for further processing.The machine input parameters, i.e., ω and v, are returned to the machine via the same protocol.LABVIEW VI obtains ω and v along with some markers to differentiate them, i.e., firstly, a 0 is sent as a marker followed by ω, and similarly, 1 is sent as a marker followed by v.The actual data acquisition rate is 10 Hz.However, there is a delay of ∼31 milliseconds in the multiplexer, which leads to an effective sampling rate of 8 Hz.
For 42 experiments, these sensors' data was collected.Figure 4 presents the variation in the acquired raw signals.
To represent ω and v together, feed per revolution (FPR) is considered, which is the ratio of v and ω. Figure 4(a) shows the correlation among UTS and rotational speed and FPR.Lower FPR produces welds with high UTS (> 210 MPa) and moderate UTS (180-201 MPa), whereas higher FPR gives rise to welds with lower UTS (< 150 MPa).FPR is low when v is less, and ω is high, the combination results in desirable frictional heating and plastic deformation of the base materials.However, the opposite condition results in low heat and deformation, resulting in defective welds.For these situations, the sensors' data also vary.F z lies in 6000-8400 N (Fig. 4(b)) and M z in 9-16 NM (Fig. 4(c)) for higher UTS.The variation is also expressed with FPR and UTS values, which shows sufficient segregation of welds.These plots indicate that the raw signals can be utilized to model UTS due to their close relationship.cloud server, and (c) use of a limiter.The real-time data acquired in the FSW machine is continuously fed to an edge device.The edge device is connected to the FSW machine via WebSocket using the TCP/internet protocol (IP).As the effective sampling rate is 8 Hz, data to the edge device is received in each millisecond interval.Each interval's data is fed to the DNN model (ML 1 ) residing in the edge device that predicts the UTS of the weld in real time.

C. MONITORING AND CONTROL FRAMEWORK
As data is sampled in millisecond intervals, UTS prediction also occurs in millisecond intervals.The decision box compares the predicted UTS value with a desired UTS value.If the predicted value is less than the desired UTS, the data is sent to the cloud.For making it more relevant to the industrial application, an instance of Google cloud server was utilized.The cloud server consists of another DNN model (ML 2 ), which predicts the modified parameters to achieve the desired UTS.The modified parameters form the feedback to the FSW machine.Instead of directly feeding the parameters, they are routed via the edge device.The edge device consists of a limiter that checks and determines whether the values are within the safe limits of the machine.In the next section, the results achieved are discussed.

III. RESULT AND DISCUSSION
This section discusses the results obtained by applying the proposed methodology.While the Pearson correlation evaluates the linear relationship between two variables, the Spearman correlation identifies the monotonic relationship.It is helpful because the variables need not change together at a constant rate.As the aim here was to determine the association of the variables/parameters with UTS, the Spearman correlation will be more helpful.This method is based on the ranked values for each variable rather than the raw data.

A. DATA ANALYSIS -CORRELATION
Figure 6 depicts the correlation maps obtained by employing the two methods.From the figure, ω, v, F z , and M z can be found to have a moderate relationship with UTS, and P has a weak relationship.The highest correlation was found with FPR.Despite the weak relationship exhibited by power, it can act as an alternative solution for the control scheme if the load cell fails or starts behaving erroneously.

B. IMPORTANCE OF DATA -NOISE AND VARIANCE IN SIGNALS
It is imperative to study the presence of noise in the signals.Raw signals might have random errors that imply unpredictable variations in the measured signals.This error is also referred to as noise, whose sources could be vibrations of the machine, fluctuations in incoming electrical power, electromagnetic radiation from nearby electrical equipment, etc.Therefore, it was imperative to study the presence of noise, i.e., variance and bias in the signals.Various filters were applied to the raw sensors' data: average filter, median  filter, Gaussian filter, Wiener filter, Fourier denoising, wavelet denoising, and Whittaker smoothing.It was assumed that the noise was additive.The average filter is a linear filter used to reduce additive shot noise.It takes a window sliding along the signal replacing the data value with the mean value of all the neighboring data values.The size of the sliding window (N) is an odd number.The median filter is a nonlinear filtering technique utilized for removing the additive noise of impulsive nature.It is similar to the average filter, excluding the fact that the median of the neighboring values alters the data value in this case.A Gaussian filter is a linear low-pass filter in the frequency domain, which convolves a Gaussian function over the signal.It is effective in removing Gaussian noise.The degree of smoothing is controlled by the standard deviation (σ).
Wiener filter is based on the statistical approach, and it works well for both additive and multiplicative noises.It assumes that the spectral properties (cross-spectral density between observed and original signal and power spectral density of the original signal) are known.The noise is considered to be uncorrelated with the signal.This filter tries to reduce the overall mean square error of the denoised data by comparing it with the original data.It is effective in removing Poisson noise, Gaussian noise, and Speckle noise from the signal.Fourier denoising is another filtering technique in the frequency domain where Fast Fourier Transform is applied to the data, and thresholding is done based on Donoho's method.Wavelet denoising refers to the time-frequency domain transform using wavelets to localize the signal features at different scales.Lastly, Whittaker smoothing was utilized, which smoothens the time series based on optimization of penalized least squares.It attempts to fit a curve that characterizes original data.The parameter λ is the smoothing factor.A cost-effective machine learning model, random forest, is developed with each set of filtered data to predict the UTS.The performance of these models developed with the filtered data is compared with the model built using the unfiltered data.Random forest regression model is chosen as it is popular for nonlinear modeling and takes less computational time with no local minima/maxima problems.The performance is compared in terms of MAE as presented in Table III.
Except for Fourier denoising, there does not exist a significant difference in MAE.Least MAE was obtained with Whittaker smoothing, which is not a substantial improvement from the MAE obtained using raw data.If this filter were utilized in real time, the cost and time invested in filtering signal would weigh more than the improvement in accuracy it provides.Fourier denoising provided a substantial improvement in MAE.But it is a frequency domain filter, so utilizing it in the model was not possible for denoising in real time.
It is important to identify the reason why the raw signal gives a better performance in the case of FSW.The probable reasons for the same could be (a) negligible vibration during  the welding and (b) negligible effect of other electronic components, etc.There might be other reasons for this as well, but they have not been the focus of this article.Further to explore the efficacy of the raw data over the processed data, principal component analysis was also carried out.As mentioned in the introduction, earlier research has shown the utility of the wavelet decomposition technique for localizing the welding defects in real time, where the detail coefficients were extracted from the signal [28].It comprised of a set of 35 detail coefficients, each of force, torque, and power, a total being 105.The raw data utilized in this study consists of five components, i.e., force, torque, power, ω, and v.
Figure 7(a) shows the plot of variance in the case of the wavelet coefficients, and Fig. 7(b) shows the same with respect to the raw data.It can be observed that close to 90% of the variance can be explained by only 2 components of raw data, while the same requires more than 20 components in the case of the processed data.Thus, the weld quality prediction can be better performed by using the raw data instead of performing further signal processing.This will ensure the timeliness of the monitoring and control system Thus, the database consists of the historical data of various welding jobs (42 numbers of experiments) performed at different process parameters, i.e., ω and v, corresponding sensors' data (i.e., force, torque, and power), and UTS values of each weld.FPR was not taken into consideration as the input parameters for welding consisted of ω and v only, and this was beneficial for real-time application.

C. MACHINE LEARNING
The application of a cost-effective ML model like random forest for predicting the weld quality is established in Section III.B.This model is developed using the unfiltered and unprocessed data, and its performance is determined to be equivalent to the models developed with the filtered data.This section discusses the development of DNN model for predicting the UTS using the unfiltered and unprocessed data.The performance of this model is compared with that of the random forest model.
Two DNN models are built: one (ML 1 ) for predicting the UTS and the second (ML 2 ) for predicting the modified parameters.These models are trained and tested offline and then are deployed in the scheme for real-time decisionmaking.ML 1 is deployed in the edge device and ML 2 in the cloud server.The dataset for training ML 1 consisted of five features, i.e., F z , M z , P, ω, and v, and UTS was the output.From the correlation map, it is observed that all the sensors' data are having a moderate degree of correlation with UTS.Therefore, all the contributing factors were considered in modeling.The dataset for ML 2 consisted of four features, i.e., F z , M z , P, and desired UTS, and ω and v were the outputs.A neural network tries to generalize a problem by learning a mathematical transformation between given inputs and outputs.The learning occurs in deep networks of the model having several layers and neurons.Because of their capability in generalizing a given problem, they are considered to be more robust than the shallow ML models.Therefore, the performance of random forest model and DNN model is compared.Also, an earlier research work developed neural network model for UTS prediction using filtered and processed data [28].Therefore, to compare the usefulness of employing unfiltered and unprocessed data, the architecture of the models proposed in [28] is considered.This includes hidden layers and hidden neurons in each layer.The modification was in the input layer only.The UTS prediction model consisted of 8 hidden layers and the other model for predicting the modified parameters consisted of 10 hidden layers, as presented in Fig. 8(a) and (b), respectively, with multiple neurons in each layer.The optimized architectures of ML 1 and ML 2 were obtained by applying genetic algorithm.
These models were trained with the unfiltered data recorded in this study by utilizing the backpropagation algorithm that employs the gradient descent method.The learning rate for ML 1 was varied from 0.001 to 0.00001, and for ML 2 , it was varied from 0.01 to 0.00001.The models were tuned using the Adam optimizer [30].The momentum coefficient was fixed as 0.9.The activation function is a scaled exponential linear unit that helps preserve the mean and the activation function.It preserves the mean and variance information from the previous layer making the neural net self-normalizing.It prevents the problem of vanishing gradients.
For training and testing of the models, a random split of 70% and 30% of the dataset was performed.The validation set was a part of the training data.In the model development process, a part of the data was always held back and the MAE was computed to determine the models' performance.The performance of the models was ensured to be adequate by testing on several portions of the training data.Finally,  These plots show the minimization of the loss with the increasing number of epochs during the training.The testing results for the model predicting UTS is depicted in Fig. 10, where the predicted UTS values are shown to correspond to the actual values.The metrics considered for evaluating the performance of the model are listed in Table IV.
A satisfactory MAE with a high R 2 value is obtained for the model.However, since multiple features are input to the DNN, the R 2 value can give a false impression.It is validated by evaluating the Adjusted R 2 , which in this case is 0.9994.It suggests the ability of the model to make accurate predictions.In comparison to prior research, the model developed in [28] has a mean absolute percentage prediction error of ∼4%, which is less than 1% with the DNN model developed in this work.
1) EDGE DEVICE -PROCESS MONITORING.An edge device is located at the edge of communication between a source of data generation and a server.In this work, it is between the FSW machine and the Google cloud server.This device usually has a low hardware configuration and is attached to the machine via some communication protocol.The purpose is to filter, analyze, or process the data locally, close to the point of generation.Manufacturing machines will generate a vast amount of data, and the data has to be analyzed to make intelligent decisions.The analyses can be entirely performed in a cloud server; however, the data must be continuously sent and received, requiring an uninterrupted high bandwidth.Therefore, an edge device proves beneficial to having a reliable system and preventing loss of data.It accelerates data streaming and helps in eliminating time lag.The edge device used in this work has a randomaccess memory (RAM) of 8 GB and 500 GB disk space and a Windows operating system.This computer accessed the FSW machine via the TCP/IP protocol, and they exchange data through WebSocket.As the welding starts, this device receives the sensors' data (F z , M z , and P) and the input parameters (ω and v) and feeds them to ML 1 for predicting the UTS.2) CLOUD SERVER -PROCESS CONTROL.The cloud server is an instance of Google Cloud with a RAM of 16 GB and 500 GB of disk space.It was connected with the edge device via TCP/IP but on a different port number.The cloud server consists of the ML 2 to predict the modified parameters.The sensory data is received here when the predicted UTS is lower than the desirable UTS value.While controlling the FSW machine for achieving a better weld is taken in the edge, the action is performed through this cloud.The model exploits the correlation to find the values of ω and v needed to achieve the desired value of the UTS.The predicted ω and v are sent back to the edge using the socket connection between the cloud and the edge based on the TCP/IP protocol.The edge acts as a relay between the cloud and the FSW machine, i.e., to transfer the feedback received from the cloud to the FSW machine.Edge performs a safety check using the predefined constraints on the parameters received as feedback from the cloud and ensures that the predicted values do not compromise the machine's health.
The employed FSW machine can accommodate v of 1000 mm/min and ω of 3000 rpm.The edge bounds ω in 600-2600 rpm and v in 35-200 mm/min.These were identified from the experiments.A set of experiments in this study was conducted at 2600 rpm, which produced satisfactory welds.Thus, 2600 rpm has been set as the upper limit.ω < 600 rpm is insufficient to plasticize the workpiece and, therefore, has been ignored.At the same time, no welding was performed at v > 200 mm/min.The lower limit (35 mm/min) avoids making the process slow, affecting efficiency.If ω is predicted to < 600 or > 2600 rpm, then 600 and 2600 will be sent to the machine, respectively.Similarly, if v is predicted < 35 mm/min or > 200 mm/min, then 35 and 200 will be sent, respectively.These constraints ensure that the motors of the machine are rotating within the safe values.

D. VALIDATION OF THE DEVELOPED SCHEME
Several experiments were performed to test the proposed framework.The results are presented in the following subsections.Tensile specimens were cut from the welded sample, and their UTS was determined to validate the scheme's results.However, one challenge here was that as the model detected the predicted UTS to be lesser than the desired value, it sent the data to the cloud to control the weld quality, which occurred in less than a second.But, the tensile specimen (as per ASTM E8) needs to have a width of 10 mm (subsize sample).Thus, it was decided to deal with the data in batches for validating the scheme to address this challenge.However, a constant batch size may not be capable of deriving acceptable results each time.Considering the continuous and constant length of the samples to be welded, it may work fine when v is chosen in small values.Still, when v is considerably high, the welding will finish instantly without even letting the scheme control the process during any anomaly.Therefore, an equation has been written for the dynamic batch selection, as shown in Eq. 1.
Batch size = 60 × 10 × 8 Initial velocity ðvÞ (1 where 60 is used for conversion of time to seconds, 10 corresponds to the width of the tensile sample for which the dynamic batch is being selected, 8 refers to the sampling rate of 8 Hz, and the initial velocity is the v with which the welding process begins, and the batch size is always an integer value. 1) REAL-TIME CONTROL OF WELD QUALITY -START-ING WITH OPTIMUM CONDITIONS.A sample was welded by selecting the following input parameters: 1400 rpm (ω) and 50 mm/min (v).These parameters were chosen randomly from the database.As per the database, this parametric combination produced a weld with a UTS of 199 MPa, which corresponds to ∼70% joint strength efficiency (shown as "Initial selection" in Fig. 11).However, to validate the developed scheme, 80% joint strength efficiency was fed to the system, which formed the desirable value.As the welding begins, the data is received in the edge device, which continuously predicts the UTS of the weld being fabricated.The picture of the welded sample is depicted in Fig. 11.As per Eq. 1, the batch size for this weld was 96.
Therefore, after collecting 96 data points, the scheme was fed with the next set of data points of F z , M z , P, ω, and v for predicting the UTS, which was less than the desired value (80% joint strength efficiency).Therefore, that corresponding batch of sensors' data was sent to the cloud server, which predicted the modified parameters as shown in Fig. 11: 1006 rpm (ω) and 49 mm/min (v) (shown as "Achieved result").The predicted UTS was 220 MPa which corresponds to 81.5% joint strength efficiency.This result is validated from the experimental knowledge base developed in this study.The closest parametric combination is 1000 rpm (ω) and 50 mm/min (v), which produced a weld sample with joint strength efficiency of 83%.
Figure 12 shows the corresponding sensors' data during the entire process.The maximum amplitude of F z and Fig. 11.Picture of the welded sample with achieved joint strength efficiency of 80% from the initial selection of 70% using the developed monitoring and control scheme.M z during the stage of "Initial selection" is ∼4000 N and ∼10 NM, respectively, which was a result of the selected process parameters, 1400 rpm (ω) and 50 mm/min (v).Upon detection, this resulted in modified parameters in real time, i.e., 1006 rpm (ω) and 49 mm/min (v), while the magnitude of force was ∼5000 N and torque of ∼12 NM.
In this manner, the framework is able to control the weld quality.Variation in power is not shown, since there was no significant change in the power signal.The reason for this could be its lower correlation with UTS, ω and v.This set was chosen to produce a defective weld, which was known from the created knowledge base.The defects can be seen in the figure (shown as "Initial selection").For this experiment, the scheme was fed with the desirable UTS to be 220 MPa, i.e., 80% joint strength efficiency.In this case, the batch size was 19 (Eq.1).As the welding began and the data was received, the model fed the machine with modified parameters, 1008 rpm (ω) and 60 mm/min (v), which has a UTS of 220 MPa (shown as "Achieved result").This predicted parametric combination avoided the welding defects in contrast to the initial set conditions. Figure 14 shows the corresponding variation in the sensors' data (F z and M z ) during the entire process.Huge fluctuations in the data can be observed for the selected initial combination.As highlighted, the combination of ω and v decides the frictional heating and plastic deformation.When these quantities are improper, defects will be produced.The sensors capture the effect of the welding parameters; thus, huge fluctuations are observed.However, post the control over the process in real time, there is negligible variation in the sensors' data, and a sound weld is produced.
As highlighted, the developed scheme always attempts to maintain the desired UTS.Industries may not have a fixed UTS value.In that case, the system can be fed with an upper and lower band of UTS values catering to industry needs.If the predicted UTS is out of that band, the batch of sensors' data and the mean of the lower and upper bounds can be sent to the cloud server for predicting v/ω.In this way, the system can maintain the UTS of the sample being welded in certain bounds.As the framework works on each data point, the control is achieved in less than a second.However, to test and validate the scheme model, a batch size has been selected here.For industrial applications, this batch size can be removed.

E. BENEFIT OF USING EDGE ALONG WITH THE CLOUD SERVER
The edge-cloud architecture provides a trade-off between the qualities of edge and cloud computations and attempts to derive the best from both.It utilizes the high computational power of the cloud system, which may simultaneously control many machines in a manufacturing industry.At the same time, it also uses the edge system attached to the individual machine for real-time data streaming and processing, which eliminates time lag while making the process real time.
In this manner, the presented architecture derives optimal results by harnessing the qualities of the blocks mentioned above.Figure 15 shows the throughput of the real-time data transmission between edge and cloud.It can be observed that the time taken for transmitting data to the edge device is always lesser than that of the cloud.Hence, it benefits by reducing time lag.The other advantage could be from the security perspective.Industries are concerned about sharing their data on a public cloud server.As the manufacturing data is limited within the edge device for monitoring, it ensures the security of the data.The data will only be sent over a public network in an anomaly in the process.

IV. CONCLUSION
An intelligent Industry 4.0 framework for continuous monitoring and feedback-based real-time control of defects in    the FSW process is presented in this article.The following are the major conclusions: • Raw signals carry adequate information that can be leveraged for online monitoring of the weld quality.In this study, the variance and bias in the data is assured by modeling the UTS using filtered and unfiltered data.

Figure 5
Figure 5 depicts the schematic representation of the framework consisting of welding machine and coupled edgecloud system.The major highlights of the framework are as follows: (a) use of raw signals, (b) use of an edge device and

Fig. 3 .
Fig. 3. Multiplex build in the VI: (a) circuit diagram and (b) Boolean expression and truth table.
The correlation matrix was determined to explore the signals' association with UTS.Correlation measures the extent to which two variables tend to change together.Two methods were considered for determining the correlation among the parameters, namely (a) Pearson and (b) Spearman.

Fig. 5 .
Fig. 5. Schematic representation of the framework for real-time monitoring, prediction, and feedback-based control of weld quality.

Fig. 7 .
Fig. 7. Plot of explained variance in case of: (a) processed data and (b) raw data.
the performance was ensured by computing on the unseen test data.The test data was completely new to the model and, therefore, a separate data for validation was not considered.The training and testing loss for the models predicting UTS and modified parameters are presented in Fig.9(a) and (b).

Fig. 9 .
Fig. 9. Plots depicting the training and testing loss: (a) UTS prediction model and (b) modified parameters prediction model.

2 )
REAL-TIME CONTROL OF WELD QUALITY -START-ING WITH DEFECTIVE CONDITIONS.
Figure 13  depicts the picture of another welded sample, the fabrication of which was initiated at 600 rpm (ω) and 250 mm/min (v).

Fig. 13 .
Fig.13.Picture of the welded sample with achieved joint strength efficiency of 80% from the initial selection of 50% using the developed monitoring and control scheme.

Industry 4 . 0
Application in Manufacturing for Real-Time Monitoring and Control

Table II .
Experimental observations

Table III .
MAE obtained in the ML model by using the filtered and raw datasets

Table IV .
Model evaluation • A cost-effective ML model like random forest predicts the UTS values using unfiltered or unprocessed data with a MAE of 0.1557 only.The neural network model trained on the unfiltered data is superior to random forest model and predicts UTS values with a MAE of 0.10 only.• Axial force and spindle torque are strong indicators of weld quality.Severe fluctuations are observed in these signals while welding with improper welding parameters resulting in defective welds.• An on-off type controller, as proposed in this study, can avoid defective welding conditions.It operates on a desired UTS value which is compared with the predicted UTS value.• Edge devices are essential for addressing time-critical manufacturing decisions.The edge-cloud system developed in this study reduces the throughput time compared to the use of cloud infrastructure only.