A hybrid control strategy for grinding and polishing robot based on adaptive impedance control

In order to realize the active and compliant motion of the robot, it is necessary to eliminate the impact caused by processing contact. A hybrid control strategy for grinding and polishing robot is proposed based on adaptive impedance control. Firstly, an electrically driven linear end effector is designed for the robot system. The macro and micro motions control model of the robot is established, by using impedance control method, which based on the contact model of the robot system and the environment. Secondly, the active compliance method is adopted to establish adaptive force control and position tracking control strategies under impact conditions. Finally, the algorithm is verified by Simulink simulation and experiment. The simulation results are as follows: The position tracking error does not exceed 0.009 m, and the steady-state error of the force is less than 1 N. The experimental results show that the motion curve coincides with the surface morphology of the workpiece, and the contact force is stable at 10 ± 3 N. The algorithm can realize more accurate position tracking and force tracking, and provide a reference for the grinding and polishing robot to realize surface processing.


Introduction
With the development of large fan blades, aircraft turbine blades, and propellers, the surface quality requirements of complex curved workpieces are constantly increasing, and the machining process requires higher precision. The grinding and polishing process requires high precision. However, the current manual grinding and polishing operation is inefficient, time-consuming, and processing accuracy cannot be guaranteed. In addition, the polishing operation environment is noisy and dusty, which can easily cause occupational diseases and even personal injury. 1 Industrial robots have the advantages of low price, large working space, and strong flexibility. In order to solve the shortcomings of manual polishing and the advantages of applying industrial robots, the development of grinding and polishing robot systems and other types of automatic polishing equipment has received extensive attention. 2  and polishing are typical contact processing, which is different from non-contact operations such as spraying. The contact between the end effector and the surface of the workpiece will generate force, which affects the contact stress between the polishing tool and the workpiece. The contact stress has an important influence on the surface quality of the workpiece. 3 When it is too large, it will cause a large amount of removal, but when it is too small, it will reduce the grinding and polishing efficiency. 4 Therefore, the constant force and compliant motion control of the grinding and polishing robot have become the main research direction to improve the quality of grinding and polishing.
The compliant control method can be roughly divided into two categories: direct method and indirect method. The direct method refers to the direct control of force and motion respectively, while the indirect method refers to the control of the dynamic relationship between force and motion to achieve compliant motion. The most representative way to directly control motion and force is the force/position hybrid control method proposed by Raibert and Craig. 5 This method uses the orthogonal and complementary characteristics of the robot position subspace and the force subspace during interaction to perform decoupling control of force and position. 6 It is mainly used in fields where precise force control is required. The prerequisite for its application is that the force and position trajectories required for the contact process are known, and it is not suitable for interactive collaboration in an unstructured environment. The indirect method controls the relationship between the external force and the motion state of the robot, satisfies the characteristics of the compliant motion, and realizes the compliant control of the robot. Common methods include impedance control, 7 admittance control 8 and stiffness control. 9 The method proposed by Hogan 10 to realize the compliant motion control of the robot based on the indirect method is called impedance control. Impedance control can ensure that the robot moves in a constrained environment and maintains appropriate interaction forces. It has strong robustness to some uncertain factors and external interference, and has less calculation amount in application. It is widely used in the compliant motion control of robots. However, there are still many difficulties in impedance control. On the one hand, the kinematics and dynamics of the robot itself have time-varying, strong coupling and nonlinear characteristics, and only using impedance control cannot solve the problems in engineering applications. 11 On the other hand, impedance control has disadvantages such as poor trajectory tracking ability, and the expectation force cannot be accurately controlled. 12 Therefore, in the practical application of impedance control, the traditional structure should be changed or integrated with other control methods. For example, impedance control is combined with adaptive control, fuzzy control, neural network and learning control. 13 In order to realize robot constant force processing, there are currently two methods for using robots to perform active and compliant motion of processing tools through force feedback: straight arm system and arm-around system. In the straight arm robot system, the contact stress is controlled by the constrained motion of each joint. Because of the large size and weight of the robot, the dynamic response is usually slow in the control process. At the same time, the large inertia of the robot will have a great impact on the tool and the workpiece, and it is easy to damage the tool or the workpiece. Therefore, the system becomes unstable under high bandwidth. 14 However, the grinding and polishing process requires dynamic high-frequency adjustment of the contact stress to adapt to sudden changes in the surface curvature of the workpiece. The arm-around system realizes contact stress control by externally adding active end effector movement, which is the most commonly used method in active compliance movement. This is also called the macro-micro robot system method. Industrial robots are called macro robots, which mainly provide surface path tracking of workpieces, and end effectors are called micro robots, which realize tool posture and contact force adjustment. 4 Compared with the straight arm system, the active compliance method of the macro-micro robot system can effectively adapt to the high bandwidth and high precision requirements in the processing operation. 15 The research on using the macro-micro robot system for active compliant motion control to improve the performance of the robot mainly focuses on the structure design of the micro robot and its control method. Mohammad et al. 16 proposed an active end effector, this design reduced the undesirable vibration in the automatic grinding and polishing process through the limited inertia effect. Tol et al. 17 proposed a macromicro robot system that integrates parallel kinematics (PKM) and 2-DOF micro-robots into an automatic deburring and finishing system, which improved the force control performance of the robot. The system relies on an accurate model of the workpiece geometry. Jamisola et al. 18 proposed the use of a force/position hybrid control algorithm to realize the compliant motion of macro and micro robots. Since the algorithm is limited to the position and force control on the same axis, there will be problems when processing complex workpieces with large geometric errors. Duan et al. 19 combined impedance control and force/position hybrid control to achieve the process of tracking the contour of the workpiece in an uncertain environment, but did not consider using active end effector to improve response speed.
The above algorithms have disadvantages such as poor adaptability for machining uncertain surface contours and slow response speed. A hybrid active compliant control strategy for grinding and polishing robots based on adaptive impedance control is proposed. It meets the requirements of high-bandwidth and highprecision machining of complex curved surfaces and reduces the impact caused by sudden changes in contact force. In the control strategy, the industrial robot performs macro position control, and the end effector switches between micro position control and force control. Force control adopts adaptive impedance control and force/position hybrid control method. Finally, the effectiveness of the algorithm is verified by the constant force active compliant motion control simulation.

Structural design
The grinding and polishing robot system is a system that connects the end effector to the end of the industrial robot through series connection. The end effector is connected by the arm-around method to realize the contact stress control during the grinding and polishing process. The structure of the grinding and polishing robot is shown in Figure 1. The six-degree-of-freedom industrial robot in the figure is used as a macro robot, and the end effector driven by a voice coil motor is used as a micro robot. The system has the characteristics of large working space, fast response speed and high precision. Figure 2 is a structural diagram of the end effector. The end effector includes a connecting flange, a voice coil motor module, a mounting flange, a force sensor and a polishing module. The voice coil motor module includes a linear voice coil motor, a linear guide and a bracket. The polishing module includes electric spindle or high-speed motor, tool holder and grinding head. In the voice coil motor module, the linear voice coil motor is composed of a stator and a mover. The stator is fixedly connected to the end of the industrial robot through a connecting flange to ensure a rigid connection of the linear voice coil motor during operation. On the linear guide rail, the mover moves along the axial direction in the stator to prevent the coil from deflection around the axis. The grating displacement sensor detects the mover position in real time. The voice coil motor module and the grinding module are connected through a force sensor, which is used to detect the torque and grinding force of the grinding module in real time. The polishing module provides the rotating movement of the grinding head through the electric spindle, and the designed tool holder is used to facilitate the replacement of the grinding head.
In the grinding and polishing robot system, the industrial robot is used for coarse adjustment of the macro position. The end effector processes the displacement sensor signal and the force sensor signal through the controller to form a dual-loop control of the force position, thereby realizing fine position adjustment. The position control loop is controlled by the displacement sensor to control the stroke and position accuracy. The force control loop feeds back the contact force signal to the controller, and converts it into a position signal through the controller. The force sensor measures the actual contact force signal of the polishing module and converts it into the driving signal of the voice coil motor module and the posture adjustment signal of the industrial robot. It is used for real-time adjustment of the end effector to realize the closed-loop control of the contact stress of the workpiece.
The traditional design uses the electric motor as the power source and transmits the grinding force through shafts, gears and other components. In this design, a voice coil motor is used to provide driving force for the end effector and an electric spindle is used to provide grinding force. This reduces the load required for the motion state while satisfying the robot polishing process. The scheme using the motor and the shaft has a relatively high load. On the one hand, the end effector needs to output more force, which will increase the weight of the end effector and require high-load industrial robots. On the other hand, the movement of the motor and the shaft may cause high noise and high vibration of the end effector, which will reduce the control performance. In addition, the electric spindle can output force to meet the grinding requirements under the light weight condition, which reduces the overall quality of the end effector. Therefore, the weight of the end effector can be reduced by using a voice coil motor and an electric spindle. This design realizes the horizontal or vertical installation of the electric spindle by changing the clamping method of the tool holder. In this way, the overall size of the end effector can be adjusted, the working range of the robot and the processing direction of the grinding and polishing head can be changed to meet the use of more occasions.

Robot macro motion control
As industrial robots have the characteristics of wide working range, fast movement speed and large displacement, the algorithm that controls the movement of the grinding and polishing robot system in a large range is called robot macro motion control. The industrial robot joint 1 to joint 3 and joint 4 to joint 6 consider the position motion process control and end effector posture control, respectively.
Industrial robot joints select speed closed loop for motion control. The RMRC (Resolved Motion Rate Control) algorithm is simple and easy to provide speed commands to industrial robot controllers, so it is chosen as the control algorithm of industrial robots. 20 The RMRC algorithm uses the robot kinematics differential to convert the joint speed into the end working space speed, which can be computed as follow: where J(u) is the Jacobian matrix; _ x is the task velocity vector;u : is the joint velocity vector. Find the inverse solution of equation (1) and obtain the value _ u.
where J + (u) is the pseudo-inverse matrix of the Jacobian matrix. For J (u) is non square matrix, its inverse matrix is not defined. Moore-Penrose inverse matrix can guarantee the uniqueness of solution.
Thereby, Moore-Penrose pseudo-inverse is used in (2). b is the zero-space vector of J; I is the identity matrix.
Considering the multi-joint robot, the dynamic characteristics of the system can be described by the secondorder nonlinear differential equation as: 21 Through the model of formula (3), taking _ u in formula (2) as the control input of the system, the control law is where M(u) is the positive definite inertia matrix; C(u, _ u) is the Centrifugal force and Coriolis force; t fric (u) is the friction vector; g(u) is the gravity vector; u r and u are the expected angular displacement of the joint and the actual joint angle displacement, respectively; e m is the tracking error; k p and k d are the proportional and differential coefficients of PD control, respectively.

Robot micro motion control
The end effector has a small working space, but has the characteristics of fast response speed and high precision. The algorithm that controls the small-scale movement of the grinding and polishing robot system on the surface of the workpiece is called robot micro-motion control. This section mainly considers the position control of the end effector.
Because of the complexity of the robot dynamic model, it is considered to simplify the control algorithm design. Firstly, in the process of modeling and controlling the macro micro robot system, Zheng Ma considered that the operation process was low-speed motion and only considered gravity compensation. 22 In the experiment, the moving speed of the robot is set at 6-20 mm/s, and the desired contact force control is achieved. Secondly, in the actual grinding and polishing process, the robot movement speed is 10-40 mm/s, which can obtain the desired processing quality. Finally, through the above, it is considered that the robot operation in this paper is mainly low-speed motion, which meets the requirements of the dynamic model to simplify the dynamic model by ignoring the speed and acceleration terms when the joint speed and acceleration are small. In the follow-up simulation and experiment, the other coefficients of dynamics are taken as 0 to simplify the model and design the control algorithm. There are two control algorithms for the end effector and the workpiece from no contact to a stable contact process: PD control. In this paper, the robot operation is mainly low-speed motion, ignoring errors such as Coriolis force, and mainly studying gravity errors. In robot force control operations, the external force reading of the sensor is usually reset to zero for accuracy. When the robot is in an unloaded state, the sensor installed between the end effector of the robot and the workpiece does not read zero, so the end effector needs to be compensated for gravity. The influence of gravity is removed from the sensor reading, so that the compensated sensor reading is always zero when it is not affected by external forces. The position control method using PD with gravity compensation, the control law is: where g mi (u) is the n 3 1 order gravity vector; u rmi and u mi are the n 3 1 order end effector joint expected angle vector and joint angle vector; e mi is the tracking error; k p and k d are the proportions and the differential coefficient of PD control, respectively. n is the number of end effector joints. In this article, the end effector has 1 degree of freedom, so the value of n is 1. The force sensor on the end effector is connected to the polishing module. The force information collected by the sensor includes the weight information of the polishing module, and the force information needs to be processed to obtain the gravity compensation amount. The gravity direction of the grinding head is the negative direction of the Z-axis of the robot base coordinate system, and the corresponding gravity vector is set to g o = 0 0 G ½ . When solving the grinding process g mi (u), the tool gravity vector needs to be projected to the robot end coordinate system. During the grinding and polishing process of the robot, the end posture is constantly changing. Set the transformation matrix of the robot end as R. At the initial position of the robot, the three coordinate axis vectors of the force sensor information collection coordinate system are expressed asx 0 ,ỹ 0 ,z 0 . With the transformation process of the robot's end posture, the direction vectors of the force information collection system's coordinate axis under the base frame arex,ỹ, The conversion matrix R a from the base coordinate system to the force sensor information collection coordinate system is, The gravity vector g o = 0 0 G ½ under the base frame is projected to the force sensor information collection frame.
Adaptive impedance control. For the grinding and polishing process, the adaptive impedance control method is adopted for force control. The algorithm is as follows: According to the definition of impedance control, it can be described as a second-order model: where m, b, and k are the inertia, damping, and stiffness of the end effector; x and x r are the actual position and the desired position; f e and f r are the actual contact force and the desired contact force.
Simplify the contact force model between the end effector and the workpiece to a spring model: where k e is the environmental stiffness, and x e is the environmental position. The expected position in impedance control is a fixed value. When the actual contact position deviates from the expected position, a large contact force will appear, causing inaccurate position tracking. The following content will analyze the conditions of accurate position tracking in impedance control.
During the grinding and polishing process, the contact between the end effector and the workpiece will cause a sudden change or jitter of the axial force. Impedance control is not sensitive to changes in the end contact force, which makes it impossible to adjust the axial contact force more quickly. In order to improve the accuracy of the axial position tracking of the grinding and polishing robot, formula (11) can be rewritten as: With the impedance model equation (11), the proportional-derivative control of the contact force is introduced. k p and k d are the coefficients corresponding to the contact force and the change speed of the contact force. Adjusting k p can reduce the tracking error, and adjusting k d can change the sensitivity of the model to changes in contact force, thereby improving the overall position tracking performance of the model. Due to the slow axial movement speed during the machining process, the desired position is regarded as a constant in the analysis.
From the environmental contact model equation (12), the actual position x can be expressed as: Substituting formula (14) into formula (13), where Laplace transform on equation (12): when the expected force is constant, F r (s) = f r =s,X e (s) = x e =s. The steady-state error of contact force tracking is: when the force steady-state error e ss = 0, the expected position x r is a fixed value. It will satisfy the following formulas: where the parameter f r is set according to the actual contact situation. Therefore, the key to achieving a tracking target with zero force steady-state error is to be able to estimate or measure the environmental position x e and environmental stiffness k e in real time. The environmental position and stiffness are estimated online in real time, eliminating the environmental parameter errors mentioned above. This will obtain a new reference trajectory for realtime tracking of the desired contact force.
As shown in Figure 3, using the indirect adaptive control method. 23 The desired position x r is defined as: wherex e andk e are the real-time estimated values of x e and k e respectively. From the environmental contact model equation (12), we know where k h = k e x e . According tox e andk e , the real-time estimated value of contact force wherek h is the estimated value of k h . Given (20) and (21), we can see whenf e = f e , we can see from equations (19) and (21) f e =k e x Àk exe =k e (x À x r ) + f r ð23Þ Then Substituting equation (21) into the impedance model equation (8), we know In the steady state, from equation (25), it can be seen that the condition of (k + k pke )e = 0 is e!0 or (k + k pke ) ! 0, According to the environmental stiffness k e .0 andk e .0, (k + k pke ).0 is obtained. Since the force tracking error is e = f e À f r = 0, wherê f e ! f e , f e ! f r , the position tracking with zero force steady-state error is realized.
Using Lyapunov stability theory, design update algorithm ofx e andk e to realizef e ! f e . Define the Lyapunov function as where G is the second-order diagonal positive constant value matrix, G = 1=r 1 0 0 1 = r 2 ! , r 1 and r 2 are positive scalar constant values. According to the Lyapunov stability principle, to then the derivative of the Lyapunov function along the direction _ f is when the estimation error f changes in the direction given by equation (27), the system converges near the equilibrium state. When t ! ',f e ! f e , thus f e ! f r .
Combining the definition of f and formula (27), we can get In summary, the adaptive controller for the desired position x r is designed as follows

Control strategy
The industrial robot is combined with the end effector motion control, based on the adjustment of the contact force of the end effector and the control position of the industrial robot. Aiming at the grinding and polishing robot system scheme, a compliant motion control strategy is proposed. The control strategy is divided into two parts. The first part considers the process of robot moving to the workpiece in free space, the purpose is to reduce the impact force generated when the grinding and polishing robot hits the workpiece. The second part considers the end position, posture and force control adjustment when the robot is in contact with the workpiece and performs a compliant motion.

Impact control
The impact control is aimed at the working scene of the grinding and polishing robot and the workpiece from free space to stable contact. In Figure 4, when the grinding and polishing robot moves in the free space, the end effector contacts the workpiece with the required force through the impact control scheme. The position of the end effector is adjusted according to the contact force acting on it. When the position changes, the controller provides driving instructions for the voice coil motor module. Therefore, it is necessary to consider the linear motion range of the motor during the movement of the voice coil motor module. Define the middle position of the motor stroke as the motion reference position. It is also assumed that the distance between the workpiece and the grinding and polishing robot is unknown.
In Figure 4, the robot macro motion control algorithm is used to control the position of the grinding and polishing robot, and the robot micro motion control algorithm is used to switch to realize the position control and force control of the end effector. An appropriate amount of speed feedback adjustment is performed at the joints of the industrial robot. By reducing the speed of the robot's macro motion, the energy and therefore the impact force are reduced. The grinding and polishing robot detects the contact force in real time through a force sensor to determine the contact state: (1) When the robot is not in contact with the workpiece, the end effector selects a larger k pmi . It carries out position control with big rigidity to keep the motor position at the middle position of the motor stroke, which is the reference position P r . When the grinding and polishing robot moves along the contour of the workpiece, the end effector is controlled in P r to make the robot in the best working area.
(2) When f e À f r .h 1 f r is in contact with the workpiece, h 1 uses aluminum-aluminum friction coefficient of 0.2. 24 The end effector reduces k pmi and position control stiffness. It performs a larger position movement while applying a smaller force. By reducing the speed of the robot's macro motion, energy and impact are reduced. (3) When it is f e À f r .h 2 f r , the industrial robot will maintain its position, and the robot micromotion control algorithm will switch to the force control of the end effector. The robot macro motion almost stops.
The above is the process from free space to stable contact between the grinding and polishing robot and the workpiece. According to the specific material and application requirements of the workpiece, a is used as a contact sign to slow down the industrial robot, and b is a sign that the end effector is converted from position control to force control. When selecting other workpieces, you can fine-tune the above coefficients to obtain a good control effect.

Compliant control
The compliant motion control considers the process of stable contact between the grinding and polishing robot and the workpiece. It includes industrial robot pose control and end effector force control. The robot macro motion control algorithm makes the industrial robot move in accordance with the planned trajectory. The end effector maintains the required posture and force. The content of the control strategy is shown in Figure 5.
Force and position hybrid control of grinding and polishing robot. When the end effector is in contact with the workpiece, the grinding and polishing robot needs to be controlled to produce the desired motion and force. As shown in Figure 6, this paper draws on the idea of force/position hybrid control and introduces a selection matrix S to orthogonally decouple the task space into position free subspace and force constrained subspace. The axis of the force coordinate system and the position coordinate system are perpendicular, similar to the hybrid control of force/position. The industrial robot will move in the selected direction, the end effector adjusts the force applied to the workpiece through the impedance control method. The grinding and polishing robot uses force and position information for pose adjustment and end effector force control. The end  In the control scheme, even if the workpiece has a large size error, the grinding and polishing robot still moves along the unknown workpiece contour without losing contact. When the changing speed of the workpiece geometry is within the bandwidth of the robot system, the ability to track the pose of the grinding and polishing robot can be achieved. Most of the time in the tracking control should be in the end effector force control to meet the requirements of rapid response.
Polishing posture adjustment. For tracking inclined surface of workpiece contour, this article adopts the idea of contact torque adjustment. It adjusts the end posture of the robot when the robot is in initial stable contact with the inclined surface. When moving along the inclined surface, only consider adjusting the attitude of the robot end relative to the inclined surface during the initial contact, and there is no need to adjust the attitude at other times.
The end force of the grinding and polishing robot is shown in Figure 7. b is the base coordinate system. v n is the speed of the end of the robot, F n is the normal pressure of the inclined surface. F 1 is the craft corner, F 2 is the angle of the inclined plane. F is the movement angle of the robot in base coordinate system, which is equal to the sum of F 1 and F 2 . In the current posture, the torque generated by F n at the end of the robot is M n (k). Assuming that F n can generate torque M d at the end of the robot in the desired posture, then The current robot end posture adjustment rotation matrix is T R(k + 1) in the robot tool coordinate system, and the force sensor coordinate system coincides with the tool coordinate system T: where I is the unit matrix; u and u are the equivalent rotation axis vector and rotation angle respectively; S(u) is the skew symmetric matrix function of the vector u. 25 Calculate u(k + 1) and u(k + 1) according to the following expressions: where k m and k u are constant coefficients. It is easy to know that T R(k + 1) can be expressed as:  where b T R is the rotation transformation matrix of the robot tool coordinate system relative to the base coordinate system, then where b T(k) is the current pose matrix of the robot end. Substituting b T(k + 1)) into the inverse kinematics solution can obtain the robot joint angular displacement value of the desired posture. The robot macro motion control algorithm realizes the desired posture of the robot end adjustment.
Adjustment of grinding position. After the end of the grinding and polishing robot adjusts its posture and makes stable contact with the inclined surface, the end effector sends its displacement information to the industrial robot during the force control process. When the displacement of the end effector is far away from the set reference position, the existing displacement error is converted into a displacement compensated by the industrial robot. This puts the end effector at the reference point position.
The displacement error of the end effector is: where P is a position vector of 1 3 1 order; P r and P mi are the reference point position and actual displacement of the end effector. Considering that the end effector itself has 1 degree of freedom, the position error is represented by the scalar e pos at this time. The displacement error of the end effector in space should be represented by a position error vector of 3 3 1. Assuming that the end effector moves toward the z-axis relative to the end coordinate system of the grinding and polishing robot at this time, e pos is transformed into e mi . The displacement error of the end effector is compensated by the industrial robot, and we can get: where b T T is the transformation matrix of the robot tool coordinate system relative to the base coordinate system, and b T(k) is the current pose matrix of the robot end. Substituting b T(k + 1) into the inverse kinematics solution can obtain the robot joint angular displacement value, which is realized position error compensation of the end effector.

Simulation and analysis
According to the polishing process, the control strategy of the polishing robot is proposed to enhance the smooth motion performance of the polishing system. The MATLAB simulation platform is used to simulate the motion control of the grinding and polishing robot system. In the grinding process, it is usually considered to process in the normal direction of the workpiece, where the simulation processing direction is the normal direction of the workpiece. Furthermore, in the hardware part of this paper, a single degree of freedom end effector is designed. Considering the motion of the end effector, only the single direction motion is discussed. In order to verify the feasibility of the macro and micro force position hybrid control strategy for grinding and polishing robot, this paper avoid the complexity of three-dimensional posture and position simulation. The simulation assumes that the posture of the macro robot remains unchanged, and only considers the constraints such as the change of the normal position of the macro robot.

Robot micro motion control simulation
Position tracking. A single-direction position correction is performed on the micro-motion of the robot to verify whether the adaptive impedance control model can adapt to changes in the environment. 26 Assuming that the end position x of the robot is the same as the desired position x r , the error caused by the robot macro motion position control system is ignored. The environmental stiffness in the simulation can be selected according to the actual processing conditions. This article selects the processed aluminum parts. Table 1 shows the specific simulation parameters. Figure 8 shows the simulation of the designed adaptive control system performance in MATLAB/ Simulink. Table 2 shows the simulation parameters of displacement tracking under different conditions. Because the simulation is aimed at the force control algorithm and the corresponding control strategy, the movement of the end effector is mainly simulated. In order to show the dynamic model of the end effector, the voice coil motor subsystem is added in Figure 8.   Figure 5 shows the simulation of Simulink position tracking under different working conditions. Table 3 shows the simulation result data.
In Figure 9(a), when the environment position and stiffness remain unchanged, impedance control can achieve stable position tracking. The control system cannot accurately track the environmental position due to the error between the expected position and the environmental position. It can be seen from the average value of the two errors in Table 3 that the adaptive impedance control can achieve a smaller error tracking of the environmental position when the environmental position and stiffness are unchanged.  In Figure 9(b), the environment position changes with a sine law. Impedance control has lost the ability to track the environment position stably, while adaptive impedance control can still better track the environment position. In Table 3, although the average value of impedance control error is only 0.00127 m, the corresponding standard deviation is relatively large, and the tracking process is unstable.
In Figure 9(c), the location of the environment changes suddenly. Compared with the standard deviations of the two methods in Table 3, the impedance control transient response is faster. In their average error comparison, the adaptive impedance control environment position tracking error is small. From equation (30a), we know that we need to pay attention to the value of the desired force f r . If f r is too small, it is expected that the update of the position will be slow, so that it cannot respond quickly to changes in the environmental position. This shortcoming can be solved by appropriately increasing f r , but if f r is too large, the system will produce tracking errors of the environmental position. The value of f r needs to be determined according to actual requirements. 27 Figure 9(d) reflects the position tracking performance when the environmental stiffness changes suddenly. When the environmental stiffness changes suddenly, it can be seen from Table 3 that the response speed of adaptive impedance control is faster than impedance control, and the adjustment time is shorter. Figure 9(d) shows that the sudden change of environmental stiffness has an impact on the position tracking result of adaptive impedance control.  Position tracking. Table 2 is a parameter table of different working conditions. The adaptive impedance control simulates the contact force of the robot's micro-motion, and the expected force f r = 5. Figure 10 shows the Simulink simulation model of force estimation under different working conditions, and the simulation results are shown in Figure 11. The allowable error range of the force estimation curve is 1% of the expected force. Table 4 shows the statistical results of the simulation data.
In Figure 11(a), when the environment position and stiffness remain unchanged, the adaptive impedance control contact force estimate f e converges to the desired force f r . In Figure 11(b), when the environmental position changes in a sinusoidal law, the adaptive impedance control produces a larger force estimation   Figure 11(c) and (d) show that large force estimation errors will be caused, when the environment position or the environment stiffness changes suddenly. The environmental position increased from 0.01 to 0.011 m, resulting in a 10% change, corresponding to a force estimation error of 5 N. The environmental stiffness is reduced from 7000 to 3000 N/m, resulting in a 57% change, corresponding to a force estimation error of 2.851 N. The comparison shows that for a given f r , a sudden change in the environmental position produces a greater contact force error. Figure 11 shows that under different working conditions, f e will convergences to f r . This proves that the stability analysis conclusion described above is correct.

Impact control
The purpose of this experiment is to control the contact process between the grinding and polishing robot and the workpiece. In this process, through limited workpiece position information, the contact force will be controlled to the desired value and a small impact force will be generated.
It is assumed that the position control of the robot is error-free. In Figure 7, v n is the end speed of the robot along the inclined plane, which can be equivalently replaced by the environment position change speed v e in the control simulation. The impact force during the contact between the grinding and polishing robot and the workpiece is simulated and analyzed in Matlab/ Simulink. Table 5 shows the simulation parameter table of the impact force during the robot contacting the workpiece. Figure 12 shows the simulation of the grinding and polishing robot contacting the workpiece. The maximum contact force generated by the collision was taken when environmental stiffness changes into 7000 N/m at 1.5 s, and it is 220 N. The impact force control is used to handle the larger impact force in Figure 12. Table 5 shows the simulation conditions. The impact force control considers adjusting the size of the contact force, and uses the environmental stiffness change speed k e (1.5 s) as the variable design experiment. Setting k e (1.5 s) to the environmental stiffness 1/20, 1/10, 1/5, and 1/2 as the environmental stiffness change rate, and the values are 350, 700, 1400, and 3500 N/m/s.
In the description of impact control, h 1 = 0:2 is a contact mark, and h 2 = 0:6 is a mark that the end effector position control is converted to force control. v e is changed according to the control strategy in section 2.1. When the contact force increases to (1.2 f r ) 6 N, v e begins to decrease. When the contact force increases to (1.6 f r ) 8 N, the desired position of environment stops and v e is zero. The Simulink simulation results of the impact force control experiment for different environmental stiffness change speeds are shown in Figure 13, and the simulation results are shown in Table 6. Figure 13(a) corresponds to 350 N/m/s for k e (1.5 s). When the force estimation is h 1 or 6 N, the desired position curve becomes slow. When the force estimation is h 2 or 8 N, the desired position stagnates or even decreases. When the force estimation meets the desired value, the slope of the desired position curve recovers and moves according to v e . The force estimation and position estimation finally converged to the desired    value. The initial part of the force estimation curve is 0 N as the non-contact area, which satisfies the definition of contact force in equation (12). When k e (1.5 s) increases to 700 N/m/s, it can be seen from Table 6 and Figure 13(a) and (b) that the force estimation curve becomes narrower and higher. This shortens the corresponding adjustment time and increases the force error. Figure 13(c) and (d) show that with k e (1.5 s) increases, the force error increases, but the corresponding environmental error is stable. It can be seen from the above that the same workpiece and the same working condition have little effect on the position error when the environmental stiffness changes.
In Table 6, k e (1.5 s) increases and the adjustment time becomes shorter. The position error is reduced, the range is 0.041 m, and the corresponding force error gradually increases, the range is 17.84 N. In the impact control, considering the force adjustment time, the environmental stiffness change speed is selected to be 1400 N/m/s. When the environmental stiffness changes suddenly, the contact force is within the safe force range of the sensor, and the contact force can quickly remain stable. In addition, the desired position of the robot can quickly track the change of the environment position, and the error adjustment ability is strong.

Compliant control
When the contact force is stable, the robot moves on the surface of the workpiece according to the compliant control. According to the force/position hybrid motion control algorithm, the end of the industrial robot moves parallel to the surface of the workpiece, and the end effector performs force control perpendicular to the surface of the workpiece. The end effector will eventually reach the limit of its working space and lose contact force. For compliance control in section 2.2, when the end effector force control process is displaced, the industrial robot obtains the displacement value of the force control direction. The industrial robot moves perpendicular to the surface of the workpiece to keep the end effector at the reference position. During this process, the end effector maintains contact and does not lose contact force.
It is assumed that the position control of the robot is error-free. Figure 14 shows the compliant control simulation in MATLAB/Simulink, and Table 7 shows the corresponding simulation parameters.
Considering the tracking of the inclined surface of the workpiece, the angle of the inclined surface is expressed by the environmental position change speed v e . The simulation is designed with v e as a variable, taking 0.001, 0.005, 0.01, and 0.05 m/s to simulate processing conditions. When the environment position changes in different speeds, adaptive impedance control is used to obtain the position displacement during the control process. Figure 15 shows the Simulink simulation experiment of speed compliance with different environment position changes, and Table 8 shows the simulation results. When v e is 0.001 m/s and k e (1.5 s) is 1400 N/m/s for compliant motion control, the force estimation and position estimation of Figure 15(a) converge on the expected value. As shown in Table 8 and Figure 15(b), when v e increases, the position estimation curve is similar to that of Figure 15(a), and the corresponding position error is the same. However, the steady-state error of the force estimation curve becomes larger and the adjustment time becomes shorter.
As shown in Figure 15(c) and (d), during the process of increasing the speed of environmental position change, the corresponding environmental position error is stable, but the steady-state error of the force gradually increases. It can be seen from (30d) and (30b) that when the environmental position error is stable, the change of the environmental position will cause the estimation force to increase. This is in line with the situation that the force estimation in the table increases with the increase of the environment position speed.
In Table 8, when v e increases, the force adjustment time becomes shorter. The position error does not change much, the range is 0.00019 m, and the corresponding force steady-state error range is 3.902 N. Figure 15 shows that the robot and the workpiece are in stable contact. As v e increases, the force stabilizes in a short time, but the steady-state error of the estimated force increases. Considering that the reference force is 5 N, the maximum position error and the steady-state error of the force are in a reasonable range when the ring v e is less than 0.01. During the machining process, the environment position change speed less than 0.01 m/s can be selected to set the grinding and polishing speed parameters.

Experiment
In order to verify the hybrid control method of macro and micro force and position of grinding and polishing robot, the control experiment is carried out on the system platform. As the macro micro motion control method of the grinding robot is established in the control strategy, the joint control of the industrial robot and the end effector is carried out. In this section, the effectiveness of the method will be verified through the contact force and the macro micro motion trajectory. The composition of the experimental platform is shown in Table 9.
After the robot is powered on and enabled, the robot switches to the manual mode to control the robot to return to the origin. At this time, the grinding tool and   the workpiece are in a non-contact state. When the motion mode is switched to the automatic mode, the robot starts to read and run the trajectory taught in advance, as shown in Figure 16.
The initial position of robot is the teaching point 0. The robot moves from the teaching point 0 to the teaching point 1, and then to the teaching point 2, and the force control in z direction is turned on. The robot position in z direction remains unchanged. At this time, the grinding head and the workpiece have not contacted, and the end effector will make the grinding head fit with the workpiece and maintain the desired contact pressure under the force control. At the same time, the robot moves back and forth between teaching point 3 and teaching point 2 along the tangential direction (x direction) of the workpiece under the position control. The actual contact force between grinding head and workpiece in the whole grinding process is collected and analyzed. The sampling period of force sensor is 5 ms.
On the experimental platform described in Table 9, the performance of the macro micro force position hybrid control method in the grinding process is verified. The effectiveness of the method is verified by the motion trajectory and contact force. In this section, the contact force between the grinding head and the workpiece is set as 10 N, and the tangential movement speed in x-axis is 10 mm/s. The actual contact force between the grinding head and the workpiece during the grinding process is collected. There are protrusions on the surface of the workpiece, and only the coordinates of the starting point of the trajectory are given in the RAPID program.
During the experiment, the surface condition of the workpiece is unknown. According to the hybrid control method of macro micro force and position, the real-  time position of the industrial robot and the end effector can be superimposed as the surface position of the workpiece. In the experimental results, the z-axis macro motion and micro motion position of the end effector of the robot are shown in Figure 18. The abscissa represents the number of sampling periods, and the ordinate represents the position of each part of the robot.
The machining path can be obtained by superposing the two position curves in Figure 17, and the millimeter level shape of the actual workpiece surface can be estimated by the machining path, as shown in Figure 18.
After obtaining the estimation of workpiece surface topography, it is necessary to verify the workpiece surface condition. When the robot moves to the teaching point 2, the self-locking of voice coil motor is turned off, so that the end effector and the workpiece surface are always in a state of contact. The experimental results are shown in Figure 19. The ordinate represents the contact force between the grinding head and the workpiece.
In Figure 18, we can see that there are three bumps larger than 325 mm in the surface profile estimation curve, and the peaks appear at the 7500th, 13,440th and 18,580th sampling periods respectively. It shows that in the process of robot grinding and polishing, large contact forces are detected at these three positions, and the corresponding position adjustment are carried out.
It can be seen from Figure 19 that the contact force is not kept at 0 N during the movement without force control, which is due to certain deformation on the surface of the workpiece. As shown in Figure 19, the peak values of the contact force at the two bulges are 1.815 and 1.465 N. There are two peaks in the contact force curve, and the convex peaks appear in the 6960th and 17,580th sampling periods respectively. Through the comparison between Figures 18 and 19, the corresponding period of curve convex peak is basically the same, so the estimated workpiece surface position is basically consistent with the actual position. The experimental results show that the force control algorithm can effectively estimate the millimeter level surface topography of the workpiece.    Turn on the force control, carry out the experiment under the same conditions of other experiments, and collect the force in z direction of the sensor. The force control algorithm adopts adaptive impedance control, and the parameters are obtained by measurement during the experiment. The value of k is 2877.5 N/m, b is 220.36 N/ (m/s), and m is 1.4 kg.
The contact force curve of force control experiment is shown in Figure 20, the position curve of each part is shown in Figure 21, and the displacement curve of grinding and polishing robot is shown in Figure 22. According to the change of contact force, the curve is divided into five segments. In segment 1, before the end effector contacts the workpiece, the macro motion of the robot generates the contact force. Segment 2 is the process of the end effector contacting the workpiece, in which the micro motion of the end effector produces the contact force. Segment 3 is the process of the robot moving when the workpiece bulges, and the macro micro cooperative movement. Segment 4 is the stable operation process of the grinding and polishing robot. In Segment 5, the grinding robot ends its motion, and the end effector moves for force control.
The force and displacement of the above five parts are shown in Table 10.
It can be seen from Table 10 and Figures 20 to 22 that in segment 1, the robot first performs macro motion to generate contact force, and then the end effector performs high-frequency displacement adjustment. The amplitude of contact force curve is 3.48 N. In segment 2, the displacement adjustment of the end effector is less than that of the segment 1, and the amplitude of the contact force curve decreases to 3.42 N. In segment 3, when the grinding head is on the convex part of the workpiece surface, the adjusting displacement of the end effector increases, and the amplitude of the corresponding contact force increases to 3.93 N. Compared with the first two segments, the amplitude of contact force changes little, so the force control algorithm is effective. In segment 4, the robot realizes the stable grinding process. When the relative displacement of macro and micro motion increases, the contact force curve is stable, and the contact force is stable at 10 6 3 N. In segment 5, the robot is in the end position of the trajectory, the macro motion stops first, and the micro motion is adjusted until the contact force is 0 N to end the grinding and polishing process.    The experimental results show that the hybrid algorithm can estimate the millimeter level surface topography of the actual workpiece by machining trajectory, and it is effective for force control of unknown surface contact process. As for the error of force tracking, it can be considered that the force control is realized by using the secondary development interface of the robot. The controller of the robot system is closed and cannot directly modify the reference position. It can only send the robot control system to move to the relevant point through the interface, which reduces the real-time performance of the force control command.

Conclusions
(1) For the grinding and polishing robot system, an electrically driven end effector is designed to meet the needs of the system and to carry out a lightweight design. In addition, the digital axis modeling method is used to establish a model of the grinding and polishing robot system in contact with the environment. Through the discussion of the control model combined with the system dynamics and the impedance control method, the macro and micro motion control model of the grinding and polishing robot is established. (2) Aiming at the impact process of grinding and polishing, the active compliance method is adopted to establish impact control and compliance control strategies. The rough position information of the workpiece is used to realize the contact process of the workpiece through impact control, and the contact of the workpiece with unknown contour can be realized through the compliant motion control. Finally, the adaptive force control and position tracking control of grinding and polishing processing are realized. (3) The algorithm is verified by Simulink simulation and experiment. In MATLAB/Simulink, the control model, impact control and compliance control are simulated under different working conditions to verify the performance of force control and position tracking. The simulation results show that when the environmental stiffness change speed is 1/5 of the environmental stiffness and the environmental position change rate is less than 0.01, the position tracking error of the end effector does not exceed 0.009 m, and the force steady state error is less than 1 N. Through the grinding experiment of the workpiece, the effectiveness of the hybrid control strategy is verified. The motion curve is consistent with the surface morphology of the workpiece, and the contact force is stable at 10 6 3 N. The experimental results show that the hybrid algorithm can estimate the millimeter level surface topography of the actual workpiece by machining trajectory, and it is effective for force control of unknown surface contact process.