Introduction

The current trend asks the industrial production for mass customization, which enhances the variety of products and decreases the batch volume to individual products (Da Silveira et al., 2001), thus requiring assembly systems to be more performing (Azzi et al., 2012).

To achieve that, new technologies are introduced, e.g. collaborative robots (cobots), whose demand is increasing (Tan et al., 2010). Collaborative assembly systems (CAS) (Faccio et al., 2019) can guarantee a production increase and the flexibility requested by the market (El Zaatari et al., 2019); however, safety is still considered one of the main issues in this type of cell (Surdilovic et al., 2010).

The trade-off between productivity, flexibility, and safety, Gerbers et al. (2018), leads to the disequilibrium of assembly systems toward one of them. To correctly maximize all of them, it is necessary to develop a proper solution (Bautista & Pereira, 2007), i.e., it is necessary to introduce a safety constraint in the task allocation problem. This latter is a very studied topic for assembly systems and different authors presented their solutions.

Previous strategies, reported in Johannsmeier and Haddadin (2016), Krüger et al. (2009), Müller et al. (2017) presented frameworks for human robot collaboration (HRC) with the introduction of safety systems in highly productive systems. However, the solutions presented so far focus more on the distribution of tasks and they did not include safety as a constraint.

The proposed work aims to introduce a new mathematical method for collaborative systems, introducing a safety constraint in the model. Hence, the newly proposed method defines a task allocation strategy characterized by high productivity, as it minimizes the makespan, but also by a minimum interference between the resources, leading to a safe work space. This work considers typical characteristics of HRC systems, e.g., different tasks time for the resources, technological constraints, and the parallelization of the tasks between the resources. This can have a strong impact in the industrial field because it allows having a performing and safe system, without the introduction of other devices, which would increase the cost while lowering the flexibility. Moreover, cobots’ speed is usually set much lower than the effective capability of the cobot, due to safety reasons; indeed, speed and separation monitoring (SSM) methods may move the robot unnecessarily slow when close to the operator, whereas power and force limiting (PFL) methods may reduce the productivity when the operator is far from the cobot (Palleschi et al., 2021).

However, a proper task allocation may effectively improve the performance of the system by temporarily increasing the cobot speed when the distance between the resources is sufficient, in accordance with the standards and the cobot characteristics. Indeed, if the task allocation approach does not consider the distance between the resources, it forces the robot to maintain the speed to a minimum value due to safety reasons; on the other hand, by introducing a distance-related constraint it is possible to decrease the cobot speed by a factor, \(f_s\), properly evaluated, only when the distance between the resources is not sufficient, thus effectively improving both the system performance and safety. This new model, in fact, maximizes the time in which the two resources are above the safety distance, allowing the cobot to keep a higher speed for more time, and this results in an increase of the efficiency but also in an improvement of the safety.

The paper is organized as follows: in Section ‘Literature review’ the state of the art regarding safety task allocation problem is presented; in Section ‘Proposed task allocation’ the hypothesis and the model are explained, while Section ‘Model application and comparison’ is for the application of the new model, with the results, and the comparison with the one without safety constraint. Lastly, Section ‘Conclusion’ concludes the work.

Literature review

In recent years, the global market requires increasingly customized products, i.e., small batches of products with a great variety (Faccio et al., 2020); hence, more flexible systems are required to achieve this goal (Browne et al., 1984; Boschetti et al., 2021a).

A first solution could be achieved by implementing a manual assembly system (MAS) (Faccio et al., 2019), which simply provides to assign to the human operator all the tasks to be performed, thus achieving the maximum degree of flexibility; however, manual systems are influenced by the performance of operators, their productivity, work rate, safety (Edmondson & Redford, 2002). Moreover, MASs are characterized by the high costs of the workforce.

However, to correctly move from the mass production paradigm to the mass customization one, it is necessary for a system to be competitive while ensuring the flexibility required. For these reasons, automatic systems such as collaborative robots (cobots) (Klumpp et al., 2019) are preferred, since they can guarantee the repeatability of robots with the flexibility of human operators (Simões et al., 2020). Indeed, cobots are designed to work in the same workspace of the operator without physical barriers, differently from traditional robots which are enclosed by safety fences due to safety reasons. Therefore, safety becomes a fundamental aspect due to the risk of contact between the robot and the person.

As stated by Villani et al. (2018), the main fields of research for human-robot collaborations (HRC) studies are:

  • Safety, which concerns the safety standards introduced by international regulations [3-5], and how collaboration can take place.

  • Design methods, which include the study of control laws, the choice of sensors, and tasks to be performed to ensure that the operator works safely side by side with the robot, actively sharing the workspace and tasks to be completed.

As safety is fundamental to accomplish a proper HRC, these two fields are strictly related. In order to ensure the safety of the operator, the cobot speed shall be reduced (Vicentini, 2020), affecting productivity.

In Faccio et al. (2019), an extensive analysis of the convenience of collaborative assembly systems has been carried out, showing the influence of product and process characteristics, the number of tasks, the percentage of assembly task allocation, and the degree of collaboration, on the system performance.

To achieve the maximum performance from these systems, it is important to properly address these characteristics, which is possible by correctly assigning the tasks between the resources, i.e., by solving an assembly line balancing (ALB) problem.

Previous works, which are presented in Table 1, have typically solved the task allocation problem by adopting solutions based on frameworks. The Table has been ordered according to the relevance of the studies, where relevance is understood as the number of citations per year (citations obtained from Google Scholar, 22 July 2022, 2022 = 1 year, 2021 = 2 years, etc).

Table 1 State of the art on the task allocation problem

Johannsmeier and Haddadin (2016), propose a framework divided into three levels, where the assembly process starts from the evaluation of information about tasks, products, and resources. They introduce the planning of cobot trajectories with sensors and vision systems. The authors address safety issues with the introduction of different systems, but it is not considered with the other optimization parameters.

Another framework-based solution was proposed by Tsarouchi et al. (2017). The authors present a decision algorithm that allows them to find a series of solutions, basing their evaluation on criteria presented in the literature, i.e., the capacity of the resource, if it is already working, and the resources’ task times.

On the other hand, (Michalos et al., 2018b; Fechter et al., 2018) suggest solving the task allocation problem with the development of an appropriate layout. Their method is based on an analysis of several criteria, comparing the different solutions in terms of productivity, ergonomics, and process quality with the possible layouts that allow efficient use of the work plan.

Ranz et al. (2017) try to determine optimal scheduling by taking into account the ability of the resources, thus, placing greater emphasis on the final quality of the product. In this way, they aim to provide an objective approach based on empirical observations for the allocation of those actions that cannot be assigned a priori to one resource or to another.

Differently, Chen et al. (2013) propose a mathematical model that describes the task balancing problem and whose resolution leads to a task scheduling that minimizes the total assembly time of the product. The authors assume that the entire process of collaborative assembly can be divided into two parts: parallel or sequential assembly, i.e., tasks that can be executed in parallel or that have a sequential relationship. Thus, their optimization algorithm is divided into a number of sub-problems equal to the number of the previously identified groups, leading to significant simplification.

Another solution for the task allocation problem is proposed by Boschetti et al. (2021b), where a model for collaborative assembly line balancing (C-ALB) is developed, including paralleling tasks and collaboration.

Task assignment is also considered by Michalos et al. (2018b), where a framework that considers the design of the layout for HRC is presented. Through a multi-criteria approach, different solutions are analyzed in terms of productivity, quality, and efficiency.

A robotic system implementation that combines the capabilities of industrial robots with those of human operators is presented in Michalos et al. (2018a). The authors here propose a case study where each task is assigned to the resource that best fits the request. Through manual guiding and wearable devices, they establish a safe collaboration without fences, which leads to the conclusion that the resources are oriented toward collaboration more than the competition.

From the presented literature review it is possible to observe how the task allocation problem in HRC systems is an important one, Inkulu et al. (2021), with a great effort by the literature on methods focused on finding the optimal task allocation to improve productivity.

On the other hand, there are different solutions to improve safety but also guarantee productivity, e.g., the introduction of sensors, gesture recognition systems (Liu & Wang, 2018), and collision avoidance systems (Boschetti et al., 2022).

The regulations themselves, (ISO, 2016; UNI, 2011), introduce safety paradigms:

  • Safety-rated monitored stops (SRMS): if humans come too closer to the cobot, it will stop.

  • Hand guiding (HG): operator guides the cobot, which has to maintain the object in position.

  • Speed Separation Monitoring (SSM): based on the distance from the operator, the cobot can change its speed.

  • Power and Force Limiting (PFL): cobot’s arm will stop if it receives an impact with a preset force value.

Starting from these, an example of how it is possible to improve productivity with SSM is offered by Byner et al. (2019), where a laser scanner is used to monitor the closeness between the operator and the cobot, i.e., if the cobot is close enough to the operator, its speed is reduced to a fixed limit. This guarantees the consistency of the production because the robot does not stop if it is too close to the operator.

Gualtieri et al. (2020) present a framework to consider safety, ergonomics, and efficiency in the design of a collaborative work cell. Safety and ergonomics are guaranteed with the introduction of a motion planning approach that implements smooth trajectories, considering also the posture of the operator to avoid overload and flexion or extension of the human body. Efficiency is ensured by a correct design of the workspace, which is provided by automatic vision systems and the avoidance of manual parts reorientations.

Similarly, (Krüger et al., 2009) propose a survey on how to properly achieve a shared workspace, with remote and haptic interfaces to reach an efficient human-robot collaboration and to realize interactive learning. They also suggest the use of laser scanners, safety sensors, pre- and post-collision systems, and intelligent grippers to satisfy safety requirements. The authors recommend dividing assembly tasks into four steps: separation, transfer, orientation, and positioning of the parts to have an easier and more flexible feeding and so to maintain high productivity.

Galin et al. (2020), state that productivity is directly influenced by safety and by the collaboration between the human operator and the cobot. The latter can be achieved with an intelligent manufacturing process based on the division of tasks between the two resources, obviously taking into account safety measures that can be both hardware or software.

Lastly, (Bettoni et al., 2020) propose an adaptive human-robot collaboration based on a decision-maker implemented by machine learning techniques. Their aim, thanks also to a physiological monitoring system, is to provide relief from both mental and physical workload, which is achieved by changing the support level offered by a collaborative robot. In this way, the operator is less stressed and the total productivity increases by 16%, while the quality issues decrease by 95%.

From the presented literature review, it is possible to observe, to the authors’ knowledge, how the task allocation and safety issues have not been merged in the literature. This is because in task allocation problems the cobot is considered intrinsically safe thus, focusing mainly on improving productivity through optimal scheduling and considering issues such as task parallelization. On the other hand, frameworks that improve the safety in HRC systems are mainly focused on safety devices, which reduce the flexibility of the work cell, hence, task allocation is not used to improve the safety in the workspace.

The novelty this article introduces is a task allocation model with a new constraint based on the distance between the operator and the cobot, which considers how the cobot speed changes when the distance between the resources is lower than a safety value. Moreover, this new constraint aims to maximize the time in which the two resources are sufficiently far from each other, making it possible to improve safety since the danger of a collision decreases and also to raise the efficiency since the makespan decreases thanks to the fact that the cobot can keep a higher speed for more time.

Proposed task allocation

Nomenclature

Input variables and parameters

J:

Number of tasks

j:

Task indexes \(j = 1,\ldots ,J\)

K:

Number of resources

k:

Resource index \(k=1,\ldots ,K\)

\(t_{jk}\):

Task time j for resource k [min]

\(D_{ij}\):

Pairwise distance matrix between the tasks ij [JxJ]

\(d_s\):

Minimum safety distance between the resources [cm]

\(f_s\):

Speed decrement/Time increment

Output variables Optimization variables:

\(x_{jkt}\):

Assembly line balance decision variable [binary]

Objective function:

ms:

Makespan [min]

\(t^*_{jk}\):

Task time j for resource k increased by safety constraint [min] (we considered only \(k=2\), i.e., the cobot)

Indexes adopted to evaluate the obtained task allocation

\(c_\%\):

Collaboration index Other variables used in this work

t:

Temporal instant [s]

T:

Temporal horizon [s]

\(U_k\):

Set of unfeasible tasks for resource k

C:

Intrusion distance, defined by [1] [m]

\(T_{coll}\):

Collaboration time [min]

\(S_h\):

Minimum separation distance due to operator’s reaction time [m]

\(S_r\):

Minimum separation distance due to cobot reaction time [m]

\(S_s\):

Distance for cobot stop [m]

\(Z_d\):

Uncertainty about operator’s position [m]

\(Z_r\):

Uncertainty about cobot position [m]

\(T_r\):

Cobot reaction time [s]

\(T_s\):

Cobot stop time [s]

\(Ts_{max}\):

Cobot stop time at maximum speed [s]

\(v_h\):

Operator speed [m/s]

\(v_r\):

Rated cobot speed [m/s]

\(v_c\):

Cobot speed [m/s]

\(v_{rel}\):

Relative speed [m/s]

\(v_{max}\):

Maximum cobot speed [m/s]

\(\nu \):

Safety coefficient

E:

Transferred energy during a contact [J]

\(\beta \):

Reduced mass [kg]

\(\varDelta _{ms}\):

Difference between the makespan without and with the safety constraint [min]

\(d_s^*\):

Optimal safety distance [cm]

Problem statement and assumptions

A set of tasks J need to be assigned to K collaborative resources with different characteristics, i.e., collaborative robot and human operator. In particular, we are focusing on an assembly process where both the resources share the workspace at the same time. A possible scenario can be seen in Faccio et al. (2019), where a collaborative assembly between a cobot and a human operator is presented. In this scenario, the two resources need to pick up and assemble five screws; a similar example is advantageous since it allows us to avoid considering the effects of precedence between the tasks on the assembly process. Some of the hypotheses that characterize the model are retained in the proposed work, which are:

  • mass production of one homogeneous product by performing J operations of a given product process: single-model line hypothesis. The single-model representation is a Virtual Average Model (VAM), which characteristics are calculated from the different product variants, so, eventually, it can be easily extended to a mixed-model;

  • deterministic and integer operations times; this is done in order to avoid the influence of stochastic effects;

  • each task is performed by only one resource.

The proposed method aims to investigate the effects of a distance constraint on a task allocation for human-robot collaborative systems. Indeed, due to safety reasons, the collaborative robot(s) speed should be reduced when the distance between the resources is lower than a certain threshold. Since this scenario leads to a decrease in the cobots performance, it is reasonable to search for a task allocation process that considers the distance between the resources during the process in order to maximize the system performance. Hence, additional hypothesis have been introduced to better focus on the aim of the proposed work and highlight the influence of the distance:

  • the assembly line is composed by a single workstation consisting of one human operator and one cobot, i.e., \(K = 2\);

  • the considered collaborative resources share workplace and task time;

  • the distance between the resources is measured as the distance between their current tasks, thus, considering the space occupied by the robot and the human operator at micro-level (Faccio et al., 2020) during the task completion.

Model description

The objective function of the proposed model is the minimization of the makespan ms in a collaborative workstation composed by a cobot and a human operator. This means that is a non linear model for a task allocation with a single objective minimization.

$$\begin{aligned} min\ ms = \sum _{t=0}^T\sum _{k=1}^K(t+t_{jk})x_{jkt} \end{aligned}$$
(1)

Subject to:

$$\begin{aligned}&\sum _{t=0}^T\sum _{k=1}^Kx_{jkt}=1 \quad \forall j \end{aligned}$$
(2)
$$\begin{aligned}&t^*_{jk} = t_{jk}\cdot (1 + f_s \cdot d_{ij} \cdot \sum _{t} x_{jkt}) \quad \forall j,i \quad k = 2 \end{aligned}$$
(3)
$$\begin{aligned}&x_{jkt} = 0 \quad \forall j \in U_k \end{aligned}$$
(4)
$$\begin{aligned}&x_{jkt} \in \{0,1\} \quad \forall j,k,t \end{aligned}$$
(5)

where \(x_{jkt}\) is the optimization variable:

$$\begin{aligned} x_{jkt}={\left\{ \begin{array}{ll} \text {1\ if the task }{j}\text { is performed by the resource }{k} \\ \quad \text { at the time }{t} \\ \text {0 otherwise}\\ \end{array}\right. } \end{aligned}$$
(6)

The time dimension t is considered as done by Boschetti et al. (2021b), to evaluate ms, Eq. (1). The guarantee that each task is executed by a single resource is given by the Eq. (2). The distance constraint introduced in this work is defined in Eq. (3), considering the cobot as the resource \(k = 2\) and where \(d_{ij}\) is defined given the values of \(D_{ij}\) as:

$$\begin{aligned} d_{ij} = {\left\{ \begin{array}{ll} 1 \ \text {if the distance between task }i\text { and }j \\ \quad \text { is less than }d_s\\ 0 \ \text {otherwise}\\ \end{array}\right. } \forall i,j \end{aligned}$$
(7)

where \(d_s\) is the minimum safety distance between the resources, defined on the basis of the reaction and stopping distance of both resources, as defined by the standards and better described in the following section. The distance constraint allows us to relate the distance between the resources with the performance of the system. Indeed, as the distance between the resources increases, the robot is capable of moving at a higher speed, effectively reducing the task completion time by reducing the picking and assembly time. Hence, in this way it is possible to minimize the makespan while also increasing the safety distance between the resources.

Lastly, the technological constraints are introduced in Eq. (4), which limits the possible solutions by considering that the resource k may not be able to carry out some tasks j. These tasks are included in the set \(U_k\), whose elements \(u_{jk}\) are the tasks j that cannot be executed by resource k, differentiating between different types of resources. This is characteristic of collaborative assembly systems, where the layout is characterized by resources that are not homogeneous. However, by considering comparable task times and capabilities, it is possible to apply the model to traditional and homogeneous scenarios.

Safety distance and speed increment

In this paper, collaborative robots with speed and separation monitoring are considered, as described by the standards. The regulation ISO/TS 15066:2016 (2016) provides the definition of three zones where the interaction between the operator and the cobot can take place:

  • great distance between cobot arm and operator where they can both work at their nominal speed because contact risk is low;

  • medium distance where cobot has to reduce its speed because the risk increases with the distance reduction;

  • small distance where cobot is expected to stop due to a high probability of impact.

Cobot speed is then limited taking into account its overall reaction times, thus establishing a stopping distance as:

$$\begin{aligned} d_s = S_h + S_r+S_s+C+Z_d+Z_r \end{aligned}$$
(8)

where \(S_h\), \(S_r\), and \(S_s\) are the safety distances due to operator reaction time, robot reaction time, and the robot stop time, respectively; C, \(Z_d\), and \(Z_r\) are terms related to uncertainties or factors that are not easily predictable. Moreover, the parameter C refers to robots or machines that are not collaborative, so it can not be correct to include it in the evaluation of ds, Marvel and Norcross (2017), since cobots should work without any additional device. Therefore, a safety parameter \(\nu \) is defined, which increases the values of distances to enclose these factors. This results in:

$$\begin{aligned} d_s = (S_s+S_r+S_h)\cdot \nu \end{aligned}$$
(9)

These values are used to evaluate a safety distance, below which a cobot speed reduction is required. With the speed reduction, also the stop distance will be smaller and so the cobot is in a safe condition, improving the safety of the system.

Regarding the separation distance due to operator reaction time, the regulation defines it as:

$$\begin{aligned} S_h = \int _{t}^{t+T_r+T_s}v_h(x)dx = v_{h}\cdot (T_r+T_s) \end{aligned}$$
(10)

where \(T_r\) is the cobot reaction time and \(T_s\) is the cobot stop time.

Considering the established override speed \(v_{max}\) and the rated speed \(v_r\), it is easy to determine:

$$\begin{aligned} T_s = T_{s,max} \cdot \frac{v_r}{v_{max}} \end{aligned}$$
(11)

where \(T_{S,max}\) is the stop time at maximum speed, usually identified in the robot data-sheet. From this, it is possible to calculate:

$$\begin{aligned} \begin{aligned} S_s=v_r\cdot T_s\\ S_r = v_r\cdot T_r \end{aligned} \end{aligned}$$
(12)

Similarly, it is possible to evaluate the maximum collaborative speed by considering the transferred energy during contact as described by the regulation, and which is defined as:

$$\begin{aligned} E = \frac{1}{2}\beta v_{rel}^2 \end{aligned}$$
(13)

where \(\beta \) is the reduced mass of the two-body systems, while \(v_{rel}\) is the relative speed between the operator and the cobot.

From that it is possible to derive the maximum collaborative speed of the cobot as:

$$\begin{aligned} v_c = v_{rel}-v_h \end{aligned}$$
(14)

Model application and comparison

To apply the model, proper assumptions have been made, considering both the product and process characteristics.

Regarding the product characteristics, we defined the following assumptions:

  • components’ size is defined on the basis of small parts that can be manipulated with hands;

  • tasks layout are typically arranged in a grid to have a uniform distribution and to avoid the introduction of other variables;

  • the number of tasks is defined in order to be compatible with the proposed layout and safety distance.

Regarding the process characteristics, we defined:

  • tasks precedence are not considered (completely parallel tasks). This is done in order not to introduce other variables, since the level of tasks parallelization influences the performance (Boschetti et al., 2021b);

  • the operator’s hands speed is calculated from DeGoede et al. (2001);

  • time for assembly tasks for both resources is obtained from Faccio et al. (2019);

  • cobot speed decrement \(f_s\), and so cobot time increment, has been defined considering the ratio between \(v_r=0.25\ m/s\) (usually considered as a collaborative speed (Faccio et al., 2020)) and the maximum collaborative speed \(v_c = 0.32\ m/s\) obtained from Eqs. (13) and  (14), with \(E=0.49\ J\), \(\beta = 0.6\ kg\) and \(v_h = 1.6 \ m/s\) as in [2];

  • the minimum safety distance between the resource is set to \(d_s = 80\ cm\) because of Eq. (12), using \(T_{s,max} = 1.2\ s\), typical (worst) stop time for a collaborative robot, \(T_r = 0.1\ s\), a typical refresh rate of a vision system with a safety parameter \(\nu =1.1\). This value is acceptable since it is comparable to the reach of a commercial collaborative cobot in normal conditions of use.

These values are reported in Table 2, for better understanding.

Table 2 Process characteristics values for the case study

The following output parameters are considered:

  • makespan ms, i.e. the total time required to complete all the tasks of the assembly process;

  • collaboration index \(c\%\), whose formulation has been adopted from Boschetti et al. (2021b), i.e. the shared time \(T_{coll}\) normalized with respect to the total assembly time ms:

    $$\begin{aligned} c_{\%}=\frac{T_{coll}}{ms} \quad [0,1] \end{aligned}$$
    (15)
Table 3 Tasks time and position

Comparison between the models without and with safety constraint: a case study

This section compares the models without and with the safety constraint. The first one does not change cobot speed according to the operator position, hence, the cobot speed is set to a minimum collaborative value to ensure the operator safety. On the other hand, the second one introduces the safety constraint based on the minimum safety distance (Eq. 12), so the cobot can work faster when it is far from the operator. Both models do not consider the precedence constraint.

Starting from the parameters previously described, \(J=12\) tasks are considered, with a grid layout and for each one the time required by the operator and the time required by the robot are considered. The values are shown in Table 3.

Fig. 1
figure 1

Task allocation without safety constraint

Fig. 2
figure 2

Task allocation with safety constraint

To solve the problem, we adopted the Solving Constraint Integer Programs (SCIP) framework in the MATLAB (Mathworks) environment. We adopted this framework since it is one of the fastest non-commercial solvers for mixed integer programming (MIP); indeed, it was possible to solve each simulation in about 2 minutes.

The task allocations obtained from both models are shown in Figs. 1 and  2.

Figures 1a and 2a represent tasks assigned to the operator, “OP” with an orange bar and those assigned to the robot with a green bar, “R” along with the amount of collaboration “C” represented by a blue bar. In both figures, red areas represent the tasks that do not allow keeping a safe distance as they are performed simultaneously despite their proximity. Figures 1b and 2b represent the positions of the tasks the resources have to perform, in particular, orange squares are operator’s tasks while blue circles are cobot tasks. In both the figures, the tasks performed simultaneously that do not allow to keep a safe distance, are circled in red.

It can be seen that the makespan ms is smaller with the new model by about 15%, which is achieved by rising the cobot speed when the safety distance is ensured, in accordance to the standards. On the other hand, the traditional model needs to reduce the cobot speed to ensure the safety requirements at all times. In this way, Figures 1, 2 and 3 show that the time in which the resources are below the safety distance is decreased, i.e, the cobot works at the faster speed for more time, so the total time required to do all the tasks is lower. It is important to specify that this method does not reduce the number of occurrences of two near tasks but the total time where the distance between the resources is lower than \(d_s\). From Fig. 3, in fact, it is possible to see that with the safety constraint the time in which the two resources are below the safety distance, decreases from \(19\ min\) to \(6\ min\), that means that it goes from being the 50% of the makespan, to being the 18% of it, i.e. a reduction of 32% was obtained.

In order to generalize this case, several analysis have been carried out where the times of the tasks have been varied, both for the operator and for the robot. The results are shown in Fig. 4, where on the \(x-\)axis is reported an average time of the tasks, while on the \(y-\)axis the makespan ms, showing a decrease in the makespan regardless of the mean task times.

Influence of the number of tasks

In this section, the influence of the number of tasks on the makespan ms and on the collaboration index \(c_\%\) is investigated. The tests are done keeping all the other parameters constant, i.e., \(d_s = 80 \ cm\), \(f_s = 0.28\), whereas only the number of tasks has changed from \(J=9\) to \(J=20\). A number of tasks greater than this value was not considered due to the computational time with the solver used. Indeed, for \(J < 12\) the average computation time was less than \(60\ s\), for \(13< J < 17\) was about \(120\ s\), and for J defined between 18 and 20 it was necessary to increase the time limit to 3 minutes. However, for \(J>20\) it is suggested to solve the model through the use of a heuristic algorithm since the solver was not able to find any solution in a limited amount of time.

The results are shown in Fig. 5 for makespan performance and in Fig. 6 for the percentage of collaboration.

Fig. 3
figure 3

Time where the resources are below and over the safety distance

Fig. 4
figure 4

Makespan performance as a function of average tasks time

Fig. 5
figure 5

Effect of the number of tasks on makespan ms

Figure 5 shows a comparison between the two models, with a significant decrease in ms with the new one. From the obtained data, an interpolation is made: the data has been fitted with different curves, like power with two terms, spline, or sum of sine but the best one is 2-nd degree polynomial form, with a bisquare robustness. These curves show that as the number of tasks increases the difference in makespan between the two models is increasing, from \(3\%\) with \(J=9\) to almost \(18\%\) with \(J=20\).

Figure 6 shows the influence of the number of tasks on \(c\%\), where the proposed method provides better result, improving the collaboration between the two resources. Similarly to the ms, also here the best fitting model is a 2-nd degree polynomial form with bisquare robustness.

Fig. 6
figure 6

Effect of the number of tasks on the collaboration index \(c\%\)

Influence of the minimum safety distance

Similarly, the safety distance \(d_s\) influences ms. Hence, the model is tested changing the safety distance from \(d_s = 10 \ cm\) (totally unsafe) to \(d_s=150 \ cm\) (includes all the tasks positions). In this analysis only the safety distance has been varied (and so the robot speed since they are related as described above), while the other parameters are kept constant, using the ones defined in Table 2 and in Table 3

Fig. 7
figure 7

Effect of the minimum safety distance \(d_s\) on makespan ms

As it is possible to see in Fig. 7, the method with the safety constraint ensures a smaller makespan, about \(20\%\) less, than the other. This happens as long as the safety distance is less than the distance between the workstations of the tasks, evaluated through the average distance \(D_{\text {mean}}\) between them. As we can see from the interpolated data, obtained with smoothing spline, when the safety distance is above \(D_{\text {mean}}\), the constraint on the safety distance no longer holds and the model tends not to assign tasks to one resource in order to respect it, effectively increasing the makespan. In addition, it is possible to see that ms is strongly related to ds, since less this value is, smaller is ms because also the cobot speed is affected by \(d_s\). Increasingly reducing \(d_s\), an higher speed can be kept for more time.

Starting from this, it is possible to analyse which is the optimal safety distance, in order to have the maximum decrement of the makespan. To do that, the difference \(\varDelta _{ms}\) between ms without safety constraint and ms with the safety constraint, that is here called \(ms_s\), can be investigated, Eq. 16

$$\begin{aligned} \varDelta _{ms} = ms-ms_s \end{aligned}$$
(16)

Its trend is shown in Fig. 8 where, from the interpolated data (with \(R^2\simeq 0.91\)), it is possible to see that the maximum difference is with \(d_s^*\simeq 60\ cm\). This can have high practical implication because \(d_s\) is function of the cobot speed, meaning that it is possible to choose the optimal speed to have the maximum decrement of the makespan.

Fig. 8
figure 8

\(\varDelta _{ms}\) trend as function of \(d_s\), with \(d_s^*\)

Overall results

The overall result is presented in Fig. 9, where the influence of both the number of tasks and the minimum safety distance \(d_s\) is shown. In particular x-axis represents the number of tasks, y-axis represents \(d_s\) and z-axis represents ms for both models. This figure is obtained with the same 2-nd degree polynomial interpolation as before.

Fig. 9
figure 9

Effect of the number of tasks and \(d_s\) on ms

From this figure it is possible to derive the Fig. 10, where the axis and the interpolation are the same as Fig. 9. It represents the difference between ms obtained without the safety constraint minus ms obtained with it.

Fig. 10
figure 10

Surface plot from data interpolation of the difference between ms obtained without and with safety constraint

The results show that these dimensions have to be taken into account in the design of the task allocation in order to improve the system performance. Moreover, since it is possible to observe a steeper slope along the number of tasks, it is possible to presume a greater influence of this parameter on the total time required.

Conclusion

Task allocation and safety problems are two of the biggest issues in collaborative robotics since there are typically two resources, i.e., the operator and the cobot, that have to interact to achieve high performance but at the same time, the workspace has to ensure a proper level of safety.

However, the models proposed so far, have focused more on one of the aforementioned issues and, consequently, highlighted a trade-off between productivity and safety, unless introducing additional devices.

As a result of this gap, a new model for collaborative assembly systems with a safety constraint is proposed, aiming to minimize the total time required to complete all the tasks. The novelty of the proposed model is that it takes into account the distance between the resources and it modulates the speed of the cobot accordingly. Thus, it is allowed to keep higher speeds, although collaborative, for longer, since this model, thanks to the safety constraint, maximizes the time in which the resources are sufficiently far, i.e. above the safety distance. This has led to a decrease in the makespan, up to almost \(18\%\), since the task allocation developed reduces the time during which the two resources are below the safe distance. Moreover, evaluating the effect that different safety distances have on the makespan, it is possible to identify the one that allows to have the maximum decrement of ms with respect to the value obtained without the safety constraint and so to choose optimal cobot speed.

The proposed method did not consider stochastic times and precedence in order not to limit the space of solutions but they will be developed in future investigations. Hence, in the next development of this model, time variability will be introduced. This is due to the fact that operators can spend a variable amount of time performing tasks, thus, a certain degree of uncertainty may arise. Another future search can involve the introduction of a precedence diagram for all those products that have a specific assembly process and, finally, a dynamic task allocation with real-time control of the cobot will be developed to adapt its position to the operator’s one and to ensure maximum productivity at the same time.