1 Introduction

The transport of containers filled with liquids finds application in several industrial applications, e.g., in food & beverage or pharmaceutical production and packaging lines. Typically, the manipulation of such containers is assigned to linear transport systems or industrial serial robots; in many cases the required motion follows planar curves. The prediction of the liquid movement inside the container, referred to as sloshing, is important to prevent the liquid from overflowing. Additionally, a reliable sloshing prediction model can be exploited to limit the stirring of the liquid during task execution.

For this purpose, machine-learning methodologies are presented in [2] and [3], where, starting from data collection, predictive algorithms are built to inspect the behavior of discrete liquid particles inside a cylindrical container. This technique, though very powerful, requires experiments to be run in advance, together with a not negligible computational effort.

In [4] and [5], the Finite Element Method (FEM) is adopted for the analysis of sloshing in rectangular containers, requiring a preliminary generation of the mesh able to replicate the liquid behavior.

The meshless Smooth Particle Hydrodynamics (SPH) method is employed in [6] and [7] to model the sloshing by discretizing the liquid in tens of thousands particles: the simulations accurately match the experimental data, at a cost of days of computation.

In [8] the coefficients of the nonlinear sloshing dynamics model presented in [9] are provided to evaluate the sloshing height for 3-dimensional motions, leading to a complex formulation, which may be difficult to use.

A ready-to-use and fast alternative is represented by the development of equivalent discrete mechanical models. The literature considers two main discrete approaches for the modeling of sloshing dynamics inside a container subjected to 2-dimensional planar motion [10]: a spherical pendulum and a 2-DOF mass–spring–damper system. In the former case, the generalized coordinates describing the system are the angles defining the position of the pendulum mass, whereas in the latter they are the mass displacements from the reference position. Although being intuitive, the use of the angular coordinates of the pendulum mass to assess the sloshing behavior of the liquid (see [11, 12]) lacks physical meaning, in particular when the knowledge of the liquid peak height is important. For this reason, in the spherical pendulum model used in [13], [14], and [15], the sloshing height is estimated by means of the tangent functions of the spherical coordinates. However, estimating the sloshing height by means of the tangent of the pendulum angles may lead to singularity conditions when the container acceleration is high, since in this case these angles can approach \(90^{\circ}\) and the tangent tends to assume unrealistic high values.

To overcome this drawback, a novel approach, based on the mass–spring–damper model [16], is proposed in [17] for the sloshing-height estimation. This model is validated for 1-dimensional motions in [17] and it is exploited in [18] and [19] to plan antisloshing trajectories. The same technique is used in a software application presented in [20] to execute simulations of liquid sloshing in cylindrical and rectangular containers. In [17], the authors propose the possible extension to planar motions, but no experimental validation is provided. The latter is the objective of this paper, particularly referring to 2-dimensional planar motions of a cylindrical container, with accelerations up to 9.5 m/s2. With respect to the preliminary conference version presented in [1], this contribution also reports an extension of the formulation to 3-dimensional motions comprising a vertical acceleration up to 5 m/s2. Experiments are also provided for this case.

The paper is structured as follows. Section 2 presents the model parameters and the equations of motion (EOMs) in terms of the corresponding generalized coordinates. Section 3 provides the formulation of the sloshing-height estimation. In Sect. 4, the results from an experimental campaign are described and discussed. Lastly, in Sect. 5 conclusions are drawn and suggestions for future developments are given.

Fig. 1
figure 1

Mass–spring–damper model

Fig. 2
figure 2

Liquid free-surface shapes

2 Sloshing model

2.1 Model parameters

We will consider a cylindrical container of radius \(R\), filled with a liquid of height \(h\) and mass \(m_{F}\). A simplified discrete mechanical model can be used to reproduce the liquid-sloshing dynamics. In particular, the mass–spring–damper model comprises a rigid mass \(m_{0}\) (whose signed vertical distance from the liquid’s center of gravity \(G\) is \(h_{0}\)) that moves rigidly with the container, and a series of moving masses \(m_{n}\), with each one of them representing the equivalent mass of a sloshing mode (Fig. 1a). Each modal mass \(m_{n}\) is restrained by a spring \(k_{n}\) and a damper \(c_{n}\), and its signed vertical distance from \(G\) is \(h_{n}\).

The model parameters can be determined by imposing a number of equivalence conditions with the original system [10]:

  • the overall mass must be the same,

    $$ m_{F} = m_{0} + \sum _{n=1}^{\infty} m_{n}; $$
    (1)
  • the height of the center of gravity \(G\) must remain the same for small oscillations of the liquid,

    $$ m_{0} h_{0} + \sum _{n=1}^{\infty} m_{n} h_{n} = 0; $$
    (2)
  • the natural frequency associated with the \(n\)th mode must coincide with the one that can be obtained from the continuum model,

    $$ \omega _{n}^{2} = \frac{k_{n}}{m_{n}} = g \frac{\xi _{1n}}{R} \tanh \Bigl(\xi _{1n} \frac{h}{R}\Bigr) ;$$
    (3)
  • the sloshing force acting on the container wall must be the same as the one calculated from the continuum model, leading to the determination of the \(n\)th sloshing mass,

    $$ m_{n} = m_{F} \frac{2 R}{\xi _{1n} h (\xi _{1n}^{2}-1)} \tanh \Bigl( \xi _{1n} \frac{h}{R}\Bigr). $$
    (4)

In equations (3) and (4), \(\xi _{1n}\) is the root of the derivative of the Bessel function of the first kind with respect to the radial coordinate \(r\), for the 1st circumferential mode and the \(n\)th radial mode [21], while \(g\) is the gravity acceleration. The damping ratio \(\zeta _{n}=\dfrac{c_{n}}{2 \sqrt{k_{n} m_{n}}}\) can be determined by using empirical formulas [10].

For a container under 2-dimensional motion on the horizontal \(xy\) plane, the excitation is provided by the container accelerations along the \(x\) and \(y\) directions, denoted with \(\ddot{\mathbf{S}}_{0} = [\ddot{x}_{0} \;\; \ddot{y}_{0} \;\; 0]^{T}\). The motion of the \(n\)th sloshing mass is described by the generalized coordinates \((x_{n}, y_{n})\), whose definition is illustrated in Fig. 1b. The latter are then used to compute the liquid sloshing height.

2.2 Equations of motion

In general, three dynamic regimes are possible [10]:

  • small oscillations in which the liquid free-surface remains planar (Fig. 2a);

  • relatively-large-amplitude oscillations in which the liquid free-surface is no longer planar (Fig. 2b);

  • strongly nonlinear motion, where the liquid free-surface exhibits instantaneous peaks characterized by swirling shapes.

While the third motion regime will not be the object of the present study, the first and second cases can be analyzed by means of a linear mass–spring–damper model (L model) and a nonlinear mass–spring–damper model (NL model), respectively.

The NL model considers the sloshing mass \(m_{n}\) as sliding on a parabolic surface, with an attached nonlinear spring of order \(w\) (Fig. 1c) [16]. The analytical expression of the parabolic surface allows writing the vertical coordinate \(z_{n}\) as a function of \(x_{n}\) and \(y_{n}\), namely

$$ z_{n} = \dfrac{C_{n}}{2R}(x_{n}^{2} + y_{n}^{2}), $$
(5)

where \(C_{n} = \omega _{n}^{2} \dfrac{R}{g}\). The time derivative of equation (5) is

$$ \dot{z}_{n} = \dfrac{C_{n}}{R}(\dot{x}_{n} x_{n} + \dot{y}_{n} y_{n}). $$
(6)

The nonlinear spring exerts the forces \(\alpha _{n} k_{n} x_{n} ^{2w-1}\) and \(\alpha _{n} k_{n} y_{n} ^{2w-1}\), along the \(x\) and \(y\) direction, respectively. In this paper, we choose \(w=2\) and \(\alpha _{n}=0.58\), as suggested in [16]. If the radial generalized coordinate \(r_{n} = \sqrt{x_{n}^{2} + y_{n}^{2}}\) is introduced, the nonlinear-spring force in the radial direction can be written as \(\alpha _{n} k_{n} r_{n} ^{2w-1}\).

The EOMs, describing the time evolution of the generalized coordinates \((x_{n}, y_{n})\), can be obtained by means of the Lagrange equations:

$$ \textstyle\begin{cases} \dfrac{d}{dt}\Bigl(\dfrac{\partial T}{\partial \dot{x}_{n}}\Bigr) - \dfrac{\partial T}{\partial x_{n}} + \dfrac{\partial V}{\partial x_{n}} = - \dfrac{\partial D}{\partial \dot{x}_{n}}, \\ \dfrac{d}{dt}\Bigl(\dfrac{\partial T}{\partial \dot{y}_{n}}\Bigr) - \dfrac{\partial T}{\partial y_{n}} + \dfrac{\partial V}{\partial y_{n}} = - \dfrac{\partial D}{\partial \dot{y}_{n}}, \end{cases} $$
(7)

where

  • the kinetic energy \(T\) of the \(n\)th sloshing mass can be computed by taking into account its velocity \(\dot{\mathbf{s}}_{n} = [\dot{x}_{n} \;\; \dot{y}_{n} \;\; \dot{z}_{n}]^{T}\), the container velocity \(\dot{\mathbf{S}}_{0} = [\dot{x}_{0} \;\; \dot{y}_{0} \;\; 0]^{T}\) and by exploiting equation (6):

    $$ \begin{aligned} T & = \dfrac{1}{2} m_{n} [(\dot{x}_{0} + \dot{x}_{n})^{2} + (\dot{y}_{0} + \dot{y}_{n})^{2} + \dot{z}_{n}^{2}] \\ & = \dfrac{1}{2} m_{n} \Bigl[(\dot{x}_{0} + \dot{x}_{n})^{2} + (\dot{y}_{0} + \dot{y}_{n})^{2} + \dfrac{C_{n}^{2}}{R^{2}}(\dot{x}_{n} x_{n} + \dot{y}_{n} y_{n})^{2}\Bigr]; \end{aligned} $$
    (8)
  • the potential energy \(V\) considers the contribution of gravity and nonlinear-spring forces, namely

    $$ V = m_{n} g z_{n} + \int _{0}^{r_{n}} \alpha _{n} k_{n} r_{n} ^{2w-1} d r_{n} = m_{n} g \dfrac{C_{n}}{2R}(x_{n}^{2} + y_{n}^{2}) + \dfrac{\alpha _{n} k_{n}}{2w} (x_{n}^{2} + y_{n}^{2})^{w} ;$$
    (9)
  • the Rayleigh function \(D\) accounts for energy dissipation,

    $$ D = \dfrac{1}{2} c_{n} (\dot{x}_{n}^{2} + \dot{y}_{n}^{2} + \dot{z}_{n}^{2}) = m_{n} \zeta _{n} \omega _{n} \Bigl[\dot{x}_{n}^{2} + \dot{y}_{n}^{2} + \dfrac{C_{n}^{2}}{R^{2}}(\dot{x}_{n} x_{n} + \dot{y}_{n} y_{n})^{2} \Bigr]. $$
    (10)

The substitution of equations (8), (9), and (10) in the system (7) leads to the formulation of two coupled EOMs for the NL model:

$$ \textstyle\begin{cases} \textstyle\begin{array}{l} \ddot{\overline{x}}_{n} + 2 \omega _{n} \zeta _{n}[\dot{\overline{x}}_{n} + C_{n}^{2}(\overline{x}_{n}^{2} \dot{\overline{x}}_{n} + \overline{y}_{n} \dot{\overline{y}}_{n} \overline{x}_{n})] + \\ \hspace{20 mm} + C_{n}^{2}(\overline{x}_{n} \dot{\overline{x}}_{n}^{2} + \overline{x}_{n}^{2} \ddot{\overline{x}}_{n} + \overline{x}_{n} \dot{\overline{y}}_{n}^{2} + \overline{x}_{n} \ddot{\overline{y}}_{n} \overline{y}_{n}) + \\ \hspace{40 mm} + \omega _{n}^{2} \overline{x}_{n} [1 + \alpha _{n}(\overline{x}_{n}^{2} + \overline{y}_{n}^{2})^{w-1}] + \dfrac{\ddot{x}_{0}}{R}= 0, \\ \ddot{\overline{y}}_{n} + 2 \omega _{n} \zeta _{n}[\dot{\overline{y}}_{n} + C_{n}^{2}(\overline{y}_{n}^{2} \dot{\overline{y}}_{n} + \overline{x}_{n} \dot{\overline{x}}_{n} \overline{y}_{n})] + \\ \hspace{20 mm} + C_{n}^{2}(\overline{y}_{n} \dot{\overline{y}}_{n}^{2} + \overline{y}_{n}^{2} \ddot{\overline{y}}_{n} + \overline{y}_{n} \dot{\overline{x}}_{n}^{2} + \overline{y}_{n} \ddot{\overline{x}}_{n} \overline{x}_{n}) + \\ \hspace{40 mm} + \omega _{n}^{2} \overline{y}_{n} [1 + \alpha _{n}(\overline{x}_{n}^{2} + \overline{y}_{n}^{2})^{w-1}] + \dfrac{\ddot{y}_{0}}{R}= 0, \end{array}\displaystyle \end{cases} $$
(11)

where \(\overline{x}_{n} = x_{n}/R\), \(\overline{y}_{n} = y_{n}/R\). As far as the L model is concerned, the linearization of the EOMs in equation (11) provides two decoupled EOMs in the generalized coordinates \((x_{n}, y_{n})\) of the \(n\)th mode:

$$ \textstyle\begin{cases} \ddot{x}_{n} + 2 \zeta _{n} \omega _{n} \dot{x}_{n} + \omega _{n}^{2} x_{n} + \ddot{x}_{0} = 0, \\ \ddot{y}_{n} + 2 \zeta _{n} \omega _{n} \dot{y}_{n} + \omega _{n}^{2} y_{n} + \ddot{y}_{0} = 0. \\ \end{cases} $$
(12)

2.3 Extension to 3-dimensional motion

If an excitation \(\ddot{z}_{0}\) along the \(z\)-axis is added to that on the \(xy\) plane, the container is subject to a 3D motion, namely \(\ddot{\mathbf{S}}_{0} = [\ddot{x}_{0} \;\; \ddot{y}_{0} \;\; \ddot{z}_{0}]^{T}\). As long as we assume to employ the mass–spring–damper model presented in Sect. 2.1 to reproduce the liquid behavior, the same model parameters can be used. This choice allows the derivation of a fast and easy model extension, without the complication inherent in the construction of a different discrete model. As a consequence, we assume that the additional motion along the \(z\)-axis only influences the kinetic energy of the \(n\)th sloshing mass:

$$ \begin{aligned} T & = \dfrac{1}{2} m_{n} [(\dot{x}_{0} + \dot{x}_{n})^{2} + (\dot{y}_{0} + \dot{y}_{n})^{2} + (\dot{z}_{0} + \dot{z}_{n})^{2}] \\ & = \dfrac{1}{2} m_{n} \Bigl\{ (\dot{x}_{0} + \dot{x}_{n})^{2} + (\dot{y}_{0} + \dot{y}_{n})^{2} + \Bigl[\dot{z}_{0} + \dfrac{C_{n}}{R}(\dot{x}_{n} x_{n} + \dot{y}_{n} y_{n})\Bigr]^{2}\Bigr\} , \end{aligned} $$
(13)

where \(\dot{z}_{n}\) is still given by equation (6). Hence, combining equation (7) with equations (13), (9), and (10), the NL-model EOMs for the 3D motion become

$$ \textstyle\begin{cases} \textstyle\begin{array}{l} \ddot{\overline{x}}_{n} + 2 \omega _{n} \zeta _{n}[\dot{\overline{x}}_{n} + C_{n}^{2}(\overline{x}_{n}^{2} \dot{\overline{x}}_{n} + \overline{y}_{n} \dot{\overline{y}}_{n} \overline{x}_{n})] + \\ \hspace{20 mm} + C_{n}^{2}(\overline{x}_{n} \dot{\overline{x}}_{n}^{2} + \overline{x}_{n}^{2} \ddot{\overline{x}}_{n} + \overline{x}_{n} \dot{\overline{y}}_{n}^{2} + \overline{x}_{n} \ddot{\overline{y}}_{n} \overline{y}_{n}) + \\ \hspace{38 mm} + \omega _{n}^{2} \overline{x}_{n} [1 + \alpha _{n}(\overline{x}_{n}^{2} + \overline{y}_{n}^{2})^{w-1}] + \dfrac{\ddot{x}_{0}}{R} + \dfrac{\ddot{z}_{0}}{g} \omega _{n}^{2} \overline{x}_{n} = 0, \\ \ddot{\overline{y}}_{n} + 2 \omega _{n} \zeta _{n}[\dot{\overline{y}}_{n} + C_{n}^{2}(\overline{y}_{n}^{2} \dot{\overline{y}}_{n} + \overline{x}_{n} \dot{\overline{x}}_{n} \overline{y}_{n})] + \\ \hspace{20 mm} + C_{n}^{2}(\overline{y}_{n} \dot{\overline{y}}_{n}^{2} + \overline{y}_{n}^{2} \ddot{\overline{y}}_{n} + \overline{y}_{n} \dot{\overline{x}}_{n}^{2} + \overline{y}_{n} \ddot{\overline{x}}_{n} \overline{x}_{n}) + \\ \hspace{38 mm} + \omega _{n}^{2} \overline{y}_{n} [1 + \alpha _{n}(\overline{x}_{n}^{2} + \overline{y}_{n}^{2})^{w-1}] + \dfrac{\ddot{y}_{0}}{R} + \dfrac{\ddot{z}_{0}}{g} \omega _{n}^{2} \overline{y}_{n} = 0, \end{array}\displaystyle \end{cases} $$
(14)

whereas the L-model EOMs yield

$$ \textstyle\begin{cases} \textstyle\begin{array}{l} \ddot{x}_{n} + 2 \zeta _{n} \omega _{n} \dot{x}_{n} + \omega _{n}^{2} x_{n} +\ddot{x}_{0} + \dfrac{\ddot{z}_{0}}{g} \omega _{n}^{2} x_{n} = 0, \\ \ddot{y}_{n} + 2 \zeta _{n} \omega _{n} \dot{y}_{n} + \omega _{n}^{2} y_{n} + \ddot{y}_{0} + \dfrac{\ddot{z}_{0}}{g} \omega _{n}^{2} y_{n} = 0. \\ \end{array}\displaystyle \end{cases} $$
(15)

3 Analytical sloshing-height estimation

3.1 1-Dimensional motion

If only a 1-dimensional excitation in the \(y\) direction is provided and the phenomenon of rotary sloshing is neglected [10], solely the generalized coordinate \(y_{n}\) is different from zero. In such a case, the conservation of the center of gravity \(y\)-coordinate, between the continuum model and the equivalent model, yields

$$ y_{G} m_{F} = \sum _{n=1}^{\infty} y_{n} m_{n} + y_{0} m_{0} = \sum _{n=1}^{ \infty} y_{n} m_{n} .$$
(16)

Considering a cylindrical container with cross-section \(S=\pi R^{2}\), filled with a liquid of height \(h\), \(y_{G}\) can be computed as

$$ \begin{aligned} y_{G} & = \dfrac{1}{S h} \iint _{S} \int _{-\frac{h}{2}}^{ \frac{h}{2}+\eta (r,\theta ,\overline{\eta}_{n})} y \; dz dS \\ & = \frac{1}{\pi R^{2} h} \int _{0}^{R} \int _{0}^{2 \pi} \int _{- \frac{h}{2}}^{\frac{h}{2}+\eta (r,\theta ,\overline{\eta}_{n})} r^{2} \sin{\theta} \; dz d\theta dr, \end{aligned} $$
(17)

where the function \(\eta (r,\theta ,\overline{\eta}_{n})\) describes the liquid free-surface shape, \(\overline{\eta}_{n}\) is the sloshing height of the \(n\)th mode, \((r,\theta )\) are the polar coordinates, with \(x = r \cos{\theta}\), \(y = r \sin{\theta}\), and \(dS = r\; d\theta dr\). As for the L model, the function \(\eta (r,\theta ,\overline{\eta}_{n})\) describes a plane (Fig. 2a),

$$ \eta (r,\theta ,\overline{\eta}_{n}) = \sum _{n=1}^{\infty} \overline{\eta}_{n} \frac{r}{R} \sin{\theta}, $$
(18)

whereas, for the NL model, the nonplanar free-surface can be described by means of the first-kind Bessel function (Fig. 2b), namely

$$ \eta (r,\theta ,\overline{\eta}_{n}) = \sum _{n=1}^{\infty} \overline{\eta}_{n} \frac{J_{1}(\xi _{1n} \frac{r}{R})}{J_{1}(\xi _{1n})} \sin{\theta}. $$
(19)

Independently from the adopted function \(\eta \), the expression of \(y_{G}\) from equation (17) can be used in equation (16) to express \(\overline{\eta}_{n}\) as a function of the model parameters and the generalized coordinates \((x_{n},y_{n})\), with the latter being obtained by solving the EOMs (see Sect. 2.2). The L-model assumption of planar surface leads to

$$ y_{G} = \frac{1}{\pi R^{2} h} \int _{0}^{R} \int _{0}^{2 \pi} \int _{- \frac{h}{2}}^{\frac{h}{2}+\sum \overline{\eta}_{n} \frac{r}{R} \sin{ \theta}} r^{2} \sin{\theta} \; dz d\theta dr = \frac{R}{4 h}\sum _{n=1}^{ \infty} \overline{\eta}_{n} .$$
(20)

Regarding the NL model, by exploiting one of the Bessel function properties, i.e., \(\int _{0}^{R} r^{2} J_{1}(\xi _{1n} \frac{r}{R}) \; dr = R^{3} \frac{J_{1}(\xi _{1n})}{\xi _{1n}^{2}}\), \(y_{G}\) can be evaluated as

$$ y_{G} = \frac{1}{\pi R^{2} h} \int _{0}^{R} \int _{0}^{2 \pi} \int _{- \frac{h}{2}}^{\frac{h}{2}+\sum \overline{\eta}_{n} \frac{J_{1}(\xi _{1n} \frac{r}{R})}{J_{1}(\xi _{1n})} \sin{\theta}} r^{2} \sin{\theta} \; dz d\theta dr = \frac{R}{h} \sum _{n=1}^{\infty} \frac{\overline{\eta}_{n}}{\xi _{1n}^{2}} .$$
(21)

Inserting the results from equations (20) and (21) into equation (16) allows the formulation of the \(n\)th sloshing height (SH) for the L and NL models, respectively, as shown in the leftmost column of Table 1.

Table 1 SH estimation for a 1-dimensional planar motion, without (left column) and with (right column) an excitation along the \(z\)-axis

3.2 2-Dimensional motion

When accounting for a 2-dimensional excitation, the plane \(\Pi \), on which the maximum sloshing height (MSH) occurs, changes its orientation instantaneously, according to a rotation about the \(z\)-axis by the angle (Fig. 1b),

$$ \phi _{n} = \arctan \Bigl(\frac{y_{n}}{x_{n}}\Bigr) .$$
(22)

If the liquid behavior is analyzed on the plane \(\Pi \) at every instant, equation (16) can be extended to the radial coordinate of \(G\), remembering that \(r_{n} = \sqrt{x_{n}^{2} + y_{n}^{2}}\):

$$ r_{G} m_{F} = \sum _{n=1}^{\infty} r_{n} m_{n} = \sum _{n=1}^{\infty} m_{n} \sqrt{x_{n}^{2} + y_{n}^{2}} .$$
(23)

Equations (20) and (21) can be used to express \(r_{G}\) in terms of \(\overline{\eta}_{n}\), depending on the adopted model. The approach seen in Sect. 3.1 allows writing the formulas for the \(n\)th MSH evaluation, both for the L and NL models, considering a 2-dimensional motion of the container (the leftmost column of Table 2).

Table 2 MSH estimation for a 2-dimensional planar motion, without (left column) and with (right column) an excitation along the \(z\)-axis

3.3 Remarks

By looking at the leftmost columns of Tables 1 and 2, one can point out that, for equal values of the generalized coordinates (\(x_{n},y_{n}\)), the ratio between \(\overline{\eta}_{n}\) obtained from the L model in equations (22), (28) and \(\overline{\eta}_{n}\) from the NL model in equations (24), (30) is always \(4/\xi _{1n}^{2}\). If only the 1st mode is considered, this ratio is equal to \(4/\xi _{11}^{2} \approx 1.18\) and shows that the assumption of planar free-surface always overestimates the sloshing height compared to the assumption of a nonplanar free-surface. Furthermore, while in equations (22), (24), \(\overline{\eta}_{n}\) has the same sign of \(y_{n}\), in equations (28), (30) \(\overline{\eta}_{n}\) is always positive. This means that equations (22), (24) express the trend of the sloshing height on only one side of the container (on the other side, the sloshing height is estimated as the opposite of \(\overline{\eta}_{n}\)): in this case, we will simply talk about sloshing height (SH). Conversely, in equations (28), (30), \(\overline{\eta}_{n}\) indicates the maximum peak that occurs on the container wall (on a plane oriented as described in equation (26)): in this case, we will use the expression maximum sloshing height (MSH).

3.4 Extension to 3-dimensional motion

When an additional excitation along the \(z\)-axis is taken into account, the formulas for the SH and the MSH estimation are reported in the rightmost columns of Tables 1 and 2. They are seemingly identical to those employed in the case of a planar motion along the \(xy\) plane. However, the generalized coordinates \(x_{n}, y_{n}\) are obtained by solving the EOMs in (14) for the NL model and in (15) for the L model, instead of equations (11) and (12), respectively.

Summing up, once that the liquid properties are known (in terms of container radius \(R\), static height \(h\), and density \(\rho \)), the equivalent-discrete model parameters (see Sect. 2) can be computed, and the 3-dimensional formulation can be applied to study the liquid sloshing for a general motion of the container, namely \(\ddot{\mathbf{S}}_{0} = [\ddot{x}_{0} \;\; \ddot{y}_{0} \;\; \ddot{z}_{0}]^{T}\), by simply employing the EOMs in (15) if the L model is adopted, or by solving the EOMs in (14) if the NL model is chosen. Once that the generalized coordinates (\(x_{n},y_{n}\)) of the \(n\)th sloshing mass are computed, if the container is not subject to an acceleration along the \(x\)-axis throughout the whole motion (\(\ddot{x}_{0} = 0\) [m/s2]), for the SH estimation, we must refer to Table 1. Conversely, if both \(\ddot{x}_{0}\) and \(\ddot{y}_{0}\) are other than zero, the reference for the MSH estimation is Table 2. The aforementioned generalization for the sloshing-height estimation is illustrated by the flowchart in Fig. 3.

Fig. 3
figure 3

Flowchart describing the computation of the liquid sloshing height, depending on the type of container acceleration and the adopted model

Hence, the sloshing-height estimation requires the numerical solution of the EOMs to find the generalized coordinates (\(x_{n},y_{n}\)) of the \(n\)th sloshing mass, together with the computation of the formulas in Tables 1 and 2, depending on the adopted model. Regarding our (nonoptimized) MATLAB implementation, the average computational time is \(0.7\text{ s}\), for either the linear and the nonlinear formulations.

4 Experimental validation

4.1 Experimental setup and motion laws

The experimental setup comprises a cylindrical container with radius \(R = 50\text{ mm}\) and a liquid static height \(h = 70\text{ mm}\). The liquid is water, which is colored by adding dark brown powder, in order to obtain a better contrast for the image processing analysis. Motions are performed by an industrial robot (Stäubli RX130L) and recorded by a GoPro Hero3 camera. The trajectories are planned so that the robot follows three geometrical paths on the \(xy\) plane (Fig. 4), each of them with different motion profiles, characterized by increasing container accelerations:

  • a back-and-forth linear path (indicated as l-motion);

  • an eight-shaped path (e-motion);

  • a circular path, performed twice in succession (c-motion).

In Fig. 5, the trends of the second time derivativeFootnote 1\(\ddot{\sigma}\) of the path parameter are illustrated: for every path, all three motion profiles are shown. Note that the legend refers to the maximum of the container acceleration norm \(\|\ddot{\mathbf{S}}_{0}\|_{\max}\) reached during the corresponding motion.

Fig. 4
figure 4

The three planar paths followed by the robot during experimental validation

Fig. 5
figure 5

The three motion profiles performed per each planar path

Fig. 6
figure 6

The 3D paths obtained as an extension of the 2D case

Fig. 7
figure 7

Snapshots from the image processing analysis of the recorded videos

Additionally, the 2D planar motions obtained from a modified trapezoidal motion law with 6 segments of \(\ddot{\sigma}\) are extended into 3D motions (l3-motion, e3-motion, c3-motion) through the inclusion of an excitation along the \(z\)-axis (Fig. 6a). In particular, for the e3-motion and c3-motion, the accelerations along the \(x\) and \(y\) directions are kept unchanged with respect to the corresponding e-motion and c-motion of the 2D case, respectively. The same cannot be said about the l3-motion, where the acceleration along the \(y\)-axis was slightly modified to meet the robot limits. As a result of the extension, if 2D and 3D paths are observed from the top of the \(xy\) plane, they share the same shape, whereas, from a front perspective, the vertical coordinate changes along the path according to an excursion \(\Delta z\) (Fig. 6b). On each 2D path, two different trends of \(\ddot{z}_{0}\) are considered, thus providing two different 3D paths, characterized by two different values of \(\Delta z\):

  • a profile with moderate dynamics, namely \(\lvert \ddot{z}_{0} \rvert _{\max} \in [2,3]\text{ m}/\text{s}^{2}\);

  • a profile with more prominent dynamics, namely \(\lvert \ddot{z}_{0} \rvert _{\max} \in [4,5]\text{ m}/\text{s}^{2}\).

Regarding the extraction of the experimental sloshing height from the recorded videos, once each frame is converted into black & white, the image must be processed in two different ways, depending on the excitation type:

  • SH detection. When the excitation is given by a 1-dimensional acceleration along the \(y\)-axis with or without the addition of \(\ddot{z}_{0}\) on the vertical direction, the trend of the SH can be examined on only one side of the container (Sect. 3.3); in this case, the SH is detected by identifying the black pixel with the highest \(z\)-coordinate on the rightmost side of the container (Figs. 7a, 7b); then, the SH is evaluated as the difference (converted in \(\textrm{mm}\)) between the vertical coordinate of the detected pixel and that of the pixel representing the liquid static height \(h\).

  • MSH detection. When the excitation is a general planar or spatial motion, the MSH can occur anywhere on the container wall. The MSH is again detected as the black pixel with the highest \(z\)-coordinate, but in this case the whole surface of the container is considered. Furthermore, a distinction is made between a peak occurring on the front part of the container and a peak on the rear wall, noticing that in the former case the liquid image presents a uniform black shape (Fig. 7c), whereas in the latter case the liquid image is characterized by white regions due to the light reflection on the liquid free-surface (Fig. 7d). Through this distinction, the peak can be correctly located on the container surface and the knowledge of the image depth can be used to obtain a more realistic measure of the MSH.

4.2 Experimental results

In Fig. 8, the 2-dimensional L and NL model predictions are compared with the results from the experimental motions, only considering the 1st sloshing mode. A good adherence between the experiments and the models can be appreciated for the 1-dimensional motions (Figs. 8a, 8b, 8c), and tracking remains reliable also for 2-dimensional motions, especially when considering lower values of \(\|\ddot{\mathbf{S}}_{0}\|_{\max}\) (Figs. 8d, 8g). As the value of the 2-dimensional excitation \(\ddot{\mathbf{S}}_{0}\) is increased, the model predictions still capture the trend of the real liquid MSH, although they seem to lose accuracy in correspondence to the peaks reached by the liquid (Figs. 8e, 8f, 8h, 8i). This can be eventually attributed to two reasons:

  • The high dynamics given to the container causes a regime of strongly nonlinear motions, where the liquid free-surface loses the assumed shape and shows instantaneous swirly peaks, as illustrated in Fig. 9a, that cannot be tracked by the models;

  • The height of the frames that are employed for the image processing analysis, grants a greater field of view when the liquid peak occurs on the rear wall of the container (Fig. 9b), whereas, for a peak on the front wall (Fig. 9c), the value of the real MSH is saturated by the frame upper limit; this explains the discrepancy between the experiments and the prediction models in the red areas that are highlighted in Figs. 8e, 8f, 8h, 8i.

Regarding the former case, the L-model assumption of a planar surface during motion loses adherence with reality when the container acceleration is roughly greater than \(\|\ddot{\mathbf{S}}_{0}\|_{\max} \approx 8\text{ m}/\text{s}^{2}\), with a maximum jerk of \(\|\dddot{\mathbf{S}}_{0}\|_{\max} \approx 60\text{ m}/\text{s}^{3}\). This is reflected in a less accurate correspondence between the model prediction and the experimental result, even though the model evaluation is still reliable. It is worth observing that the maximum peaks are always overestimated by the L model. As far as the NL model is concerned, the assumption of a free surface described by means of the Bessel function of the first kind finds a better correspondence with reality, compared with the L model. The model estimation begins to lose adherence with reality when the container acceleration reaches a value of roughly \(\|\ddot{\mathbf{S}}_{0}\|_{\max} \approx 9.5\text{ m}/\text{s}^{2}\), with a maximum jerk of \(\|\dddot{\mathbf{S}}_{0}\|_{\max} \approx 74\text{ m}/\text{s}^{3}\). Additionally, the global maxima predicted by the NL model are always below the experimental ones.

Fig. 8
figure 8

Comparison of the proposed models and the experimental results from the planar motions

Fig. 9
figure 9

Snapshots from the recorded videos, showing the different peaks reached by the liquid

Table 3 summarizes the obtained results by reporting the accuracy index \(\epsilon _{mod}\) expressing the error between the model and the experimental maxima:

$$ \epsilon _{mod} = \frac{\overline{\eta}_{\max ,\,mod} - \overline{\eta}_{\max ,\,exp}}{\overline{\eta}_{\max ,\,exp}} \times 100 \% $$
(24)

where the subscripts \(mod\) and \(exp\) denote the adopted model (2-dimensional L/NL) and the experimental results, respectively. For all motions, \(\lvert \epsilon _{2D-L} \rvert \) is always below \(18 \%\), and \(\lvert \epsilon _{2D-NL} \rvert \) never exceeds \(19 \%\), with the NL model granting a better tracking during the whole time period. Furthermore, the positive sign of \(\epsilon _{2D-L}\) proves that the L model always overestimates the real SH and MSH peaks, as expected (see Sect. 3.3), hence providing a more conservative estimation.

Table 3 Accuracy index \(\epsilon _{mod}\) evaluated for the planar motions

In Fig. 10, the results from the 3D motions are illustrated: for each motion, the 3-dimensional L and NL model predictions are compared with the 2-dimensional L and NL ones, to show the benefit obtained by employing the extended formulation. In general, the 3-dimensional models exhibit a better correspondence with respect to the 2-dimensional ones, especially when the vertical acceleration is more significant (e.g., when \(\lvert \ddot{z}_{0} \rvert _{\max} \in [4,5]\text{ m}/\text{s}^{2}\)). The definition of the index \(\sigma _{mod}\) expresses the mean absolute error between the experimental results and the model predictions,

$$ \sigma _{mod} = \frac{\sum _{i=1}^{N} \lvert \overline{\eta}_{exp}(t_{i}) - \overline{\eta}_{mod}(t_{i}) \lvert}{N} ,$$
(25)

where the subscripts \(mod\) and \(exp\) denote the adopted model (2-dimensional L/NL or 3-dimensional L/NL) and the experimental results, respectively, whereas \(t_{i}\) refers to the \(i\)th time instant and \(N\) represents the number of samplings. The analysis of Table 4, in which the index \(\sigma _{mod}\) is evaluated for the 3-dimensional motions, confirms the qualitative evidence, i.e.:

  • for equal formulations (3D or 2D), the NL model grants a better tracking of the real-liquid trends with respect to the L model (for instance, in most cases, \(\sigma _{3D-NL} < \sigma _{3D-L}\) and \(\sigma _{2D-NL} < \sigma _{2D-L}\));

  • in general, the 3D formulation provides a more reliable correspondence with reality, compared to the 2D formulation; indeed, in most cases \(\sigma _{3D-NL} < \sigma _{2D-NL}\) and \(\sigma _{3D-L} < \sigma _{2D-L}\).

Fig. 10
figure 10

Results from the 3D motions

Table 4 Accuracy index \(\sigma _{mod}\) evaluated for the 3-dimensional motions, comparing the 3D and the 2D formulations

4.3 Remarks

In the described experiments, the employed amount of liquid inside the container (\(R=50\text{ mm}\), \(h=70\text{ mm}\), with \(h/R=7/5\)) has a mass of \(m_{F} \approx 0.55\text{ kg}\). Considering only the first sloshing mode to model the liquid dynamics, from equation (4), we can theoretically compute the mass \(m_{1}\) which is responsible of the liquid sloshing (\(m_{1} \approx 0.18\text{ kg}\)). If the case with the highest dynamics is taken into account (e.g., the c-motion with \(\|\ddot{\mathbf{S}}_{0}\|_{\max} \approx 9.5\text{ m}/\text{s}^{2}\)), it can be shown, from the simulations, that the forces transmitted by the liquid on the robot end-effector are negligible, hence not influencing the robot dynamics. Conversely, as the value of \(m_{F}\) is increased (and consequently of \(m_{1}\), if \(h/R\) is fixed), the forces acting on the robot end-effector get more important.

It is also worth mentioning the influence of the ratio \(h/R\). In particular, for a fixed value of \(m_{F}\), when \(h/R\) increases, the value of the sloshing mass \(m_{1}\) drops down [10], whereas \(m_{1}\) represents a more important contribution as \(h/R\) decreases. As long as the sloshing mass \(m_{1}\) grows, the sloshing of the liquid becomes more significant, and the free surface might not satisfy the model assumptions. Consequently, for lower values of \(h/R\), the prediction models may lose adherence with reality. This also finds confirmation by looking at the correlation between the first natural frequency and the ratio \(h/R\) (see equation (3)): with the decreasing of \(h/R\), \(\omega _{1}\) tends to lower values, meaning that the fundamentals of the liquid free-surface can be easily excited by the motion-law spectrum, in correspondence of the highest amplitudes [18]. This may result in a more nonlinear behavior and shape of the liquid free-surface that might not be detected by the models, although a higher number of sloshing modes is considered.

5 Conclusions and future work

A novel technique for the sloshing-height estimation of a liquid inside a cylindrical container subject to 2-dimensional planar motions was proposed, extending what was presented in [17]. The technique is based on simple discrete mechanical models, rather than machine-learning or complex fluid dynamics methodologies, thus granting a reliable and easy-to-compute estimation.

Experiments, considering three container planar paths performed by an industrial robot with different motion profiles, were presented and the relative results were discussed. An accuracy index, expressing the error between the model and the experimental sloshing-height maxima, was used to prove the effectiveness of the estimation, even for high values of the container acceleration (up to \(9.5\text{ m}/\text{s}^{2}\)).

Additionally, the 2-dimensional formulation was extended into a 3-dimensional one, to take into account an additional excitation along the vertical direction, hence resulting in a 3D motion of the container. The planar paths of the 2D case were extended by adding a \(z\)-axis acceleration (up to \(5\text{ m}/\text{s}^{2}\)). The mean absolute error between the experimental results and the model predictions was examined to evaluate the benefit, in terms of accuracy, obtained by employing the 3D formulation instead of the 2D one.

Future work will include a further validation study considering higher values of the vertical acceleration and the use of the proposed sloshing-height estimation for square-section containers, adapting the formulation that was presented in Sect. 3. In addition, a detailed sensitivity analysis will be addressed to assess the influence of the container dimensions on the accuracy of the model predictions (Sect. 4.3).