1 Introduction

Robotic research has witnessed remarkable advances in industrial applications such as spray painting, palletizing, and welding. Such tasks are performed using either simple position-based or force-based control strategies as the interaction between the end effector and the environment is negligible. Despite the numerous advancements in robotics, the tasks that involve physical interactions with the environment in which humans excel are inherently challenging for the robots to carry out autonomously. The subtle positional and force adaptations exhibited by the human operators to compensate for instabilities cannot be captured by pre-programmed position or force control strategies alone [1, 2]. As a consequence, polishing tasks that take up to 50% of total manufacturing time in the industry [3] still predominantly rely on skilled operators. Notwithstanding the growth, robot finishing constitutes less than 1% of current robot applications [4]. This is owing to several factors such as the robotic metal finishing still not as good as manual operation in the surface finish in smoothness, accuracy, and the difficulties in programming the robot itself. These problems are exacerbated when it comes to small and medium enterprises (SME) due to high mix low volume parts handled by them.

Robots that are used for polishing require a high degree of compliance during the execution to control the final output [5,6,7,8,9,10]. Thus, an adaptive interaction control is required to achieve the desired profile geometry and surface roughness which can be achieved based on either special compliant tools such as macro-mini systems or compliance based on the control algorithms. In the interaction control using special compliant tools, the end effector can typically compensate for force errors in different axes. The compliant tools can either be passive [11,12,13] or can be active tools [14] to maintain the desired contact force. The passive compliant tools usually rely on the compliance of the tool itself to maintain the normal contact force, whereas the active tools rely on a closed-loop force control system to correct the force errors. Huang et al. in [11, 13] make use of passive compliant tools (PCT) for grinding and polishing turbine vanes. In [15], an active end effector–based force control system is devised for robotic deburring. Although the active compliance control that uses an actuator is very good resulting in high accuracy, there are difficulties in designing these special compliant polishing tool [16]. Further, excessive compliance of the tool will decrease the stiffness during the polishing and makes the profile tracking less accurate.

To achieve interaction tasks using control algorithms, either hybrid position/force controllers or impedance controllers are typically deployed. In a hybrid position/force control for surface finishing, the position is generally regulated along the surface, while the force is usually controlled in normal directions. Force control strategies and hybrid position/force control of robotic manipulators have been extensively deployed for finishing processes including deburring, polishing, and grinding. A comprehensive overview of robot force control can be found in [17, 18]. In [19], hybrid position/force control based on fuzzy control is proposed for obtaining the desired chamfer depth. Surdilovic et al. [20] utilized CAD/CAM for path planning for milling and grinding very hard materials like Inconel and proposed a combination of force and feed control for polishing hard materials. Hybrid control requires precise knowledge of surface geometry to yield a good surface finish. Besides, as a controller with fixed impedance, hybrid control struggles with stability issues arising from tool usage [21] and cannot adapt to unknown surface conditions.

In impedance-based control, the relationship between the position and force is regulated, thus enabling to adapt to unknown environments. Hogan [22] in his seminal work proposed the idea that, in impedance control, the force commanded to the robot is regulated in response to a variation of the nominal trajectory (due to the interaction with the external environment), while in admittance control, the robot kinematics is controlled in response to a detected force (arising from the interaction with the environment). In a pioneering work, Kazerooni [23] developed and implemented impedance control methodology for precision deburring and grinding. Later, Wang et al. [24] developed an adaptive framework based on impedance control in which the cutting force and feed rate are adjusted automatically to obtain better quality, in which a model is developed to predict the cutting force. Isela et al. [25] were able to perform path tracking maneuvers using impedance control on industrial robots. Loris et al. [26] performed robot probing tasks by limiting the force overshoots in which the control gains are defined analytically by estimating environment stiffness using an extended Kalman filter. Drawing inspiration from human behaviors, Yanan et al. [27] presented a human-like controller to interact with unknown environments that can adapt force, stiffness, and position for contact tasks such as drilling and cutting. Furthermore, Buckmaster et al. [4] proposed an admittance control–based approach for surface finishing in which a high admittance is maintained normal to the part surface and high impedance is maintained tangent to the part surface where the tool path is generated using CAD, which is similar to the hybrid position/force control.

One of the robust control schemes involves iterative learning control (ILC) which is simple to implement and does not require exact knowledge of the dynamic model of the robot [28, 29]. In a typical iterative impedance control scheme for a robotic manipulator, the control objective is to track a target (reference) impedance model as well as the reference trajectory, in which the impedance is learned [30,31,32]. Such an ILC ensures that the system response fulfills the specified target impedance as the actions are repeated.

Despite these advancements, finishing remains challenging and is an active research problem [33,34,35,36,37,38,39,40], especially difficult due to the double whammy of dealing with instabilities from chattering as well as the difficulty in achieving precision in polishing hard materials for numerous industrial applications. Our goal in this study is to develop a complete framework that can carry out the finishing operations on a variety of materials using collaborative robots in a simple yet robust manner suitable for SME. We propose a novel iterative learning controller based on impedance that simultaneously adapts both the position and the force in each iteration. Unlike the iterative adaptive impedance controllers found in the literature [28, 30,31,32], the proposed iterative controller does not require any a priori knowledge of forces to polish a particular material and does not require force feedback as the force adaptation is accomplished implicitly.

We validate the adaptive controller through various chamfering and filleting trials on numerous materials such as titanium, aluminum, and wood. In addition to the robot control, manual programming of the robot is highly cumbersome and needs highly skilled operators [41]. Since the polishing posture and the toolpath have an enormous effect on the efficiency of the overall polishing operation as well on the surface integrity of the workpiece [16], SMEs often have to rely on either inefficient manual programming or expensive vision sensors [42]. To address this challenge, we propose a novel mathematical model to generate a toolpath in real time for filleting process based on Lissajous curves that do not require any external sensors. Further, our framework extensively utilizes kinesthetic teaching in low impedance settings through which an operator can intuitively teach various processes efficiently.

Major contributions of this paper include a robust ILC based on fixed impedance to track the position and to implicitly control the force to polish different materials, including hard metals like titanium, using collaborative robots and the mathematical model to generate the filleting toolpath. One of the main advantages of our framework is that the no knowledge of the force is required as a priori to polish parts made of different materials, which is particularly helpful for SMEs that process high mix low volume workpieces. Further, our framework can acquire the toolpath and posture efficiently without requiring any additional force sensors or vision systems keeping the cost of the entire setup economical and at the same time overcome the bottlenecks associated with manual programming. To the authors’ knowledge, we are the first to study polishing using cobots based on an iterative impedance controller and propose an accurate way to generate a toolpath for filleting in real time.

The paper is organized as follows: In Section 2, the mathematical model to generate the toolpath and the iterative controller are introduced. In Section 3, the hardware and the software setup for the polishing trials are described. Using the chamfering trials on titanium workpieces as a use-case, we provide an elaborate account on the effects of the proposed controller in Section 4.1. To illustrate the generalization capability of the proposed framework on different materials, the trials on aluminum coupons are explained in Section 4.2, and in Section 5, the filleting trials on aluminum and wood are briefly outlined.

2 Toolpath generation and adaptive controller

The toolpath generation for chamfering and filleting process is described in Section 2.1. Further, the details on the proposed adaptive controller are given in Section 2.2. The nomenclature of the symbols used in the article is given in the Table 1

Table 1 Nomenclature

.

2.1 Toolpath generation

To generate the reference trajectory for the robot quickly without requiring any vision systems, we utilize kinesthetic teaching by the operator. The details of the toolpath generation for chamfering and filleting process are described in Sections 2.1.1 and 2.1.2, respectively.

2.1.1 Toolpath generation for chamfering

Chamfering is a finishing operation in which a sharp edge is beveled generally at an angle of 45° to the two adjoining right-angled faces. For obtaining the toolpath for the chamfering, in our framework, the human operator kinesthetically teaches the robot in a low impedance (high compliance) mode (i.e., with stiffness values as low as 1 N/m, whereas maximum achievable values are as high as 5000 N/m). Using the starting and ending points of the chamfering and the robot posture obtained from the kinesthetic teaching by the operator, a reference trajectory is generated by linear interpolation with a user-specified chamfering depth as illustrated in Fig. 1a and b.

Fig. 1
figure 1

a Kinesthetic teaching and b illustration of the chamfering trajectory

2.1.2 Toolpath generation for filleting based on a mathematical model

Filleting is a polishing process of rounding an edge to improve the part’s durability by dispersing the stress concentration. Unlike chamfering, the toolpath for the filleting is quite complicated due to the fact that the filleting trajectory requires fine motion with continuous changes in both position and orientation of the tool along the edge. In a typical industrial setting, the manual filleting process is carried out with two unique features: the orientation of the tool is continuously varied and subsequently followed up by a lateral movement along the edge as shown in Fig. 2 to ensure that the edge is rounded off evenly. Inspired by both the manual filleting and chamfering process, we have reformulated the problem of filleting as a special case of chamfering in which the tool inclination is varied at different parts of the edge.

Fig. 2
figure 2

Varying tool poses in filleting (a) at the edge, (b) X′Y′ face, and (c) Y′Z′ face

For example, when working exactly on the edge, i.e., the intersection between the two faces X′Y′ and Y′Z′, the tool will be at an inclination angle of 45° as observed from the Fig. 2a. Further, when the tool is at the face X′Y′, the inclination of the tool θ will be increased depending on how far the tool center point is from the edge as indicated by Fig. 2b. At its farthest, the tool will be held parallel to the surface X′Y′ and θ = 90°. Likewise, when the tool is at the surface Y′Z′, the angle of inclination θ will be reduced depending on how far the tool center point is from the edge as viewed from Fig. 2c. At the extreme point, the tool will be at an upright vertical position on the face Y′Z′ and the θ = 0°.

The frames X′, Y′, and Z′, as shown in Figs. 2a, b, and c and 3b, are used to generate 2D Lissajous curves based on the kinesthetic teaching by the user and have an identical orientation to the robot’s X, Y, and Z frames. To obtain a filleting toolpath in real time based on this strategy, we propose a simple mathematical model in which the two parameters angle of inclination θ and lateral movement along Y are automatically generated using the concept of Lissajous curves [43]. In general, the Lissajous is the 2D wave patterns that are generated when we plot two sinusoidal waves on both X- and Y-axes as indicated by the Eqs. (1) and (2).

Fig. 3
figure 3

a 2D Lissajous curves and b mathematical model to transform Lissajous into 3D Pose

$$ {\mathrm{Y}}^{\prime }=\mathrm{Asin}\left(\mathrm{at}+\updelta \right) $$
(1)
$$ \uptheta =\mathrm{Bsin}\left(\mathrm{bt}\right) $$
(2)

where A and B refer to the amplitude of the functions Y′ and θ, respectively; a and b refer to the frequencies of the functions Y′ and θ respectively; and δ refers to the phase shift between the functions Y′ and θ. By modifying the frequency, amplitude, and phase shift, we can generate a wide variety of patterns for disparate application. Using the starting and ending poses P1 (x1,y1,z1, R1) and P2 (x2,y2,z2, R2), respectively, as well as the desired fillet radius (r) that is obtained from the user, a 2D Lissajous curve is generated using two functions Y and θ [Eqs. (3) and (4)] as shown in Fig. 3a.

$$ {\mathrm{Y}}^{\prime }=\frac{\left({\mathrm{y}}_2+{\mathrm{y}}_1\right)}{2}+\left(\frac{{\mathrm{y}}_{2-}{\mathrm{y}}_1}{2}\right)\sin \left(\mathrm{at}+\updelta \right) $$
(3)
$$ \uptheta =\frac{\uppi}{4}+\left(\frac{\uppi}{4}\right)\sin \left(\mathrm{bt}\right) $$
(4)

The terms (y2 + y1)/2 and π/4 are added to functions Y′ and θ, respectively, to ensure that resultant filleting motion is smooth with continuous changes in both position and orientation of the tool along the edge as shown in the Fig. 2. As we need the reference trajectory comprising 3D poses to command the robot, a relationship between 2D Lissajous pattern to the 3D position is established based on the model as illustrated in Fig. 3b.

Using the desired fillet radius and Y′ and θ that we generated using the 2D Lissajous curves, the position component of the pose XP and the rotational component R are determined as follows.

$$ {\boldsymbol{X}}_P=\left[\begin{array}{c}r-r\cos \theta \\ {}Y^{\prime}\\ {}-\left(r-r\sin \theta \right)\end{array}\right] $$
(5)
$$ R=\left[\begin{array}{ccc}\sin \theta & 0& -\cos \theta \\ {}0& 1& 0\\ {}\cos \theta & 0& \sin \theta \end{array}\right] $$
(6)

Thus, using the Eqs. (5) and (6), the 2D Lissajous curve in the parametric space is transformed into the 3D poses for the reference robot trajectory. As the orientation directly obtained from the Eq. (6) changes at each successive point which may lead to jittery motion of the tool, we fixed the filleting orientation by using 8 discrete sets of angle θ between 0° and 90° by rounding off the angles R obtained from Eq. (6) and thus generated a reference trajectory to yield a fillet profile with desired radius (r) as illustrated in Figs. 4 and 5b. Reference trajectories for both chamfering and filleting are used to initialize the robot motion, and once a reference trajectory is generated, any interaction with the human operator is no longer required.

Fig. 4
figure 4

Illustration of filleting trajectory

Fig. 5
figure 5

Reference trajectory with via frames. a Chamfering and b filleting

2.2 Iterative controller based on impedance

In our iterative learning controller based on impedance, the robot acts as a virtual spring-damper system in which the force exerted on the environment is directly proportional to the difference between the desired state of the robot and the actual state. The dynamics of an impedance-controlled robot in Cartesian space, from Ficuciello et al. [44], is given by

$$ \Lambda {\ddot{\mathrm{P}}}_{\mathrm{ACT}}+{\mathrm{D}}_{\mathrm{d}}\left({\dot{\mathrm{P}}}_{\mathrm{CMD}}-{\dot{\mathrm{P}}}_{\mathrm{ACT}}\right)+{\mathrm{K}}_{\mathrm{d}}\left({\mathrm{P}}_{\mathrm{CMD}}-{\mathrm{P}}_{\mathrm{ACT}}\right)={\mathbf{W}}_{\mathrm{ext}} $$
(7)

where Λ represents the 6 × 6 inertia matrix of the robot and the PCMD and PACT are the 6D configuration frames that represent the commanded and the actual pose of the robot that include 3D positions XP and orientation R in Euler angles. In general, a robot pose P can be represented as shown in the equation below.

$$ \mathrm{P}={\left[{{\mathbf{X}}_{\mathrm{P}}}^{\mathrm{T}}\ {\mathrm{R}}^{\mathrm{T}}\right]}^{\mathrm{T}} $$
(8)

The matrices Dd and Kd are the desired Cartesian damping and desired Cartesian stiffness matrices, respectively, both being 6 × 6 matrices. The term Wext represents the external interaction wrench arising from the tooling task and includes both interaction 3D forces fext and 3D torques τext, i.e., Wext = [fextτext]T.

To make it specific about the position, consider an initial trajectory of the robot TREF which comprises of M “via” frames P, each with position XP and orientation R and with the sampling time ti in milliseconds. The reference trajectory TREF for chamfering and filleting can be represented as a sequence of robot pose frames P as shown in Fig. 5a and b, respectively. The chamfering reference trajectory is comprised of 400 via frames with a user-specified chamfer depth of 1 mm, while the filleting reference trajectory includes 800 via frames with a user-specified fillet radius of 5 mm.

$$ {\mathrm{T}}_{\mathrm{REF}}=\left\{{\mathrm{P}}_{\mathrm{REF}}\left({\mathrm{t}}_{\mathrm{i}}\right),\mathrm{i}=1,2,\dots, \mathrm{M}\right\} $$
(9)

Similarly, a commanded trajectory for any pass can be written in terms of frames P as,

$$ {\mathrm{T}}_{\mathrm{CMD}}^{\mathrm{N}}=\left\{{\mathrm{P}}_{\mathrm{CMD}}^{\mathrm{N}}\left({\mathrm{t}}_{\mathrm{i}}\right),\mathrm{i}=1,2,\dots, \mathrm{M}\right\} $$
(10)

where the subscript N represents the iteration number and, for the first iteration, the commanded trajectory of the robot will be equal to the reference trajectory \( {\mathrm{T}}_{\mathrm{CMD}}^1:= {\mathrm{T}}_{\mathrm{REF}} \). The commanded frames of the end effector are represented as \( {\mathrm{P}}_{\mathrm{CMD}}^{\mathrm{N}}\left({\mathrm{t}}_{\mathrm{i}}\right) \), while the actual frames of the end effector are represented as \( {\mathrm{P}}_{\mathrm{ACT}}^{\mathrm{N}}\left({\mathrm{t}}_{\mathrm{i}}\right) \). Kinematic positional error εP is determined by the following equations:

$$ {\boldsymbol{\upvarepsilon}}_{\mathrm{P}}^{\mathrm{N}}\left({\mathrm{t}}_{\mathrm{i}}\right)={\mathbf{X}}_{\mathrm{REF}}\left({\mathrm{t}}_{\mathrm{i}}\right)-{\mathbf{X}}_{\mathrm{ACT}}^{\mathrm{N}}\left({\mathrm{t}}_{\mathrm{i}}\right) $$
(11)
$$ {\boldsymbol{\updelta} \mathbf{P}}^{\mathrm{N}}\left({\mathrm{t}}_{\mathrm{i}}\right)=\upalpha \ast {\boldsymbol{\upvarepsilon}}_{\mathrm{p}}^{\mathrm{N}}\left({\mathrm{t}}_{\mathrm{i}}\right) $$
(12)

where both \( {\boldsymbol{\upvarepsilon}}_{\mathrm{P}}^{\mathrm{N}}\left({\mathrm{t}}_{\mathrm{i}}\right)\kern0.5em \mathrm{and}\kern0.5em \boldsymbol{\updelta} \mathbf{P}\in {\mathbb{R}}^3 \) are used to track the desired reference trajectory, N indicates the iteration number, and α is the proportional gain. The actual position of the robot at each instance of time ti is then measured using the in-built robot sensors and subsequently sent to the MATLAB for analysis. For the next iteration N + 1, the commanded trajectory of the robot will be computed as follows:

$$ {\mathrm{T}}_{\mathrm{CMD}}^{\mathrm{N}+1}=\left\{{\left[{\left({\mathbf{X}}_{\mathrm{CMD}}^{\mathrm{N}}\left({\mathrm{t}}_{\mathrm{i}}\right)+{\boldsymbol{\updelta} \mathbf{P}}^{\mathrm{N}}\left({\mathrm{t}}_{\mathrm{i}}\right)\right)}^T\ R{\left({t}_i\right)}^T\right]}^T,\mathrm{i}=1,2\dots, \mathrm{M}\right\} $$
(13)

Intuitively, it can be interpreted that the commanded trajectory is iteratively adapted so that robot actual trajectory can track the desired reference trajectory resulting in the desired geometric profile of the workpiece. The advantage of using iterative impedance control in interactive tasks is that the force would automatically adapt depending on the relationship with the position. Thus, the proposed algorithm adapts the positions directly while implicitly controlling the contact force. From Eq. (7), The force exerted by the manipulator is directly proportional to the difference between the commanded position and actual position, i.e.,

$$ {\mathbf{f}}_{\mathrm{ext}}\propto \left({\mathbf{X}}_{\mathrm{CMD}}-{\mathbf{X}}_{\mathrm{ACT}}\right) $$
(14)

The controller that we propose for the polishing processes accomplishes the whole operation in multiple iterations (passes). Based on the Eqs. (11), (12), and (13), both position and forces are adapted iteratively in each pass. As the tool center point of the robot is required to be a maintained at a certain orientation in the chamfering and filleting processes, we consider only the adaptation of the position of the frames in the control algorithm in Eqs. (11), (12), and (13); i.e., only the positional component XP will be adapted, and orientation R will be kept constant. If the tool is not removing enough material and still far from the reference position (i.e., high value \( {\boldsymbol{\upvarepsilon}}_{\mathrm{P}}^{\mathrm{N}} \)) in the Nth iteration, the force fext would increase in the subsequent N + 1th iteration to facilitate higher material removal. Similarly, if the tool removes the material adequately and the difference between the commanded and actual positions is low (i.e., low \( {\boldsymbol{\upvarepsilon}}_{\mathrm{P}}^{\mathrm{N}} \)), the corresponding interaction force tends to be low in the next N + 1th iteration. Thus, the robot operator does not need any a priori information about the contact forces required to polish a material. Though the actual trajectory of the robot can converge with the initial reference trajectory given enough time, we achieved the best results in chamfering and filleting with 15 and 5 iterations, respectively, from our trials. The steps involved in chamfering and filleting can be illustrated as below.

figure a

The feedback about the actual position, forces, and orientation with which the robot reaches any particular point is logged and stored for analytical purposes. At the end of each iteration, the actual trajectory obtained from the controller is compared with the reference trajectory in Eq. (11) and subsequently used to adapt the commanded trajectory in Eq. (13) to diminish the positional error in the next iteration as shown in Fig. 6. Such an incremental adaptation of trajectory is to ensure that the finishing operation is accomplished following the desired profile and incremental force adaptation without damaging the workpiece. Furthermore, due to the error correction through an iterative feedback, loop also lessens the amount of rework later.

Fig. 6
figure 6

Schematic diagram of the proposed controller

The proposed controller is very different from a typical position-based impedance control approaches found in the literature [45, 46]. In a typical position-based impedance control, an inner positional control loop is combined with an outer force control loop. The inner loop represents a common positional controller, while the outer loop includes a force feedback compensator representing admittance. This outer loop becomes active when the end effector contacts environment and induce a force. Based on the force error between the actual force and target force, the force compensator produces a position adjustment command. In the inner loop, the position error is used to induce the force (impedance) by multiplying with a given stiffness value (K). Unlike a position-based impedance controller, our proposed controller does not require force feedback compensator to simultaneously adapt the force and trajectory.

3 Experimental setup

3.1 Hardware setup

The hardware structure consists of KUKA LBR iiwa 7 R800 compliant robot that uses Series Elastic Actuators to actuate the joints. It possesses 7 degrees of freedom, has 7 kg payload, and has a repeatability of ± 0.1 mm. As a result of its low weight, it has a low moment of inertia which makes the robot adept in responding to collisions to minimize its impact and is ideal for collaborative tasks involving humans. A Dynabrade 11476 dynabelter abrasive belt tool powered by compressed air is attached to the flange of the KUKA robot as shown in Fig. 7. This Dynabrade tool is a heavy-duty model with 1″ wide abrasive belt capacity and hence capable of polishing even the metals with very high hardness such as titanium. We used an abrasive of grit size P100 for the chamfering trials on both titanium and aluminum coupons and the filleting trials on aluminum workpieces. The KUKA robot supports impedance control mode, which is ideal to carry out collaborative tasks and to ensure a robust response to environmental uncertainties. In impedance mode, the linear stiffness can be set up to 5000 N/m, while rotation stiffness can be set up to 300 Nm/rad.

Fig. 7
figure 7

KUKA iiwa R800 Robot attached with abrasive belt tool

3.2 General software architecture

The KUKA robot is programmed with Sunrise Workbench software based on JAVA Programming language using KUKA RoboticsAPI with its predefined methods. Using the TCP/IP connection, a bidirectional communication link between MATLAB and Sunrise Workbench is established. We used an in-built mode in Sunrise Workbench known as “Sunrise Connectivity Servoing” that can set one end destination frame for the KUKA robot at a time from MATLAB. By updating the end destination continuously in real time from MATLAB, a continuous stream of Cartesian trajectory is given to the KUKA robot. During the robot execution, the actual pose of the robot for each via frames is measured and sent back to MATLAB for iterative adaptation. Thus, at the end of each pass, the actual trajectory followed by the robot is determined through the feedback from the controller and compared against the reference trajectory using the adaptation algorithm proposed in Section 2.2 and consequently used to update the commanded trajectory in the next iteration.

For the experiments on the chamfering and filleting, the stiffness matrix Kd is set such that the translational stiffness along X-, Y-, and Z-axes is 800 N/m, while the rotational stiffness about all axes is set to 300 Nm/rad. The value of the damping coefficient (Dd) for all degrees of freedom is set at 0.7.

4 Experiments on chamfering

We selected titanium and aluminum coupons for the chamfering trials as they are among the widely used materials in the manufacturing industry. The effects of the iterative controller are described in detail in Section 4.1 taking the chamfering trials on titanium workpieces as a use-case. In addition, the results of the trials on aluminum work coupons are briefly explained in Section 4.2. Finally, the profile and surface roughness measurements of the chamfered components are provided in Section 4.3.

4.1 Chamfering trials on titanium workpieces

Based on the kinesthetic teaching of the robot in a compliant mode, we first obtained the reference trajectory for chamfering with a chamfer depth of 1 mm in both X and Z directions as viewed in Fig. 5a. Subsequently, the chamfering trials on titanium work coupons are initiated with a gain of around 15% (i.e., α = 0.15) in the Eq. (12). Once an iteration is complete, the actual trajectory followed by the robot is compared against the reference trajectory of the robot and the commanded trajectory for the subsequent pass is adapted based on Eqs. (11), (12), and (13). Before the commencement of the operation, the commanded path at the first iteration equals the initial reference trajectory as observed from Fig. 8a. As the robot initiates the finishing operation in the first iteration, there was a positional difference between the reference and the actual trajectories of the robot despite the material removal. To overcome this positional error, the commanded position in X- and Z-axes are adapted significantly, attempting to go far deeper into the workpiece than the initial 1 mm depth given in the reference trajectory. The positional error between the reference and the actual trajectories of the robot keeps diminishing gradually after each iteration. This can be seen from plotting the actual path of the robot as shown in Fig. 8b. Further, the absolute error is computed for each instance of time by calculating the squared error between the reference and the actual trajectories of the robot as given below.

$$ {\mathrm{E}}_{\mathrm{abs}}=\sqrt{\left({\left({\mathrm{x}}_{\mathrm{REF}}-{\mathrm{x}}_{\mathrm{ACT}}\right)}^2+{\left({\mathrm{y}}_{\mathrm{REF}}-{\mathrm{y}}_{\mathrm{ACT}}\right)}^2+{\left({\mathrm{z}}_{\mathrm{REF}}-{\mathrm{z}}_{\mathrm{ACT}}\right)}^2\right)} $$

where xREF, yREF, and zREF refer to the x, y, and z values of frames in reference robot trajectory (in mm) and xACT, yACT, and zACT refer to the x, y, and z values of frames actual robot trajectory (in mm). When we plot the absolute error (for each frame) and the mean absolute errors (for an iteration) between the reference and actual trajectories of the robot as in Fig. 9a and b, respectively, we observed the positional error keeps decreasing gradually after each iteration. We observed that the error reduction is significant in the initial passes followed by gradual plateauing in the later passes. Intuitively, this whole reduction in the positional error can be construed as a mechanism to track the required profile (i.e., reference trajectory) accurately after each pass, which is quite apparent from the lower values of the plot for the absolute errors.

Fig. 8
figure 8

a Commanded and b actual path followed by the robot

Fig. 9
figure 9

a Absolute error and b mean absolute error between TREF and TACT

As expected, the force exerted by the robot is highly dependent on the positional difference between the commanded (TCMD) and the actual trajectories (TACT) at a given time instance as observed from the corresponding plots of absolute error and mean absolute error in Fig. 10a and b, respectively. Unlike the positional error between the reference and actual trajectories, this error is observed to be increasing after each subsequent adaptation. This has to do with the fact that robot is not able to reach the commanded path in the initial iteration, i.e., not able to penetrate the titanium workpiece to track the commanded path, and thus adapts its commanded path further to compensate for the low material removal and low forces. Thus, the forces are implicitly controlled by adapting the commanded trajectory in our controller.

Fig. 10
figure 10

a Absolute error and b mean absolute error between TCMD and TACT

Consequently, the normal force is initially low in the first few iterations as the force exerted on the workpiece by the robot is directly proportional to the positional difference between the commanded and the actual trajectories of the robot based on a virtual spring-damper system. As the commanded path gets adapted based on the positional error, the normal force also gradually updated after each pass as observed from Fig. 11a and b. During the initial pass, the mean normal contact force is 5.43 N, and in the 15th pass, it reaches 7.19 N. In the force plots as observed from Fig. 11a, a significant spike in force is observed when the tool initially establishes contact with the workpiece.

Fig. 11
figure 11

a Normal forces and b mean normal forces chamfering titanium workpieces

4.2 Chamfering trials on aluminum workpieces

We conducted chamfering trials in aluminum work coupons with the same end-of-arm tool and observed a control behavior that was identical to the trials on titanium. For example, the positional error between the reference and the actual paths decreases gradually in each iteration as evident from Fig. 12a and b. After 13 passes, the positional error no longer reduces noticeably and reaches a saturation point as shown by the plots for absolute error. Generally, in our controller, if the tool cannot approach the initial reference trajectory in the first few passes, it leads to a gradual increase in normal forces in latter passes as observed from the trials involving titanium. When we plot the absolute error between the commanded and the actual robot trajectories for a few selected passes, as seen from Fig. 13a and b, we observe that the positional error between TCMD and TACT is comparatively low in aluminum compared to the trials on titanium. As a consequence, the mean forces observed at each iteration tends to be relatively lower than the one observed during the titanium trials as depicted in Fig. 14a and b. At the initial iteration, the mean normal force is 1.42 N, while at 15th pass, it equals to 2.18 N. One explanation for the relatively low absolute error and the forces observed in chamfering aluminum coupons is due to the hardness of aluminum. As the hardness of aluminum is much lower than titanium, the robot’s actual trajectory was able to approach the desired reference trajectory relatively fast in initial iterations, thus rendering the forces low in latter passes.

Fig. 12
figure 12

a Absolute error and b mean absolute error between TREF and TACT

Fig. 13
figure 13

a Absolute error and b mean absolute error between TCMD and TACT

Fig. 14
figure 14

a Normal forces and b mean normal forces chamfering in aluminum work coupons

4.3 Performance metric

To validate the chamfering trials on both titanium and aluminum coupons, we use the accuracy and the surface roughness as a performance metric to gauge the output. To measure the dimensions of the chamfered edges, we utilized a noncontact laser profile measurement device (GapGun Pro), and the measurements are shown in Table 2. In addition, the surface roughness of the chamfered edges is given in Table 3. As we utilized a coarse abrasive belt of grit size of P100 for the chamfering trials, an even finer surface finish can be achieved by using a finer abrasive, i.e., higher grit size.

Table 2 Profile measurement of the chamfered workpiece
Table 3 The surface roughness of the chamfered workpiece

We have obtained geometrical accuracy of ± 0.133 and ± 0.033 in the titanium and aluminum workpieces, respectively, which are acceptable for grinding operations in the industry [15, 48]. The chamfered output of the titanium and aluminum workpieces can be viewed from Fig.15a and b, respectively.

Fig. 15
figure 15

Chamfered workpieces. a Titanium and b aluminum

We have consistently obtained surface roughness values less than 1.5 (μm) in the titanium and 1.85 (μm) in aluminum workpieces, respectively, which are acceptable for grinding operations in the industry [48]. A further finer surface finish can be achieved by carrying out the experiments with abrasives of higher grit size and using coolants such as diamond polishing paste.

5 Experiments on filleting

To test the generalization of the iterative controller, we carried out filleting trials on the aluminum and wooden workpieces and briefly described the results in Section 5.1. Subsequently, the profile measurements of the filleted coupons are provided in Section 5.2.

5.1 Filleting trials on aluminum and wooden coupons

The filleting trials are carried out using a toolpath that is generated by the proposed mathematical model as seen in Fig. 5b with a user-specified fillet radius of 5 mm. The frequencies of the functions Y′ and θ are set to be 2 and 0.43, respectively, to ensure that the robot trajectory during the filleting follows a reciprocal movement for different angles of θ along the edge and not across it. Though the controller behavior in filleting is in general identical to the trials on chamfering, the absolute error between the reference and the actual filleting trajectories as well as the forces involved in filleting aluminum workpieces are relatively high compared to the chamfering trials on aluminum coupons as seen in the Fig. 16a and b, respectively. This observation of the relatively high mean absolute error may be owing to the several factors such as higher material removal, as the desired fillet radius is set to be 5 mm compared to 1 mm desired depth given in chamfering, as well as the complicated trajectory of the filleting itself. From the experiments, the mean normal force in the first iteration is observed to be 7.35 N and gradually adapted to 5.8 N in the final iteration. A sample of the fillet output in aluminum work coupon can be seen in Fig. 18a.

Fig. 16
figure 16

a Mean absolute error, b mean normal force in filleting Aluminum, c mean absolute error, and d mean normal force in filleting wood

For the filleting trials on wooden workpieces, we have utilized Dremel E-4000 as the end-of-arm tool (EOAT) as observed in Fig. 17 due to its suitability. Apart from EOAT and the abrasives used, the remaining setup and the procedure followed is same as the filleting trials on aluminum. In the trials, we observed that the mean absolute error and mean normal force in each iteration to be relatively low compared to the filleting trials on aluminum as shown in Fig. 16c and d, respectively. A sample specimen of the filleted component can be viewed in Fig. 18b.

Fig. 17
figure 17

End-of-arm-tool for filleting wooden coupons

Fig. 18
figure 18

Filleted workpieces. a Aluminum and b wood

5.2 Performance metric of the filleted components

To validate the output of the filleted components, we use the accuracy of the filleted component using a noncontact profile measurement device (GapGun Pro). The readings from the device are shown in Table 4 for several trials on both aluminum and wooden workpieces. These results are acceptable for filleting in the industrial applications as they are within ± 1 mm tolerance of desired filleting profile [48].

Table 4 Profile measurement of filleted component*

6 Conclusion and future work

In this paper, we have presented an adaptive framework to carry out the finishing process in a variety of materials, using a collaborative robot utilizing an iterative impedance control architecture and kinesthetic teaching. In addition, we proposed a mathematical model based on Lissajous curves to generate complex filleting toolpath in real time. The experiments on both chamfering and filleting processes prove that the proposed iterative controller based on impedance can obtain desired geometric profile and surface finish for various materials. Our controller requires no prior knowledge of the forces required to polish a material as the position and forces are adapted simultaneously based on iterative feedback. Due to its iterative adaptation, our controller reduces the amount of rework needed and thus is highly suitable for SMEs that handle the high volume and low mix parts. Furthermore, our framework is inexpensive since it requires no additional vision and force sensors while overcoming the problems associated with manual programming. We acknowledge that for tasks involving complex geometries such as the finishing of fan blades and turbines parts, we will need to generate and adapt trajectories on the free-form surfaces. To that end, we plan to integrate the iterative learning controller with the trajectory generating method proposed by Kana et al. [50] in the future work.