1 Introduction

Everyone deals with the sloshing of liquids in containers daily. We know from experience how to transport open liquid containers like water glasses or coffee cups without violent sloshing or spilling, and we know to be careful when handling “difficult containers” like a flat soup plate or a Martini cocktail glass. In a technical context, sloshing is important for a wide range of applications: from the rapid transport of liquids in aerospace and automotive industries to the safe handling of molten metal in casting processes [1], the stability of cargo ships, or the precise movement of liquid containers in pharmaceutical production. In all these cases, the sloshing dynamics need to be accurately predicted and typically mitigated, i.e., modeled and controlled.

Sloshing dynamics are described by the fluid field equations, which can be solved numerically, e.g., by the finite element method [2, 3] or smooth particle hydrodynamics [4,5,6,7,8] which are particularly suitable for modeling large free surface displacements and splashing. While numerical methods are applicable to containers of arbitrary shapes, the resulting models are often unsuitable for model-based control tasks due to their high computational demand. Therefore, so-called equivalent mechanical models are often used (e.g., [3, 9, 10]). Their structure and parameters must be chosen such that they deliver dynamically equivalent reaction forces [11]. Different sloshing phenomena require adapted equivalent models, e.g., highly nonlinear vertical sloshing phenomena have been successfully represented by bouncing-ball models [8] or neural network models [12, 13], moderately nonlinear horizontal sloshing has been described by a linear mechanical oscillator with an internal cubic mass-spring system [14], free-surface-flow interacting with flexible containers by port-Hamiltonian models [15], and low-amplitude horizontal sloshing in rigid containers is commonly modeled by mechanical equivalent pendulum models. Existing approaches for designing equivalent (pendulum) models often rely on closed-form solutions for the governing equations [16]. Therefore, the vast majority of publications only consider simple container geometries for which analytical solutions for the sloshing problem exist (e.g., for cuboids [16], cylinders of various orientations [1, 16, 17] or cones [18]). Many authors deal with cylindrical tanks [19,20,21,22,23] or rectangular tanks [24,25,26,27,28], but also equivalent models for spherical tanks [10], tilted cylinders [29], or prismatic-walled containers [30] have been derived. Moreover, many works consider just a single (most dominant) sloshing mode. We propose a generally applicable parametrization method for physics-based equivalent pendulum models incorporating an arbitrary number of sloshing modes in arbitrarily shaped containers.

Sloshing control by closed-loop approaches can achieve a rather robust sloshing suppression but also requires real-time measurement and processing of the sloshing dynamics [23]. When realizing feedback control is not possible, feedforward approaches like a simple, model-free “waiter-tray” approach [31, 32] which only seeks to minimize lateral acceleration of the transported objects can be used. Feedforward trajectory design by frequency domain notch [19, 29] or customized filtering [25] aims to suppress the liquid’s excitation at low-damped sloshing modes while input-shaping methods [20, 24] try to compensate any sloshing motion at the end of a maneuver. Generally, better performance can be expected from model-based approaches. In optimal control methods, the relative motion between container and liquid computed via a suitable model is minimized while carrying out a desired transport maneuver. This has been done for rest-to-rest maneuvers in minimum-time and minimum-energy settings [26]. The minimum-time problem was also solved via linear programming [22] and multiple-shooting methods [23, 33]. Optimal control approaches often require computationally intensive nonlinear optimization. In contrast, flatness-based control greatly simplifies the design of rest-to-rest maneuvers and the construction of dynamic feedforward controllers. In general, flatness-based control is a systematic approach to express the full system dynamics and the system input through a differentially flat output and its time derivatives [34, 35], which has been successfully applied to sloshing problems [27, 30]. A recent, innovative approach introduces a virtual spherical pendulum on which the liquid container is suspended [36]. This approach draws inspiration from a traditional method of carrying tea in northern Africa, today marketed as SpillNot [37]. Even when violently displacing the pendulum’s pivot point, it is almost impossible to spill liquid from the suspended container. While the setup is remarkably robust, the mounted container and pendulum must be adapted to each other to deliver optimal performance.

In this contribution, we use the virtual tray concept [36] together with flatness-based approach to suppress multiple sloshing modes [38] which is extended by a novel parameter identification scheme to handle arbitrarily shaped containers. The liquid dynamics are modeled by a physics-based equivalent pendulum model with an arbitrary number of pendulums, whose parameters are identified from a finite element (FE) model of the liquid. Both models are described in Sect. 2. The identification methodology aims to match fluid reaction forces and torques due to prescribed container motions between the equivalent and FE models. The nonlinear fitting procedure is described in Sect. 3 together with details for the identifiability analysis. Section 4 details the feedforward control and trajectory planning concept: we design the virtual tray such that the first sloshing mode is rendered uncontrollable, thus making it impossible to excite. The flatness-based approach allows an optimization-free design of rapid rest-to-rest trajectories where an arbitrary number of further sloshing modes is brought to rest exactly at the end of the desired maneuver. We demonstrate the effectiveness of the proposed approach by applying it to a Martini cocktail glass, which is highly susceptible to sloshing due to its geometry, in Sect. 5. After the identification of a three-mode equivalent pendulum model, we design a rapid rest-to-rest trajectory to serve a cocktail in 1.6 s using an industrial robot. The maneuver is completed without visible surface displacement, confirming the model predictions.

2 Modeling of the sloshing dynamics

The main idea of the proposed concept is to describe the dynamics of the fluid in the container by a numerically efficient mechanical pendulum model which is suitable for the control task. This equivalent model must match the fluid behavior in terms of fluid reaction forces and torques with respect to forced container motion. Fluid reaction forces can be accurately predicted by solving the governing partial differential equations for the fluid, as described in Sect. 2.1. The set of ordinary differential equations describing the pendulum model is derived in Sect. 2.2. To obtain the equivalence of both models, we present a novel parameter identification procedure for equivalent pendulum models in Sect. 3.

2.1 Fluid field model

In general, the description of liquid dynamics in containers is done by the full Navier–Stokes equations on changing domains to incorporate the free surface and spilling. While the governing equations can be solved by high-fidelity computational fluid dynamics (CFD), this comes at a high computational effort. Therefore, we take the useful assumptions of an in-viscid and in-compressible fluid and small free surface displacements to simplify the governing equations. A detailed derivation is given in [2], and Fig. 1 depicts the domains and boundary conditions used in the following summary.

Fig. 1
figure 1

Sketch of domains and boundary conditions for the field model

Considering the fluid as in-viscid and in-compressible, we linearize and combine the governing equations for balance of momentum and mass, which leads to a potential flow description, i.e., we consider the Laplace equation

$$\begin{aligned} \varvec{\nabla }\cdot {\varvec{\nabla }{p}} = 0 \quad \text {in}\quad \Omega . \end{aligned}$$
(1)

Contrary to the usual introduction of a velocity potential, p directly denotes the dynamic pressure in the fluid domain \(\Omega \). The total pressure actually present in the fluid is the sum of the dynamic pressure and the static pressure satisfying the hydrostatic equilibrium equations.

To prescribe the motion of the container wall, we use the in-homogeneous Neumann condition

$$\begin{aligned} \varvec{\nabla }{p}\cdot \varvec{n} = \rho \varvec{a}\cdot {\varvec{n}} = \rho a_{\textrm{n}} \quad \text {on}\quad \Gamma _{\textrm{w}} , \end{aligned}$$
(2)

where \(\rho \) denotes the fluid density and \(\varvec{n}\) is the outward facing normal vector of the boundary. The spatial distribution for the values \(a_{\textrm{n}}\) follows from the prescribed container trajectory.

At the free surface, we need to satisfy the dynamic and kinematic boundary conditions: the dynamic condition states that the total pressure at the free surface must equal the ambient pressure. The kinematic condition ensures that fluid particles at the free surface stay at the free surface, i.e., the velocity of the free surface corresponds to the particle velocity. This condition is commonly linearized, which is appropriate for non-steep waves [39]. The final (combined) boundary condition at the free surface then reads

$$\begin{aligned} \frac{1}{g} \frac{\partial ^{2}p}{\partial {t}^2} = \varvec{\nabla }{p}\cdot \varvec{n} \quad \text {on}\quad \Gamma _{\textrm{f}} , \end{aligned}$$
(3)

where g denotes the acceleration of gravity. The free surface elevation can be computed by \(\eta (x,y) = p(x,y,0)/(\rho g)\) on \(\Gamma _{\textrm{f}}\).

To obtain the variational (FE) formulation of the problem, we introduce an appropriate test function q in (1), integrate over the computational domain, and incorporate the boundary conditions (2)–(3) via integration by parts. We obtain: find \(p \in H^1(\Omega )\) such that

$$\begin{aligned} \int \limits _\Omega \varvec{\nabla }{q}\cdot \varvec{\nabla }{p} \mathrm d\Omega - \int \limits _{\Gamma _{\textrm{f}}} \frac{1}{g} q \frac{\partial ^{2}p}{\partial {t}^2} \mathrm d\Gamma = \int \limits _{\Gamma _{\textrm{w}}} q \rho a_{\textrm{n}} \mathrm d\Gamma , \end{aligned}$$
(4)

for all test functions \(q\in H^1(\Omega )\). The spatial discretization is done by (nodal) finite elements in the usual manner. The problem can be solved in the frequency domain, by assuming harmonic forcing of the form \(a_n(t) = \hat{a}_n e^{j\omega t}\) where \(\omega \) denotes the angular frequency. Similarly, the undamped eigenvalue problem to compute sloshing frequencies and modes can be obtained. For time domain solutions, the common HHT-scheme [40] with slight numerical damping is useful.

The overall reaction force and torque of the fluid exerted onto the container are

$$\begin{aligned} {\varvec{F}} = \int \limits _{\Gamma _{\textrm{w}}} p{\varvec{n}} \mathrm d\Gamma \,,&\qquad {\varvec{M}}_0 = \int \limits _{\Gamma _{\textrm{w}}} {\varvec{r}} \times p{\varvec{n}} \mathrm d\Gamma \,, \end{aligned}$$
(5)

where \({\varvec{r}}\) is the location vector of a surface point measured from the origin making \({\varvec{M}}_0\) the reaction torque with respect to the origin. The reaction forces and torques can be computed in a post-processing step from the FEM solution. The above formulation has been implemented in the open-source finite element software openCFS [41].

2.2 Equivalent pendulum model

Equivalent mechanical models for representing linear sloshing dynamics typically consist of a set of oscillators (pendulums or mass–spring–dashpot systems) representing the most important sloshing modes, and a container-fixed rigid distributed mass (commonly called “frozen mass”) to correctly represent the asymptotic high-frequency behavior. We use a pendulum model consisting of an arbitrary number of N mathematical pendulums and a single frozen mass attached to the container as depicted in Fig. 2. The pendulums are defined by their masses \(m_i\), lengths \(l_i\), and pivot locations \(L_i\) on the container’s axis (measured downwards from the undisplaced free surface). The frozen mass is defined by its mass \(m_0\), moment of inertia \(I_0\) (with respect to the center of mass), and center of mass location \(L_0\) (below the free surface on the container’s axis).

Fig. 2
figure 2

Equivalent pendulum model with one fluid pendulum i drawn

To derive the equations of motion, we use the Lagrange formalism. We formulate the equations of motion with respect to a reference point P on the container axis with distance \(L_P\) above the water surface. This enables us to prescribe imposed translations and rotations of the container by the horizontal displacement \(\tilde{x}_P(t)\) of the reference point and the rotation angle \(\tilde{\varphi }(t)\) around the reference point. The nonlinear kinematics of the system are defined by the location vectors of the center of mass of all components

$$\begin{aligned} {\varvec{r}}_i&= \begin{bmatrix} x_i&0&z_i \end{bmatrix}^\intercal \quad \text {with}\nonumber \\ x_i&= \tilde{x}_P-( L_P + L_{i} ) \sin (\tilde{\varphi }) - l_{i} \sin (\tilde{\varphi }_{i}+\tilde{\varphi }) \,,\nonumber \\ z_i&= L_P - ( L_P + L_{i}) \cos (\tilde{\varphi }) - l_{i} \cos (\tilde{\varphi }_{i}+\tilde{\varphi }) \,, \end{aligned}$$
(6)

with \(i=0\) for the frozen mass (where \(l_0=0\)) and \(i=1,\dots ,N\) for the pendulums. The pendulum pitch \(\tilde{\varphi }_i\) is measured relative to the container axis. The Lagrange formalism yields the \(2+N\) equations of motion

$$\begin{aligned} \frac{\textrm{d}}{\textrm{d}t} \left( \frac{\partial T}{\partial \dot{q}_j} \right) - \frac{\partial T}{\partial q_j} + \frac{\partial V}{\partial q_j} = Q_j , \end{aligned}$$
(7a)

with

$$\begin{aligned} T&= \frac{1}{2}I_0 \dot{\tilde{\varphi }}^2 + \frac{1}{2} \sum _{i=0}^{N} m_i \dot{{\varvec{r}}}_i \cdot \dot{{\varvec{r}}}_i \,,&V&= - \sum _{i=0}^{N}m_i {\varvec{r}}_i \cdot {\varvec{g}} \,, \end{aligned}$$
(7b)

where T is the kinetic energy and V is the potential energy. The vector \({\varvec{g}}=[0,0,-g]^\intercal \) denotes the gravitational acceleration, which must be chosen consistently to the assumed equilibrium free surface configuration. The generalized coordinates \(q_j\) are collected in the vector \(\tilde{\varvec{q}} = [\tilde{x}_P, \tilde{\varphi }, \tilde{\varphi }_1, \dots , \tilde{\varphi }_N]^\intercal \), and the respective generalized forces \(Q_j\) in \(\tilde{\varvec{Q}} = [-\tilde{F}_x,-\tilde{M}_y,0,\dots ,0]^\intercal \). Note that we have kept degrees of freedom \(\tilde{x}_P\) and \(\tilde{\varphi }\) describing the rigid body position of the container in the equations of motion. When these are prescribed, i.e., considering the forced motion of the container, the corresponding generalized forces \(\tilde{F}_x\) and \(\tilde{M}_y\) become reaction forces exerted by the water on the container.

Assuming small deviations \(\varvec{q}\) around the equilibrium positions \(\mathring{\varvec{q}}\), thus setting \(\tilde{\varvec{q}}=\mathring{\varvec{q}}+\varvec{q}\) and \(\tilde{\varvec{Q}}=\mathring{\varvec{Q}}+\varvec{Q}\), respectively, in (7) and neglecting higher-order terms yields the linearized equations for force, torque and the N pendulums

$$\begin{aligned} \sum _{i=0}^{N}m_i \ddot{x}_P - \sum _{i=0}^{N}m_i \bar{L}_i\ddot{\varphi } -\sum _{i=1}^{N} m_i l_i \ddot{\varphi }_i&= -F_x \,, \end{aligned}$$
(8a)
$$\begin{aligned} - \sum _{i=0}^{N}m_i \bar{L}_i\ddot{x}_P + \left( I_0 + \sum _{i=0}^{N}m_i \bar{L}_i^2\right) \ddot{\varphi } + \sum _{i=1}^{N} m_i l_i \bar{L}_i \ddot{\varphi }_i&\nonumber \\ + \sum _{i=0}^{N} m_i g \bar{L}_i\varphi + \sum _{i=1}^{N} m_i g l_i \varphi _i&= - M_y, \end{aligned}$$
(8b)
$$\begin{aligned} -\ddot{x}_P+\bar{L}_i\ddot{\varphi } +l_i \ddot{\varphi }_i+g \varphi +g \varphi _i&= 0 \,, \end{aligned}$$
(8c)

respectively, where the length \(\bar{L}_i=L_P+L_i+l_i\) was introduced for convenience.

We aim to obtain equivalence between the fluid field and pendulum model by matching fluid reaction forces upon prescribed, harmonic container motion, i.e., in the frequency domain. Considering the steady-state response to the forced harmonic motion of the container \(\varvec{q}(t)=\hat{\varvec{q}}e^{j\omega t}\), the sloshing Eq. (8c) directly delivers the response of each pendulum, i.e., can be directly solved for \(\hat{\varphi }_i\). Plugging the solution into the frequency domain form of Eqs. (8a) and (8b), one obtains expressions for reaction force and torque for a given container motion (in terms of \(\hat{x}_P\) and \(\hat{\varphi }\)). We now define two load cases for the forced motion of the container, as illustrated in Fig. 2 (bottom).

The first case is harmonic translatory displacement (sway), where \(x_P=\hat{x}_P e^{j\omega t}\) and \(\varphi =0\) which yields the reaction force and reaction torque

$$\begin{aligned} \hat{F}_{xx}^{(\mathrm p)}(\omega )&= \hat{x}_P \omega ^2 \left[ \sum _{i=0}^{N}m_i+\sum _{i=1}^{N}m_i\frac{\omega ^2}{\omega _{i}^2-\omega ^2}\right] \,, \end{aligned}$$
(9a)
$$\begin{aligned} \hat{M}_{yx}^{(\mathrm p)}(\omega )&= -\hat{x}_P \omega ^2 \left[ \sum _{i=0}^{N} m_i \bar{L}_i+ \sum _{i=1}^{N}{m_i \frac{\bar{L}_i\omega ^2 - g }{\omega _{i}^2-\omega ^2}} \right] \,, \end{aligned}$$
(9b)

where \(\omega _i=\sqrt{g/l_i}\) is the natural frequency of a simple pendulum. Note that we use the second index to denote the load case while the first index denotes the direction of force or torque, e.g., \(M_{yx}\) denotes the reaction torque around the y-axis for translatory excitation in x-direction (sway).

The second load case is harmonic tilting, where \(x_P=0\) and \(\varphi =\hat{\varphi }e^{j\omega t}\). In this case the corresponding pitch reaction force and reaction torque in the frequency domain become

$$\begin{aligned} \hat{F}_{x\varphi }^{(\mathrm p)}(\omega )&= -\hat{\varphi } \omega ^2 \left[ \sum _{i=0}^{N} m_i \bar{L}_i+ \sum _{i=1}^{N}{m_i \frac{\bar{L}_i\omega ^2 - g }{\omega _{i}^2-\omega ^2}} \right] \,, \end{aligned}$$
(10a)
$$\begin{aligned} \hat{M}_\mathrm{y\varphi }^{(\mathrm p)}(\omega )&= \hat{\varphi }\left[ I_0 \omega ^2 + \sum _{i=0}^{N} m_i \bar{L}_i \left( \bar{L}_i\omega ^2 - g \right) + \sum _{i=1}^{N}m_i \frac{ (\bar{L}_i\omega ^2 - g)^2}{\omega _{i}^2-\omega ^2} \right] \,. \end{aligned}$$
(10b)

The results of the FE analysis only yield the dynamic components of reaction force and torque. In order to make the equivalent pendulum model comparable, it is necessary to exclude the static components, i.e., subtract the static part obtained with \(\omega =0\), which is zero for Eqs. (9a), (9b) and (10a) and nonzero for Eq. (10b). By dividing the force and torque functions by the corresponding displacements, we obtain the transfer functions later used for parameter identification

$$\begin{aligned} {H}_{xx}^{(\mathrm p)}(\omega )&= \frac{\hat{F}_{xx}^{(\mathrm p)}(\omega )}{\hat{x}_P} \,,&{H}_{x\varphi }^{(\mathrm p)}(\omega )&= \frac{\hat{M}_{yx}^{(\mathrm p)}(\omega )}{\hat{x}_P} \,, \end{aligned}$$
(11a)
$$\begin{aligned} {H}_{\varphi x}^{(\mathrm p)}(\omega )&= \frac{\hat{F}_{x\varphi }^{(\mathrm p)}(\omega )}{\hat{\varphi }} \,,&{H}_\mathrm{\varphi \varphi }^{(\mathrm p)}(\omega )&= \frac{\hat{M}_\mathrm{y\varphi }^{(\mathrm p)}(\omega )-\hat{M}_\mathrm{y\varphi }^{(\mathrm p)}(0)}{\hat{\varphi }} \,, \end{aligned}$$
(11b)

where the first index denotes the load case (x for sway and \(\varphi \) for pitch), and the second index indicates the reaction (x for horizontal force and \(\varphi \) for torque). The transfer functions for the considered system are later depicted in Fig. 8. Note that the identity \(H_{x\varphi } = H_{\varphi x} = \hat{M}_{yx}/\hat{x}_P = \hat{F}_{x\varphi }/\hat{\varphi }\) holds. This follows from the reciprocity principle for conservative systems, which requires that the transfer function matrix is symmetric [42]. Thus, we obtain three unique transfer functions from the two defined load cases.

3 Parameter identification and identifiability analysis

To identify the parameters of the equivalent pendulum model for the sloshing dynamics, we solve the governing fluid field equations (as given in Sect. 2.1) using an FE model (detailed in Sect. 5.1) which can be built for containers of arbitrary shape. For N sloshing modal pendulums, \(3+3N\) parameters need to be determined: \(m_0\), \(L_0\), and \(I_0\) and \(m_i\), \(L_i\), and \(l_i\) for \(i=1,\dots ,N\). In the first step, we conduct an eigenvalue analysis of the fluid yielding the natural frequencies. Each pendulum of the equivalent model represents one mode. The pendulum lengths \(l_i\) follow directly from the respective natural frequencies, i.e.,

$$\begin{aligned} l_i=\frac{g}{\omega _{i}^2}. \end{aligned}$$
(12)

The remaining \(3+2N\) parameters are collected in the vector \({\varvec{\theta }}=\left[ m_0, L_0, I_0, m_1,\dots , m_N, L_1, \dots , L_N\right] ^\intercal \) and will be computed by a parameter fitting procedure.

We obtain the data for the fit by using the FE model to compute the steady-state response to prescribed harmonic container motions, i.e., we compute harmonic analyses in a given frequency range. The container motion in the two load cases (sway, pitch) is imposed via a prescribed acceleration according to Eq. (2), where the acceleration values in each point follow from the linearized rigid body kinematics. Using the post-processing results Eq. (5), we obtain data for force and torque at discrete angular frequencies \(\omega _n\) of the harmonic analysis. By normalizing with the applied corresponding displacement, we obtain transfer functions analogous to those derived for the equivalent pendulum model Eq. (11)

$$\begin{aligned} H_{xx}^{(\mathrm FE)}(\omega _n)&= \frac{\hat{F}_{xx}^{(\mathrm FE)}(\omega _n)}{\hat{x}_P} \,,&H_{\varphi x}^{(\mathrm FE)}(\omega _n)&= \frac{\hat{M}_{yx}^{(\mathrm FE)}(\omega _n)}{\hat{x}_P} \,, \end{aligned}$$
(13a)
$$\begin{aligned} H_{x\varphi }^{(\mathrm FE)}(\omega _n)&= \frac{\hat{F}_{x\varphi }^{(\mathrm FE)}(\omega _n)}{\hat{\varphi }} \,,&H_\mathrm{\varphi \varphi }^{(\mathrm FE)}(\omega _n)&= \frac{\hat{M}_\mathrm{y\varphi }^{(\mathrm FE)}(\omega _n)}{\hat{\varphi }} \,. \end{aligned}$$
(13b)

Again, the FE results show that \(H_{\varphi x} = H_{x \varphi }\) holds.

In order to obtain equivalence between equivalent pendulums and FE model, we formulate a nonlinear optimization problem. The goal is to minimize the difference between obtained force/torque transfer functions of the harmonic FE analysis and the associated pendulum model functions. Thus, we choose the objective function

$$\begin{aligned} f(\varvec{\theta }) = \sum \limits _{k \in \mathcal {K} } \sum \limits _{n \in \mathcal {N}}\biggl [\frac{1}{s_{k}}\bigl ( H_{k}^{(\mathrm p)} (\omega _n,\varvec{\theta }) - H_{k}^{(\mathrm FE)}(\omega _n) \bigr )\biggr ]^2 , \end{aligned}$$
(14)

which sums the scaled quadratic difference between FE and pendulum transfer functions evaluated at chosen frequencies (in the set \(\mathcal {N}\)). Note that some parameters in \(\varvec{\theta }\) do not occur in all pendulum model functions, see Eqs. (9a), (9b), (10a) and (10b); therefore, one needs to include all three transfer functions in the set \(\mathcal {K}=\{ xx, x\varphi , \varphi \varphi \}\). The scaling \(s_k\) is used to ensure similar orders of magnitude for the different transfer functions to balance the terms in the sum of the objective function. A suitable scaling choice is the common non-dimensionalization of transfer functions [16] as used in Fig. 8. Furthermore, we introduce constraints to ensure that parameters remain physical (e.g., remain greater than zero). We define

$$\begin{aligned} m_i&\ge 0 \,, \quad \forall \quad i=0,\dots ,N, \, \end{aligned}$$
(15a)
$$\begin{aligned} I_0&\ge 0 \,, \end{aligned}$$
(15b)
$$\begin{aligned} m_0+\sum \limits _{i=1}^{N} m_i&= \rho V \,, \end{aligned}$$
(15c)

where V denotes the water volume. Equation (15c) ensures that the total mass is conserved. The final optimization problem is: Minimize the objective function (14) subject to the constraints (15). To solve the optimization problem, we employ an SLSQP (Sequential Least Squares Programming) algorithm [43].

Carrying out the described optimization procedure delivers the optimized parameter vector \({\varvec{\theta }}^\textrm{s}\). The question is how the data used for the objective function should be chosen, i.e., at which frequencies in \(\mathcal {N}\) they should be evaluated. In general, the dataset has to be chosen such that it contains sufficient information about the physical system so that all pendulum model parameters can be determined uniquely. This can formally be addressed by analyzing identifiability based on the concept of Fisher information, which is commonly used for analyzing optimal experiment design for system identification [44, 45].

We consider the harmonic force and torque transfer functions \(H_{k}^{(\mathrm p)}(\omega ,\varvec{\theta })\) at a specific frequency \(\omega \) as a data point. The parameters in \(\varvec{\theta }\) are in general heterogeneous in their dimensions and magnitudes, which may introduce a bias when evaluating the sensitivity of \(H_{k}^{(\mathrm p)}(\omega ,\varvec{\theta })\) with respect to the different parameters [45]. Thus, we normalize each element of the parameter vector \({{\theta }}^*_j={\theta }_j / {\theta }^\textrm{s}_j\) using chosen parameters \({\varvec{{\theta }}}^\textrm{s}\). The output vector is summarized as

$$\begin{aligned} {\varvec{y}}(\omega )= \left[ \begin{array}{rrr} H_{xx}^\mathrm{(p)}(\omega ,{\varvec{\theta }}^*)/s_{xx} \\ H_{x\varphi }^\mathrm{(p)}(\omega ,{\varvec{\theta }}^*)/s_{x\varphi }\\ H_\mathrm{\varphi \varphi }^\mathrm{(p)}(\omega ,{\varvec{\theta }}^*)/s_{\varphi \varphi }\\ \end{array}\right] , \end{aligned}$$
(16)

where the same scaling as in Eq. (14) has been applied. The question is whether a data set comprising a selected set of frequencies \(\mathcal {N}=\{\omega _1, \ldots , \omega _K\}\) implies unique identifiability of all \(n_\theta \) equivalent model parameters \(\varvec{\theta }\). To answer this, we formulate the \((m \times n_\theta )=(3K \times (3+2N))\) parameter–output sensitivity matrix [46]

$$\begin{aligned} {\varvec{\Psi }}=\frac{\textrm{d}{\varvec{y}}}{\textrm{d}{\varvec{\theta }^*}}, \end{aligned}$$
(17)

which explains (small) output changes due to (small) parameter changes,

$$\begin{aligned} \Delta {\varvec{y}}={\varvec{\Psi }} \Delta {\varvec{\theta }}^*. \end{aligned}$$
(18)

Its singular value decomposition is expressed as

$$\begin{aligned} \varvec{\Psi }=\sum \limits _{j=1}^{\bar{r}} \varvec{u}_j \sigma _j \varvec{v}_j^\intercal \end{aligned}$$
(19)

where \(\bar{r}:= \min \{m,n_\theta \}\) and \(r=\text {rank}(\varvec{\Psi })\le \bar{r}\) represents the rank of \(\varvec{\Psi }\). The orthogonal left and right singular vectors are denoted as \(\varvec{u}_j\) and \(\varvec{v}_j\), \(j=1,\ldots ,\bar{r}\), respectively. The singular values \(\sigma _j\) are sorted in a descending way (\(\sigma _1 \ge \sigma _2 \ge \cdots \ge \sigma _{\bar{r}} \ge 0\)). This decomposition unveils both qualitative and quantitative insights into the distinctive identifiability of the parameters. The right-singular vectors can be interpreted as the directions in parameter space most sensitive to changes, where the corresponding singular values \(\sigma _j\) represent the relative magnitude of the output change for each direction. The choice of the frequency grid \(\mathcal {N}\) affects parameter identifiability, which will be analyzed in Sect. 5.3. Unique identifiability of all parameters requires that at least \(n_\theta =3+2N\) singular values must be strictly positive.

4 Flatness-based feedforward control concept

The basic idea to suppress sloshing is achieved via the following design steps:

  1. 1.

    To reduce sloshing already during the maneuver, the translatory and rotatory motion of the container is specifically restricted—we suspend the container via a virtual tray pendulum, moving only the virtual pendulum’s pivot as in the case of a “Moroccan tray”, see Fig. 3.

  2. 2.

    We further show that by a beneficial, specific choice of the virtual tray parameters it is possible to make the primary sloshing mode uncontrollable. Hence, this mode is not excited when moving the system via its pivot.

  3. 3.

    For this system composition, a so-called differentially flat output is expressed and interpreted. This output, together with its time derivatives, is algebraically related to the input, which allows straightforward trajectory planning.

  4. 4.

    Particularly, this allows us to efficiently design and shape rest-to-rest maneuvers, so that, by design, any sloshing excitation occurring during such a dynamic transit maneuver is stopped in the end.

We emphasize here that the equivalent pendulum model for the sloshing dynamics developed and parameterized above (Sects. 2.2 and 3) forms the basis of this feedforward design approach, thus enabling efficient sloshing suppression for arbitrarily shaped containers. Its performance is validated by simulations and experiments in Sect. 5.

4.1 Modeling the container suspended by a virtual tray pendulum

As illustrated in Fig. 3, we take inspiration from the idea of a “Moroccan tray” and define a virtual tray pendulum (chosen as a mathematical pendulum), and we virtually mount the liquid-filled container onto the tray pendulum. We move the tray only by actuating its pivot point, and the suspended container is thus translated and rotated according to the pendulum motion. In doing so, the lateral accelerations of the liquid are greatly reduced, thereby efficiently reducing sloshing excitation [36]. To implement the resulting trajectory, the real container motion is then prescribed in the same way as the container would move in the virtual pendulum setup.

Fig. 3
figure 3

Illustration of the virtual tray sloshing suppression control concept where the equivalent pendulum model representing the fluid (blue) is rigidly connected to a mathematical pendulum (color figure online)

First, the equations of motion for the virtual tray pendulum coupled with the sloshing equivalent pendulum model are formulated. The virtual tray is modeled as a mathematical pendulum with point mass \(m_T\) and length \(\bar{L}_T=L_T + L_P\), where \(L_P\) indicates the distance from the pivot to the liquid surface of the suspended container, and \(L_T\) is the distance of the point mass \(m_T\) from the free liquid surface (see Fig. 3). The container is rigidly connected to the virtual tray pendulum, so the pitch angle \(\varphi \) is the same for the container and the virtual tray pendulum. The combined equations of motion are thus obtained by choosing the pendulum pivot point as the reference point P in the derivation of the equations of motions (6)–(8c) and additionally considering the tray mass (analogously to the frozen mass with zero moment of inertia). Thereby, we obtain the equation of motion for the virtual tray pendulum angle

$$\begin{aligned} -m_T \bar{L}_T \ddot{x}_P + m_T \bar{L}_T^2 \ddot{\varphi } + m_T g \bar{L}_T \varphi&= M_y \,, \end{aligned}$$
(20)

illustrating that the fluid reaction moment \(M_y\) as defined by (8b) acts onto the virtual tray pendulum. Since the horizontal pivot displacement is prescribed, the corresponding Eq. (8a) just delivers the horizontal reaction force and does not need to be considered as an equation of motion. The final set of coupled equations of motion for the virtual tray system is (20), with fluid reaction moment from (8b), together with the equations for the coupled fluid pendulums (8c). These equations of motion can be organized in the state-space form

$$\begin{aligned} \dot{\varvec{x}}&= \varvec{A} \,\varvec{x} + \varvec{b} \,\ddot{x}_P \,,&\text {with}\quad \varvec{x}&= \begin{bmatrix} {\varvec{q}}\\ \dot{{\varvec{q}}} \end{bmatrix} = \bigl [ x_P, \varphi , \varphi _1, \dots , \varphi _N, \dot{x}_P, \dot{\varphi }, \dot{\varphi }_1, \dots , \dot{\varphi }_N\bigr ]^\intercal \,, \end{aligned}$$
(21)

where \(\varvec{x}\) is the \(2(N+2) \times 1\) state vector. The (kinematic) input \(\ddot{x}_P\) will be determined by the flatness-based feedforward control strategy described in Sect. 4.3, thereby fully defining the state trajectories of (21). Note that using the virtual coordinate \(x_P\) here only serves as an auxiliary means of properly restricting the container motion to non-sloshing trajectories. In particular, given \(x_P, \varphi \) and their time derivatives, the container motion is kinematically determined. This container motion will then be prescribed by the employed robotic manipulator system and its underlying control system to realize the sloshing-suppressing transport maneuver.

4.2 Virtual tray parameter adjustment to decouple sloshing mode

Moving the tray pivot \(x_P\) will generally excite both the tray pendulum oscillations and the sloshing modes. Also, particularly for a small virtual tray mass, the tray pendulum and sloshing modal dynamics are strongly coupled due to the occurring hydrodynamic reaction forces. However, the coupling between virtual tray pendulum motion (i.e., \(x_P\) and \(\varphi \)) and the sloshing dynamics is strongly influenced by the virtual tray pendulum geometry (\(L_T\), \(L_P\)) and, to a smaller degree, by the virtual tray mass \(m_T\). It turns out that by choosing the virtual tray pendulum parameters appropriately (\(L_T\), \(L_P\), and \(m_T\)), the excitation of a specific, chosen sloshing mode can be avoided altogether. This sloshing mode will then remain at rest during any maneuver driven by the tray’s pivot acceleration \(\ddot{x}_P\). We achieve that by minimizing the controllability of the chosen sloshing mode related to the input \(\ddot{x}_P\) in an appropriate sense.

Mathematically, the loss of controllability of a selected sloshing oscillatory mode is indicated by the modal Hautus controllability criterion [47]. An eigenmode identified by a complex-conjugate pair of eigenvalues \(\lambda _i\) and corresponding left eigenvectors \(\varvec{w}_i^\intercal \) (normalized to a length of 1) is uncontrollable if

$$\begin{aligned} \textrm{rank}\left( \begin{bmatrix} \lambda _i \varvec{I}-\varvec{A},&\varvec{b} \end{bmatrix} \right)&< 2(N+2) & \text {or}&\varvec{w}_i^\intercal \varvec{b}&= 0 \end{aligned}$$
(22)

holds. We focus on the case of distinct complex-conjugate oscillatory modes in the following.

In the present case, we want to make that eigenmode uncontrollable which is dominant in terms of the first asymmetric sloshing mode related to modal coordinate \(\varphi _1\). Since the system matrix \({\varvec{A}}\) and input vector \({\varvec{b}}\) both depend on the virtual tray parameters, we employ the following strategy: \(L_P\) and \(m_T\) are fixed (as discussed below). For a particular value of \(L_T\), all eigenmodes (\(\lambda _i(L_T),{\varvec{w}}^\intercal _i(L_T)\)) are determined by solving the standard eigenvalue problem for \({\varvec{A}}(L_T)\). Then, we select that eigenmode whose eigenvector \({\varvec{w}}^\intercal _{\textrm{s}}(L_T)\) shows the largest magnitude of the \(\varphi _1\)-component. We adjust \(L_T\) until the condition

$$\begin{aligned} \Vert {\varvec{w}}_{\textrm{s}}^\intercal (L_T) {\varvec{b}}(L_T) \Vert _2^2 = 0 \end{aligned}$$
(23)

is met with sufficient accuracy. This implies that the uncontrollability criterion (22) is fulfilled and that the targeted mode is made practically uncontrollable.

We remark that fixing the values of \(m_T\) and \(L_P\) is an arbitrary design choice. However, they should be chosen large enough so that a solution of (23) can be found for realizable values of \(L_T \ge 0\). Ref. [36] suggests the bound \(L_P > 3\, h_\textrm{liquid}\) (with \(h_\textrm{liquid}\) as the height of the liquid). We have empirically found that \(m_T > m_\textrm{liquid}\) (with \(m_\textrm{liquid}\) as the total liquid mass) suffices to ensure solvability and a suitable location \(L_T\) is always found to satisfactorily fulfill the uncontrollability criterion. For large \(m_T\) values, \(L_T\) approaches the first sloshing mode’s pendulum mass distance \(L_1+l_1\) (relative to the liquid surface). Then, the tray behaves like a mathematical pendulum of length \(L_P+L_T\), and the above decoupling strategy amounts to collocating tray mass \(m_T\) and the first modal sloshing pendulum mass \(m_1\).

4.3 Rest-to-rest trajectory generation based on a flat output

So far, we have prepared and parametrized a virtual dynamic system model, allowing us to move the virtual pivot \(x_P\) kinematically, in a way that the main sloshing oscillation mode is not excited. However, the pendulum motion itself and the higher sloshing modes are generally excited through the \(\ddot{x}_P\) input.

To generate rest-to-rest maneuvers, i.e., maneuvers that drive all system states’ derivatives to zero, we formulate a differentially flat output which means that this output and all its time derivatives are directly algebraically related to the system input. Then, a smooth interpolation between initial and final value of this output directly determines the system input signal (and thus all state trajectories), which can be calculated by simple algebra (no time integration necessary), realizing a rest-to-rest maneuver. Additional details including useful examples regarding flatness-based feedforward control are given in [35].

For the proposed control concept, one has to consider that the choice of virtual tray pendulum length \(L_P+L_T\) satisfying (23) renders one complex-conjugate eigenmode uncontrollable. Therefore, we extract the \(2(N+1)\)-dimensional controllable subspace of this system (21) utilizing the Kalman decomposition [48] via state transformation \(\tilde{\varvec{x}} = \varvec{T} \varvec{x}\),

$$\begin{aligned} \tilde{\varvec{x}}&= \begin{bmatrix} \tilde{\varvec{x}}_\textrm{c} \\ \tilde{\varvec{x}}_{\bar{\textrm{c}}} \end{bmatrix} = \varvec{T} \varvec{x} = \begin{bmatrix} \varvec{T}_\textrm{c} \\ \varvec{T}_{\bar{\textrm{c}}} \end{bmatrix} \varvec{x} \,,&\tilde{\varvec{A}}&= \varvec{T} \varvec{A} \varvec{T}^{-1} = \begin{bmatrix} \varvec{A}_\textrm{c} & \quad \varvec{A}_{\textrm{c} \bar{\textrm{c}}} \\ \varvec{0} & \quad \varvec{A}_{\bar{\textrm{c}}} \end{bmatrix} \,,&\tilde{\varvec{b}}&= \begin{bmatrix} \varvec{b}_\textrm{c} \\ \varvec{0} \end{bmatrix} = \varvec{T} \varvec{b} \,, \end{aligned}$$
(24)

where subscripts c and \(\bar{\textrm{c}}\) denote controllable and uncontrollable subspaces, respectively. A flat output \(y_\textrm{f}\) can directly be determined for the controllable subspace, see, e.g., [34], via

$$\begin{aligned} y_\textrm{f}&= \varvec{e}^\intercal \varvec{Q}_\textrm{c}^{-1} \tilde{\varvec{x}}_\textrm{c} = \varvec{e}^\intercal \varvec{Q}_\textrm{c}^{-1} \varvec{T}_\textrm{c} \varvec{x} = \varvec{c}_\textrm{f}^\intercal \varvec{x} \,,&\varvec{Q}_\textrm{c}&= \begin{bmatrix} \varvec{b}_\textrm{c}&\varvec{A}_\textrm{c} \varvec{b}_\textrm{c}&\ldots&\varvec{A}_\textrm{c}^{2N+1} \varvec{b}_\textrm{c} \end{bmatrix} \,, \end{aligned}$$
(25)

with the \(2(N+1)\) coefficient vector \(\varvec{e}^\intercal = [ 0, \dots , 0, \gamma _\textrm{f} ]\) and a suitable scaling \(\gamma _\textrm{f} \ne 0\). Finally, for the undamped model, the flat output expressed in the original coordinates has the intuitive structure

$$\begin{aligned} y_\textrm{f} = x_P + \alpha \varphi + \alpha _1 \varphi _1 + \dots + \alpha _N \varphi _N . \end{aligned}$$
(26)

It is evident that only position coordinates occur in (26). Also, for the resting system, \(y_\textrm{f} = x_P\) holds. Hence, rest-to-rest trajectories can be constructed in a straightforward way by a sufficiently smooth interpolation from initial to final positions.

The state trajectories for such a maneuver are finally obtained through the relation

$$\begin{aligned} \varvec{x}&= \varvec{T}_\textrm{f}^{-1} \varvec{z} \,, \quad \text {with}\quad \end{aligned}$$
(27a)
$$\begin{aligned} \varvec{T}_\textrm{f}&= \begin{bmatrix} \varvec{Q}_\textrm{f}\\ \varvec{T}_{\bar{\textrm{c}}} \end{bmatrix} \,, \end{aligned}$$
(27b)
$$\begin{aligned} {\varvec{Q}}_\textrm{f}&= \begin{bmatrix} \varvec{c}_\textrm{f}^\intercal \varvec{A}^0\\ : \\ \varvec{c}_\textrm{f}^\intercal \varvec{A}^{2N+1} \end{bmatrix} \,,\quad \text { and} \end{aligned}$$
(27c)
$$\begin{aligned} \varvec{z}&= \big [ y_\textrm{f}, \dot{y}_\textrm{f}, \ddot{y}_\textrm{f}, \dots , y_\textrm{f}^{(2N+1)}, 0, 0 \big ]^\intercal \,. \end{aligned}$$
(27d)

Using the flat output and its derivatives collected in \({\varvec{z}}\) one can also write the linear state-space system (21) in terms of these flatness coordinates as

$$\begin{aligned} y_{\textrm{f}}^{(2N+2)} = \underbrace{-a_0 y_{\textrm{f}} - \dots - a_{2N+1} y_{\textrm{f}}^{(2N+1)}}_{-{\varvec{c}}_{\textrm{f}}^\intercal {\varvec{A}}^{2N+1}{\varvec{T}}_{\textrm{f}}^{-1} {\varvec{z}}} + \gamma _{\textrm{f}} \ddot{x}_P , \end{aligned}$$
(28)

revealing the structure of an ordinary differential equation of order \(2N+2\) in terms of the flat output. One can thus choose an \(2N+2\) times differentiable function for the input \(x_{\textrm{P}}\) such that (28) is satisfied. For trajectory planning, this function must also satisfy the desired initial and end conditions, which are related to the original states via (27a). Since (27) directly relates the flat output \(y_{\textrm{f}}\) to all states \({\varvec{x}}\) time integration of the linear state-space system (21) is not necessary. Having determined all states \(\varvec{x}\), particularly \(x_P\) and \(\varphi \) and their time derivatives, the motion of the container to be moved by the robot is thus kinematically fully defined.

5 Results

As a practical example to illustrate the proposed workflow, and to validate the results via experiments, we consider a water-filled Martini cocktail glass. Its shape causes high sloshing sensitivity, and it serves as a novel benchmark problem to validate and evaluate sloshing suppression controls.

5.1 Application example description

The considered Martini glass holds a body of liquid in an approximately conical shape. Its rim diameter is 120 mm, and it is filled with water up to 10 mm below the rim. This amounted to a total water volume V of 218 mL and a water mass of 0.216 kg. The geometry is depicted in Fig. 4 together with numerical values for the main dimensions. A CAD model of the considered geometry is available as supplementary material.

Fig. 4
figure 4

Cross section of the Martini glass with important dimensions

Fig. 5
figure 5

Photograph of the robot arm with mounted glass

For the FE model, the geometry was meshed by tetrahedral elements with second-order shape functions. The considered mesh contained 1705 elements and 2867 nodes and is shown in Fig. 6. Note that we have exploited the symmetry (xz-plane) of the problem by only considering one half of the water volume. The free surface condition was applied at the top surface \(\Gamma _{\textrm{f}}\). The values used in the acceleration boundary condition at the container wall \(\Gamma _{\textrm{w}}\) were computed using rigid body kinematics from the state trajectories for container displacement and rotation which directly follow from the designed trajectory \(y_{\textrm{f}}(t)\) (given in Sect. 5.4) by (27). We assumed a water density of 998.2 kg \(\textrm{m}^{-3}\) and an acceleration of gravity of 9.81 m \(\textrm{s}^{-2}\). All FEM simulations were done using the open-source finite element code openCFS [41].

Experiments were carried out by mounting the filled glass onto an industrial robot (UR3e manipulator, Universal RobotsTM) depicted in Fig. 5. The robot was programmed to move the glass accurately along the designed rest-to-rest trajectories. Since the robot’s achievable joint speeds pose dynamic limits on the test maneuver, the studied test maneuvers were selected such that they were feasible and tracked accurately by the robot. The resulting liquid motion was recorded via a high-speed camera for validation.

5.2 Sloshing dynamics obtained from FE model

We used the FE model to compute the 30 lowest-frequency sloshing modes for the water domain by conducting an eigenvalue analysis. Computed natural frequencies range from 2.33 Hz for mode 1 to 7.2 Hz for mode 25. Selected mode shapes are depicted in Fig. 6. Not all eigenmodes can be excited by container rotations or translations due to their symmetry. Only asymmetric modes with a single radial nodal line in the pressure field at the free surface are relevant for the control problem (see Fig. 6 top) since they can be excited by container translations or rotations. Non-excitable modes show an increasing number of radial and circumferential nodal lines in the pressure field at the free surface (see Fig. 6 bottom). The relevance of eigenmodes for the sloshing problem is also made clear from the results of the harmonic analyses later used for parameter identification of the equivalent pendulum model, i.e., by resonance peaks in the transfer functions (see Fig. 8).

Fig. 6
figure 6

Sloshing modes relevant with respect to forced container displacement and rotation (large) and some non-excitable modes (small)

Harmonic analyses were carried out to compute the steady-state responses of the fluid with respect to two load cases (harmonic sway and pitch excitation) of the container. In the sway load case, a unit container displacement in x-direction was prescribed using the acceleration boundary condition on the container wall \(\Gamma _{\textrm{w}}\). For the pitch load case, we computed an acceleration field resulting from rotation by a unit angle around the bottom point of the fluid (point B in Fig. 4). For both load cases, we computed 150 frequency points in the range of 0 Hz to 7.5 Hz. The reaction forces and torques from the fluid onto the container were evaluated for both load cases. They are represented in the form of transfer functions, i.e., normalized with respect to the excitation according to Eq. (13), in Fig. 8.

The computed container reaction forces in Fig. 8 show distinctive peaks at the relevant sloshing modes (displayed in Fig. 6). At the remaining eigenfrequencies in the considered frequency range (represented as vertical lines), no influence of the corresponding modes on the harmonic response is visible. This confirms that only modes with one radial nodal line at the water surface need to be taken into account when designing an equivalent pendulum model.

5.3 Identification results

The proposed workflow for parameter identification is applicable to represent an arbitrary number of sloshing modes. In the following, we consider a model with three pendulums. Using equation Eq. (12), the pendulum lengths \(l_i\) follow directly from the frequencies of the first three relevant sloshing modes (1, 6, 14 in Fig. 6): \(l_1={45.8}\) mm, \(l_2={11.2}\) mm, \(l_3={6.72}\) mm.

The remaining parameters \(\varvec{\theta }\) were determined via the optimization problem formulated in Eqs. (14)–(15). We used the SLSQP (Sequential Least Squares Programming) implementation of the “scipy.optimize.minimize” function, a part of the SciPy library [43]. This optimization algorithm minimizes the objective function (14) subject to the constraints (15). The user has to provide an initial guess for parameters \(\varvec{\theta }^\mathrm{(0)}\). Setting \(m_i^{(0)}\) such that the mass constraint Eq. (15c) is fulfilled and \((L_i^{(0)},I_0^{(0)})=0\) was sufficient to yield a good agreement between transfer functions of FE and pendulum models for sensible choices of data points \(\mathcal {N}\).

Including all 150 data points of the harmonic analysis did not lead to good agreement between the FE and pendulum model transfer functions. This might be due to the undamped peaks in the transfer functions. A robust identification result can be obtained using the following strategy: include all frequency data up to the frequency of interest, and based on the plots of the transfer functions exclude frequency points in areas around the undamped peaks. We chose a frequency of interest up to 6.2 Hz. This is slightly above the third excitable sloshing mode. The data set used for identification is illustrated in Fig. 7. We chose frequency values that are approximately equally spaced in the quadratically scaled frequency axis (see data points in Fig. 7). One could also use the linearly spaced data on the frequency axis, which led to similar results as long as the peaks are excluded.

Fig. 7
figure 7

Frequency response (exemplarily shown for one function) for pendulum models with parameters identified using data from different frequency ranges A, B, C

Fig. 8
figure 8

Transfer functions for fluid reaction forces and torques obtained from the FE and equivalent pendulum model using parameters \({\varvec{\theta }}^\textrm{s}_{(\mathrm A,B,C)}\) with both axes suitably scaled in order to obtain a dimensionless representation and natural frequencies displayed as vertical dotted lines

We split the data set into three different frequency regions A, B, and C as illustrated in Fig. 7 to investigate the identifiability of the parameters based on the choice of \(\mathcal {N}\). Choosing \(\mathcal {N}\) such that all data regions A, B, and C are included yielded parameters \({\varvec{\theta }}^\textrm{s}_{(\mathrm A,B,C)}\) resulting in a highly accurate agreement between all three FE and pendulum model transfer functions \(H_{k}\). The corresponding functions are depicted in Fig. 8.

To formally address which choice of data points (frequencies) is required to introduce sufficient information, so that all parameters can be uniquely determined, we considered the parameter–output sensitivity matrix \(\varvec{\Psi }\), as derived in Eq. (17). This matrix also depends explicitly on the to-be-determined parameters \({\varvec{\theta }}^\textrm{s}\); thus, we evaluate \(\varvec{\Psi }\) using the parameters \({\varvec{\theta }}^\textrm{s}_{(\mathrm A,B,C)}\) we obtained from our initial identification. Performing the singular value decomposition (19) of \(\varvec{\Psi }\) reveals information about the identifiability of the parameters, i.e., quantifies the information about \(\varvec{\theta }\) in \(\varvec{y}\). As a quantitative measure for the quality of choice of data points, we can consider the minimum singular value \(\min (\sigma _i)\), which should be as high as possible, such that all parameters contribute significantly to the output of the pendulum model transfer functions \(H_{k}^{(\mathrm p)}\).

We carried out several parameter identifications, using data points only from the individual frequency intervals A, B, and C. Figure 7 shows how the frequency response (exemplarily for the sway force) of the pendulum model changes for the different obtained parameter vectors \({\varvec{\theta }}^*\). Also, the sensitivity matrix \(\varvec{\Psi }\) was evaluated for these various choices of \(\mathcal {N}\). The corresponding minimum singular value and respective obtained parameters are given in Table 1. The higher minimum singular values for increasing frequency data ranges show that higher-frequency data are more relevant, especially for identifying the parameters for the higher modes. Only including the highest frequency (Region C) data yields very good results, the fit when including all data is only slightly better. Looking at the right singular vector \(\varvec{v}_{\bar{r}}\) of the smallest singular value \(\sigma _{\bar{r}}\) indicates that particularly the parameters \(m_3\) and \(L_3\) of mode 3 are most difficult to determine, in all cases of chosen data points.

Table 1 Smallest singular values \(\sigma _{\bar{r}}\) of the output-sensitivity matrix \(\varvec{\Psi }\) (normalized to \(\max (\sigma _j)=1\)) and corresponding optimized parameters for different choices of data points (given in SI units)

The comparison of identification results and parameter-sensitivity analysis for different optimization data confirms that it is best to include data from all available frequency ranges. Therefore, we use the parameter vector \({\varvec{\theta }}^\textrm{s}_{(\mathrm A,B,C)}\) for further considerations and experiments. Observing the magnitude of the masses reveals that the first modal pendulum and the frozen mass are clearly the most important. The center of mass of the “frozen mass” lies above the free surface, as do all pendulum pivot points (\(L_i<0\)). Notably, calculating the center of mass from the obtained parameters for pendulums and frozen mass amounts to a distance of 15.624 mm below the water surface, which almost exactly reflects the center of gravity of the fluid given in Fig. 4, although not enforced in the optimization problem.

5.4 Validation of sloshing suppression in fast rest-to-rest transit maneuvers

It is now shown how an effective sloshing suppression is obtained in fast rest-to-rest maneuvers for the considered, highly sensitive Martini glass test case. First, the feedforward control law was evaluated for the virtual tray model with two sloshing modes. We deliberately chose not to include the third sloshing mode in the feedforward control law to demonstrate that by doing so, we selectively suppress only the first two sloshing modes, but not the third, upon completion of the rest-to-rest maneuver. A simulation study of a fast rest-to-rest maneuver verified the sloshing suppression in the targeted modes. Second, this maneuver was applied in a transient FEM simulation, showing a detailed picture of the liquid dynamics during the transit. Finally, an experimental evaluation using the robot manipulator and the actual water-filled Martini glass was conducted to validate the sloshing suppression with this highly sensitive container shape in practice.

To construct the proposed feedforward control law with sloshing suppression, a virtual tray with parameters \(L_P = {0.234}\,\textrm{m}\) and \(m_T = {0.3}\,\textrm{kg}\) was designed. The distance \(L_T\) (fluid surface to tray center of mass) was adjusted until condition (23) was fulfilled. This occurs for \(L_T={0.0324}\,\textrm{m}\) where the first sloshing mode is uncontrollable from the pivot acceleration input signal, as outlined in Sect. 4.

A rest-to-rest trajectory for the flat output \(y_\textrm{f}(t)\), expressed in the form (26), from \(y_\textrm{f}(0) = x_{P,0} = {0}\,\textrm{m}\) to \(y_\textrm{f}(t_1) = x_{P,1} = {0.45}\,\textrm{m}\) with \(t_1={1.6}\,\textrm{s}\) was designed as a polynomial spline of order 13 with boundary conditions

$$\begin{aligned} \frac{\textrm{d}^{(j)}}{\textrm{d}t^{(j)}}y_\textrm{f}(0) = \frac{\textrm{d}^{(j)}}{\textrm{d}t^{(j)}}y_\textrm{f}(t_1) = 0 . \end{aligned}$$
(29)

for \(j=1,\dots ,6\). The maneuver distance and duration were chosen so that the utilized robot arm could correctly realize the resulting container motion within its dynamic limitations. The trajectory and its six time derivatives were transformed into the physical state trajectories of the virtual tray pendulum system, thereby directly yielding the container position and angular coordinates, together with their time derivatives. By prescribing the container motion trajectory, the response of any modal sloshing pendulum, as well as of the liquid’s FE model has been simulated.

The resulting pendulum angles as well as fluid reaction forces are shown in Fig. 9. As expected by design, the first modal sloshing pendulum (i.e., \(\varphi _1\)) is not excited at all. The second modal sloshing pendulum was driven in a rest-to-rest fashion and thus came to rest exactly at the end of the maneuver. Only the third modal pendulum shows a very small residual oscillation afterward.

Fig. 9
figure 9

Designed rest-to-rest trajectory for pivot point P of the virtual tray, pendulum angle responses, comparison of reaction force and torque between pendulum and FE model, and surface elevation for two symmetry-plane-points on the free surface obtained from the FE model

Next, the dynamic fluid reaction force and torque are compared between the equivalent pendulum model and the high-fidelity FE model for the transient rest-to-rest-maneuver. The FEM results were obtained by numerical time integration. Note that the equivalent pendulum model does include a static torque component for stationary container pitching. Since the FE model only considers the dynamic pressure, no static torque can be predicted. Thus, the static torque value is subtracted from the pendulum model result to facilitate a comparison of the relevant dynamic torque. The reaction force and torques computed by both models during the rest-to-test trajectory are compared in Fig. 9 which shows excellent agreement.

The equivalent pendulum model does not yield any output that quantitatively predicts the free surface displacement. The dynamic pressure computed in the FE model can be related to the free surface elevation. The relative sloshing elevation with respect to the container rotated by \(\varphi \) can be computed as \(\Delta \eta (x,y)=p(x,y)/(\rho g)+x\varphi \). The elevation during the rest-to-rest maneuver for two points on the symmetry plane is depicted in Fig. 9 and shows very low (\(<{0.5}\) mm) sloshing amplitudes. Figure 10 shows a series of time snapshots during the rest-to-rest maneuver for the experiment and FE model. The video frames of the experiment highlight the high performance and accuracy of the designed trajectory. Virtually no sloshing is visible, which is in agreement with the prediction of the FE model. An illustrative video demonstration of the maneuver is available as supplementary information.

Fig. 10
figure 10

Snapshots during the maneuver with relative surface elevation \(\Delta \eta \) in mm (top) dynamic pressure in Pa at the symmetry plane (\(y=0\)) obtained from the FEM simulation (center) and video frames from the experiment (bottom)

6 Summary and conclusion

By utilizing FEM modeling of the fluid in an arbitrarily shaped container, the reaction forces and torques for forced sway and pitch motion of the container could be computed, providing a data basis for the identification of equivalent pendulum parameters. Based on the example of a Martini cocktail glass, the sloshing dynamics were first computed using the FE model. The subsequent parameter identification of an equivalent pendulum model with three modal pendulums showed an excellent agreement of the transfer functions for fluid reaction forces and torques in the considered frequency range. The identifiability analysis along the lines of Fisher information showed that the suggested data choice in the form of transfer functions for fluid reaction forces is suitable for identifying all relevant equivalent pendulum model parameters. The analysis also yielded clear guidelines for frequency points of the data: choose all available frequencies in the frequency range of interest but exclude data too close to the poles present at the undamped natural frequencies. Obviously, the equivalent pendulum model needs to have sufficient pendulums to represent all relevant sloshing modes in the frequency range of interest.

The application of our flatness-based virtual tray control concept allowed us to design trajectories for fast rest-to-rest transits of the fluid-filled Martini glass. The use of a suitably designed virtual tray pendulum renders the dominant (first relevant) sloshing mode uncontrollable, leading to very low free surface elevations during transit if the container can be pitched sufficiently. The modal coordinate of the second relevant sloshing mode is zero at the end of the rest-to-rest maneuver as designed by the flatness-based approach. Comparison of high-fidelity (FE) and equivalent (pendulum) modes for transient trajectories showed excellent agreement in terms of fluid reaction forces and torques.

Experiments conducted using an industrial robot to prescribe the rest-to-rest trajectories revealed the practical applicability of the proposed methodology. Rapid container translations, only limited by the speed limits of the used robot, in the order of several diameters, are possible in less than three fundamental periods of the first sloshing mode. These transits were accomplished without noticeable free surface elevation during or after the maneuver demonstrating the performance of the proposed concept.