## 3 Results: Newly Elaborated \"Whip-Lashing\" Method
### Elaboration of the Cycle Time Minimization (CTM) Algorithm
#### Modelling of RV-2 AJ Arm Motion as Whip-Lashing in MATLAB Software  
After studying the cycle time variation, the analysis of torque change effect regarding the both trajectories are discussed in this section. To perform the simulation in the Simulink environment, we imported the RV-2 AJ body structure XML file into MATLAB. Then, we configured each link and joint in the structure to receive the vector of positions as input blocks that represent the original and the improved path, as well as to calculate the torques applied for providing the series of such positions. Figures 14 and 15 present the block system needed to determine the finishing cycle time \(ct\) and torque vectors \(\mathbf{T}\) calculated during the \(ct\) minimizing process, where the blocks \"Improved Trajectory\" and \"Original Trajectory\" contain spline function for each joint specified by angles vector that should RV-2 AJ arm execute according to each position. \"RV-2 AJ arm block\" contains the mechanical properties of the robot arm. Using Scope Box, we visualized the torque diagram of each working joint (second-third-fourth, \(j=2,3,4\)) for the original and improved paths (Figure 16). Figure 14: The block system scheme of RV-2 AJ arm of the original trajectory. Figure 15: The block system scheme of RV-2 AJ arm of the improved trajectory. In this section, we investigated the variation effect of the second joint (shoulder) and third joint (elbow) regarding the allowable torque values **aT** for those joints. As can be observed in Figure 16, the variation of torque values for the two paths for a starting cycle time \(ct=5\) [s] and \(ts=1\) [s] describes the behavior of the RV-2 AJ arm. In Figure 16, it can be seen that the torques of the fourth joint are close to zero due to the weight in this segment, which is very small compared to the other segments, which hold other segments. The comparison between the two paths was based on shoulder, which presents the second joint. It was clear that in the first iteration where \(ct=5\) [s], the torque curve for the original path reached higher peak values than the improved path, where the maximum torque value for the original path was **mT** = 31 Nm and for the improved path was **mT** = 27 Nm. We also observed an overshoot in the beginning stage for both curves, which is explained as the gravity effect on the mechanical structure. As mentioned before, we started within a large cycle time \(ct=5\) [s] and within \(ts=1\) as a first iteration. The algorithm of minimization of cycle time started to calculate maximum torque for such a cycle time. If the maximum torque was always below the allowable torque for every joint, then the cycle time \(ct\) decreased by the time step \(ts\). Figure 17 presents the variation of joints torques according to the original path for different cycle times \(ct=5\), 4, 3, 2 [s] to see the behavior of torque curves and compare their peak values in each iteration, in order to observe when the torque peak of an iteration exceeds the allowable torque value **aT**. Regarding the second joint (shoulder), in the interval 0-5 [s] we observed that the decrease of cycle time resulted in an increase of torque value for the original trajectory, where in \(ct=2\) [s] the maximum torque value of the original trajectory exceeded the allowable torque value with **mT** = 42 [N\(\cdot\)m]. Therefore, this value \(ct=2\) [s] was stored as the searched cycle time value \(sct\) for the original trajectory and according to this value we calculated a new time step which was smaller than the first one, so the algorithm iterated the cycle time value more precisely. Figure 16: Variation of joint torques according to the two paths, \(ct=5\) [s]. As presented in Figure 18, the searched cycle time \(sct\) = 2 [s] obtained for the original path minimized the possible range to find the optimal maximum torque with optimal new cycle time.