# Optimal Energy Tank Initialization for Minimum Sensitivity to Model Uncertainties

Andrea Pupa, Paolo Robuffo Giordano, Cristian Secchi

► To cite this version:

Andrea Pupa, Paolo Robuffo Giordano, Cristian Secchi. Optimal Energy Tank Initialization for Minimum Sensitivity to Model Uncertainties. IROS 2023 - IEEE/RSJ International Conference on Intelligent Robots and Systems, Oct 2023, Detroit, MI, United States. pp.1-8. hal-04216655

HAL Id: hal-04216655

https://hal.science/hal-04216655v1

Submitted on 25 Sep 2023

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
# Optimal Energy Tank Initialization for Minimum Sensitivity to Model Uncertainties

Andrea Pupa<fnref n="1" />, Paolo Robuffo Giordano<fnref n="2" />, Cristian Secchi<fnref n="1" />

**Abstract**— Energy tanks have gained popularity inside the robotics and control communities over the last years, since they represent a formidable tool to enforce passivity (and, thus, input/output stability) of a controlled robot, possibly interacting with uncertain environments. One weak point of passification strategies based on energy tanks concerns, however, their initialization. Indeed, a too large initial energy can cause practical unstable behaviors, while a too low initial energy level can prevent the correct execution of the task. This shortcoming becomes even more relevant in presence of uncertainties in the robot model and/or environment, since it may be hard to predict in advance the correct (safe) amount of initial tank energy for a successful task execution. In this paper we then propose a new strategy for addressing this issue. The recent notion of closed-loop state sensitivity is exploited to derive precise bounds (tubes) on the tank energy behavior by assuming parametric uncertainty in the robot model. These tubes are then exploited in a novel nonlinear optimization problem aiming at finding both the best trajectory and the minimal initial tank energy that allow executing a positioning task for any value of the uncertain parameters in a given range. The approach is finally validated via a statistical analysis in simulation and experiments on real robot hardware.

## I. INTRODUCTION

Passivity-based control (PBC) has gained large attention over the past years, especially in the robotics field. One of the main reasons behind this great success are related to the physical interpretability of PBC and to its modularity. Indeed, the controller and the robotic system are usually equivalent to a physical system. This is the case of the well-known mass-spring-damper in impedance/admittance control [1], or distributed mass-spring system in communication channels [2]. Thanks to these characteristics, the resulting behavior of the system is easier to understand and the implementation is more intuitive. Moreover, coupling a passive system with another passive system leads to a coupled system that is still passive, making passivity-based control really modular. Passivity is a significant property since a passive system is not only simply stable, but passivity is a necessary and sufficient condition for achieving robust stability [3]. Passivity-based control has been exploited in many robotic fields, such as collaborative robotics [4], bilateral teleoperation [5], and multi-robot system [6].

However, traditional passivity-based control may lack flexibility. By selecting a specific passive dynamics, indeed,

the behaviour of the system may be limited and too much constrained. For example, in human-robot collaboration tasks impedance adaptation is crucial to achieve a good interaction [7]. Likewise, in teleoperation scenarios it may be necessary to change the stiffness of the coupling when the environment changes [8]. Lastly, in case of multi-robot system, it may be necessary that some of the agents implement a reactive behaviour which cannot be guaranteed by a fixed coupling [9].

In all these (and similar) examples, energy tanks [10] have been introduced for decoupling passivity-based control from the specific dynamics of the system. Energy tanks are virtual elements that can store the energy naturally dissipated by the system. This energy can then be reused for, e.g., implementing a desired behavior in a (guaranteed) passive way. The main advantage of energy tanks is their intrinsic flexibility, which can allow to easily enforce passivity and, therefore, robust stability for virtually any task and robot/environment of interest.

One of the main open points in the use of energy tanks is related to their initialization. In fact, even if formally passive, a system passified via an energy tank can still have practical unstable behaviors if the initial tank energy is too high [6]. On the other hand, if the tank is initially not loaded with sufficient energy, the system may not be able to perform the desired task. In [11], [12] the authors introduced the concept of *Task-energy*, which is the energy required for realizing a force tracking task. By exploiting this method it is then possible to estimate in a non-heuristic way the initial energy for the tank. In [13] the concept of frozen energy is introduced as an extra-energy reservoir to be released into the tank when necessary for completing the task. In [14], the tank is initialized with a high amount of energy and a strategy for incrementally making some energy available based on and online estimation of the task to be executed is proposed.

These approaches, however, are not robust to uncertainties in the robot/environment, in particular in their parameters such as mass, friction, stiffness and so forth. Therefore, if the real model parameters differ from the nominal ones used to estimate the task-energy, the tank may still deplete (or alternatively one would need to overestimate the initial tank energy, therefore defeating the purpose of a principled initialization).

Explicitly considering the role of model uncertainties in planning/control design is of paramount importance in robotics. A lot of work has been done in the past literature to address and overcome uncertainties of the robot model

<footnote n="1">¹ A. Pupa and C. Secchi are with the Department of Science and Methods of Engineering, University of Modena and Reggio Emilia, Italy. E-mail: {andrea.pupa, cristian.secchi}@unimore.it</footnote>

<footnote n="2">²P. Robuffo Giordano is with CNRS, Univ Rennes, Inria, IRISA, Campus de Beaulieu, 35042 Rennes Cedex, France. E-mail: prg@irisa.fr
This work was supported by the project ANR-20-CE33-0003 "CAMP"</footnote>
and/or the environment. A possible approach is to estimate online the uncertain parameters for adjusting the control action during the task execution [15]. However, parameter estimation often requires some form of 'persistency of excitation' in the robot trajectories, which may not always be practical or attainable for the task at hand. Furthermore, online parameter estimation may lead to undesired behaviours such as erratic/unpredictable transients. Another popular possibility is to instead generate feedforward (planned) trajectories for minimizing the effects of uncertainties [16]–[20]. These works are, however, often either limited to the open-loop cases (without taking into account the controller), or require a very specific control design (which may not always be desirable, computationally feasible or even attainable for non-trivial systems). An alternative approach has been recently developed in [21]–[24] by introducing and exploiting the notion of closed-loop state sensitivity for a robot/controller pair: in short, for any robot/environment model and control strategy, it is possible to compute the so-called state sensitivity matrix Π that relates how variations in the model parameters affect the robot states in closed-loop. Furthermore, by assuming known ranges for the (otherwise unknown) uncertain parameters, it is also possible to exploit Π for evaluating the tubes of perturbed states/inputs along a future trajectory [23]. These quantities can then be leveraged for producing motion plans that are intrinsically minimally sensitive to parametric uncertain, and with a robust and guaranteed satisfaction of constraints such as limited actuation or obstacle avoidance, see [23], [24] for some examples.

Inspired by this line of works, the aim of this paper is to explicitly consider presence of parametric uncertainties in the robot/environment model during an interaction task passified by an energy tank, and to then study how the sensitivity machinery can be exploited for finding a suitable initialization of the tank energy (despite the model uncertainty). Summarizing, the main contribution of this work are:

* The definition of the closed-loop sensitivity of the energy tanks;

* The definition of a new optimization problem that exploits the sensitivity for optimally initializing the energy tank, i.e., choosing the lowest initial tank energy that still ensures realization of the task in presence of model uncertainties;

* A comprehensive validation of the proposed approach, both in simulation and in a real scenario.

The paper is organized as follow: in Sec. II the problem related to the initialization in presence of uncertainties is detailed, while Sec. III provides the main background related to the sensitivity. In Sec. IV, instead, the sensitivity notions are applied to the energy tanks and the sensitivity of the tank state is derived. This concept is exploited in Sec. V to build an optimization problem that allows to initialize the tank in an optimal way. Lastly, in Sec. VI, an extensive validation carried out both in simulation and in a real scenario is provided, while future works are addressed in Sec. VII.

## II. PROBLEM STATEMENT

Consider a fully-actuated gravity compensated robotic system modeled in the task space by the following Euler-Lagrange equation:

$$M(x)\ddot{x} + C(x, \dot{x})\dot{x} + D(x)\dot{x} = u + F_e, \quad (1)$$

where $x, \dot{x}, \ddot{x} \in \mathbb{R}^{n_x}$ are the pose, the velocity and the acceleration of the robot, respectively. $M(x), D(x) \in \mathbb{R}^{n_x} \times \mathbb{R}^{n_x}$ and the positive definite inertia matrix and the positive semidefinite damping matrix respectively. $C(x, \dot{x})$, instead, represents the Coriolis terms. Finally $u \in \mathbb{R}^{n_x}, F_e \in \mathbb{R}^{n_x}$ are the control input and the external force due to the interaction with the environment and $y = \dot{x}, \in \mathbb{R}^{n_x}$ is the output of the system. As well known, see e.g. [25], (1) is passive with respect to the pair $(u + F_e, y)$ using the kinetic energy $K(t) = \frac{1}{2}\dot{x}^T M(x)\dot{x}$ as a storage function.

Consider the task of generating a desired reference trajectory $x_d(t) \in \mathbb{R}^{n_x}$, with $t \in [t_i, t_f]$ that takes (1) from an initial configuration $x(t_i)$ to a final configuration $x(t_f)$ and consider any desired controller that generates a control input $u_d(t)$ such that $e(t) = x_d(t) - x(t) \to 0$ with a desired transient in case of free motion, i.e. $F_e = 0$. If the controlled system is passive, then it is robustly stable [3], [6] and it would not be destabilized in case of interaction with the environment, i.e. $F_e \neq 0$. Trajectory tracking controllers do not ensure a passive behavior by design, but passivity can be implemented using energy tanks [10].

Energy tanks are virtual energy storing elements that can exchange energy through their input/output port and they are represented by

$$\begin{cases} \dot{x}_t = u_t, \\ y_t = \frac{\partial T}{\partial x_t} = x_t, \end{cases} \quad (2)$$

where $x_t \in \mathbb{R}$ is the state of the tank and $(u_t, y_t) \in \mathbb{R} \times \mathbb{R}$ is the power port of the tank. The energy stored in the tank is given by

$$T = \frac{1}{2} x_t^2. \quad (3)$$

and, by combining (2) with (3) it is straightforward to show that the tank can store/release the energy through its power port:

$$\dot{T} = u_t y_t. \quad (4)$$

Energy tanks can be interposed between the plant (1) and the controller in order to ensure passivity, as shown in Fig. 1 (see, e.g., [6] for more details).

Exploiting the output $y$ of the system and any other measurable signal, the controller generates the desired control input $u_d$ that is exploited for modulating the interconnection between the tank and (1). The energy tank is joined to (1) as follows:

$$\begin{cases} \mathbf{u} = wy_t, \\ u_t = -w^T\mathbf{y} + \frac{D}{x_t}, \end{cases} \quad (5)$$

where $w = \frac{u_d}{y_t} = \frac{u_d}{x_t}$, with $u_d$ the desired input of the system, and $D = \dot{x}^T D(x) \dot{x}$ is the amount of energy dissipated by the system. Using (5), the energy tank stores
<figure><img src="image_2.png" /><figcaption>Fig. 1: Control scheme</figcaption></figure>

the energy dissipated by (1) and, through the modulation gain $w$, exploits the stored energy for reproducing (in a passive way) the desired input as long as sufficient energy is present in the tank. In order to avoid singularity problems it is necessary to initialize the tank with enough initial energy and to prevent depletion of the stored energy over time. This can be achieved by initializing the tank with a non-zero initial value, i.e. $x_t(t_i) \neq 0$, and by introducing a modular function $\sigma(t)$ such that:

$$ \sigma(t) = \begin{cases} 1 & \text{if } T(t) > \varepsilon, \\ 0 & \text{otherwise,} \end{cases} \qquad (6) $$

where $\varepsilon$ is a design lower threshold.

By plugging (6) in (5) it is possible to obtain the modulated power port:

$$ \left\{ \begin{array}{l} \mathbf{u} = \sigma wy_t, \\ u_t = -\sigma w^T \mathbf{y} + \frac{D}{x_t}, \end{array} \right. \qquad (7) $$

As shown in [6], the control scheme in Fig. 1 is passive with respect to the pair $(\mathbf{F}_e, \mathbf{y})$ using the storage function $K(t) + T(t)$, independently of the value of $u_d$. The desired input generated by the controller can be implemented only if sufficient energy in the tank is available and, consequently, possibility of tracking a trajectory in $t \in [t_i, t_f]$ depends on the amount of energy stored in the tank.

Initializing the energy tank with a very large amount of energy would easily solve the problem and would lead to a theoretically passive but practically unstable behavior [6]. The approaches available in the literature for initializing the tank consider a specific set of parameters characterizing the system and the controller and, therefore, its robustness and practical usability are not optimal. Furthermore, uncertainties in the robot/environment model are also not explicitly considered, therefore further reducing the usability in many real scenarios. The aim of this work is therefore to propose an integrated and novel optimization problem such that, for any desired controller/task and by explicitly considering presence of parametric uncertainties for the robot/environment models, achieves the following goals:

* generation of an optimized trajectory $x_d(t)$ for the chosen robot/controller pair guaranteed to realize the task without depletion of the tank energy for any value of the uncertain parameters in a given range;

* 'optimal' initialization of the tank energy, i.e., the smallest possible initial energy that ensures a correct task execution despite the uncertain parameters.

### III. SUMMARY OF STATE SENSITIVITY NOTIONS

Consider a generic robot/environment model

$$ \dot{\mathbf{q}} = \mathbf{f}(\mathbf{q}, \mathbf{u}, \mathbf{p}), \qquad (8) $$

where $\mathbf{q} \in \mathbb{R}^{n_q}$ represents the robot state, $\mathbf{u} \in \mathbb{R}^{n_u}$ is the control input, and $\mathbf{p} \in \mathbb{R}^{n_p}$ represents the (possibly uncertain) robot/environment parameters. For instance in manipulation and interaction tasks one may consider uncertainties in the mass or inertial properties of the manipulated object, in the stiffness/friction parameters of the environment, and so forth.

In the context of tracking tasks, let us consider an output function $\mathbf{y}(\mathbf{q}) \in \mathbb{R}^{n_y}$ (e.g., the manipulator pose) that needs to follow a desired reference trajectory $\mathbf{y}_d(t) \in \mathbb{R}^{n_y}$, and an associated trajectory tracking controller with the generic form

$$ \left\{ \begin{aligned} \dot{\mathbf{\xi}} &= \mathbf{g}(\mathbf{\xi}, \mathbf{q}, \mathbf{y}_d(t), \mathbf{p}_c, \mathbf{k}_c, t), \\ \mathbf{u} &= \mathbf{h}(\mathbf{\xi}, \mathbf{q}, \mathbf{y}_d(t), \mathbf{p}_c, \mathbf{k}_c, t), \end{aligned} \right. \qquad (9) $$

where $\mathbf{\xi} \in \mathbb{R}^{n_q}$ are the internal states of the controller (e.g. an integral action), $\mathbf{p}_c \in \mathbb{R}^{n_p}$ are the nominal model parameters, i.e., the nominal value of $\mathbf{p}$ used by the controller that may differ from the real $\mathbf{p}$, and $\mathbf{k}_c \in \mathbb{R}^{k_c}$ are the controller gains.

For the closed-loop system (8-9) it is possible to define the so-called *state sensitivity matrix*

$$ \mathbf{\Pi}(t) = \left. \frac{\partial \mathbf{q}(t)}{\partial \mathbf{p}} \right|_{\mathbf{p}=\mathbf{p}_c} \in \mathbb{R}^{n_q \times n_p}, \qquad (10) $$

and *input sensitivity matrix*

$$ \mathbf{\Theta}(t) = \left. \frac{\partial \mathbf{u}(t)}{\partial \mathbf{p}} \right|_{\mathbf{p}=\mathbf{p}_c} \in \mathbb{R}^{n_u \times n_p}, \qquad (11) $$

which quantify how variations in the parameters $\mathbf{p}$ (w.r.t. the nominal $\mathbf{p}_c$) affect the states and inputs during motion. A closed-form expression for $\mathbf{\Pi}(t)$ and $\mathbf{\Theta}(t)$ is not available in the general case, but in [21], [23] it is shown how these quantities can be easily obtained by forward integrating the following system of differential equations

$$ \left\{ \begin{aligned} \dot{\mathbf{\Pi}}(t) &= \frac{\partial f}{\partial \mathbf{q}} \mathbf{\Pi} + \frac{\partial f}{\partial \mathbf{u}} \mathbf{\Theta} + \frac{\partial f}{\partial \mathbf{p}}, & \mathbf{\Pi}(t_i) &= 0, \\ \dot{\mathbf{\Pi}}_{\xi}(t) &= \frac{\partial g}{\partial \mathbf{q}} \mathbf{\Pi} + \frac{\partial g}{\partial \mathbf{\xi}} \mathbf{\Pi}_{\xi}, & \mathbf{\Pi}_{\xi}(t_i) &= 0, \\ \mathbf{\Theta}(t) &= \frac{\partial h}{\partial \mathbf{q}} \mathbf{\Pi} + \frac{\partial h}{\partial \mathbf{\xi}} \mathbf{\Pi}_{\xi}, \end{aligned} \right. \qquad (12) $$

where $\mathbf{\Pi}_{\xi} \in \mathbb{R}^{\xi \times n_p}$ is the sensitivity of the controller states.

Matrices $\mathbf{\Pi}(t)$ and $\mathbf{\Theta}(t)$ can be used for several purposes such as optimization of the reference trajectory $\mathbf{y}_d(t)$ for producing minimally sensitive motion plans (by minimizing some combined norm of $\mathbf{\Pi}(t)$ and $\mathbf{\Theta}(t)$ as done in [21], [22]). An extension has also been recently proposed in [23] for evaluating the tubes (or ellipsoids) of uncertain states/inputs. Assume that each parameter $p_i$ can vary in a given range $\delta p_i$ centered at a nominal $p_{c_i}$

$$ p_i \in [p_{c_i} - \delta p_i, p_{c_i} + \delta p_i] \qquad (13) $$
and define the diagonal weight matrix $W = \text{diag}(\delta p_i^2)$. Letting $\Delta p = p - p_c$, an ellipsoid in parameter space centered at $p_c$ and with semi-axes $\delta p_i$ has equation

$$ \Delta p^T W^{-1} \Delta p = 1 \quad (14) $$

and, as discussed in [23], one can obtain the corresponding ellipsoids in state space

$$ \Delta q^T (\Pi W \Pi^T)^{-1} \Delta q = 1 \quad (15) $$

and in input space

$$ \Delta u^T (\Theta W \Theta^T)^{-1} \Delta u = 1. \quad (16) $$

Here $\Delta q$ stands for $\Delta q = q - q_{nom}$ where $q_{nom}$ is the state evolution of (8–9) in the unperturbed case $p = p_c$, and analogously for $\Delta u = u - u_{nom}$.

The state and input space ellipsoids can be used for different purposes. In particular, in the context of this work, one can exploit (15–16) for obtaining the tubes of perturbed trajectories for the individual components of the states and the inputs. By again referring to [23] for all details, for each direction of interest in the state space one can obtain the ‘tube radius’ $r_i(t)$ such that

$$ q_{nom,i}(t) - r_i(t) \le q_i(t) \le q_{nom,i}(t) + r_i(t). \quad (17) $$

where, as usual, $q_{nom,i}(t)$ is the behavior of the state $q_i(t)$ in the unperturbed case $p = p_c$. Equation (17) bounds from above/below the envelope of perturbed states when the parameter uncertainty is bounded as in (13), and an analogous upper/lower bound can also be obtained for the inputs components $u_i(t)$.

## IV. SENSITIVITY OF ENERGY TANKS

Exploiting the sensitivity framework detailed in Sec. III, it is interesting to analyze how uncertainties in the parameters $p$ would affect the state of the tank. However, the sensitivity framework is based on the assumption that all the equations involved in the control are continuous and differentiable, which is not the case for the standard tank modulation (6). Therefore, in this paper a new modulation function is introduced:

$$ \sigma = \frac{1}{2} + \frac{1}{2} \tanh \left( \frac{6}{\epsilon} T - \frac{\epsilon^2}{6} \right), \quad (18) $$

where the step function is approximated with a sigmoid function.

At this point, it is possible to define the tank sensitivity as:

$$ \Pi_{x_t}(t) = \left. \frac{\partial x_t(t)}{\partial p} \right|_{p=p_c} \in \mathbb{R}^{1 \times n_p}, \quad (19) $$

which represents how sensitive the state of the tank is w.r.t. the variations of the parameters around $p_c$. To improve the overall behavior of the system, it is possible to analyze how the uncertainties in the parameters affect the state of the tank in order to avoid its depletion, i.e. the output of the tank $u$

will be equal to the desired controller output $u_d$. Following analogous derivations as in (12), one obtains

$$ \begin{aligned} \dot{\Pi}_{x_t}(t) = & \frac{\Pi_{x_t}}{x_t^2} (\sigma \mathbf{y}^T \mathbf{u}_d - D) + \frac{1}{x_t} \frac{\partial D}{\partial x} \Pi_{\mathbf{y}} + \\ & - \frac{1}{x_t} (\sigma \mathbf{u}_d^T \Pi_{\mathbf{y}} + \mathbf{y}^T \mathbf{\Theta}), \quad \Pi_{x_t}(t_i) = 0, \end{aligned} \quad (20) $$

where $\Pi_{\mathbf{y}}$ is the row-block of matrix $\Pi$ associated to the sensitivity of the system output (the system velocity in our case).

Equation (20) allows to analyze the behaviour of the tank from a different perspective, i.e., from the variations of the parameters. First of all, it is possible to note that also the tank sensitivity suffers singularities at $x_t = 0$. Thus, the lower bound of the tank $\epsilon$ affects the sensitivity of the tank, i.e. small values of $\epsilon$ would make the tank more sensitive to the variation of the parameters. However, as demonstrated in [11], it is possible to choose $\epsilon$ at will, since it is only necessary that the initial difference $T(t_i) - \epsilon$ is enough to execute the task. Secondly, it is possible to note that when the system dissipates a large amount of energy $D$ the sensitivity $\Pi_{x_t}$ decreases, i.e. when the $i$-th component of $\Pi_{x_t}$ is positive the damping $D$ would reduce its value and when it is negative the damping would increase its value. Intuitively, this means that in the presence of an high dissipation, the state of the tank is more robust to the variations of the parameters. However, the variation of the damping w.r.t. to the state $x$ may still “negatively” affect the robustness of the tank, since it depends on the sign of $\Pi_{\mathbf{y}}$ and $\frac{\partial D}{\partial x}$. It is worth underlining that the amount of energy injected in the tank $D$ is defined by construction of (7). Thus it is possible to have $\frac{\partial D}{\partial x} = 0$.

As already done for the other sensitivity matrices in Sec. III, it is possible to build the kernel matrix of the ellipsoid for the tank state:

$$ K_{\Pi_{x_t}} = \Pi_{x_t} W \Pi_{x_t}^T, \quad (21) $$

which in our case is simply a scalar. The radius $r_{x_t}(t)$ of the tube around the tank state is then:

$$ r_{x_t}(t) = \sqrt{K_{\Pi_{x_t}}}, \quad (22) $$

which leads to the following tube for the tank state in presence of parametric uncertainties:

$$ x_{t,c}(t) - r_{x_t}(t) \le x_t(t) \le x_{t,c}(t) + r_{x_t}(t), \quad (23) $$

where $x_{t,c}$ is, as usual, the evolution of the tank state when $p = p_c$.

## V. OPTIMIZATION PROBLEM

We now show how the tank sensitivity introduced in Sec. IV can be exploited for optimization purposes. The main goal is to ensure that, even in presence of parametric uncertainty, the system will be able to execute the task and the tank will never deplete. This can be mathematically expressed by the following inequality:

$$ T(t) > \epsilon. \quad (24) $$
The tank sensitivity $\Pi_{x_t}$, however, refers to the internal state of the energy tank and not to actual stored energy. To this aim, it is possible to express the inequality (24) as function of $x_t$:

$$x_t > \sqrt{2\epsilon}, \qquad (25)$$

where only the solution $x_t > 0$ is admitted. Considering also the uncertainty tube in (23) it is possible to find a lower bound for the tank state:

$$x_{t,c} - r_{x_t} > \sqrt{2\epsilon}. \qquad (26)$$

Starting from the constraint (26), it is then possible to define which is the optimal initial tank state $x_t(t_i)$, i.e. the lowest initial energy, and the best trajectory $x_d(t)$ such that the system will be able to perform the task with the desired controller and the energy tank will not deplete for any value of the uncertain parameters in the assumed range of variation. This can be obtained by solving the following optimization problem:

$$\begin{array}{ll}
\min_{\mathbf{a},x_t(t_i)} & \frac{1}{2} x_t(t_i)^2 \\
\text{s.t.} & \mathbf{A}_{eq}\mathbf{a} = \mathbf{b}_{eq} \\
& x_{t,c}(t) - r_{x_t}(t) > \sqrt{2\epsilon} \quad \forall t \in [t_i, t_f], \\
& x_{t,c}(t) + r_{x_t}(t) < \sqrt{2T_{max}} \quad \forall t \in [t_i, t_f],
\end{array}
\qquad (27)$$

where $\mathbf{a} \in \mathbb{R}^{n_a}$ is a vector of parameters for shaping the desired trajectory $x_d(\mathbf{a}, t)$ (e.g. the coefficients of a polynomial trajectory), $b_{eq} \in \mathbb{R}^{n_b}$ is the vector of the boundary conditions while $\mathbf{A}_{eq} \in \mathbb{R}^{n_b \times n_a}$ is the matrix that allows matching these conditions.

The first constraint guarantees that the optimized trajectory is compliant with the desired boundary conditions, e.g., initial/final position, velocity and acceleration. The second constraint ensures that the tank will not deplete despite the parametric uncertainty. The third constraint is used to ensure that the energy inside the tank will not exceed an admissible threshold $T_{max}$. By imposing this threshold, it is possible to guarantee that the behavior of the robot will remains stable also in practical cases.

As already mentioned in [21], the concept of sensitivity and the uncertainty tubes may also be exploited to find a trajectory that ensures the maximum robustness to the variations of $\mathbf{p}$. Thus, if necessary, the cost function of the optimization problem in (27) may also be modified as follows:

* $\frac{1}{2} \|\Pi_{x_t}(t_f)\|^2$ for reducing the sensitivity at the end of the trajectory.

* $\frac{1}{2} \int_{t_i}^{t_f} \|\Pi_{x_t}(\tau)\|^2 d\tau$ for reducing the sensitivity along the whole trajectory.

Of course, one could also consider optimization of the sensitivity of the states and/or inputs as done in [21], [22]. It is worth noting that choosing to reduce sensitivity along the entire trajectory would bring $x_t(t_i)$ closer to the upper bound $\sqrt{2T_{max}}$. This is because, as seen in (20), a high value of $x_t$ reduces the sensitivity.

## VI. VALIDATION

The proposed strategy has been validated both in a simulated environment and via real experiments. In the simulated environment, a 2 DoFs omnidirectional robot has been considered, and in the real experiments this has been translated in a UR10e pushing a mass over a table. Indeed, this task is a representative scenario in the context of automated warehouses. In fact, when the robot is unable to lift some package, e.g. because it is too heavy or there is not enough space, the package has to be pushed to the desired position. Thus, in the case of a collaborative robot, i.e. a robot that works in close contact with the human operator, the passivity of the system is necessary to ensure safety in the work cell. Therefore, the model of the system can be summarized as:

$$\dot{\mathbf{q}} = \begin{pmatrix} \dot{x}_1 \\ \dot{x}_2 \\ \dot{x}_3 \\ \dot{x}_4 \end{pmatrix} = \begin{pmatrix} x_3 \\ x_4 \\ \frac{u_1 - b x_3}{m} \\ \frac{u_2 - b x_4}{m} \end{pmatrix}, \qquad (28)$$

where $\mathbf{p} = [m, b]$ is the vector of the considered uncertain parameters (the mass and the sliding friction coefficient over the floor). The chosen control action is a feedforward + friction compensation + PD force controller:

$$\mathbf{u}_d = \begin{pmatrix} m_c \dot{x}_{1d} + K_D \dot{x}_1 + K_P \dot{x}_1 + b_c \dot{x}_1 \\ m_c \dot{x}_{2d} + K_D \dot{x}_2 + K_P \dot{x}_2 + b_c \dot{x}_2 \end{pmatrix}, \qquad (29)$$

where $\tilde{x}_1 = x_{1d} - x_1$ and $\tilde{x}_2 = x_{2d} - x_2$ represent the two errors in each direction, and $m_c$ and $b_c$ are the nominal values for the parameters. The control action is provided as input to the energy tank as defined in Sec. II:

$$\left\{ \begin{array}{l} \dot{x}_t = -\frac{\sigma}{x_t} \mathbf{u}_d^T \begin{pmatrix} \dot{x}_1 \\ \dot{x}_2 \end{pmatrix} + \frac{b_c - \delta_b}{x_t} \begin{pmatrix} \dot{x}_1 & \dot{x}_2 \end{pmatrix} \begin{pmatrix} \dot{x}_1 \\ \dot{x}_2 \end{pmatrix}, \quad (30) \\ \mathbf{u} = \sigma \mathbf{u}_d. \end{array} \right.$$

The energy dissipated by the system and injected in the tank is not known a priori, and by using only the nominal value $b_c$ could lead to a loss of passivity in case of an uncertain $b$ (the tank could store more energy than what is actually dissipated). However, since the uncertainty of the friction coefficient is known, it is possible to exploit it to ensure the passivity, i.e. the energy dissipated by the system will be at least equal to $(b_c - \delta_b) (\dot{x}_1 \quad \dot{x}_2) (\dot{x}_1 \quad \dot{x}_2)$.

All the framework has been implemented and tested on Matlab exploiting `fmincon` solver with an Intel Core i7-7700 and parallelizing the computation using the Matlab Parallel Computing Toolbox. Regarding the real experiment, instead, the robot is velocity controlled exploiting the Real-Time Data Exchange library integrated into the ROS Melodic Morenia meta-operating system at a frequency of 500 Hz.

### A. Simulations

The overall procedure has been first validated in simulation, where it is possible to control all the parameters and to inject random but known perturbations. The nominal parameters are equal to $m_c = 2.0$ Kg and $b_c = 2 \frac{kg}{s}$, while
<table><caption>TABLE I</caption><thead><tr><th>Variable</th><th>Initial</th><th>Final</th></tr></thead><tbody><tr><td>x<sub>1</sub></td><td>0</td><td>1</td></tr><tr><td>x<sub>2</sub></td><td>0</td><td>2</td></tr><tr><td>x&#x0307;<sub>1</sub></td><td>0</td><td>0</td></tr><tr><td>x&#x0307;<sub>2</sub></td><td>0</td><td>0</td></tr><tr><td>x&#x0307;<sub>1</sub></td><td>0</td><td>0</td></tr><tr><td>x&#x0307;<sub>2</sub></td><td>0</td><td>0</td></tr><tr><td>t</td><td>0</td><td>1</td></tr></tbody></table>

<figure><img src="image_3.png" /><figcaption>Fig. 2: Evolution of the controller state in the perturbed cases. The red dashed lines represent the tube around the controller state, while the green dotted line represents the lower bound of the tank state. The colored lines, instead, represent the evolution of the tank state for each perturbed case.</figcaption></figure>

the uncertainty is $\delta_{pi} = 10\%p_{ci}$. The lower bound energy has instead been chosen as $\varepsilon = 3$. This choice has been done for two main reasons. The first one is purely for a computational point of view. Indeed, it has been experimentally observed that lower values of $\varepsilon$ introduce higher nonlinearities, see (18), with a consequent increment of the required optimization time. The second one is because, as shown in (20), a small value of $x_t$ increments the sensitivity of the tank and, since the main goal is to minimize $x_t$, choosing $\varepsilon$ not close to 0 automatically helps to reduce the sensitivity. Lastly, the initial condition and the desired final condition given to the optimization problem are listed in Tab.I.

In this simulated scenario, three case studies with different cost functions have been carried out:

1) Minimize the initial energy: $\frac{1}{2}x_t(t_i)^2$.

2) Minimize the sensitivity of the controller state at the end: $\frac{1}{2}\|\Pi_{x_t}(t_f)\|^2$.

3) Minimize the sensitivity of the controller state all over the trajectory: $\frac{1}{2} \int_{t_i}^{t_f} \|\Pi_{x_t}(\tau)\|^2 d\tau$

The results of the first simulation are shown in Figures 2-4. Figure 2 shows the evolution of the controller state and demonstrates that, for every perturbation, the tank state lies inside the tube as expected. This means that, thanks to the proposed approach, even in the worst case the energy tank does not deplete and $u = u_d$, i.e. $\sigma = 1$. Figures 3-4, instead, show the same results for the position and the velocity of the robot, respectively.

Focusing on the controller state, Fig. 5 shows the evolution of the controller state for the other two simulations. It is worth noting that in Fig. 5a the final tube size is smaller, while in Fig. 5b the tube is reduced all over the path. Regarding the initial tank state $x_t(t_i)$, instead, it is higher than the one in Fig. 2, since in these two cases it not minimized and, from a sensitivity point of view, it is better

<figure><img src="image_4.png" /><figcaption>Fig. 3: Evolution of the system position in the perturbed cases. The red dashed lines represent the tube around the controller state, while the colored ones represent the evolution of the position for each perturbed case.</figcaption></figure>

<figure><img src="image_5.png" /><figcaption>Fig. 4: Evolution of the system velocity in the perturbed cases. The red dashed lines represent the tube around the controller state, while the colored ones represent the evolution of the velocity for each perturbed case.</figcaption></figure>

to have $x_t$ high, see equation (20).

Lastly, a comparison in the optimization time has been performed. We generated random initial and final states and found the optimal solution for all three cost functions. For all the random comparisons, the final time $t_f$ has been set to 1. This is because, in the optimization process, it is necessary to integrate (12). Thus, different final times would affect the required optimization time. The results are summarized in Fig. 6, where it is possible to note that using $\frac{1}{2}x_t(t_i)^2$ as cost function required more time. This is due to the fact that closely to the lower bound, the nonlinearity of $\sigma$ takes an important role. This also demonstrates why it has been chosen $\varepsilon = 3$.

## B. Experiment

The setup of the experiment is shown in Fig. 7. In order to better capture the real scenario, the friction model has been
<figure><img src="image_6.png" /><figcaption>Fig. 5: Resulting evolution for random perturbations of the controller for the second and third simulations.</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>Fig. 6: Comparison for the three cost functions.</figcaption></figure>

changed from the viscous friction to the Coulomb friction:

$$F_{\text{friction}} = \mu \cdot m \cdot g \cdot \text{sign}\left(\frac{\dot{x}_1}{\dot{x}_2}\right), \quad (31)$$

where g is the gravity acceleration. The function sign() is non differentiable in 0, but it can be approximated with a sigmoid function. This leads to:

$$\dot{q} = \begin{pmatrix} \dot{x}_1 \\ \dot{x}_2 \\ \dot{x}_3 \\ \dot{x}_4 \end{pmatrix} = \begin{pmatrix} x_3 \\ x_4 \\ \frac{u_1 - \mu \cdot m \cdot g \cdot \tanh(25\dot{x}_2)}{u_2 - \mu \cdot m \cdot g \cdot \tanh(25\dot{x}_2)} \\ \frac{m}{m} \end{pmatrix}, \quad (32)$$

where $p = [m, \mu]$. The computation of the control action and the tank state evolution are analogous to the previous case.

<figure><img src="image_8.png" /><figcaption>Fig. 7: Setup of the experiment: the UR010e robot with a custom tool that allows pushing the mass and the ATI mini 45 F/T sensor.</figcaption></figure>

<table><caption>TABLE II</caption><thead><tr><th>Variable</th><th>Initial</th><th>Final</th></tr></thead><tbody><tr><td>x<sub>1</sub></td><td>x<sub>1,real</sub></td><td>x<sub>1,real</sub> + 0.15</td></tr><tr><td>x<sub>2</sub></td><td>x<sub>2,real</sub></td><td>x<sub>2,real</sub> + 0.15</td></tr><tr><td>dot{x}<sub>1</sub></td><td>0</td><td>0</td></tr><tr><td>dot{x}<sub>2</sub></td><td>0</td><td>0</td></tr><tr><td>dot{x'<sub>1</sub></td><td>0</td><td>0</td></tr><tr><td>dot{x'<sub>2</sub></td><td>0</td><td>0</td></tr><tr><td>t</td><td>0</td><td>1.5</td></tr></tbody></table>

<figure><img src="image_9.png" /><figcaption>Fig. 8: Evolution of the controller state in the real experiment.</figcaption></figure>

For the real scenario, the nominal parameters are equal to $m_c = 2.04$ Kg and $\mu_c = 0.15$, while the uncertainties of the mass and the friction coefficient are set to $\delta_m = 0.15$ kg and $\delta\mu = 0.042$, respectively. The initial condition and the desired final condition for the optimization problem are listed in Table II.

Similarly to before, two experiments have been performed:

1) Nominal experiment, $m = m_c$, considering the tube around the tank state.

2) Perturbed experiment, $m \neq m_c$, considering the tube around the tank state.

For both cases, the friction coefficient $\mu$ has been experimentally estimated moving the mass at constant speed. However, this estimation is subject to uncertainties in the measurement, this is why it has been decided to not modify the friction coefficient, e.g. changing the surface.

In both the first and the second experiments, the robot is

<figure><img src="image_10.png" /><figcaption>Fig. 9: Evolution of the system position in the real experiment.</figcaption></figure>
<figure><img src="image_11.png" /><figcaption>Fig. 10: Evolution of the system velocity in the real experiment.</figcaption></figure>

capable of moving the mass along the planned path. Figure 8 shows that, thanks to the optimization problem, the tank state always lies inside the tube. This means that the controller is always able to implement the desired action. Figures 9 and 10, instead, demonstrate that also the evolution of the state remains confined in the tube.

## VII. CONCLUSIONS AND FUTURE WORKS

In this work a new method for initializing the energy tank while being robust to uncertainties in robot/environment model parameters has been proposed. The strategy relies on the concept of *closed-loop state sensitivity* to build tubes that envelope all the possible deviations of the tank state w.r.t. its nominal evolution for a given range of parametric uncertainty. This machinery is used as a starting point to formulate a nonlinear optimization problem that allows to compute both the best trajectory for the robot and the lowest initial tank energy such that the system will implement exactly the desired behaviour without depleting the tank energy for any value of the uncertain parameters.

Future works will focus on a more complex experimental validation, e.g., focusing on the uncertainties of the dynamic modeling of a robotic manipulator, or in the grasping pose. Furthermore, the overall approach may be extended and generalized for all the Port-Hamiltonian systems and not only the case of energy tanks. Lastly, it may be interesting to analyze the robustness of the approach in the presence of external inputs, e.g. an operator interacting with the robot.

## REFERENCES

[1] B. Siciliano, O. Khatib, and T. Kröger, Springer handbook of robotics. Springer, 2008, vol. 200.

[2] G. Niemeyer and J.-J. Slotine, "Stable adaptive teleoperation," *IEEE Journal of oceanic engineering*, vol. 16, no. 1, pp. 152–162, 1991.

[3] S. Stramigioli, "Energy-aware robotics," in *Mathematical Control Theory I: Nonlinear and Hybrid Control Systems*. Springer, 2015, pp. 37–50.

[4] F. Benzi and C. Secchi, "An optimization approach for a robust and flexible control in collaborative applications," in *2021 IEEE International Conference on Robotics and Automation (ICRA)*. IEEE, 2021, pp. 3575–3581.

[5] M. Minelli, N. Piccinelli, F. Falezza, F. Ferraguti, R. Muradore, and C. Secchi, "Two-layer-based multiarms bilateral teleoperation architecture," *IEEE Transactions on Control Systems Technology*, 2022.

[6] F. Benzi, F. Ferraguti, G. Riggio, and C. Secchi, "An energy-based control architecture for shared autonomy," *IEEE Transactions on Robotics*, vol. 38, no. 6, pp. 3917–3935, 2022.

[7] P. Capsi-Morales, C. Piazza, M. G. Catalano, A. Bicchi, and G. Grioli, "Exploring stiffness modulation in prosthetic hands and its perceived function in manipulation and social interaction," *Frontiers in Neuro-robotics*, p. 33, 2020.

[8] C. Yang, G. Ganesh, S. Haddadin, S. Parusel, A. Albu-Schaeffer, and E. Burdet, "Human-like adaptation of force and impedance in stable and unstable interactions," *IEEE transactions on robotics*, vol. 27, no. 5, pp. 918–930, 2011.

[9] M. T. Spaan, T. S. Veiga, and P. U. Lima, "Active cooperative perception in network robot systems using pomdps," in *2010 IEEE/RSJ International Conference on Intelligent Robots and Systems*. IEEE, 2010, pp. 4800–4805.

[10] F. Califano, R. Rashad, C. Secchi, and S. Stramigioli, "On the use of energy tanks for robotic systems," in *Human-Friendly Robotics 2022: HFR: 15th International Workshop on Human-Friendly Robotics*. Springer, 2023, pp. 174–188.

[11] C. Schindlbeck and S. Haddadin, "Unified passivity-based cartesian force/impedance control for rigid and flexible joint robots via task-energy tanks," in *2015 IEEE international conference on robotics and automation (ICRA)*. IEEE, 2015, pp. 440–447.

[12] E. Shahriari, A. Kramberger, A. Gams, A. Ude, and S. Haddadin, "Adapting to contacts: Energy tanks and task energy for passivity-based dynamic movement primitives," in *2017 IEEE-RAS 17th International Conference on Humanoid Robotics (Humanoids)*, 2017, pp. 136–142.

[13] R. Rashad, D. Bicego, J. Zult, S. Sanchez-Escalonilla, R. Jiao, A. Franchi, and S. Stramigioli, "Energy aware impedance control of a flying end-effector in the port-hamiltonian framework," *IEEE Transactions on Robotics*, vol. 38, no. 6, pp. 3936–3955, 2022.

[14] F. Benzi, M. Brunner, M. Tognon, C. Secchi, and R. Siegwart, "Adaptive tank-based control for aerial physical interaction with uncertain dynamic environments using energy-task estimation," *IEEE Robotics and Automation Letters*, vol. 7, no. 4, pp. 9129–9136, 2022.

[15] K. J. Astrom and B. Wittenmark, "Adaptive control 2nd edition," *Addison-Wesley Pub Co.*, vol. 1994, 1994.

[16] S. Candido and S. Hutchinson, "Minimum uncertainty robot path planning using a pomdp approach," in *2010 IEEE/RSJ International Conference on Intelligent Robots and Systems*. IEEE, 2010, pp. 1408–1413.

[17] —, "Minimum uncertainty robot navigation using information-guided pomdp planning," in *2011 IEEE International Conference on Robotics and Automation*. IEEE, 2011, pp. 6102–6108.

[18] A. Ansari and T. Murphey, "Minimum sensitivity control for planning with parametric and hybrid uncertainty," *The International Journal of Robotics Research*, vol. 35, no. 7, pp. 823–839, 2016.

[19] R. Tedrake, I. R. Manchester, M. Tobenkin, and J. W. Roberts, "Lqr-trees: Feedback motion planning via sums-of-squares verification," *The International Journal of Robotics Research*, vol. 29, no. 8, pp. 1038–1052, 2010.

[20] A. Majumdar and R. Tedrake, "Funnel libraries for real-time robust feedback motion planning," *The International Journal of Robotics Research*, vol. 36, no. 8, pp. 947–982, 2017.

[21] P. Robuffo Giordano, Q. Delamare, and A. Franchi, "Trajectory generation for minimum closed-loop state sensitivity," in *2018 IEEE International Conference on Robotics and Automation (ICRA)*. IEEE, 2018, pp. 286–293.

[22] P. Brault, Q. Delamare, and P. Robuffo Giordano, "Robust trajectory planning with parametric uncertainties," in *2021 IEEE International Conference on Robotics and Automation*, 2021, pp. 11095–11101.

[23] P. Brault and P. Robuffo Giordano, "Tube-based trajectory optimization for robots with parametric uncertainty," http://rainbow-doc.irisa.fr/pdf/tube_based_traj_opt.pdf.

[24] S. Wasiela, P. Robuffo Giordano, J. Cortés, and T. Simeon, "A sensitivity-aware motion planner (samp) to generate intrinsically-robust trajectories," in *2023 IEEE International Conference on Robotics and Automation*, 2023.

[25] A. van der Schaft, *L2-Gain and Passivity Techniques in Nonlinear Control*, 3rd ed. Springer Publishing Company, Incorporated, 2016.