## 5 Discussion  
The paper describes the grid approach to finding the optimal robot location, where all possible robot locations are evaluated using a simulation in CoppeliaSim, and then the location with the best (lowest) fitness function \(f_{f}\) value is selected. In our case, there was an additional preprocessing step that found all valid robot locations using a simple and fast custom-made simulation system to increase the speed of the process. This step is not required, and therefore the research can be reproduced without this custom simulation system. The grid approach can alternatively be replaced by using some optimization algorithms, for example, the Particle Swarm Optimization (PSO) [31], which could further reduce the time needed to find the optimal solution. However, PSO would not provide the same type of comprehensive analysis of the whole space around the trajectory, and could also possibly return a local minimum instead of the global one. The method was demonstrated and tested on ten sample trajectories and the collaborative robot UR3. As can be seen from the results in Table 2, the percentage improvement in the fitness function between the worst and the best possible robot location ranged from 54% to 80.3%. This is mostly a theoretical improvement, as the worst-rated locations would likely be not chosen by the system integrator or workplace project architect for other reasons (they are typically on the edge of the working area of the robot or close to a singular configuration). If we instead compare the best robot location to the average \(f_{f}\) value of all possible locations, the improvement still ranges from 22% to 53.1%; therefore, it is clear that some interesting reduction in the robot joints wear can be achieved by selecting the optimal robot location instead of a \"random\" one. This method can be used in practice, provided there is a dynamic model of the selected robot available for some suitable simulation system (for example, CoppeliaSim). It is necessary to properly define the whole simulation model of the workplace, including any potential obstacles, otherwise, the returned optimal robot location could be invalid due to a collision. Nonetheless, it is still important to verify that the optimal location is feasible from the point of view of energy connections and other similar restrictions that cannot be included in the simulation. The dynamic model should include all properties and phenomena that noticeably affect the torque values in joints of the robot, as the torques are one of the main inputs for the proposed method. It is, thus, necessary to properly define and simulate also the payload in the end-effector, including any technological forces caused by the effector during, for example, cutting, milling, and spraying. The simulation system CoppeliaSim chosen in our demonstration is capable of simulating all these effects. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & **B** & **1** & **2** & **3** & **W** \\ \hline A1 & 0.6932 & 0.6359 & 0.6362 & 0.6833 & 0.6541 \\ A2 & 0.6985 & 0.7334 & 0.6912 & 0.6278 & 0.732 \\ B1 & 0.8743 & 0.8722 & 0.8168 & 0.5735 & 0.6244 \\ B2 & 0.9056 & 0.9096 & 0.9025 & 0.5915 & 0.6359 \\ C1 & 0.8246 & 0.7075 & 0.6933 & 0.6151 & 0.5887 \\ C2 & 0.8199 & 0.6657 & 0.7792 & 0.6965 & 0.6149 \\ D1 & 0.8594 & 0.8393 & 0.8728 & 0.6591 & 0.5087 \\ D2 & 0.9243 & 0.8984 & 0.8968 & 0.7126 & 0.5238 \\ E1 & 0.8541 & 0.8658 & 0.8960 & 0.7118 & 0.5825 \\ E2 & 1.0100 & 0.9590 & 0.8224 & 0.7360 & 0.6303 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Ratios between the real and simulated values of fitness function in the five robot locations for individual trajectories. Color gradient red–white is used for better visual representation of the value (white is the ideal ratio of 1.0, red is the ratio 0.5). Experiments on a real robot UR3 verified that the simulation model in CoppeliaSim matched the reality acceptably well.