1. Introduction
The most common industrial robot applications are related to the handling of products, the welding, and the assembly of parts [
1]. In such applications, the performance of the robotic workcell is usually limited by the performance of the robot, i.e., the time required by the robot to move between the points. Moreover, usually, these applications are kinematically redundant; in other words, the robot kinematic chain has more degrees of freedom than those required by the task; thus, the robot can perform the same task with several different configurations at one or more working point. The redundancy is mainly due to the symmetry of the task, in which the products can be handled by rotating around the tool axis continuously, (e.g., when vacuum grippers are used), or by discrete angles, (e.g., when standard grippers with two symmetrical fingers are used); thus, it is possible to rotate
around the tool axis to pick up an object. In common industrial installations, redundancy is disregarded. In fact, setting up a new workcell is usually a long and tedious process; thus, it is more important to perform a speedy setup instead of optimizing the robot movements. Fortunately, teach-by-demonstration techniques are gaining in popularity [
2], thus speeding up the process while, at the same time, including redundancy [
3].
As the same task can be performed with different robot configurations, it is possible to choose such configurations so that the movement between points is optimized, i.e., joint displacement is minimized. Redundant robot movement is a well-known topic in literature [
4,
5] and has been exploited both for the execution of tasks [
6], to promote safe human–robot interaction [
7] and to implement multiple robot applications [
8].
Many of the aforementioned applications are also flexible in terms of task order. In other words, the overall task can be performed independently from the subtask order. For example, if a robot has to fill a grid with products, the order in which the grid is filled is irrelevant to the overall task (i.e., the entire grid completion). As a result, different subtask orders may result in different task times due to the different sequence of movements between the points. To obtain the best order to fulfill the task, solving the Travelling Salesman Problem (TSP) is a valuable option [
9]. Such TSP, which aims at finding the shortest path to visit all the “cities” (i.e., the points) once, has been studied extensively over the years thanks to its wide applicability; in fact, researchers are still proposing novel algorithms to solve this problem as efficiently as possible [
10,
11,
12]. TSP has been used in many fields, such as package delivery [
13], in which multiple drones were used to deliver packages to customers at the same time, task scheduling for assembly lines [
14], medical waste collection during the COVID-19 pandemic [
15,
16], and rolling scheduling problem in the production of iron and steel [
17]. Moreover, the TSP has been jointed with Genetic Algorithms (GA) to divide the tasks between robots [
18], although GA are usually stochastic and may provide different solutions based on the simulation.
However, TSP suffers from a primary disadvantage: in its basic formulation, the path must visit all the cities once; thus, it does not allow for leaving a city unvisited. This major limitation has also been studied in the years. Luo et al. [
13] use multiple travelers to reach all the cities; in this sense, each traveler has to reach only a subset of cities. Similar problems have been faced in [
19], where multiple layers are considered, and in [
20], where each traveler is capable of reaching their own cluster of cities and can also move in a cluster of shared locations available to all the travelers. Li et al. [
21] introduced virtual tasks to associate tasks of different orders; these are also grouped into clusters. The proposed methods focus on putting forward a solution that allows for visiting all the cities with multiple travelers. However, in other applications, a designer can be interested in the opposite scenario: visiting only a subset of cities with a single traveler (e.g., to check only a small part of a component for anomalies [
22]).
In this paper, we aim to solve this issue, by focusing on a robotic application. In fact, if a redundant application is considered, the robot can reach a point (i.e., a city) with multiple configurations, thus requiring different movement times. As a result, each configuration can be considered a separate city, but the different configurations in the same points are mutual, so the robot must visit one of the possible configurations and not the others. In particular, this paper aims at adapting the TSP to the following scenarios:
to find the optimal task order in the case of multiple working points with multiple configurations and no fixed sequence;
to find the optimal configurations in the working points with multiple configurations and a fixed sequence.
The paper is structured as follows:
Section 2 introduces the complexity of the problem of the multiple-configurations;
Section 3 describes the analytical model required to implement the multi-configuration within the TSP;
Section 4 shows simulation and experimental results to analyze how both the cost and computational time of the TSP solution are affected by the model parameters. Finally, conclusions are drawn in
Section 5.
2. Industrial Robotic Tasks with Multiple Feasible Configurations at the Working Points
Let us consider the problem in which the robot should perform a task composed of
N points, where the sequence is not imposed by the task. For example, let us consider a quality inspection where a robot must move a camera around an object from a starting (home) position, taking
shots of the object. In this context, the number of possible paths
, i.e., the number of possible sequences of points, is as follows [
23]:
as a path is made up of
connections and the direction of the path is not relevant. In fact, Equation (
1) holds for an industrial robot, since the joints are actuated by means of electric motors, thus moving from point
i to point
j has the same cost of the inverse motion. Conservative forces (e.g., gravity) are not relevant, since the TSP provides a closed path. The complexity of the problem (i.e.,
) greatly increases by increasing the number of points
N: for example, 5 points led to
, while 10 points led to
. Hence, it is crucial to find a way of narrowing down the number of possible paths to ensure low computational times.
If a point can be reached with multiple configurations, the number of paths increases. For example, if a single point can be reached with
k configurations, each of the paths yielded by Equation (
1) must be considered
k times; thus, the total number of paths becomes
. In fact, in the aforementioned case of the quality inspection, a camera with a rectangular sensor can fulfill the task by taking a photo by rotating
about its optical axis (
Figure 1). The path must now choose between two configurations (
) for a single point, doubling the number of possible paths.
This situation occurs when either the tool can be placed in different ways or the robotic arm can be posed in different configurations, or both. Indeed, an industrial 6-axis robot is kinematically redundant, as its inverse kinematic problem provides multiple solutions based on the structurally available configurations. For a standard robot, such configurations are commonly related to the shoulder (lefty/righty), elbow (above/below), and wrist (flip/no flip), with a total of eight (8) possible combinations of configurations. In practice, it is often impossible that all the configurations are feasible (due to possible collisions or joint mechanical limits), but among the possible configurations, it is important to choose the one that optimizes robot performance. Particularly, flip/no-flip configurations are usually feasible, as they rarely result in collisions with the environment.
In general, let
be the number of points with
multiple configurations and
be the number of groups of points holding the same number of configurations. The number of possible paths is as follows:
where
. Please note that, when all the points allow only one configuration (i.e.,
,
,
), Equation (
2) yields Equation (
1).
The higher the number of configurations for each point, the higher the number of combinations. For example, in
Figure 2a, the number of combinations is shown for different
k values under the hypothesis that all the points have the same number of configurations (i.e.,
,
,
).
Moreover, even in the case of a fixed point sequence, the number of combinations, in the case of
, is not equal to 1. Indeed, a designer could be interested in optimizing the performance of the robot by choosing the appropriate configurations in the case of a fixed robot task order, i.e., when the industrial process is composed of a fixed sequence of subtasks. In this case, Equation (
2) can be simplified as follows:
As there is only one fixed point sequence, so the term
is neglected. Even without the factorial factor of Equation (
2), the number of combinations greatly increases with
(
Figure 2b).
It is worth noticing that an increase in the total number of possible paths is generally followed by an increase in the computational effort required for finding the best solution. However, the increase in computational effort is generally followed by a reduction in the overall solution cost (i.e., a reduction in the robot cycle time). In fact, increasing the number of possible configurations with the same number of points increases the number of combinations and, thus, is likely to find a path that requires a lower cost to be followed.
To verify this reasoning, an industrial 6-axis robot (Adept Viper s650) has been exploited, and 20 simulations have been performed. During each test, N random configurations are chosen in the robot joint space (); then, the corresponding inverse flip/no-flip robot configurations are calculated (). Finally, the configurations with on the last joint are calculated for both the flip/no-flip configurations ().
For each value of
k, all of the possible path movement times are calculated.
Figure 3a shows the ratio between the minimum time of the solution with
(
) and the minimum time with no multiple configurations (
,
). It is clear how increasing the number of possible configurations changes the minimum possible time; thus, simply by considering different robot configurations, it is possible to reduce the cycle time.
The same trend can be noted if the point sequence is fixed and only the configurations are to be chosen (
Figure 3b). It is worth noticing how, in
Figure 3a, the ratio
is calculated by taking, for each
N, the best solutions with
and with
, which means that those solutions may be found with different point sequences. In the case of
Figure 3b, however, the solutions with
and with
have the same point sequence; thus,
may reach even lower values. Indeed, it could be possible that the solution with
is way worse than the one with no fixed point sequence so that
may decrease.
3. Optimizing Cycle Time through the Travelling Salesman Problem
Provided that the task can be fulfilled in different ways, optimization techniques such as the TSP can be used to obtain the optimal solution according to a target cost function. The TSP provides the path that connects all the points reducing the cost index. Such a path must visit the points once, and the cost index can be any design target, such as traveling distance, traveling time, and energy consumption. The cost index is usually stored within a square matrix C, in which an element describes the cost in moving from point h to point k. Such cost can be any performance index based on the specific application (e.g., movement time, energy consumption, maximum acceleration, safety index).
The TSP is particularly interesting because it aims at finding the best path among all the possible combinations. Other optimization techniques, such as genetic algorithms, are generally stochastic; thus, it is possible that the calculated solution is not the global optimum. Moreover, increasing the number of configurations has a major drawback: its maximum possible cost increases with k; thus, choosing the wrong path (with a stochastic approach) could not benefit from the increase of k and, conversely, could provide an even more expensive solution (if compared to the case with ).
The TSP can be easily applied in the case of Equation (
1), as the solution provided passes through all the
N points. On the contrary, the application of the TSP in the case of multiple configurations is not straightforward. In fact, the points to be considered are more than
N, as multiple configurations must be considered:
However, the solution must encompass only N points. In other words, the solution must not provide a path that passes through the same point with different configurations.
The TSP does not allow for ignoring some points. It is then necessary to improve the algorithm to provide a feasible solution. As shown in a previous work [
24], it is possible to divide the positions into clusters. By applying the cluster constraints, the TSP is forced to choose a path that enters a cluster via one point, visits all the other points of the cluster, and exits towards other points (
Figure 4).
In this sense, if, for a single point, all the configurations are clustered, the TSP is forced to move to a point, pass through all the configurations, and move to another point. However, it is not possible to simply cluster all the configurations together, as the last configuration of the cluster is different from the first. In fact, it is necessary that the TSP solution enters and exits from the same configuration; otherwise, the final cost would be affected. For example, let us consider the quality inspection case (
Figure 1). In taking the photo, the TSP solution must move to the point with a chosen configuration and then move to the next, ignoring the other configurations.
To overcome this issue, mirror copies are introduced. Mirror copies are copies of the existing configurations and are used to avoid discrepancies in the final cost of the TSP solution. As the mirror copies are equal to the configurations, the costs of moving toward the other points are the same. Configurations and mirror copies of the same point are grouped into a cluster. To avoid confusion, the points are named via one single subscript (e.g., ); the configurations, with a double subscript (); and the mirror copies, with an asterisk ().
To obtain a reasonable solution, the TSP must obey to the following constraints in moving to a point with multiple configurations:
The path must enter a cluster through one configuration and exit through its mirror copy.
To avoid discrepancies in the final cost, the connections within a cluster must have null cost.
To do so, we propose to connect the configurations and the mirror copies in the following way: considering point , the j-th configuration () is connected within the cluster only to its mirror copy () and to the mirror copy of the following configuration (). The last configuration is connected to the mirror copy of the first configuration .
Moreover, we apply some constraints: with reference to
Figure 5, the number of blue connections must equal the number of configurations
k, while the number of yellow connections must equal
. In total, each cluster contains
connections.
As an example, let us consider Cluster P1 in
Figure 5. If the path moves to point
via configuration
, it is then forced to move to
,
and so on, exiting the cluster from
. As a result,
k blue connections and
yellow connections are used. Please notice that it is not possible for the path to move from
to
and exit from
, as, in this case, the path would pass through
blue connections and
k yellow connections, not obeying the aforementioned constraint.
The introduction of the mirror constraint increases the complexity of the TSP, as the number of cities increases. In fact, it is possible to rewrite Equations (
1) and (
2) as follows:
where
It is worth noticing that
must be doubled only when the mirror configurations are needed. Equation (
5) is valid with the standard TSP, when no constraints are applied. Otherwise, Equation (
6) holds.
Equations (
5) and (
6) do not provide the same number of possible paths. It is clear how the number of possible paths is greatly reduced by applying the constraints, thus reducing the overall complexity.
The proposed method can be applied also in the case of a working cycle made of a set of Cartesian paths that must be executed in sequence. Let us consider, as an example, a painting task where the painting tool must be moved along certain paths; in such an application, the robot configuration must be kept all along each path, but may change between the exit point of a path and the starting point of the subsequent path. The cycle time can be optimized using the proposed method, by assigning a cluster to each path (
Figure 6). The cluster must comprise all the possible configurations of the starting point of the path (instead of the working point), whereas the mirror copies are substituted by the corresponding configurations of the exit point of the path. In this way, the TSP will optimize both the sequence of the paths (clusters) and the robot configuration assigned to each path, while forcing the robot to keep such configuration all along the path at the same time.
Overall, the optimization procedure by means of the modified TSP can be summarized as follows (
Figure 7):
Define the working positions as Cartesian points ().
Identify the feasible redundant configurations for each point (), excluding the configurations that are outside of robot mechanical limits or that result in collisions with the workcell equipment.
Calculate the elements of the cost matrix
C. This part can be performed by means of common trajectory optimization algorithms, such as RRT-connect algorithms [
25,
26].
Solve the modified TSP using the feasible configurations and the cost matrix as inputs.
Finally, the optimal task sequence is provided.
Please note that the TSP outputs a list of the sequence of configurations
that minimizes the overall cost. Since the TSP requires the path to pass through all the configurations, the output list must be filtered to remove all the unused configurations (including the mirror copies), so that the final list is made of a single configuration per point (i.e., the configurations circled in green in
Figure 5).
Optimizing Cycle Time in the Case of a Fixed Point Sequence
Although the TSP is generally used to choose the optimal path, it is possible to use it to choose the configurations used with a fixed point sequence (i.e., with a fixed path). In this case, the number of possible combinations decreases. In fact, as shown in Equation (
3), the term
is related to the number of sequences, which can be neglected in the case of a fixed sequence. As a result,
, while Equation (
6) can be rewritten as follows:
As shown in [
24], it is possible to force the TSP solution to follow a certain path by making it choose a connection between two points, namely
and
. To do so, the number of chosen connections between
mirror copies and
configurations must be equal to one: consequently, the TSP solution is forced to move from a mirror copy of
toward a configuration of
; then, the solution is forced to exit
via a mirror copy and move toward the next point. This process can be iterated until the entire sequence is fulfilled.