## 3 Results: Newly Elaborated \"Whip-Lashing\" Method
### Elaboration of the Cycle Time Minimization (CTM) Algorithm  
The organigram presented in Figure 8 contains different blocs (A-E) that define the following calculations:  
* **A**: Filling up the **TM** torques matrix with the **T** torque vectors for every \(i\)-th trajectory point. * **B**: Copying the \(i\)-th **T** torque vector in the \(i\)-th column of the **TM** torques matrix. * **C**: Determining the **mT[\(j\)]** maximum torque for the \(j\)-th joint. * **D**: Checking if any joint torque maximum **mT[\(j\) ]** exceeds the allowed torque **aT[\(j\) ]** for the \(j\)-th joint. * **E**: Refinement of time step _ts_ if necessary and continuing iteration, or finishing if time step _ts_ goes below ending time step _ets_. Figure 7: The motion of RV-2 AJ arm. By running the algorithm for the original and improved trajectories, the two minimum cycle times were determined and compared. In Figure 8, the elaborated cycle time minimization algorithm is introduced in detail. The algorithm aimed to calculate the cycle time \(ct\) of the trajectory. It was made using a successive approximation algorithm as mentioned before. The concrete parameters of the algorithm are the next. The number of trajectory points \(TP\) = 12, where the index of a specified point is \(i\) = 1,..., 12. The number of RV-2 AJ arm joints is 5, where the index of a specified joint is \(j\) = 1,..., 5. In the algorithm two conditions should be fulfilled:  
Figure 8: Cycle time minimization algorithm. A–E stand for different blocs that define different calculations. * _ts \(\leq\)ets (ts_--time step; _ets_--ending time step),
* \(\mathbf{mT}[j]\leq\mathbf{aT}[j]\) (\(\mathbf{mT}[j]\)--the joints' torque maximums; \(\mathbf{aT}[j]\)--allowed torque for every \(j\)-th joint). The algorithm aimed to determine the following data:  
The \(\mathbf{T}[j]\) torque vector is calculated for every \(i\)-th trajectory point and copied into the \(\mathbf{TM}[j][i]\) torque matrix into the \(i\)-th column. The \(\mathbf{T}\) torque vector is determined by the \"inverse Dynamics MATLAB Robotics System Toolbox function\" of the MATLAB Robotic Toolbox. Then, the maximum of every \(j\)-th row of \(\mathbf{TM}\) torque matrix is determined to the \(j\)-th cell of the \(\mathbf{mT}[j]\) maximum torque vector. Then the \(\mathbf{mT}[j]\leq\mathbf{aT}[j]\) condition setting the _tof_ torque overload flag selects between cycle time decreasing or time step refinement and back stepping. 4 Discussion: Trajectory Optimization's Results of RV-2 AJ Arm Using the Application of CTM Algorithm  
The two trajectories are defined by positioning the same starting and ending points and 10 desired inner points that differ for each path using the spline function of MATLAB script to define the continuous path between the points. Figures 9-12 visualize the code script results for both trajectories (the original and the improved). The static Figures 10 and 12 cannot make the motion of the robot arms felt. The execution of script code for both trajectories resulted in the value of cycle time \(ct\) for each path, as presented in Figure 13, uniting the two results with drawing manipulation to make comparable the relation between the two trajectories and robot arm motions alike. First, a starting large cycle time \(ct=5\) [s] was entered as input, then the algorithm was run till we obtained a new cycle time described as the searched cycle time \(sct\) when the torque limiting condition became unsatisfied, the algorithm continued to iterate the new values for cycle time \(ct\) and time step \(ts\) around the searched cycle time value till the value of tuned time step became smaller than the value of ending time step \(ets\). For the original path, the minimum cycle time was \(ct=2.82\) [s], while for the improved path, the minimum cycle time was \(ct=1.86\) [s]. Comparing the two results, we proved that the improved trajectory, which is described as a whip motion analogue, utilized the maximum allowed torques with shorter cycle time than the original trajectory.