The constant force control based on an optimized environmental model for the robotic lapping of curved surface

During the curved surface lapping processing by robot, the surface quality of the processed workpieces cannot be fully guaranteed because of the uncontrollability of lapping contact force. Therefore, the accurate control of the contact force between the tool and the workpiece is important to improve the processing quality. This paper proposes an impedance control strategy based on an optimized environmental model to address the serious constraints brought by the uncertainty of the environmental model in impedance control on the compensation accuracy of contact force and constructed a contact environmental model of elastic abrasives based on neural network algorithm, which improved the compensation accuracy of contact force through iterative iteration and prediction between the environmental model and the impedance model. Constant force control is achieved through accuracy compensation, which ultimately leads to an improvement in the surface quality of the workpiece. Through comparison experiments, it is found that compared with the unoptimized method, the force control tracking error is reduced by 60.9%, the contact force variance is reduced by 25.7%, the contact force error during curved surface force control lapping process is reduced by 58.3% and the contact force variance is reduced by 52.5%, and the workpiece roughness Ra value is reduced by 37.2%. Therefore, the robotic constant force control system based on optimized environmental model can achieve a better force control effect, which can realize accurate and stable control of contact force during curved surface lapping process by robot, and has certain potential for engineering application.


Introduction
With the development of science and technology, the demand and application of curved surface components are becoming more and more extensive, and the harsh environment puts high demands on the surface quality of the components. Lapping is widely used as one of the practical methods to improve the surface quality of workpieces [1], but traditional lapping methods suffer from low efficiency, poor accuracy, and harsh working conditions [2][3][4]. In recent years, the emergence of robot-assisted lapping technology has effectively improved the efficiency and quality of lapping processing. It is gradually replacing traditional lapping methods and being applied to lapping processing of curved surface components.
The choice of tools in curved surface lapping will directly affect the final processing result. Flexible bond abrasives have good elasticity and lapping characteristics and have good surface adaptability when lapping curved surfaces, which can effectively improve the surface quality of workpieces and fulfill the high-quality lapping requirements for curved surface components [5][6][7][8]. Since lapping is a typical contact processing approach, which achieves material removal through the contact force generated between the tool and the workpiece surface, the constant contact force is also a key factor affecting the final quality of the processing [9]. The main practical problem is that the lack of rigidity caused by the high flexibility of robot will lead to unstable contact force in the lapping process. Therefore, precisely 1 3 control the contact force of robot is a key difficulty of the robot-assisted lapping process.
The robotic contact force control technology refers to the technology of maintaining a constant contact force between the robot and the working environment through certain means of compensation. The robotic contact force control methods can be roughly divided into two categories, one of which is through-arm control where force control is performed by directly driving the robot arm, and the other is around-arm control where external end-effectors are mostly used to compensate for tracking errors to achieve control of contact force [10]. In the through-arm control scheme, domestic and foreign scholars [11,12] optimized the control strategy and force control algorithm to achieve direct control of contact force at the end of tool through self-compensation of robot. Although the through-arm control scheme does not require external end-effector, its responsiveness and tracking performance is limited by the large motion inertia of manipulator system [13]. In order to solve the deficiency in performance of through-arm control scheme, around-arm control schemes with additional end-effector are widely used. Wei et al. [14] designed a passive end-effector for robotic polishing, which solved the active force control method problems of contact force control delay and overshoot in initial stage. However, the expected value of contact force controlled by this passive end-effector has to be determined before manufacturing. As a result, the expected value of contact force cannot be adjusted according to different processing requirements. This passive end-effector also has the problems of low force control accuracy and deficiency when applied in processing curved surface workpieces. Therefore, contact force control schemes using external active end-effector are widely adopted. Dong et al. [15] designed an active pneumatic polishing force control system based on highspeed on/off with PWM controlling, but the inherent low accuracy and low responsiveness of pneumatic devices lead to force tracking errors and the dynamic response speed is much lower than those of electric direct drive force control schemes. Zhang et al. [16] designed a 1-DOF (degree-offreedom) constant force end effector for robotic magnetorheological finishing with normal contact force as monitoring target. The average error of constant force control is within 0.1 N, but this end-effector can only be used for robotic magnetorheological finishing which has a large motion inertia. Zhang et al. [17] proposed an end-effector based on impedance control with pneumatic cylinders and voice coil motors, which has good control accuracy, step response, and dynamic bandwidth. However, this end-effector is still in the prototype stage. In recent years, more and more new control methods based on variants and combinations of traditional control methods have been proposed [18]. Cao et al. [19] designed a dynamic adaptive hybrid impedance controller (DAHI) with adjustable update rate parameters online. Wang et al. [20] proposed a hybrid force/position controller for manipulator based on adaptive fuzzy control. Nuno Mendes et al. [21] designed an adaptive fuzzy controller that does not require a system model and can learn fuzzy rules of control system online. Better control accuracy and robustness have been achieved by combining traditional force control methods with each other for optimization or by applying the latest artificial intelligence algorithms to force control, but most of these emerging force control methods have problems of complex algorithm structures. So, it is more difficult to implement.
Impedance control is widely used due to its advantage of being able to simultaneously control motion and contact force [22], but at the same time, high-accuracy impedance control heavily relies on precise environmental models [23]. For this reason, domestic and foreign scholars have conducted relevant research on environmental model in impedance control. Ji et al. [24] established a contact force model for the interaction between apples and the environment and proposed a variable damping impedance force control strategy for the gripper grasping force tracking to achieve compliant grasping of apples. Zhou et al. [25] proposed an adaptive impedance control strategy based on a contact model between the robot and the environment; the macro-micro motion control model of the robot was established to realize the optimization of impact conditions and contact force tracking. Duan et al. [26] analyzed the contact force model between the robotic end-effector and the environment and proposed an impedance parameters adaptive adjustment method to effectively reduce force tracking error caused by uncertainty of environmental parameters. Shen et al. [27] used recursive least squares method to iteratively calculate environmental parameters, which can track the expected force without the need for known environmental information. Although these methods effectively address the influence of unknown environmental model on force control accuracy in impedance control, most of them still stay in the simulation and force control tracking stage, and most of them use the adjustment of impedance parameters to achieve indirect compensation with the uncertainty of environmental model. However, in the actual curved surface lapping process, complex processing environment generated by combination of robot and elastic abrasive tool will have a significant impact on contact force control effect. Establish the predicted model of the contact force involved in the machining process is of significance to improve the final processing quality of the workpiece [28]. Therefore, it is necessary to optimize control strategy according to the actual elastic abrasives lapping processing environment to ensure the accuracy of the control system. This paper proposes an impedance control strategy based on an optimized environmental model, using a combination of neural network and contact experiments to optimize the environmental model, avoiding over-rapid repeated compensation while reducing the impedance control compensation error by iterative iteration and prediction seeking, and developing a robot-assisted constant force control system for curved surface lapping which improved the accuracy of contact force control and successfully applying this system to the lapping process of curved surface components. The experimental results proved the feasibility of this system, which is a good reference for robotic force-controlled curved surface lapping.

Impedance control strategy
As shown in Fig. 1, the impedance control in robotic lapping process indirectly achieves the purpose of controlling contact force by establishing a functional relationship between the contact force and the position error between the robot and the environment and by adjusting the end position deviation of the robot.
Typically, the impedance relationship is expressed as a differential equation [29]: where M, B, and K are the inertia, damping, and stiffness matrices of the impedance control system; X is the actual position of the contact point between the abrasive tool and the workpiece; X r is the expected position of the contact point between the abrasive tool and the workpiece, respectively; and F d and F r are the expected contact force and the real contact force between the robot and the environment.
In order to meet the control requirements of discrete signals, it is necessary to discretize continuous impedance system in the time domain. The Laplace transform of Eq. (1) is: where ΔX = X − X r is the amount of deviation between the actual position and the expected position, i.e., impedance is the contact force deviation between the tool and the workpiece, and s is the Laplace transformed complex variable.
Rewrite Eq. (2) into time-domain form: The discretization of Eq. (3) and backward differential discretization: where T denotes the sampling period of sensor, ΔX(k) denotes the displacement compensation at current moment, and ΔX(k−1) and ΔX(k−2) denote the displacement compensations at the previous moment and the next moment, respectively.
Substituting Eq. (4) and Eq. (5) into Eq. (3): The discrete impedance system function can be obtained by sorting Eq. (6): It can be seen that the current displacement compensation ΔX(k) is related to the contact force, the compensation ΔX(k−1) at the previous moment, and compensation ΔX(k−2) at the next moment. The system response speed is related to the system inertia M, damping B, and stiffness K. It can also be seen that the discrete impedance system is equivalent to a second-order spring-damper system, which can be quickly stabilized by adjusting the parameter values of a 0 , a 1 , and a 2 so that the system reaches stability with a small amount of overshoot.

Optimized impedance control strategy based on the environmental model
The block diagram of the impedance control strategy based on the environmental model is shown in Fig. 2.
The outer loop of block diagram realizes position control, the inner loop realizes impedance control, and the inner and outer loops are connected through the environmental model. Position control means that the robot is controlled by the robot controller to perform Cartesian coordinate motion and reads real-time contact force. The inverse After each iteration and prediction, the deviation of expected contact force value gradually reduces until the deviation value F e is less than the deviation of expected contact force threshold, and then, the environmental model outputs the optimal position compensation value X ′ e after multiple rounds of update iterations and sends the optimal position compensation to the end-effector to realize high-accuracy position compensation. The meanings of the symbols in Fig. 2 are as follows: X r is the processing path of robot, X is the real trajectory of robot, F r is the real contact force, F g is the gravity compensation value, X i is the actual end position of tool calculated by the inverse environmental model, F ′ r is the prediction of environmental model, F d is the expected contact force, F e is the contact force deviation value, X e is the position compensation value calculated by the impedance model, and X ′ e is the position compensation value after update iterations.
The impedance control strategy based on the optimized environmental model proposed in this paper focuses on the characteristics of the low rigidity of the tandem industrial robot and the springback of the elastic abrasives when subjected to compression, which improves the accuracy of the output compensation value while reducing the frequency of compensation through iterative optimization search, avoiding the frequent compensation of the robot due to the real-time variation of the contact pressure during the surface interpolation process, and improving the force control accuracy and stability of the robot-assisted lapping process.

Optimized environmental model based on BP neural network
When using the impedance control strategy based on the environmental model, the accuracy of environmental model determines the control accuracy of the system. If the accuracy of the environmental model is insufficient, it will lead to difficulty in stabilizing the contact force. The elastic abrasives are different from the common rigid abrasives, and the contact force changes are complicated during the downward press process, which leads to a more complicated environmental model establishment based on the elastic abrasives. In order to obtain an accurate environmental model, this paper proposes an environmental model optimization method based on BP (back propagation) neural network which has a good effect in establishing the complex nonlinear relationship between input and output.

Setting of neural network parameters in the environmental model
The role of environmental model is to predict the contact force based on the downward displacement and the processing inclination. As shown in Fig. 3, a neural network environmental model with a three-layer structure consisting of input layer, hidden layer, and output layer is established. Two parameters, the processing inclination angle θ and value of downward displacements X, are used as input samples; therefore, the number of neurons in the input layer is 2. The contact force F is used as output sample; therefore, the number of neurons in the output layer is 1. The number of neurons in the hidden layer is calculated based on Eq. (8): where i, j, and k are the number of nodes in the input layer, the hidden layer and the output layer, respectively, and b is a constant in range of [0, 10].
According to the calculation results of Eq. (8), the range of the number of neurons in the hidden layer is determined to take a range between 2.7 and 11.7. The specific number of nodes in the hidden layer is determined in accordance to the determination coefficient R 2 which reflects the output performance of the neural network model: where ŷ i is the average value of ỹ i and the value of R 2 ranges from 0 to 1. The closer the value of R 2 is to 1, the better the neural network model performs. By analyzing the R 2 values of the training results with different numbers of hidden layer nodes, the most suitable number of nodes in the hidden layer for this paper is 7.

Training and testing of the neural network
In order to verify the accuracy of the environmental model, this paper adopts the method of pressing workpiece with abrasive tool as shown in Fig. 4 to conduct contact experiments. Contact force data is collected using a 6-axis force sensor. The contact force in the elastic lapping process yields a better processing result around 10 N [30], so the collection range of contact pressure in input data is set to 0~15 N, and the collection range of downward displacement should be between 0~0.95 mm, and 1 data point is taken at every 0.05 mm interval. Five data points of 20°, 25°, 30°, 35°, and 40° are selected as the processing inclination angle in the input data. As shown in Fig. 4, the processing inclination angle is the angle formed between the normal line of the contact point and the direction line of the cutter axis. Five processing inclination data points and 20 downward displacement data points are combined to form 100 sets of experimental parameters, of which 95% are used for training and 5% for testing. Since there are two input parameters and one output parameter in the neural network, and the magnitude and value range of each parameter vary greatly while the sigmoid function has a limit on output range, the input and output data are normalized before training. The LM (Levenberg-Marquardt) algorithm is adopted in the training function to reduce the complexity of calculation. This algorithm can better realize the combination of Newton method and gradient descent method. It has both the local convergence of Gauss-Newton method and the global characteristics of gradient descent method. The speed of this algorithm is dozens or even hundreds of times of the traditional gradient descent method, which can greatly improve the convergence speed of the neural network and effectively improve its overall performance. Combined with LM algorithm, the loss function adopts the mean square error (MSE) function shown in Eq. (10): where y j is the input value of the sample, ŷ j is the predicted value, and n is the total amount of sample.
Training results are shown in Fig. 5, where Fig. 5a shows the results of regression analysis. The R value obtained by training the neural network constructed in this paper is 0.99994, which indicates that the neural network constructed in this paper has excellent predictive performance. The relationship between the amounts of iterations and the MSE of input and output is shown in Fig. 5b. MSE drops rapidly after starting the training, and MSE converges to optimal value of 3 × 10 −3 after 409 epochs of training.
The training data and test data are randomly grouped, and 5 groups of random test samples are used to test the trained BP neural network to predict contact force under different processing inclination angles and downward displacement. The predicted results are shown in Table 1. It can be seen that the deviation between the prediction output of the neural network and the experimental results are kept within 1%.  The prediction results are relatively accurate, which can be used to establish the complex nonlinear mapping relationship between processing inclination, downward displacement, and contact force in the environmental model.

Experimental platform
In order to verify the force control and process effect of robot curved surface lapping constant force control system based on the optimized environmental model proposed in this paper, a curved surface contact force tracking experiment and a lapping processing experiment are carried out for analysis. The experimental platform is shown in Fig. 6. A 2-DOF linear servo motion platform is used as a displacement compensation device, and the contact force control is realized by controlling the motion of 2-DOF linear servo motion platform. A 6-axis force sensor is installed on the end of the robot sixth axis to obtain real-time contact force data, and an abrasive tool is installed on the end of pneumatic spindle and fixed to the end of the force sensor by a fixture. During the force control experiment, the robot moves according to the offline programmed trajectory, and the compensation of contact force is achieved by the platform moving the workpiece. Different from the end-effector installed on the end of robot, this end-effector is directly installed on the working platform, and the workpiece is fixed on the upper end of the end-effector. By separating the endeffector from the robot, the inertia of motion is reduced, and the response speed is improved while the maximum control range of contact force is increased.

Curved surface tracking experiment
In order to verify the force control effect with the proposed method, a curved surface contact force tracking experiment is carried out in this paper. The proposed method is compared with the method without force control and the unoptimized impedance control method under contact forces of 5 N, 7.5 N, and 10 N, respectively. The specific parameters of experiment are shown in Table 2. The processing inclination angle is selected to be 25°. In order to avoid the edge effect, the center area of workpiece is selected for force control tracking experiment, after which the gravity of abrasive tool is calibrated and compensated in the force control system to eliminate the influence of the gravity of abrasive tool on the contact force. Figure 7 shows the change of contact force in the curved surface force control tracking experiment. Figure 7a, d, and    Figure 7b, e, and h are the experimental results under the expected contact force of 5 N, 7.5 N, and 10 N, respectively, with unoptimized force control method. The contact force is stabilized to a certain extent. However, due to the slow down-press speed in the initial contact stage, the compensation starts immediately when a small contact force is monitored during the down-press process, resulting in a large overshoot after the tool and the workpiece are in full contact. The excessive inaccurate compensation in process of force control tracking also directly leads to repeated fluctuations of contact force and multiple records of overcompensation beyond the threshold, and this phenomenon occurred under different expected contact force. Figure 7c, f, and i are the experimental results with expected contact forces of 5 N, 7.5 N, and 10 N, respectively, using the method described in this paper. The fluctuation range of contact force has been significantly reduced, and can be well stabilized within ± 0.3 N under different expected contact forces. The large fluctuation   at the beginning of processing is also well suppressed. In the process of curved surface tracking, the proposed method can effectively reduce the influence of environmental factors in the processing of lapping tools and eliminate the contact force error under the influence of many aspects to a certain extent. The contact force error is kept stable within ± 0.3 N, while the error and fluctuation magnitude are less than traditional impedance control method. Table 3 compares the force control tracking experimental results of different methods with specific data. Compared with the unoptimized method, the average and error of contact force in the tracking process have been improved to a certain extent under different expected contact forces. Compared with the unoptimized method, contact force error is reduced by 60.9%, and contact force variance is reduced by 25.7%. When compared with the results with the force control closed, the contact force error is reduced by 98.2%, and the contact force variance is reduced by 68.2%. It is proved that the method proposed in this paper can stably control the contact force while effectively suppressing the fluctuation.

Lapping processing experiment
In order to further verify the effectiveness of the proposed method in actual lapping process, the contact force of 10 N, which is commonly used in lapping as the expected contact force, was chosen for the robotic force controlled lapping experiments. As a comparison, experiments were conducted under the conditions of using the method proposed in this paper, without force control and with the unoptimized impedance control method being applied, respectively.
When the pneumatic lapping tool rotates at high speed, it generates large periodic vibrations, resulting a large interference with the contact force collected by the force sensor. In order to avoid the fluctuation of force signal caused by vibration and to reflect the most realistic contact force information, this paper adopts the recursive average filtering method to reduce such interference. It performs an arithmetic averaging operation on the data of the latest sampling point and the previous 5 sampling points, and the calculation result is outputted as the filtered data. The recursive average filtering method can well suppress high-frequency and periodic interference caused by vibration. Under the condition of turning on the pneumatic cylinder with the contact force of 10 N,  the comparison before and after turning on the filtering is shown in Fig. 8.
The specific experimental parameters of lapping experiment are shown in Table 2, and the air pressure of the pneumatic cylinder is set to 0.3 MPa. In order to ensure the consistency of workpiece surface, the robot adopts oneway and one-time parallel path lapping method as shown in Fig. 9. After each lapping is completed, it is quickly lifted until it completely leaves the workpiece and then quickly moves to next lapping starting point. The lapping time of each trajectory is 50 s, and the feedrate of robot is 60 mm/min. In order to prevent the black scorched substance from attaching to the workpiece surface produced by the lapping tool, as shown in Fig. 9, the workpiece is fixed in a reservoir which is filled with clean water. Figure 10 shows the control effects of the three schemes in processing. As shown in Fig. 10a, the contact force has a long-term deviation of more than 1 N without force control which will greatly affect the processing quality if not compensate in time. As shown in Fig. 10b, with the unoptimized impedance control method, the stability of the contact force has been improved to a certain extent, but large fluctuations still occurred in the initial stage of processing, and overcompensation beyond threshold occurred several times during processing. As shown in Fig. 10c, after adopting the method proposed in this paper, the fluctuation and stability of contact force have been significantly improved, and the contact force can be well controlled within the threshold of ± 0.3 N.
The experimental results of force control lapping show that the method proposed in this paper not only has good effect in force control tracking, but also can stabilize the contact force error within ± 0.3 N during the actual lapping process. The control effect is obviously improved compared with the traditional impedance control method. Table 4 shows the contact force data by using different force control methods with the expected force of 10 N. It can be seen that the contact force error is reduced by 58.3% compared with unoptimized method, and the contact force variance is reduced by 52.5%. Compared with the method without force control, the contact force error is reduced by 98.8%, and the contact force variance is reduced by 75.0%. It is proved that the method proposed in this paper can stably control the contact force and effectively suppress the fluctuation of contact force during the lapping process.    . 11 The surface roughness comparison of the workpieces 1 3 The processed workpieces by the three methods and the original workpiece were, respectively, tested using a Taylor Hobson surface profiler, and the test results are shown in Fig. 11. It can be seen that the use of elastic abrasives processing can significantly reduce the surface roughness of the workpiece and have a good surface consistency. Compared with the surface processed using the method without force control, the traditional impedance control method, and original surface, the surface roughness is reduced by 58.2%, 37.2%, and 92.4%, respectively, after processed using the method proposed in this paper.
As shown in Fig. 12, the surface morphology of the workpiece before and after lapping was compared and analyzed using a super deep scene microscope. Rough texture left by milling exists on the original workpiece surface. After force control lapping using elastic abrasive tools, the surface presents a continuous rotational processing texture, which is formed by scratching, scoring, and pressing on the surface of the workpiece by elastic abrasive tools and diamond abrasives under the action of rotational motion. The rough texture left by milling on original workpiece surface is removed by robotic force control lapping, and the surface morphology of processed workpiece is finer and more uniform.
The workpiece processed by robotic force control lapping method described in this paper is shown in Fig. 13. The surface quality of the processed area has been significantly improved in comparison with the unprocessed area. The regular traces after milling on original surface have been effectively polished, and a prominent specular reflection phenomenon can be observed. The processing results show that the method proposed in this paper can realize finishing processing of curved metal workpieces, which has certain practical significance.

Conclusions
This paper proposes a contact force impedance control method based on an optimized environmental model for curved surface lapping with robotic elastic abrasive tools, which improves the accuracy and stability of contact force and achieves high quality curved surface constant force lapping by robot using elastic abrasives. Both theoretical analysis and experimental results prove the effectiveness of the proposed method. The conclusions are summarized as follows: (1) In terms of the environmental model, traditional impedance control environmental model is less optimized and less integrated with the actual processing environment; a neural network model is introduced to establish a complex nonlinear mapping relationship between the contact force and the downward displacements of elastic abrasives, which improves the force-position prediction accuracy of the environmental model. (2) Proposes the method of calculating the compensation by multiple iterations and predictions based on an accurate environmental model, which optimizes the overall framework of the impedance control strategy. Compared with the unoptimized impedance model, force control in the curved surface lapping process by robot using elastic abrasive tools. A robotic forcecontrolled lapping platform is built and applied to the actual curved surface lapping process. The results of the lapping experiments indicate that, in comparison with the data before optimization, the force control error less than 0.3 N during processing is reduced by 58.3%, and the variance of contact force is reduced by 52.5%; the surface roughness of the processed parts is reduced by 37.2%.
Author contributions All authors contributed to the study conception and design. Theoretical research, experiments, data collection, and analysis were performed by Yuxin Shi, Jinghang Wang, Xiangbo He, and Yunfeng Peng. The first draft of the manuscript was written by Yuxin Shi, and all authors commented on previous versions of the manuscript. All authors read and approved the final manuscript.
Funding This work was supported by the National Natural Science Foundation of China (no. 52075463) and Shenzhen Science & Technology Program (no. JCYJ20210324122001003).

Data availability
The datasets generated and/or analyzed during the current study are available from the corresponding author on reasonable request.

Declarations
Ethical approval Not applicable.

Consent to participate Not applicable.
Consent for publication Written informed consent for publication was obtained from all participants.