Safe Adaptive Trajectory Tracking Control of Robot for Human-Robot Interaction Using Barrier Function Transformation

In this chapter, safety methods in human-robot (HR) interaction/collaboration are presented. Ensuring the safety of humans, objects, or even the robot itself in the robot ’ s operating environment is one of the crucial aspects of collaborative robotics. Since there are limited ways of controlling the behavior of humans, e.g., by placing physical barriers, shaping the behavior of the robot is a feasible option. The chapter discusses current methods of placing barriers for human safety in an industrial setting and novel methods of placing virtual barriers by designing robot controllers using barrier transformation. The concepts of barrier functions (BFs), control barrier functions (CBFs), and barrier transformations are reviewed. The barrier transformation concept is used to design an adaptive trajectory tracking controller for the robot such that the robot does not cross the virtual barriers. The designed controller is tested in simulations. Future directions of safety technology in humanrobot collaboration are presented.


Introduction
In many robotics and other engineering applications, maintaining system states within a prescribed bound is essential to satisfy the system safety property. For example, in a manufacturing collaborative robotics context, it is crucial for the robot to satisfy requirements, such as trajectory boundedness and to safely carry out its operations [1][2][3]. In medical robotics context, when a robot is interacting with a person, the person undergoing surgery cannot move so the robot must stay within virtual barriers in 3D space so that it does not harm the person. See [4] for an example cobot architecture. A review of recent methods for safe human-robot (HR) interaction methods is presented in [5].
In this chapter, safety in the context of HR collaboration is defined such that the robot does not cross over a prescribed physical space where humans or other robots are operating or the robot does not cross joint or the task space limits when the robot is collaborating with the person. The violation of constraints can lead to severe degradation of the robot's performance, unsafe behavior, and sometimes failure of the robot's components. In collaborative robotics applications such as collaborative manipulation [6], collaborative construction [7], teleoperations [8,9], for human-in-the-loop control applications [10], or distributed multi-robot control applications [11][12][13], restricting the motion of the robot to a constrained configuration or task space is essential. Safe HR collaboration/interaction is also important for introducing robot factory co-workers in manufacturing automation [14,15], developing robotic assistants for astronauts [5], for assistive robotics [16][17][18][19][20].
The literature related to the control of the robot in HR interaction focuses on designing impedance control laws [16,[21][22][23] or admittance control laws [23,24] for adapting the interaction forces exerted by the human on the robot, when the robot is physically interacting with the human. In [24], an admittance controller is designed which takes inputs from human actions to achieve safer HR interaction. In [25], a physical human-robot interaction in the context of bikebot is presented. In [21], a an adaptive impedance controller for HR interaction is developed that is based on the NN model of the human intention. In [26], a controller is developed for human robot handover interaction based on dynamic movement primitives. In these examples, the human is physically interacting with the robot.
Other studies in the literature address the problem of robot/autonomous system control to avoid running into humans by modeling them as obstacles [27][28][29]. Most of these studies view the problem as a collision avoidance problem and solve the collision avoidance using potential field approach [30]. These control actions are purely reactionary in nature [31]. To achieve pro-activeness, studies in literature have designed controllers and motion planners that incorporate the probabilistic information about the possible intentions of human actions [32][33][34]. When humans and robots collaborate, inference of the person's intentions or robot's intentions improves the overall performance of the collaborative task [35]. Many studies in the literature have focused on designing scheduling and planning algorithms. In [36], a stochastic trajectory optimizer for motion planning is used for planning robot arm motion based on human intentions. In [37], scheduling, planning and control algorithms are presented that adapt to the changing preferences of a human co-worker, while providing strong guarantees for synchronization and timing of activities. In [38], new hierarchical planners based on Hierarchical Goal Networks are developed for assembly planning in human-robot team.
In the context of control architecture design for human-in-the-loop systems, adaptive controllers are presented using the inner-outer loop control structure in [10]. Stability studies of human-in-the-loop telerobotics with time-delay is presented in [39]. However, these studies do not explicitly consider safety aspects of the human-in-the-loop systems. Providing safety guarantees on the learned controller of machine/robot is typically achieved by adjusting the reference command using a pre-filter called a reference governor [40,41] or by using optimal control under uncertainty in a differential game setting.
For keeping the robot state bounded in a prescribed bound saturated controllers can be used [42,43]. Barrier function (BF) is a commonly used approach to certify the forward invariance of a closed set with respect to a system model, which can be used to examine the system's safety property [44,45]. There are two candidates to construct BFs, namely, Reciprocal BFs and Zeroing BFs. The Reciprocal BFs can be of inverse-type and logarithmic-type. Extensions of BFs to controlled systems called as control Barrier Functions (CBF) have also been developed in the literature [46,47]. Applications of BFs or CBFs in many autonomous robotic systems, such as robot manipulators, autonomous vehicles, and walking robots, are shown in [48][49][50]. In [47,49,51], BFs were successfully applied to dynamical systems where ensuring safety conditions are critical. In [51], time-varying BFs and CBFs for avoiding moving and static obstacles are derived, and their application to flying quadcopter is shown which avoids unsafe obstacle regions. Robustness properties of the CBFs are studied in [46], which shows that if a perturbation (or model error) makes it impossible to satisfy the invariance condition for a reciprocal barrier function, then the solution of the model must cease to exist because the control input becomes unbounded. For the Zeroing CBFs, Input-to-State stability (ISS) result holds in the presence of model uncertainties. A concept of exponential BFs and CBFs is introduced in [52]. The method of CBFs is extended to position-based constraints with relative degree 2 in [53] to address the safety constraints for systems with a higher relative degree. Furthermore, a backstepping based design method to design CBFs with a higher relative degree is also introduced. However, achieving a backstepping-based CBF design for systems with a higher relative degree is challenging. In [52], a concept of exponential CBFs is introduced that can handle state-dependent constraints for systems with a higher relative degree. In [54], a safety aware RL framework using BFs is proposed.
Barrier Lyapunov function (BLF) is another method that is used for the control of nonlinear systems when the outputs and states have upper and lower bound constraints (cf. [55,56]). The BLF is constructed such that its value grows to infinity whenever its argument approaches the bounds. In [55,57], an adaptive controller is developed using BLF defined over the output tracking error for single-input and single-output (SISO) nonlinear systems in a strict-feedback form. The controller works when the constraints are either constant or time-varying output constraints. An extension to output tracking with partial state constraints is developed in [58]. Using a similar BLF, in [59], an adaptive neural network with full-state feedback control that uses a Moore-Penrose pseudoinverse term in the control law design is developed for an uncertain robot dynamics with output constraints, and the signals of the closed-loop systems are proven to be semi-global uniformly ultimately bounded (SGUUB). In [54, 60], a BLF method that uses reinforcement learning (RL) is developed for a state regulation problem of a SISO nonlinear systems in the Brunovsky form with full-state and control input constraints.
Designing safe controllers using learning-based control methods are also presented in the literature. For example, in [61], a safe, online, model-free approach to path planning with Q-learning is discussed. A general safety framework for learning-based control using reachability analysis is presented in [62]. In [63], a receding horizon safe path planning approach using mixed integer linear programming (MILP) is presented. Safe trajectory generation for autonomous operation of spacecraft using convex optimization formulation is proposed in [64]. When the region is non-convex, successive convexification can be performed [65]. A detailed survey and tutorial of L 1 adaptive control architecture for safety critical systems is presented in [66].
In this chapter, barrier function transformation, presented in [67], is used to design a safe adaptive trajectory tracking controller for the robot using Euler-Lagrange (EL) system. The safe adaptive trajectory tracking control architecture of a robot system presented in this chapter is shown in Figure 1. Full state constraints are used while designing the torque control law. A gradient parameter update law is designed along with projection laws to keep the parameter estimates bounded. A Lyapunov-based stability analysis is presented which concludes semi-global uniformly ultimately bounded tracking result. Simulations studies are conducted using 2-link robot such that the tracking controller does not cross the bounds placed on the joint angles of the robot leading to a desired end-effector motion within a certain bounds. In addition to the control design and its testing in simulation, the chapter presents a review of standard techniques of designing safe robot controllers using BFs and CBFs, followed by a review of Barrier transformations which is used to design adaptive robot controller of EL robot system in this chapter. Future directions of the method and its applicability to safety in collaborative robotics are discussed.
Rest of the chapter is organized as follows. A review of BFs and CBFs and Barrier transformations is presented. Barrier transformation is then used to design adaptive robot controller of EL robot system in this chapter. A design and analysis of the safe adaptive trajectory tracking controller is then discussed. Simulation results of the designed controller on a 2-link EL robot system model are presented. Future directions of robot control design for safe human-robot collaboration are provided at the end.

Review of barrier functions and control barrier functions
In this section, a brief review of BF and CBF are presented.

Barrier functions
Consider a continuous nonlinear dynamical system of the form where f :  n !  n is a locally Lipschitz continuous nonlinear function and . BFs define a forward invariant safe region, where the solutions of a dynamical system in this region remain in the region for all time [46,47,69].

Constructing the barrier functions
Given a closed set S ⊂  n , its interior and its boundary are defined as follows where h :  n !  is a continuously differentiable function.  (1), the closed set S defined by (2)- (4), and continuously differentiable function h :  n ! , a real-valued function b : Int S ð Þ !  that is differentiable with respect to its argument is said to be a reciprocal BF, if there exist class K functions η 1 , η 2 , η 3 such that for all x ∈ Int S ð Þ Candidate reciprocal BFs are inverse-type and logarithmic-type BFs given by b [47]. Note that the candidate is unbounded on the set boundary, i.e., b x ð Þ ! ∞ as x ! ∂S.

Control barrier functions
BFs are essential means to verify invariance of a set but they cannot be used in its direct form to design a controller [47]. In other words, to make sure that the set Int S ð Þ is forward invariant under the dynamics of the system (1), a controller that guarantees the invariance of the set is required. Similar on how Lyapunov functions are extended to control Lyapunov functions [70], the concept of BFs can be extended to the case of control systems through the use of CBFs. Given the following nonlinear affine control system with f and g locally Lipschitz, x ∈ X ⊂  n , and u ∈  m is the set of admissible input, in cases where the solutions of (7) do not stay in an invariant set S, a CBF can be specified that will assure the solutions to remain inside the invariant set.

Constructing the control barrier functions
In order to find a suitable CBF, the constraint on the system state x is encoded in a smooth constraint function h x ð Þ. A value h x ð Þ > 0 indicates adherence, whereas h x ð Þ < 0 indicates a violation. The set of admissible state X 0 is defined by A Reciprocal CBF b : Int X o ð Þ !  is a non-negative function, if there exist class K functions η 1 ,η 2 , and η 3 such that for all x ∈ Int X 0 ð Þ, where ∂x f x ð Þ along the vector field f x ð Þ and ∂x g x ð Þ along the vector field g x ð Þ. Hence for the system in (7), any locally Lipschitz controller u : X 0 !  m that is selected form (11) assures the closed-set X 0 ⊂  n is forward invariant.

Review of barrier transformation
In this section, review of barrier function transformation is presented. Consider the following logarithmic barrier function B z; a, A ð Þ:  !  defined on an open interval a, A ð Þ: where a and A are two constants satisfying a < A. The barrier function in (12) takes finite value when its arguments are within the region a, A ð Þand approaches to infinity as its arguments reach the boundary of the region, i.e., lim z!a,A B z; a, A ð Þ¼AE∞. Due to the monotonic characteristic of the natural logarithm the inverse of the barrier function (12) exists within the range of its definition, and it is given by , ∀y ∈  with the derivative defined as

Adaptive control of a robot system with full-state constraints
When a robot moves in a constrained space, it is crucial for the robot to satisfy requirements, such as the joint trajectories' boundedness, to safely carry out its operations within a prescribed bound. This section presents an adaptive safe tracking control design method that learns the parameters of an uncertain Euler-Lagrange (EL) system in an online manner using a gradient adaptive learning law. The controller is designed to track joint angles and joint velocities of the robot arm such that the bounds on the joint angles and joint velocities are maintained.

Consider the Euler-Lagrange (EL) dynamics
where M q ð Þ ∈  dÂd denotes a generalized inertia matrix, C q, _ q ð Þ∈  dÂd denotes a generalized centripetal-Coriolis matrix, G r q ð Þ ∈  d denotes a generalized gravity vector, τ ¼ τ 1 , ⋯ , τ d ½ T ∈  d represents the generalized input control vector, and q t ð Þ, _ q t ð Þ, € q t ð Þ ∈  d denote the link position, velocity, and acceleration vectors, respectively. The subsequent development is based on the assumption that all the states are observed, and that M q ð Þ, C q, _ q ð Þ, and G r q ð Þ, are unknown. The following properties, found in [71,72], are also exploited in the subsequent development. Property 1. The inertia matrix is positive definite, and satisfies the following inequality for any arbitrary vector ξ ∈  d : where m 1 and m 2 are positive constants, and ∥ Á ∥ represents the Euclidean norm.
Remark 1. Since M q ð Þ is a symmetric positive definite matrix, it can be shown that M À1 q ð Þ is also a positive definite matrix, and its 2-norm is upper and lower bounded with known constants, i.e., m ≤ ∥M À1 q ð Þ∥ ≤ m. Property 2. The EL-dynamics in (15) are linearly parametrizable as follows where Y :  d Â  d Â  d !  dÂm is the regression matrix, and θ ∈  n is the set of the unknown parameters. Property 3. The norm of the centripetal-Coriolis can be upper bounded in the following manner: where C ∈  denotes known positive bounding constant, and ∥ Á ∥ ∞ denotes the induced infinity-norm of a matrix.

and the EL-dynamics in (15) can be written as follows
where f :  2d !  d , g :  2d !  dÂd are locally Lipschitz continuous nonlinear With some algebraic manipulations, the EL-dynamics can be written into d separate first and second order dynamics: where f j :  2d ! , g j :  2d !  1Âd are nonlinear continuously differentiable functions. Using the BF transformation (12), the system in (20)- (21) can be transformed into a constrained state are the constrained joint position and velocity vectors, respectively, as follows: where B À1 φ i,j ; δ i,j , Δ i,j can be obtained using (13) and δ i,j , Δ i,j are lower and upper bounds on state, respectively. Using the chain rule of differentiation, i.e., can be obtained using (14), and some algebraic manipulations result in the transformed state φ i,j , and it is given by where and , ∀i ¼ 1, 2 and ∀j ¼ 1, ⋯, d. The constrained system in terms of Φ can be expressed in a compact form as follows where F :  2d !  2d and G :  2d !  2dÂd are given by Assumption 1. The function F :  2d !  2d is locally Lipschitz continuous, and there exists a positive constant F such that for Φ ∈ Ψ, ∥F Φ ð Þ∥ < F ∥Φ∥, where Ψ ⊂  2d is a compact set containing the origin. Moreover, the system is assumed to be controllable over Ψ with G Φ ð Þ being locally Lipschitz and bounded in Ψ, i.e., ∥G Φ ð Þ∥ < G, where G is a positive scalar. Following (28), the EL-dynamics can be represented in the constrained space as follows where and , ∀i ¼ 1, 2 and ∀j ¼ 1, ⋯, d. (33) is positive definite, and its 2-norm is upper and lower bounded by known positive constants, i.e., Lemma 1. Given the term K i ϕ i ð Þ defined in (33) with the 2-norm of its inverse, K À1 i ϕ i ð Þ, can be upper bounded by a positive constant κ i , i.e., ∥K À1 which implies that 2-norm of K À1 i φ i ð Þcan be upper bounded by a positive constant κ i . Now, using Property 2, the EL-dynamics in (30) can be linearly parameterized, and it is given by where Note that in (36), and henceforth the parameter dependency of the elements in the EL-dynamics are dropped for brevity. Lemma 2. Suppose that there exists a controller that tracks the desired trajectory for the system given in (30). Then, the same controller can also track the desired trajectory of the original system in (15) given that the initial state of the system x 0 ð Þ ¼ x 0 ∈ X . Proof: See proof of ([55], Lemma 1) Lemma 2 proves that if the initial state is within the prescribed bound, a control law can be designed for the full-state constrained system such that it satisfies the tracking objective of the original system.

Safe adaptive tracking control development
In this subsection, an adaptive control technique is used to identify the parameters of an uncertain system and track the desired joint position ϕ des 1 t ð Þ :  þ !  d and joint velocity ϕ des 2 t ð Þ :  þ !  d trajectories. Consider the following tracking control input design whereÁ ð Þ denotes the parameter estimates and β is a positive scalar. Signals a, v, r are given by whereφ 1 ≜ ϕ 1 À ϕ des 1 andφ 2 ≜ ϕ 2 À ϕ des 2 are position and velocity tracking errors, respectively. Λ ∈  dÂd is a positive definite diagonal matrix, and its 2-norm is upper bounded by a known positive constant, i.e., ∥Λ∥ ≤ Λ.
In terms of the linear parameterization of the EL-dynamics, i.e., Property 2, the control input (37) can be rewritten as where Substituting (37) in the EL-dynamics (30) yields the following closed-loop error dynamics given by whereθ ¼θ À θ is the parameter estimation error. The parameterθ update rule is given by where Γ ∈  nÂn is a diagonal and positive definite matrix, and proj Á ð Þ is a standard projection operator that ensures the parameter estimates are bounded, i.e., θ ≤θ ≤ θ (for further details see [71]).
Remark 2. The parameter estimation errorθ is bounded and uniformly continuous sinceθ evolves according to the update law in (43).

Lyapunov stability analysis
To facilitate the following development of the Lyapunov stability analysis, let ζ : λ min Á f g and λ max Á f g denote the minimum and maximum eigenvalues of its argument. Theorem 1.1. The controller and parameter update laws defined in (41) and (43) ensure SGUUB tracking of the desired state trajectories, provided the following sufficient conditions, are satisfied, where Proof: See details in [67].

Simulations
Simulation studies are conducted to verify and demonstrate the performance of the designed safe adaptive robot controller. The simulations are conducted using MacBook Pro running Intel i7 processor and 16 Gigabytes of memory and the controller and EL dynamic model is coded using MATLAB 2018a.

Safe tracking control of an uncertain EL-dynamics with full-state constraints using BF
In this section, the controller and adaptive laws developed in (37) and (43) are simulated for a two-link robot planar manipulator, with dynamics shown in (46), where c 1 , c 2 , c 12 denote cos q 1 À Á , cos q 2 À ), and cos q 1 þ q 2 À Á respectively, sin 2 denotes sin q 2 À Á , and g is the gravitational constant.
The nominal values of the parameter vector θ ¼ θ 1 , θ 2 , θ 3 , θ 4 , θ 5 ½ T are The desired trajectory is selected as The objective is to track the desired joint trajectory provided that the model parameters are unknown while the state Q ¼ q, _ q ½ T satisfies the following constraints, q 1 ∈ À4:4, 4:1 ð Þ _ q 1 ∈ À10:2, 4:2 ð Þ q 2 ∈ À7:1, 4:2 ð Þ _ q 2 ∈ À4:2, 4:93 ð Þ To this end, the barrier function formulation presented in Section 3 is used along with the adaptive control developed in Section 4. The feedback and adaptation gains for the proposed controller are selected as β ¼ position evolution q 1 t ð Þ and q 2 t ð Þ of a two degrees-of-freedom planar robot using an adaptive law with and without BF are shown in Figure 2. It can be observed from Figure 2 that when the adaptive law with BF is used, the estimated trajectories are blocked from crossing over the boundaries that are set for each of the joints. The position and velocity estimation errors are depicted in Figure 3. From Figures 2 and  3, it is clear that the tracking error asymptotically converges to zero, and, because the Lyapunov candidate does not contain any terms that are negative definite inθ, the parameter estimation does not converge but it does remain bounded. Boundedness of the parameter estimation errors can be seen in

Conclusions and future directions
This chapter provides a perspective on problems wherein humans and robots work collaboratively with one another. Research in this field aims to relax the current workplace constraints, such as fences, virtual curtains often seen in manufacturing settings between humans and robots or velocity limits on collaborative robots. This chapter develops an efficient robot control methodology to create a safe working environment without sacrificing the efficiency of the robots. In the context of the chapter, safety is defined as a constrained behavior of a system, and robot effectiveness, as driving the actual behavior of the robot to the desired behavior. To this end, an online safe tracking controller for an uncertain Euler-Lagrange robotic system with is developed where the constraints are placed on all the states. A barrier function transform is used to transform the full-state constrained EL-dynamics into an equivalent unconstrained system with no prior knowledge of the system parameters. An adaptive controller is developed along  with a gradient based adaptive parameter estimation law on the transformed system that tracks the desired trajectories of the original system. The controller guarantees that the robot trajectories remain inside a pre-specified safe region, tracking the desired trajectories and the parameter estimation errors remain bounded. The method can be utilized for applications wherein robots must operate in a confined space to reach an object for grasping or other manipulation tasks such as pick and place.
In future, the usefulness of barrier transformation to design a visual servo controller will be shown. Constrained VS approach can guarantee target features to remain within the camera field of view for the duration of the task. Some recent efforts in that direction can be found in [73]. Utilizing CBF for developing safe robot controllers by utilizing human actions and workspaces can be another avenue of future research for safe human-robot interaction.
interaction and collaboration using an industrial robot with a closed control architecture," in IEEE International Conference on Robotics and Automation, 2013, pp. 4000-4007.