# Control Force Compensation and Wear Monitoring of Variable Stiffness Joints in Drive Machining Process

Authors: Yanchen Wu
Journal: Mathematical Problems in Engineering
 (2021)

---

## Abstract

Aiming at the joint flexibility and wear state existing in the process of driving mechanical parts, this paper first proposes a stiffness and position decoupling control method for variable stiffness joints, which realizes the joint position control and the unity of joint compliance. The joint stiffness model was obtained by using the static relationship between the Jacobian matrix and the model, and the nonlinear equations composed of the mechanical model and the stiffness model of the variable stiffness device were solved by the optimization method to realize the nonlinear decoupling of the stiffness and position of the variable stiffness joint. Secondly, this paper proposes an online monitoring method of wear state in the machining process based on machine tool information. In this method, OPC-UA communication technology was used to collect and store the information of CNC machine tools online, and the internal process information related to the wear of the machine tools was obtained. Based on such information and the corresponding wear information, a wear state recognition model is established by using a convolutional neural network. The feasibility and effectiveness of the proposed compliance control scheme and the performance of online monitoring of wear condition are analysed and verified by simulation experiments.


---

## Body

## 1. Introduction

In order to achieve high motion precision, large load capacity, and easy-to-implement tracking control in traditional industrial machining, high-rigidity joint drivers are usually used [1, 2]. The rigid drive can move to a specified position or track a predefined trajectory. Once a position is reached, the drive will remain in this position regardless of changes in external force. This driver has high bandwidth, high precision, and excellent trajectory tracking ability. However, it cannot adjust the stiffness at any time according to the specific situation, the working mode is rigid, the working space is fixed, and it cannot adapt well to the complex and changeable environment. It is easy to cause safety problems in cooperation with humans [3, 4].Passive compliance is usually the use of elastic devices to increase the safety of the machine and the environment or to improve sports performance [5, 6]. However, since the elastic device itself does not have the control capability, it is difficult to achieve precise positioning and force control at the same time. Active compliance usually controls the relationship between contact force and contact displacement through force feedback [7, 8] to achieve active safety in machining. According to the different control methods, it can usually be divided into impedance control, force/position hybrid control, adaptive control, and intelligent control. However, all of the above control methods have certain limitations, such as complex calculations and limited application scope. Especially as the physical human-computer interaction between the machine and the user increases, the rigidity required for machining continues to decrease, and the torque sensor sensitivity continues to increase, resulting in increased system instability.Mechanical variable stiffness joints can solve the above-mentioned problems well and have received more and more attention [9–12]. They can usually be divided into two forms: parallel and series. In the series form, the variable stiffness component and the stiffness drive motor are usually located at the output end of the joint, which increases the mass and inertia of the joint output end, especially when constructing a multidegree-of-freedom variable stiffness joint, which further limits the stiffness change ability of the joint. Parallel connection adopts an antagonistic driving method similar to skeletal muscle, in which the variable stiffness module and the drive module can be installed separately from the output end of the joint and installed at the input end, which can greatly reduce the mass and inertia of the output end. The drive parallel variable stiffness joint structures designed by previous scholars are mostly disc-shaped joints with variable stiffness spring mechanisms arranged symmetrically on both sides [13–15]. Since its mechanical characteristics do not change with the change of joint position, the decoupling control method of its position and stiffness is not suitable for bionic or multifree parallel joints. Awad et al. [16] designed a variable stiffness elastic passive machine joint. Fosch-Villaronga and Heldeweg [17] made in-depth explorations on the key technologies related to the jumping robot. Yang and Wang [18] developed a new type of elastic drive joint. They applied a flat torsion spring to this drive joint to improve the energy storage characteristics of the joint. Quintero et al. [19] designed an ankle joint with a series elastic actuator based on the idea of bionics and did a specific study on its performance. Jing et al. [20] developed an elastic joint with dual stiffness characteristics that can reduce the impact from the ground when the robot is walking. In addition, Barbieri et al. [21] developed a modular drive unit that can be installed on robot joints. The reducer to drive the movable pulley block to move up and down, drive the movement of the wire rope and drive the joint to rotate through the output device decelerates the motor. The device adopts the structural design of the movable pulley block, which can increase the output force. Because of the modular design, it can be easily installed on the robot joints.Experienced processing personnel to estimate wear conditions based on processing noise, colour, vibration, and time mainly use traditional wear status monitoring. This method relies on human experience and is not conducive to promotion [22, 23]. In order to realize online monitoring of wear status, many advanced condition-monitoring methods have been proposed [24–26]. Some advanced signal processing methods and machine learning technologies are also widely used in online or offline wear status monitoring. Image recognition is the earliest method used to identify wear status. It uses advanced optical equipment to record wear images online to detect wear status. With the development of machine learning technology, the image information of the wear area is also used to train the prediction model. Although this method can predict intuitively monitor the wear state, the processing environment easily affects the sensor, and the image transmission will affect the recognition speed. Cao et al. [27] obtained the internal process information of the machine tool related to wear by collecting the information of the CNC machine tool and established the wear state recognition model by using the convolutional neural network. Kong et al. [28] combined principal component analysis with a least squares support vector machine (LS-SVM) model for feature extraction of multisensor signals and predicting the state of the broaching process. Paraschiakos et al. [29] collected force signals, vibration signals, and acoustic emission signals in the cutting process, studied, and proposed an improved grey hidden Markov prediction model, which achieved accurate prediction of wear status and life.Aiming at the problems of joint flexibility and wear state, this paper firstly proposes a stiffness and position decoupling control method suitable for driving variable stiffness joints, which realizes joint position control and at the same time realizes the unity of joint compliance. Secondly, this paper proposes an online monitoring method of wear status in the machining process based on machine tool information. This method uses OPC-UA communication technology to collect and store the information of CNC machine tools online to obtain the internal process information of the machine tools related to wear. Based on this type of information and corresponding wear information, a wear status recognition is established using convolutional neural networks.


## 2. Related Theoretical Knowledge

### 2.1. Joint Mechanical Structure

The reference coordinate system is the same rotation axis as the joint rotation coordinate system Aa1b1, and the reference coordinate system is fixed on the body. The operating arm coordinate system Ba2b2 is located at the end of the operating arm.The pulling force isei. The instantaneous arm of the pulling force is fi. The gravity of the operating arm is G. The instantaneous force arm in the direction of gravity is gG.The gravity and tensile force of the operating arm have the following static balanced relationship:(1)e1×f1+e2×f2−G×gG=0.Suppose that an infinitely small torqueR acts on the operating arm to cause an infinitely small rotation Q of the operating arm.(2)RQ=∂e1∂Q×f1+∂e2∂Q×f2−G×∂gG∂Q.Among them,R/Q is the stiffness H of the operating arm.The corresponding relationship between the elongationL and the joint rotation angle Q can be obtained by the position transformation of the rigid parallel machining parts. Deriving the two ends of the pose change, the corresponding relationship between velocity v = [L1 × L2] R and joint velocity Q can be obtained.(3)v=J_matrix×Q.Among them, J_matrix is the Jacobian matrix fromQ to L. Substitute the parameters into the above formula to get the following:(4)J_matrix=a1b1a2b2sinQ−a0b0cosQa1b12+a2b22+a0b02−2a1b1a2b2sinQ+a0b0cosQ1/2,−a1b1a2b2sinQ+a0b0cosQa1b12+a2b22+a0b02−2a1b1a2b2sinQ−a0b0cosQ1/2.After finishing formulas (2) to (4), the relationship between the stiffness HQ of the operating arm and the stiffness h1 and h2 of the two variable stiffness devices can be obtained.(5)HQ=J_matrixTh100h2J_matrix.The mechanical model of the permanent magnet variable stiffness device is linearly fitted to obtain the relationship between tensile force and elongation used in this paper.(6)E=0.002∗L4−0.027∗L3+0.088∗L2+0.561∗L+1.098.In the formula,E is the pulling force and L is the elongation.


### 2.2. Analysis of Wear Mechanism

The amount of wear increases with the extension of wear time, and the wear rate mainly depends on the material and speed. However, experiments show that the wear process under different conditions is basically similar and can be divided into three stages: initial wear, normal wear, and sharp wear. By monitoring the changes of parameters, the status can be monitored. Therefore, phenomena or parameters related to the operation of the machine tool can be used as the basis for monitoring the wear status. Force is the variable that best reflects the state of the processing process and is very sensitive to wear. When wear occurs, the geometric parameters will change, resulting in a decline in performance, causing the friction between the work pieces to rise rapidly, and it is easy to be detected.In the internal data of the machine tool collected by OPC-UA, the spindle load, spindle torque, and current are all closely related to the actual force. In this paper, the monitoring of the wear state is achieved through these data with a strong correlation with force. In actual production and processing, the amount of wear is greatly affected by various factors, and there are often situations where the actual amount of wear does not change after processing for a period. In addition, in the process of measuring the amount of wear, the wear area selected by the measurer is not completely the same every time, resulting in the measured amount of wear being greatly affected by human subjective factors, and only the ideal wear amount data able to establish an effective wear prediction model. For real processing, according to the required processing quality, the processed parts have only two states: normal and blunt. Therefore, the wear state prediction established in this paper will be divided into two categories to predict wear state. Figure1 shows the wear monitoring program proposed for this research.Figure 1
Online wear monitoring program.


## 2.1. Joint Mechanical Structure

The reference coordinate system is the same rotation axis as the joint rotation coordinate system Aa1b1, and the reference coordinate system is fixed on the body. The operating arm coordinate system Ba2b2 is located at the end of the operating arm.The pulling force isei. The instantaneous arm of the pulling force is fi. The gravity of the operating arm is G. The instantaneous force arm in the direction of gravity is gG.The gravity and tensile force of the operating arm have the following static balanced relationship:(1)e1×f1+e2×f2−G×gG=0.Suppose that an infinitely small torqueR acts on the operating arm to cause an infinitely small rotation Q of the operating arm.(2)RQ=∂e1∂Q×f1+∂e2∂Q×f2−G×∂gG∂Q.Among them,R/Q is the stiffness H of the operating arm.The corresponding relationship between the elongationL and the joint rotation angle Q can be obtained by the position transformation of the rigid parallel machining parts. Deriving the two ends of the pose change, the corresponding relationship between velocity v = [L1 × L2] R and joint velocity Q can be obtained.(3)v=J_matrix×Q.Among them, J_matrix is the Jacobian matrix fromQ to L. Substitute the parameters into the above formula to get the following:(4)J_matrix=a1b1a2b2sinQ−a0b0cosQa1b12+a2b22+a0b02−2a1b1a2b2sinQ+a0b0cosQ1/2,−a1b1a2b2sinQ+a0b0cosQa1b12+a2b22+a0b02−2a1b1a2b2sinQ−a0b0cosQ1/2.After finishing formulas (2) to (4), the relationship between the stiffness HQ of the operating arm and the stiffness h1 and h2 of the two variable stiffness devices can be obtained.(5)HQ=J_matrixTh100h2J_matrix.The mechanical model of the permanent magnet variable stiffness device is linearly fitted to obtain the relationship between tensile force and elongation used in this paper.(6)E=0.002∗L4−0.027∗L3+0.088∗L2+0.561∗L+1.098.In the formula,E is the pulling force and L is the elongation.


## 2.2. Analysis of Wear Mechanism

The amount of wear increases with the extension of wear time, and the wear rate mainly depends on the material and speed. However, experiments show that the wear process under different conditions is basically similar and can be divided into three stages: initial wear, normal wear, and sharp wear. By monitoring the changes of parameters, the status can be monitored. Therefore, phenomena or parameters related to the operation of the machine tool can be used as the basis for monitoring the wear status. Force is the variable that best reflects the state of the processing process and is very sensitive to wear. When wear occurs, the geometric parameters will change, resulting in a decline in performance, causing the friction between the work pieces to rise rapidly, and it is easy to be detected.In the internal data of the machine tool collected by OPC-UA, the spindle load, spindle torque, and current are all closely related to the actual force. In this paper, the monitoring of the wear state is achieved through these data with a strong correlation with force. In actual production and processing, the amount of wear is greatly affected by various factors, and there are often situations where the actual amount of wear does not change after processing for a period. In addition, in the process of measuring the amount of wear, the wear area selected by the measurer is not completely the same every time, resulting in the measured amount of wear being greatly affected by human subjective factors, and only the ideal wear amount data able to establish an effective wear prediction model. For real processing, according to the required processing quality, the processed parts have only two states: normal and blunt. Therefore, the wear state prediction established in this paper will be divided into two categories to predict wear state. Figure1 shows the wear monitoring program proposed for this research.Figure 1
Online wear monitoring program.


## 3. Variable Stiffness Joint Control Force Compensation and Online Monitoring of Wear Status

### 3.1. Modelling of Joint Variable Stiffness

The basis of the design and analysis of the variable stiffness joint active compliance controller is to establish an accurate variable stiffness joint dynamic model, as shown in the following equation:(7)Aa1a2+Bb1b2=e1e2,AQ+BQ+GQ−J_matrixTδ=0.The joint prototype of the driven variable stiffness mechanical work piece and the drive type of the control system are esCON70/10. The drive model is Escon70/10, the controller is DSpace1103, and the movement of the two motors (M1 and M2) is adjusted at a frequency of 1 kHz.The dynamic model of the variable stiffness joint is mainly divided into the operating arm, which drives motor 1 and 2. The operating arm part is nonlinearly coupled, and the motor part is linearly decoupled. The permanent magnet variable stiffness device causes the elastic deformation of the system, and the elastic deformation is ignored.In this paper, a position and stiffness decoupling compliance controller are used, as shown in Figure2. Given the position input d of the joint operating arm of the variable stiffness machining part, the position and attitude transformation relationship of the rigid parallel machining part can be obtained. The length changes L1 (d) and L2 (d) caused by the change of the posture of the joint operating arm of the machined parts with variable stiffness.(8)L1d=a1b12+a2b22+a0b02−2a1b1a2b2sinQ+a0b0cosQ1/2−a1b12+a2b22+a0b02−2a1b1a2b2sind−a0b0cosd1/2.Figure 2
Decoupling compliance controller.In the same way, the corresponding L2 (d) can be obtained.The encoder installed on the joint obtains the real-time position d of the operating arm. Given the corresponding stiffness Hd of the operating arm, substitute the above-known quantities into the nonlinear equations formed by equations (1), (5), and (6). The Newton method is used to solve the problem. In addition, the required changes of control arm stiffness L1 and L2 are obtained. Then the sum of the length adjustments at this time is L1 (d) + L1 and L2 (d) + L2 so that the decoupling and independent control of the position and stiffness of the joint operating arm of the variable stiffness machining part is realized. The control method of the two servomotors is PD position control. The position and stiffness decoupling compliance controller fully take into account the different flexibility of the joint operating arm when the stiffness changes and realizes the flexibility and position independent control of the variable stiffness joint operating arm. Since the above nonlinear equations have considered the influence of gravity, the equivalent motion state of the system becomes as follows:(9)Aa1a2+e1e2=J_matrixTe1e2ΔL1−dJ_matrixTe1e2ΔL2−d,AQ+BQ=J_matrixTe1e2−GQ.Next, perform joint compliance analysis. When the system receives the external torque EX, the dynamic equation of the system becomes as follows:(10)AQ+BQ+EX=J_matrixTe1e2ΔL1ΔL2−d−GQ.Then the final steady-state form of the system becomes as follows:(11)EX=J_matrixTe1e2ΔL1ΔL2−d.It can be seen from the final stable form of the system that as long as the rigidity control of the system is accurate, the compliance of the system can be adjusted accurately. When the system is subjected to an external moment, the new balance relationship with the pulling force and the gravity of the operating arm is as follows:(12)e1×f1+e2×f2−G×gG=EX.Solving the new nonlinear equations formed by equations (5), (6), and (12), and obtaining new rope length changes L1 and L2 not only realizes the compensation of gravity but also realizes the compensation of external torque, such as shown in Figure 3. The advantage of this is that when there is an error in position control or when the operating arm is deformed by an external force, it can be detected by the encoder in real time, and then substituted into the nonlinear equation set for decoupling calculation, so as to ensure that the joint is flexible when the joint position changes. The performance is accurate and consistent, and it realizes gravity and external torque compensation.Figure 3
Force compensation.


### 3.2. Online Monitoring of Wear Status Based on Convolutional Neural Network

This article uses Siemens 840Dsl numerical control system to realize the collection of machine tool data. In this study, the internal information of the machine tool related to force, such as spindle load and spindle torque, is used to predict the wear state. Therefore, only some parameters need to be extracted and analysed in actual acquisition.The work of the convolutional neural network CNN established in this research is to map the input signalS within a certain period to a value from −1 to 1. Among them, S represents the signal value continuously measured during a period of processing time. Among them, −1 means wear state, 0 means normal state, and 1 means abnormal state.The structure of CNN used in this study is shown in Figure4. Since the BN normalization layer has the advantages of preventing overfitting and accelerating model convergence, a BN normalization layer is added to each layer of the model. The Relu after the BN normalization layer represents the nonlinear transformation of the characteristic matrix, and the modified linear activation function is used here. Use this function to operate on all the elements in the feature matrix individually during operation, namely,(13)Out=ReluS=max0,S.Figure 4
Schematic diagram of data collection and model structure.After Relu conversion, the dimension of the feature matrix remains unchanged. This function increases the sparsity of the network, making the extracted features more representative and stronger in generalization.Each value of the feature matrix of the pooling layer corresponds to the larger value of two adjacent elements in the feature matrix of the BN normalization layer. When operating on the feature matrix in the BN layer, the regions do not overlap. The residual structure appears after the first pooling layer. The output result after pooling is downsampled and directly added to the output result after the second pooling. This operation makes the rows and columns of the two feature matrices the number remains the same. The setting of the residual structure helps to speed up the convergence of the model and prevent the gradient from disappearing. The subsequent convolution and pooling process are similar to the above description. After performing convolution and pooling operations, the output of the CNN is connected to two fully connected layers. After the fully connected layer, the network introduces a “dropout” layer, and the neurons in the fully connected layer are set to zero with a probability of 0.5 to prevent overfitting. The neural network parameter optimization selects the Adam optimizer to train the model, and the basic learning rate is 0.001. The learning rate gradually decreases as the number of training sets increases. When the error no longer decreases as the number of training increases, the learning rate is reduced to half of the original.Limited by the data sampling frequency, this article sets the input as a vector with 64 elements. That is, the load and torque of the machine tool spindle collected every 3.2 s are used as an input sample to predict the current wear state. During the training process, 20 samples are randomly selected for training each time, and the remaining samples are used for testing until the training ends when the model meets the accuracy requirements and the optimal wear state recognition model is obtained. The pseudocode of our algorithm is shown in Table1.Table 1
Pseudocode of the algorithm in this article.
Input: tensionStep 1: use formula (7) to establish an accurate dynamic model of variable stiffness jointsStep 2: use formula (8) to obtain the length changes, caused by the posture change of the joint operating armStep 3: use formula (9) to obtain the equivalent motion state equation of the systemStep 4: use formula (10) to obtain the dynamic equation of the systemStep 5: use formula (12) to obtain a new nonlinear equation systemStep 6: input the force-related internal machine tool information such as spindle load and spindle torque into the CNN networkStep 7: output the resultOutput: prediction of wear status


## 3.1. Modelling of Joint Variable Stiffness

The basis of the design and analysis of the variable stiffness joint active compliance controller is to establish an accurate variable stiffness joint dynamic model, as shown in the following equation:(7)Aa1a2+Bb1b2=e1e2,AQ+BQ+GQ−J_matrixTδ=0.The joint prototype of the driven variable stiffness mechanical work piece and the drive type of the control system are esCON70/10. The drive model is Escon70/10, the controller is DSpace1103, and the movement of the two motors (M1 and M2) is adjusted at a frequency of 1 kHz.The dynamic model of the variable stiffness joint is mainly divided into the operating arm, which drives motor 1 and 2. The operating arm part is nonlinearly coupled, and the motor part is linearly decoupled. The permanent magnet variable stiffness device causes the elastic deformation of the system, and the elastic deformation is ignored.In this paper, a position and stiffness decoupling compliance controller are used, as shown in Figure2. Given the position input d of the joint operating arm of the variable stiffness machining part, the position and attitude transformation relationship of the rigid parallel machining part can be obtained. The length changes L1 (d) and L2 (d) caused by the change of the posture of the joint operating arm of the machined parts with variable stiffness.(8)L1d=a1b12+a2b22+a0b02−2a1b1a2b2sinQ+a0b0cosQ1/2−a1b12+a2b22+a0b02−2a1b1a2b2sind−a0b0cosd1/2.Figure 2
Decoupling compliance controller.In the same way, the corresponding L2 (d) can be obtained.The encoder installed on the joint obtains the real-time position d of the operating arm. Given the corresponding stiffness Hd of the operating arm, substitute the above-known quantities into the nonlinear equations formed by equations (1), (5), and (6). The Newton method is used to solve the problem. In addition, the required changes of control arm stiffness L1 and L2 are obtained. Then the sum of the length adjustments at this time is L1 (d) + L1 and L2 (d) + L2 so that the decoupling and independent control of the position and stiffness of the joint operating arm of the variable stiffness machining part is realized. The control method of the two servomotors is PD position control. The position and stiffness decoupling compliance controller fully take into account the different flexibility of the joint operating arm when the stiffness changes and realizes the flexibility and position independent control of the variable stiffness joint operating arm. Since the above nonlinear equations have considered the influence of gravity, the equivalent motion state of the system becomes as follows:(9)Aa1a2+e1e2=J_matrixTe1e2ΔL1−dJ_matrixTe1e2ΔL2−d,AQ+BQ=J_matrixTe1e2−GQ.Next, perform joint compliance analysis. When the system receives the external torque EX, the dynamic equation of the system becomes as follows:(10)AQ+BQ+EX=J_matrixTe1e2ΔL1ΔL2−d−GQ.Then the final steady-state form of the system becomes as follows:(11)EX=J_matrixTe1e2ΔL1ΔL2−d.It can be seen from the final stable form of the system that as long as the rigidity control of the system is accurate, the compliance of the system can be adjusted accurately. When the system is subjected to an external moment, the new balance relationship with the pulling force and the gravity of the operating arm is as follows:(12)e1×f1+e2×f2−G×gG=EX.Solving the new nonlinear equations formed by equations (5), (6), and (12), and obtaining new rope length changes L1 and L2 not only realizes the compensation of gravity but also realizes the compensation of external torque, such as shown in Figure 3. The advantage of this is that when there is an error in position control or when the operating arm is deformed by an external force, it can be detected by the encoder in real time, and then substituted into the nonlinear equation set for decoupling calculation, so as to ensure that the joint is flexible when the joint position changes. The performance is accurate and consistent, and it realizes gravity and external torque compensation.Figure 3
Force compensation.


## 3.2. Online Monitoring of Wear Status Based on Convolutional Neural Network

This article uses Siemens 840Dsl numerical control system to realize the collection of machine tool data. In this study, the internal information of the machine tool related to force, such as spindle load and spindle torque, is used to predict the wear state. Therefore, only some parameters need to be extracted and analysed in actual acquisition.The work of the convolutional neural network CNN established in this research is to map the input signalS within a certain period to a value from −1 to 1. Among them, S represents the signal value continuously measured during a period of processing time. Among them, −1 means wear state, 0 means normal state, and 1 means abnormal state.The structure of CNN used in this study is shown in Figure4. Since the BN normalization layer has the advantages of preventing overfitting and accelerating model convergence, a BN normalization layer is added to each layer of the model. The Relu after the BN normalization layer represents the nonlinear transformation of the characteristic matrix, and the modified linear activation function is used here. Use this function to operate on all the elements in the feature matrix individually during operation, namely,(13)Out=ReluS=max0,S.Figure 4
Schematic diagram of data collection and model structure.After Relu conversion, the dimension of the feature matrix remains unchanged. This function increases the sparsity of the network, making the extracted features more representative and stronger in generalization.Each value of the feature matrix of the pooling layer corresponds to the larger value of two adjacent elements in the feature matrix of the BN normalization layer. When operating on the feature matrix in the BN layer, the regions do not overlap. The residual structure appears after the first pooling layer. The output result after pooling is downsampled and directly added to the output result after the second pooling. This operation makes the rows and columns of the two feature matrices the number remains the same. The setting of the residual structure helps to speed up the convergence of the model and prevent the gradient from disappearing. The subsequent convolution and pooling process are similar to the above description. After performing convolution and pooling operations, the output of the CNN is connected to two fully connected layers. After the fully connected layer, the network introduces a “dropout” layer, and the neurons in the fully connected layer are set to zero with a probability of 0.5 to prevent overfitting. The neural network parameter optimization selects the Adam optimizer to train the model, and the basic learning rate is 0.001. The learning rate gradually decreases as the number of training sets increases. When the error no longer decreases as the number of training increases, the learning rate is reduced to half of the original.Limited by the data sampling frequency, this article sets the input as a vector with 64 elements. That is, the load and torque of the machine tool spindle collected every 3.2 s are used as an input sample to predict the current wear state. During the training process, 20 samples are randomly selected for training each time, and the remaining samples are used for testing until the training ends when the model meets the accuracy requirements and the optimal wear state recognition model is obtained. The pseudocode of our algorithm is shown in Table1.Table 1
Pseudocode of the algorithm in this article.
Input: tensionStep 1: use formula (7) to establish an accurate dynamic model of variable stiffness jointsStep 2: use formula (8) to obtain the length changes, caused by the posture change of the joint operating armStep 3: use formula (9) to obtain the equivalent motion state equation of the systemStep 4: use formula (10) to obtain the dynamic equation of the systemStep 5: use formula (12) to obtain a new nonlinear equation systemStep 6: input the force-related internal machine tool information such as spindle load and spindle torque into the CNN networkStep 7: output the resultOutput: prediction of wear status


## 4. Results and Discussion

In this paper, CNN is used for online monitoring of wear state, so we collected 6,000 images of wear state. Among them, 5000 images are used for training and 1000 images are used for testing.


### 4.1. Joint Simulation Results of Flexible Variable Stiffness Machining Parts

The joint structure parameters are shown in Table2. The simulation block diagram is constructed by MATLAB/Simulink, and the nonlinear dynamic model of the variable stiffness joint is directly written by the s-Function function.Table 2
Joint parameters of flexible machining parts.
ParameterValueMoving platform radius0.025Moving and static platform spacing0.072Static platform radius0.008Winch radius0.022Moment of inertia of winch0.001Operating arm inertia1.201Operating arm weight0.312Operating arm length0.250Give a sine input signal to the variable stiffness joint with an amplitude of 5° and a period of 4 s. The joint position response curve is shown in Figure5(a). When the stiffness of the variable stiffness joint is H1 = 30 N m/rad, the trajectory of the variable stiffness joint is shown by the red line. When the stiffness of the variable stiffness joint is H2 = 60 N m/rad, the trajectory of the variable stiffness joint is shown by the black line. It can be seen from the simulation results that when the joint stiffness is small, the joint position tracking error is larger, and as the joint stiffness increases, the position tracking error decreases. As time goes by, the accuracy of trajectory control increases, which is caused by the greater joint inertia at the initial stage. At the same time, it can be seen that as the joint stiffness increases, the position tracking error caused by inertia is suppressed.Figure 5
Joint simulation results of flexible variable stiffness machining parts. (a) Position control stimulation. (b) Compliance control stimulation.
(a)(b)Keeping the position of the variable stiffness joint unchanged, an external torque of 0.52 N m is applied to the variable stiffness joint during the period of 2 s to 4 s. The compliance simulation of the joint is shown in Figure5(b). When the variable stiffness joint stiffness H1 = 30 N m/rad, the change curve of the variable stiffness joint position is shown by the dotted red line. When the stiffness of the variable stiffness joint is H2 = 60 N m/rad, the position change curve of the variable stiffness joint is shown by the black line. When the variable stiffness joint stiffness H3 = 120 N m/rad, the change curve of the variable stiffness joint position is shown by the green line. Through the analysis of the relationship between the change of joint position and the change of joint stiffness, it can be found that the stiffness control of the joint can better realize the change of joint compliance. The smaller the joint stiffness is, the stronger the joint compliance ability is.


#### 4.1.1. Location Response Analysis

The reference position input of the variable stiffness joint is a step signal with an amplitude of 10°. When the stiffness of the variable stiffness joint is 30 and 120 N m/rad, the position output response curve of the joint is shown in Figure6. When the stiffness of the variable stiffness joint is 120 N m/rad, the position overshoot of the joint is smaller and the adjustment speed is faster. Among them, the maximum position overshoot is about 4.478°, and the adjustment time is about 0.2 s. When the stiffness of the variable stiffness joint is 30 N m/rad, the overshoot and vibration of the joint increase significantly. Among them, the maximum position overshoot is about 6.344°, and the adjustment time is about 0.3 s. Through the comparative analysis of experimental data, it can be found that the overshoot and adjustment time of the variable stiffness joint position decrease with the increase of the joint stiffness. This law is the general law of the position response of the variable stiffness joint with the change of the joint stiffness.Figure 6
Position step response.


#### 4.1.2. Realization of External Force Compensation

The operating arm of the variable stiffness joint moves up 3° from the horizontal position to control the joint stiffnessH = 30 N m/rad. At 2 s, the end of the operating arm is loaded with a weight of 0.8 kg. Comparison of the external force compensation method and the nonexternal force compensation method, the position change of the operating arm is shown in Figure 7.Figure 7
Enhanced position control capabilities. (a) Joint position. (b) Corresponding position motor 1. (c) Corresponding position motor 2.
(a)(b)(c)Figure7(a) shows the change of joint position and Figures 7(b) and 7(c) show the change of the corresponding rotation angle of the two motors. When the controller with an external force compensation link is used, when the joint is subjected to the external load described in this article, the joint deformation angle caused by the joint is 0.496°. When the controller without external force compensation is used, when the joint is subjected to the external load described in this article, the joint deformation angle caused is 3.828°. When the controller with an external force compensation link is used, the joint position change caused by an external load is significantly smaller than that of the controller without external force compensation, indicating that the position tracking ability of the variable stiffness joint is significantly enhanced. The adjustment angle of the motor is also significantly greater than the adjustment angle of the motor without compensation, which also proves that the controller with external force compensation has stronger position adjustment capabilities.


#### 4.1.3. Online Monitoring Model Training and Verification

All additional network layer parameters are initialized with “xavier,” and the parameters are updated using the stochastic gradient descent algorithm. The initial learning rate is 10–3, and the weights are attenuated. The term is 0.0005 and the momentum term is 0.9.During the training process, the input of each sample is the superposition vector of 32 signals of spindle load and 32 signals of torque. It can be seen from Figure8 that after 500 iterations, the final loss function value is small, stable at about 0.001, the final training accuracy approaches 100%, and the training effect is better.Figure 8
Accuracy and loss function changes when training the model.The loss rate of the training set and the accuracy of the test set are indicators to measure the learning ability of the classification method. Generally, the loss rate of the smaller training set and the higher accuracy of the test set correspond to the stronger learning ability. This paper analyzes the long and short-term memory neural network, BP neural network, multilayer BP neural network, and the network of this paper, as shown in Figure9, where the horizontal axis is the number of iterations; the vertical axis in Figure 9(b) is the loss rate of training, and the vertical axis in Figure 9(a) is the accuracy rate of the test set. It can be seen that when the number of training error iteration of the BP method, it is relatively small. It tends to be stable, and the loss rate of the BP training set stays at about 0.23. The accuracy of the BP test set is about 0.80. In Figure 9, when the training loss rate of the multilayer BP network method is stable, the loss rate of the training set tends to be about 0.21. In addition, the accuracy of the test set is about 0.85. In Figure 9, the training loss rate of the LSMN method stays at about 0.27, while the accuracy of its test set is about 0.88.Figure 9
(a) Results analysis of training set and (b) test set of different networks.
(a)(b)The above results show that the optimization algorithm in the loss function of the training set of the BP network is Stochastic Gradient Descent (SGD), which is easy to fall into the local optimum by using random initialization. The single learning rate leads to a lower loss rate in the training set and a lower accuracy in the test set. The Adam algorithm of the network proposed in this paper is a stochastic gradient descent method, which is an adaptive gradient algorithm (Ada-Grad) that reserves a learning rate for each parameter to improve the performance on sparse gradients and let the wavelet transform neural network model. It is more suitable for monitoring wear.


## 4.1. Joint Simulation Results of Flexible Variable Stiffness Machining Parts

The joint structure parameters are shown in Table2. The simulation block diagram is constructed by MATLAB/Simulink, and the nonlinear dynamic model of the variable stiffness joint is directly written by the s-Function function.Table 2
Joint parameters of flexible machining parts.
ParameterValueMoving platform radius0.025Moving and static platform spacing0.072Static platform radius0.008Winch radius0.022Moment of inertia of winch0.001Operating arm inertia1.201Operating arm weight0.312Operating arm length0.250Give a sine input signal to the variable stiffness joint with an amplitude of 5° and a period of 4 s. The joint position response curve is shown in Figure5(a). When the stiffness of the variable stiffness joint is H1 = 30 N m/rad, the trajectory of the variable stiffness joint is shown by the red line. When the stiffness of the variable stiffness joint is H2 = 60 N m/rad, the trajectory of the variable stiffness joint is shown by the black line. It can be seen from the simulation results that when the joint stiffness is small, the joint position tracking error is larger, and as the joint stiffness increases, the position tracking error decreases. As time goes by, the accuracy of trajectory control increases, which is caused by the greater joint inertia at the initial stage. At the same time, it can be seen that as the joint stiffness increases, the position tracking error caused by inertia is suppressed.Figure 5
Joint simulation results of flexible variable stiffness machining parts. (a) Position control stimulation. (b) Compliance control stimulation.
(a)(b)Keeping the position of the variable stiffness joint unchanged, an external torque of 0.52 N m is applied to the variable stiffness joint during the period of 2 s to 4 s. The compliance simulation of the joint is shown in Figure5(b). When the variable stiffness joint stiffness H1 = 30 N m/rad, the change curve of the variable stiffness joint position is shown by the dotted red line. When the stiffness of the variable stiffness joint is H2 = 60 N m/rad, the position change curve of the variable stiffness joint is shown by the black line. When the variable stiffness joint stiffness H3 = 120 N m/rad, the change curve of the variable stiffness joint position is shown by the green line. Through the analysis of the relationship between the change of joint position and the change of joint stiffness, it can be found that the stiffness control of the joint can better realize the change of joint compliance. The smaller the joint stiffness is, the stronger the joint compliance ability is.


### 4.1.1. Location Response Analysis

The reference position input of the variable stiffness joint is a step signal with an amplitude of 10°. When the stiffness of the variable stiffness joint is 30 and 120 N m/rad, the position output response curve of the joint is shown in Figure6. When the stiffness of the variable stiffness joint is 120 N m/rad, the position overshoot of the joint is smaller and the adjustment speed is faster. Among them, the maximum position overshoot is about 4.478°, and the adjustment time is about 0.2 s. When the stiffness of the variable stiffness joint is 30 N m/rad, the overshoot and vibration of the joint increase significantly. Among them, the maximum position overshoot is about 6.344°, and the adjustment time is about 0.3 s. Through the comparative analysis of experimental data, it can be found that the overshoot and adjustment time of the variable stiffness joint position decrease with the increase of the joint stiffness. This law is the general law of the position response of the variable stiffness joint with the change of the joint stiffness.Figure 6
Position step response.


### 4.1.2. Realization of External Force Compensation

The operating arm of the variable stiffness joint moves up 3° from the horizontal position to control the joint stiffnessH = 30 N m/rad. At 2 s, the end of the operating arm is loaded with a weight of 0.8 kg. Comparison of the external force compensation method and the nonexternal force compensation method, the position change of the operating arm is shown in Figure 7.Figure 7
Enhanced position control capabilities. (a) Joint position. (b) Corresponding position motor 1. (c) Corresponding position motor 2.
(a)(b)(c)Figure7(a) shows the change of joint position and Figures 7(b) and 7(c) show the change of the corresponding rotation angle of the two motors. When the controller with an external force compensation link is used, when the joint is subjected to the external load described in this article, the joint deformation angle caused by the joint is 0.496°. When the controller without external force compensation is used, when the joint is subjected to the external load described in this article, the joint deformation angle caused is 3.828°. When the controller with an external force compensation link is used, the joint position change caused by an external load is significantly smaller than that of the controller without external force compensation, indicating that the position tracking ability of the variable stiffness joint is significantly enhanced. The adjustment angle of the motor is also significantly greater than the adjustment angle of the motor without compensation, which also proves that the controller with external force compensation has stronger position adjustment capabilities.


### 4.1.3. Online Monitoring Model Training and Verification

All additional network layer parameters are initialized with “xavier,” and the parameters are updated using the stochastic gradient descent algorithm. The initial learning rate is 10–3, and the weights are attenuated. The term is 0.0005 and the momentum term is 0.9.During the training process, the input of each sample is the superposition vector of 32 signals of spindle load and 32 signals of torque. It can be seen from Figure8 that after 500 iterations, the final loss function value is small, stable at about 0.001, the final training accuracy approaches 100%, and the training effect is better.Figure 8
Accuracy and loss function changes when training the model.The loss rate of the training set and the accuracy of the test set are indicators to measure the learning ability of the classification method. Generally, the loss rate of the smaller training set and the higher accuracy of the test set correspond to the stronger learning ability. This paper analyzes the long and short-term memory neural network, BP neural network, multilayer BP neural network, and the network of this paper, as shown in Figure9, where the horizontal axis is the number of iterations; the vertical axis in Figure 9(b) is the loss rate of training, and the vertical axis in Figure 9(a) is the accuracy rate of the test set. It can be seen that when the number of training error iteration of the BP method, it is relatively small. It tends to be stable, and the loss rate of the BP training set stays at about 0.23. The accuracy of the BP test set is about 0.80. In Figure 9, when the training loss rate of the multilayer BP network method is stable, the loss rate of the training set tends to be about 0.21. In addition, the accuracy of the test set is about 0.85. In Figure 9, the training loss rate of the LSMN method stays at about 0.27, while the accuracy of its test set is about 0.88.Figure 9
(a) Results analysis of training set and (b) test set of different networks.
(a)(b)The above results show that the optimization algorithm in the loss function of the training set of the BP network is Stochastic Gradient Descent (SGD), which is easy to fall into the local optimum by using random initialization. The single learning rate leads to a lower loss rate in the training set and a lower accuracy in the test set. The Adam algorithm of the network proposed in this paper is a stochastic gradient descent method, which is an adaptive gradient algorithm (Ada-Grad) that reserves a learning rate for each parameter to improve the performance on sparse gradients and let the wavelet transform neural network model. It is more suitable for monitoring wear.


## 4.1.1. Location Response Analysis

The reference position input of the variable stiffness joint is a step signal with an amplitude of 10°. When the stiffness of the variable stiffness joint is 30 and 120 N m/rad, the position output response curve of the joint is shown in Figure6. When the stiffness of the variable stiffness joint is 120 N m/rad, the position overshoot of the joint is smaller and the adjustment speed is faster. Among them, the maximum position overshoot is about 4.478°, and the adjustment time is about 0.2 s. When the stiffness of the variable stiffness joint is 30 N m/rad, the overshoot and vibration of the joint increase significantly. Among them, the maximum position overshoot is about 6.344°, and the adjustment time is about 0.3 s. Through the comparative analysis of experimental data, it can be found that the overshoot and adjustment time of the variable stiffness joint position decrease with the increase of the joint stiffness. This law is the general law of the position response of the variable stiffness joint with the change of the joint stiffness.Figure 6
Position step response.


## 4.1.2. Realization of External Force Compensation

The operating arm of the variable stiffness joint moves up 3° from the horizontal position to control the joint stiffnessH = 30 N m/rad. At 2 s, the end of the operating arm is loaded with a weight of 0.8 kg. Comparison of the external force compensation method and the nonexternal force compensation method, the position change of the operating arm is shown in Figure 7.Figure 7
Enhanced position control capabilities. (a) Joint position. (b) Corresponding position motor 1. (c) Corresponding position motor 2.
(a)(b)(c)Figure7(a) shows the change of joint position and Figures 7(b) and 7(c) show the change of the corresponding rotation angle of the two motors. When the controller with an external force compensation link is used, when the joint is subjected to the external load described in this article, the joint deformation angle caused by the joint is 0.496°. When the controller without external force compensation is used, when the joint is subjected to the external load described in this article, the joint deformation angle caused is 3.828°. When the controller with an external force compensation link is used, the joint position change caused by an external load is significantly smaller than that of the controller without external force compensation, indicating that the position tracking ability of the variable stiffness joint is significantly enhanced. The adjustment angle of the motor is also significantly greater than the adjustment angle of the motor without compensation, which also proves that the controller with external force compensation has stronger position adjustment capabilities.


## 4.1.3. Online Monitoring Model Training and Verification

All additional network layer parameters are initialized with “xavier,” and the parameters are updated using the stochastic gradient descent algorithm. The initial learning rate is 10–3, and the weights are attenuated. The term is 0.0005 and the momentum term is 0.9.During the training process, the input of each sample is the superposition vector of 32 signals of spindle load and 32 signals of torque. It can be seen from Figure8 that after 500 iterations, the final loss function value is small, stable at about 0.001, the final training accuracy approaches 100%, and the training effect is better.Figure 8
Accuracy and loss function changes when training the model.The loss rate of the training set and the accuracy of the test set are indicators to measure the learning ability of the classification method. Generally, the loss rate of the smaller training set and the higher accuracy of the test set correspond to the stronger learning ability. This paper analyzes the long and short-term memory neural network, BP neural network, multilayer BP neural network, and the network of this paper, as shown in Figure9, where the horizontal axis is the number of iterations; the vertical axis in Figure 9(b) is the loss rate of training, and the vertical axis in Figure 9(a) is the accuracy rate of the test set. It can be seen that when the number of training error iteration of the BP method, it is relatively small. It tends to be stable, and the loss rate of the BP training set stays at about 0.23. The accuracy of the BP test set is about 0.80. In Figure 9, when the training loss rate of the multilayer BP network method is stable, the loss rate of the training set tends to be about 0.21. In addition, the accuracy of the test set is about 0.85. In Figure 9, the training loss rate of the LSMN method stays at about 0.27, while the accuracy of its test set is about 0.88.Figure 9
(a) Results analysis of training set and (b) test set of different networks.
(a)(b)The above results show that the optimization algorithm in the loss function of the training set of the BP network is Stochastic Gradient Descent (SGD), which is easy to fall into the local optimum by using random initialization. The single learning rate leads to a lower loss rate in the training set and a lower accuracy in the test set. The Adam algorithm of the network proposed in this paper is a stochastic gradient descent method, which is an adaptive gradient algorithm (Ada-Grad) that reserves a learning rate for each parameter to improve the performance on sparse gradients and let the wavelet transform neural network model. It is more suitable for monitoring wear.


## 5. Conclusion

This paper firstly aims at the stability and safety of machining and proposes a decoupling control method for joint position and stiffness of variable stiffness machining parts with active and passive flexibility, which realizes the joint compliance control of machining parts. At the same time, the position control of the joints is realized. Secondly, real-time monitoring was carried out for the wear problem of the machined parts. Through OPC-UA, real-time data inside the machine tool is collected, which is closely combined with the actual processing scene and can directly reflect the current processing state. The convolutional neural network is used to construct the wear state recognition model, the collected data is directly used as input, and a prediction model with similar accuracy to the traditional method is obtained. The performance of the model in the training set and online verification test is in line with expectations. Simulation experiments show that the joint position and stiffness decoupling control method and wear monitoring algorithm of variable stiffness machining parts proposed in this paper have achieved good performance.



---

*Source: 5524323-2021-04-20.xml*