DOI: 10.5281/zenodo.17674328
title: Time-Optimal Anti-Sloshing Trajectory Planning for Multiple Liquid-Filled Containers Subject to SCARA Motion

description: README-------------------------------------------

MATLAB SCRIPT AND CSV FILES:------------The MATLAB script is used to load and visualize the trajectory data.It allows the user to compare optimized and non-optimized trajectories.The script generates plots for both Cartesian space and joint space,and includes sloshing simulation and experimental results.The data correspond to the paper entitled 'Time-Optimal Anti-Sloshing Trajectory Planning forMultiple Liquid-Filled Containers Subject to SCARA Motion'.

HOW TO USE:-----------1. Open the file "generate_plots.m" in MATLAB.

2. At the top of the script, in the section marked "CONFIGURATION", set the four parameters:

    trajectory = "1A";      Choose between: "1A", "2A", "1B", "2B"    motionLaw  = "OPT";     Choose between: "OPT" (optimized), "NOPT" (non-optimized)    h          = 20;        Static liquid height [mm]. Choose between: 20, 30, 40, "MULTI" ("MULTI" refers                            to the case where containers with different filling heights are transported simultaneously)    etalim     = 15;        Sloshing-height limit [mm]. Choose between: 15, 25        Compatibility Notes:        - The "NOPT" (non-optimized) motion law is available only for Trajectory "1A" or "2A"    - etalim = 25 is available only when the static liquid height is h = 40mm    - h = "MULTI" is available only with Trajectory "2A" or "2B", etalim = 15 and motionLaw = "OPT"

3. Run the script. It will automatically:   - Load the correct .csv files based on your selection   - Plot the following:     - Cartesian position, velocity, and acceleration of the point O' of the tray     - Orientation angles, angular velocity, and angular acceleration of the tray about the x', y' and z' axes     - Robot joint positions and velocities     - Sloshing heights (both model and experimental)

CSV FILES:----------The script reads the following CSV files (from the "CSV_files" folder):

1. <trajectory>_<suffix>_<h>_<etalim>_cartesian_trajectory.csv

   Note: "suffix" is a keyword automatically set by the script depending on the selected motion law (motionLaw).         - If motionLaw = "OPT", then suffix = "optimized"         - If motionLaw = "NOPT", then suffix = "nonoptimized"

   Example: 1A_optimized_h40_etalim15_cartesian_trajectory.csv

   Columns:   [1]  Time [s]   [2]  r_x tray position [m]   [3]  r_y tray position [m]   [4]  r_z tray position [m]   [5]  θx orientation [rad]   [6]  θy orientation [rad]   [7]  θz orientation [rad]   [8]  \dot{r}_x tray velocity [m/s]   [9]  \dot{r}_y tray velocity [m/s]   [10] \dot{r}_z tray velocity [m/s]   [11] ωx angular velocity [rad/s]   [12] ωy angular velocity [rad/s]   [13] ωz angular velocity [rad/s]   [14] \ddot{r}_x tray acceleration [m/s²]   [15] \ddot{r}_y tray acceleration [m/s²]   [16] \ddot{r}_z tray acceleration [m/s²]   [17] αx angular acceleration [rad/s²]   [18] αy angular acceleration [rad/s²]   [19] αz angular acceleration [rad/s²]

2. <trajectory>_<suffix>_<h>_<etalim>_joint_trajectory.csv

   Columns:   [1]  Time [s]   [2–7]  Robot joint positions  q_i (i = 1,...,6) [rad]   [8–13] Robot joint velocities \dot{q}_i (i = 1,...,6) [rad/s]

3. Sloshing data:   - <trajectory>_<suffix>_<h>_<etalim>_SH_model_<cont>.csv   - <trajectory>_<suffix>_<h>_<etalim>_SH_model_<cont>.csv   - <trajectory>_<suffix>_<h>_<etalim>_SH_exp_<cont>.csv   - <trajectory>_<suffix>_<h>_<etalim>_SH_exp_<cont>.csv

   where: cont = IC, 2, 3, 4, 5, 6, 7, EC

   Each file contains two columns:   [1] Time [s]   [2] Sloshing height η [mm]

OUTPUT:-------The script generates 3 figures:

Figure 1: Trajectory plots  - 3D trajectory   - Linear and angular velocities and accelerations along the three axes  - Orientation angles, angular velocities and angular accelerations

Figure 2: Joint space plots  - Joint positions q_i (i = 1,...,6)  - Joint velocities \dot{q}_i (i = 1,...,6)

Figure 3: Sloshing heights  - Model and experimental trends for IC and EC containers  When h="MULTI", two additional plots are generated, showing the sloshing-height trends of containers 2–6 and 3–7.

CORRESPONDENCE WITH PAPER FIGURES (referred to the case with h = 40mm and etalim = 15mm):----------------------------------

3D TRAJECTORY PLOTS (Figure 1 - subplot "3D Trajectory"):- 1A OPT/NOPT → Blue path in Figure 5a- 1B OPT      → Red path in Figure 5a- 2A OPT/NOPT → Blue path in Figure 5b- 2B OPT      → Red path in Figure 5b

SLOSHING HEIGHT PLOTS (Figure 3):- 1A OPT  → Figure 6a- 1A NOPT → Figure 6b- 1B OPT  → Figure 6c- 2A OPT  → Figure 7a- 2A NOPT → Figure 7b- 2B OPT  → Figure 7c

--------------------------------------------------------------------------------------------------------------------------------

ROBOT VIDEOS (referred to the case with h = 40mm and etalim = 15mm):------------In 'Robot_videos' folder it is possible to visualize the videos of the robot recorded during the experiments,relative to Figs. 6 and 7 of the paper. The videos are named as follows:

<trajectory>_<suffix>_<h>_<etalim>.mov

--------------------------------------------------------------------------------------------------------------------------------

LIQUID VIDEOS:------------In 'Liquid_videos_left/right' folders it is possible to visualize the videos recorded on the single containers during the experiments, relative to all the trajectories presented in the paper; "left" and "right" refer to the two GoPro attached to the tray. The videos are named as follows:

<trajectory>_<suffix>_<h>_<etalim>_<cont>.MP4