Multi-AGV Flexible Manufacturing Cell Scheduling Considering Charging

: Because of their ﬂexibility, controllability and convenience, Automated Guided Vehicles (AGV) have gradually gained popularity in intelligent manufacturing because to their adaptability, controllability, and simplicity. We examine the relationship between AGV scheduling tasks, charging thresholds, and power consumption, in order to address the issue of how AGV charging affects the scheduling of ﬂexible manufacturing units with multiple AGVs. Aiming to promote AGVs load balance and reduce AGV charging times while meeting customer demands, we establish a scheduling model with the objective of minimizing the maximum completion time based on process sequence limitations, processing time restrictions, and workpiece transportation constraints. In accordance with the model’s characteristics, we code the machine, workpiece, and AGV independently, solve the model using a genetic algorithm, adjust the crossover mutation operator, and incorporate an elite retention strategy to the population initialization process to improve genetic diversity. Calculation examples are used to examine the marginal utility of the number of AGVs and electricity and validate the efﬁciency and viability of the scheduling model. The results show that the AVGs are effectively scheduled to complete transportation tasks and reduce the charging wait time. The multi-AGV ﬂexible manufacturing cell scheduling can also help decision makers to seek AGVs load balance by simulation, reduce the charging times, and decrease the ﬁnal completion time of manufacturing unit. In addition, AGV utilization can be maximized when the ﬂeet size of AGV is 20%-40% of the number of workpieces.


Introduction
An AGV is a transport vehicle that can navigate autonomously and carry out spontaneous or controlled transportation along a prescribed route [1]. It assists intelligent factories to realize workpiece production tasks under the condition of unmanned driving. In order to efficiently use AGVs to participate in intelligent operations, it is necessary to integrate information such as processes, equipment, and workpieces into workshop scheduling. This kind of scheduling is actually the Flexible Job-Shop Scheduling Problem (FJSP) that has evolved from the traditional Job-Shop Scheduling (JSP). There is an exceptionally rich domain of research that covers many aspects of AGV scheduling and proposes numerous approaches. The majority of interest in AGV scheduling stems from its potential impact in practice by increasing efficiency and lowering costs. However, due to its complexity and numerous features, it remains a challenging problem [2]. The literature review and discussion in this paper are limited to the number of available AGVs, the power threshold, and the charging time in AGV and machine task scheduling issues with single or multiple objectives AGVs. The scheduling optimization problem of AGVs is the primary focus of related research. Fu et al. [3] elaborated the analysis process, scheduling rules and optimization methods for the AGV scheduling optimization problem. Bilge and Ulusoy [4] proposed a pseudo-polynomial-time algorithm to obtain optimal machine and vehicle schedules. Abdelmaguid et al. [5] studied a hybrid genetic algorithm approach to schedule the machines and used a heuristic technique to obtain a vehicle assignment. The authors addressed the operations scheduling and provided the vehicle assigning heuristic with a starting time for each operation, as well as its predecessor operation in the job sequence. Zhang et al. [6] proposed a mixed integer linear programming model for the joint production and transportation scheduling in flexible manufacturing system (FMS) without considering the transportation tasks associated with each job from the lower and upper area to the machine. Fontes and Homayouni [7] established a new mixed integer linear programming model to solve the joint production transportation scheduling problem, which integrated the machine scheduling problem and the AGV scheduling problem, and used two sets of chain decision strategies (machine and AGV). Using the hybrid taboo bat algorithm, Yonglai et al. [8] carried out in-depth analysis on AGV material distribution scheduling and provided an effective solution for workshop material distribution scheduling by multiple AGVs under certain constraints. In addition, Liu et al. [9] also adopted the improved pollen algorithm to study the co-integration AGV manufacturing unit scheduling problem. Regarding the average delay in flexible manufacturing units with AGVs, Heger [10,11] studied the dynamic priority assignment rules of AGVs using sorting and routing rules. Xu and Guo [12] discussed the multi-objective and multi-dimensional green scheduling method of FMS with AGV by means of the evolutionary algorithm of segmented coding, and Zhang et al. [13] studied the AGV allocation problem for mixed-flow assembly lines considering the load capacity of AGVs. Umar et al. [14] considered the path conflict problem of AGV during transportation, and solved the problem with an improved genetic algorithm, but the algorithm has a long running time and low efficiency. Mousavi et al. [15] compared the genetic algorithm with the particle swarm algorithm that combined the multi-objective AGV scheduling in order to solve the proposed model in the flexible manufacturing system, which was different from the conventional intelligent algorithm Nouri et al. [16] proposed; a hybrid meta-heuristic algorithm based on the clustering multi-agent model, which simultaneously scheduled the machines and AGVs, treated AGVs as special machines for coding. Zhang et al. [17] proposed a two-stage solution approach and a particle sworn optimization method to solve an energy-efficient path planning model of a single-load AGV. The authors analyzed the AGV energy consumption characteristics by motion state and vehicle structure, where it was found that energy consumption was an independent optimization objective in AGV path planning.
The above research has effectively advanced the exploration of AGVs' participation in intelligent job scheduling. However, there are relatively few studies on the AGV charging problem in the workshop scheduling problem in the existing literature, and only a few experts and scholars have discussed the related issues. A typical example was given by Dehnavi et al. [18], who studied the optimization problem of AGV charging station location in manufacturing units through GAMES simulation. Zhengfeng and Yangyang [19] studied the job-shop workshop scheduling problem under the consideration of multiple charging AGVs. Wang et al. [20] studied an AGV scheduling method that integrated AGV energy consumption and workshop complexity. However, this type of research adopted the AGV to perform a task and then returned immediately, and did not perform the task continuously. This was not in line with the reality that the AGV could continue to perform transportation multiple times after being charged that directly affected the determination of the number and scale of AGVs in the workshop, their work efficiency, and its evaluation. Fazlollahtabar and Saidi-Mehrabad [21] examined literature related to different methodologies to optimize AGV systems for the problems of scheduling and routing at manufacturing, distribution, trans-shipment, and transportation systems. The authors categorized the methodologies into simulation studies, metaheuristic techniques, artificial intelligent, exact, and heuristics mathematical methods. Further, De Ryck et al. [22] overviewed a number of AGV-related control algorithms and techniques that were employed in not only the early stages of AGVs, but also the algorithms and techniques used in the most recent AGV-systems, as well as the algorithms and techniques with high potential.
Extant literature shows that experts and scholars have fully realized the significant role played by intelligent robots in the manufacturing industry, and have carried out research on the scheduling problem of flexible manufacturing cells with AGVs. The model realizes the solution to the problem and optimizes the scheduling optimization objective. However, the charging ability and continuous working ability of AGVs are rarely addressed in the model in literature. In particular, most of the existing literature assumes that the charging process is completed immediately and there is no waiting. Moreover, the selection of AGVs to transport workpieces is based purely on the customer's demand for completion time without regard to AGV priority, resulting in load imbalance in AGVs. Therefore, the calculation result is quite different from the actual scheduling AGV result, and sometimes a part of the workpieces cannot be completed according to customer demands. The load imbalance even caused some AGVs not to undertake any transportation tasks, but some AGVs are always in the working state. Then, the core question of research is: how to schedule AGVs to balance the distribution of transportation tasks and minimize the maximum completion time, while meeting customer demands, and considering the charging process and waiting time of AGVs?
Aiming to seek the marginal utility and load balance of AGV with charging, this paper studies the allocation and handling process scheduling problems of AGVs on the basis of FJSP. The AGV comprehensively considers factors such as workpiece scheduling, transportation task scheduling, scheduling priority, and charging constraints, to build models, and we solve these through genetic algorithms and complete use of AGV capabilities to obtain optimal production efficiency. To achieve this objective, we describe the problem and its formulation in Section 2. Further, algorithm development and solutions are given in Section 3. Section 4 presents numerical experiments followed by conclusion and future remarks in Section 5.

Problem Description
Given the number of machines, workpieces, and customer demands, the multi-AGV flexible manufacturing cell scheduling model explores the optimal distribution of multiple AGVs with charging, so as to complete all the processing tasks and minimize the final completion time of the manufacturing unit. In the model, AGVs must transport workpiece to machine according to the corresponding handling procedure. The total time consumption includes not only AGV transportation time and machine processing time, but also AGV charging time and waiting time. The problem of charging multiple AGVs in FJSP can be described as: there are n workpieces to be machined in a machining cell, expressed as J = {J 1 , J 2 , J 3 , . . . , J n }, each workpiece J i (J i ∈ J) has p(p ≥ 1) different machining operations. Each operation O ij can be machined by an optional set of machines, the processing time of it is different for different operations O i (O i ∈ O) of each workpiece. The processing time of the same process varies with the change of the machine, and the processing sequence of the workpiece has been specified in the process route file in advance. Workpiece J i contains p + 1 handling procedures T ij , and the distance between each processing machine is measured by the AGV travel time. In the course of processing, k AGV handling robots R = {R 1 , R 2 , · · ·, R k } take out the workpiece blanks from the loading station and transport the workpiece J to m different machines M = {M 1 , M 2 , · · ·, M m } for processing until the last process of the workpiece is completed, and the AGV transports the processed workpiece to the unloading station. The AGV charging method is to stay and charge at the charging station. The charging time cannot be ignored; it affects the final scheduling decision. Therefore, the charging time is taken into account in the AGV's handling time. The issues that need to be considered are the selection of the processing machine where the process is located, the sequence of each process in the machine, and the AGV allocation problem that considers charging. In order to build a multi-AGV flexible manufacturing cell scheduling model with charging, this paper introduces the symbol definitions in Table 1, and assumes the following conditions: (1) The machine follows the principle of first-come, first-served. Each machine can process only one workpiece at a time, and each AGV can transport only workpiece for one operation at a time; (2) Each machine and workpiece have the same priority except for user requirements, and the processing and AGV transport process are uninterrupted; (3) There is a workpiece buffer area next to each machine. Ignoring the workpiece congestion, the buffer capacity is unlimited; (4) Ignore the time the AGV takes to load and unload workpieces in the warehouse or machine buffer; (5) Initially, the AGV position and the initial workpiece position are located in the loading station, and the workpieces that have completed all processes are placed in the unloading station; (6) If two adjacent processes of the same workpiece are in the same machine, the AGV handling resources will not be occupied; (7) The AGV handling speed remains unchanged during transportation, is not affected by the load, and does not consider path conflicts; (8) The difference between power consumption of the AGV with or without a load is not considered, the unit power consumption is fixed; and (9) After the AGV completes the handling of a process, if the power is less than the threshold, it returns to the charging pile for charging. When the power is greater than the threshold and meets the AGV to perform the handling task, it waits for the next handling task. The following table provides symbols that satisfy assumptions and model requirements.

Symbol Description
Indicates the l-th processing machine, and the total number of processing machines is m. R r , r ∈ {1, 2, . . . , k} Indicates the r-th AGV, the total number of AGV is k.
Indicates the i-th workpiece and the time of completion, and the total number of workpiece is n.
Indicates the j-th processing operation of the i-th workpiece, and the maximum number of operations of the workpiece is p.

T ij
Indicates the j-th delivery operation by AGV of the i-th workpiece, and the maximum transportation process of the workpiece is p + 1. t ijs , t ije Machining process O ij start time and end time.
τ je Latest finish time of the j-th processing operation required by customer.

T l−ij
The processing time of the process O ij in the processing machine M l . R r−able , R r−actual Available time and actual power of the r-th AGV.

T r−pos−M ij
The time from the current position of the r-th AGV to the machine The time from the current position of the r-th AGV to loading station ∆ where workpiece for O ij is located.
The wait time of the r-th AGV at loading station ∆ for O ij .

R r−total
The actual total travel time of the AGV to complete the transportation task (load + no load).
R r−ijs , R r−ije , R r−ij AGV start time, completion time, and time consumption of the transportation process T ij . U max , U rt Maximum load of AGV, and the load of the r-th AGV at time t.
The transportation load sequences completed by the r-th AGV, and the completion time sequences of the corresponding transportation load.

E rt , E consumption
The battery power of the r-th AGV at time t, AGV energy consumption per unit time.
E max , E min Battery maximum power, the minimum power that AGV can continue to work.
There are multiple AGVs in the manufacturing unit, and they stop working when the power stored in their batteries is exhausted, they are then required to be charged again. Therefore, it is necessary to define the available time parameters of the AGVs to ensure that when the AGVs are dispatched for handling, the AGVs are in the available state, not the charging state. The driving path of the AGV can be divided into three sections: the no-load time to the task location; the waiting time when waiting for the task profile to complete the previous process; and the time for the loaded profile to go to the destination machine. The waiting time is sometimes 0. Because the calculation of AGV power consumption is based on the driving power consumption, it is necessary to define the three states of AGV driving. The sum of the above three parts is the total time R r−ij required to complete the task. In the case when waiting time is 0, there is R r−ij = R r−total .
Due to the flexibility of selecting machines for processing in FJSP, the decision variable P M l ij needs to be set. It means assigning machine M l to complete the machining work of O ij . Similarly, the handling task needs to assign one AGV from multiple AGVs to perform the task, so it is also necessary to define decision variables to specify the AGV to perform the work. The specific decision variable symbols and meanings are as follows:

Model Formulations
The multi-AGV flexible manufacturing cell scheduling considering charging problem is actually a typical Flexible Job-shop Scheduling Problem. Because of the continuity of the system, it is not suitable to be solved by Mixed Integer Linear Programming or Multistage Stochastic Programming. Considering the complexity of Deep Q-learning in the calculation of partial derivatives, we employed Multivariate Nonlinear Programming, so as to comprehensively describe system constraints and process status. The scheduling objective is to minimize the maximum time cost of production. The completion time of the last process of the workpiece is t ipe , then the objective function that can be expressed as: The flexible manufacturing cell scheduling constraints considering multi-AGV charging are: In the above inequalities and equations, constraint (2) represents the process sequence constraint of the same workpiece, which means that the maximum completion time of the workpiece is jointly constrained by the start processing time of the last process, the processing time, and the AGV handling time, and the AGV start handling time must be greater than the completion time of the previous process. Equation (3) represents the constraints of processing machine resources, requiring that one machine can process only one workpiece at a time, and the workpiece can be allocated to only one machine for processing. Here, Q is a positive integer that represents the elasticity of the system. Equation (4) indicates that the two machining processes on the same machine satisfy the sequence relationship. Equations (5)-(12) represent the AGV resource constraints, where Equation (5) indicates that an AGV can handle only one workpiece at a time, and Equation (6) indicates that the two handling processes completed by the same AGV satisfy the sequence relationship. Equation (7) means that a workpiece can be transported by only one AGV at a time. Equation (8) indicates that the start time of the AGV is constrained by the available time of the AGV, the time from the AGV to the processing equipment of the previous process, and the completion time of the previous process of the workpiece. Formula (9) indicates that the completion time of the AGV handling task is constrained by the time when the AGV starts to transport and the time from the current position to the processing machine. Equation (10) indicates that the actual transportation time is constrained by the available time of the AGV, the current position of the AGV, the start position of the transportation, and the completion time of the previous process. Equation (11) represents the constraint on the total transportation time of the AGV. Equation (12) represents the constraint on the actual power of the AGV and the charging time of the AGV. Equation (13) represents the priority of selecting the AGV, which is composed of two parts, one is the load size of the completed task, and the other is the current power situation. To achieve load balancing, the AGV with sufficient power and small historical load is preferentially selected to undertake transportation task. Θ is a constant for equivalent conversion. Equation (14) represents the priority of the AGV loading workpiece for O ij . The AGV with earlier completion time and arrival time, and smaller power, has a higher priority for loading workpiece and a lower wait time. Here, Ω is a constant for equivalent conversion. Equation (15) indicates the time constraint and load constraint of any processing operation required by the customer. Equation (16) indicates the power constraint on which the AGV can continue to work. Equation (17) indicates the constraint to avoid deadlocks. The AGV must exclusively serve the operation O ij in order. At the same time, only one AGV can serve one operation, and only one AGV can pick up workpiece for an operation from loading station. Equation (18) are the space sizes of all entities in the system.

Solution Algorithms
The scheduling problem of flexible manufacturing units with AGVs considering charging can be divided into three sub-problems, namely, assigning processes to machines, sequencing processes assigned to each machine, and AGV allocation for transportation tasks. Ant Colony Algorithm, Gray Wolf Algorithm, and Deep Learning Network, is applied to obtain optimal strategy, but all of these received local solutions. However, Genetic Algorithm is more inclined to global search, which can quickly retrieve all feasible solutions and prevent the convergence of local optimal solutions too fast. Thus, aiming at the above three problems, this paper introduces the elite retention strategy and uses the genetic algorithm to solve it. First, all feasible solutions are divided into three segments of chromosomes: process, machine, and the AGV, then the population is obtained after initialization, and then decoding is performed after performing crossover and mutation. Finally, the fitness value is calculated to complete the selection until it reaches the threshold of the number of iterations. The core algorithm part is as follows.

Encoding Operation
The genetic algorithm involves three segments of chromosome coding: process coding, machine coding, and AGV coding. The process code describes the sequence of the production process, and its gene length is L 1 = n ∑ i=1 (P i + 1). The machine code indicates the processing machine where the process of each workpiece is located, and the length of the gene string is L 2 = n ∑ i=1 P i . The AGV code corresponds to the task code, and the length of the gene string is the length of the AGV task code string. For example, in the code shown in Figure 1, process codes are sorted from left to right, the first number 3 represents the first process of workpiece No. 3, and the fourth number 2 represents the workpiece No. 2. The fifth number 3 of the machine code indicates that the second process of the workpiece No. 2 is processed by machine No. 3, and the tenth number 4 indicates that the unloading task is virtualized by the virtual equipment, that is, the unloading station. The fourth number of the AGV code is 1. The fourth task representing the process code, that is, the second process of workpiece No. 2, is transported by the AGV numbered 1. If the handling process is assigned to the corresponding AGV code, a sequence with process handling will be generated: (

Initialization Operation
During initialization, depending upon the requirement of minimizing the maximum completion time, the machine with the shortest processing time is selected with a probability of 0.2, and the AGV code is initialized according to the principle of uniform distribution to balance the usage efficiency of the AGV and avoid idleness. After obtaining the fitness according to the objective function, the roulette method is used to select individuals from the population of size N. The probability that individual i can be retained for the next generation is related to the fitness value f i , and the probability is In addition, considering that after a series of genetic manipulations in the parent generation, individuals with high fitness have a certain probability of being eliminated, which may lead to a decrease in the average fitness of the group. To this end, we use an elite retention strategy to ensure the top 10% of the parent population do not participate in crossover and mutation. When there are multiple optimal solutions at the same time, the overall handling time of the AGV is used as the second evaluation criterion to calculate the total running time k ∑ i=1 R r−total of the AGV. The individuals are sorted in sequence according to formula: F = F + 0.0001 × ∑ k i=1 R r−total , and the individual with the smallest AGV total running time is taken as the optimal solution. After participating in the crossover mutation, a new species population of size P excepting the elite is generated, and then 10% of the worst solutions are replaced with the optimal solution stored by the parent population to maintain the next generation of the parent population and ensure excellent genetic continuity and diversity.

Crossover Operation
The interleaving operation of the process code uses the POX method. Select all processes for a certain workpiece from the parent P1, keep the positions of all processes of the workpiece unchanged on the chromosome, and keep them separate from the child individual C1. Randomly generate the parent P2, and encode the parent individual P2. (Except for the process selected in the previous step). Fill in the blank positions of C1 in turn. Similarly, the corresponding parts of P1 and P2 are combined in order to obtain the offspring individual C2. As shown in Figure 2a, all processes of workpiece 3 in the parent P1 are randomly selected and inherited to the offspring C1, and are kept in the position in the gene string remains unchanged. Then, all the processes of the parent P2, except for workpiece 3, are sequentially filled in the remaining gene string vacancies of the offspring C1 to form a complete offspring C1. Similarly, the remaining parts of P1 and P2 can be merged. The offspring C2 is obtained. The crossover selection of machine gene strings is operated using the Multi-point Preservative Crossover (MPX) method, which is used for machine crossover for chromosome process assignment, and the process order is reserved for the offspring, as shown in Figure 2b. For the parent gene string P1 And P2, the randomly generated 0_1 sequence, exchange the genes located at positions 2, 5, 6, 8, and 12, of the chromosome, and cross to generate offspring C1 and C2, that is, 1 corresponds to the same position of the parent P1 and P2 and the rest of the positions remain unchanged. The crossover of the AGV gene string is consistent with the MPX crossover method of the machine gene string. As shown in Figure 2c, the genes at positions 3, 6, 8, 10, and 12 are exchanged.

Mutation Operation
For process code, the extended insertion mutation method is adopted, that is, a gene at a given position is randomly selected in the chromosome encoded by the process, and it is randomly inserted into another position in the chromosome under the constraint that the sequence of processes of the same workpiece is fixed. The sequence of the gene after the insertion is set back one space. As shown in Figure 2d, insert the second process of workpiece No. 3 at chromosome position 6 of parent P1 into the second process of workpiece No. 2 at chromosome position 4, the second process of workpiece 2 originally at position 4. The process needs to be moved one bit backwards. As shown in Figure 2e, the mutation operation of the machine code randomly selects one of the two machine codes, and selects the machine with the shortest processing time in the machine group. The gene at position 7 is replaced, that is, the processing machine of the first process of workpiece 3 is replaced, and the original processing machine No. 3 and processing time 5 are mutated into processing machine No. 2 and processing time 3. The AGV coding mutation operation is the same as the machine coding. For example, the AGV No. 1 at position 6 in the parent P1 chromosome is randomly selected according to the probability, and replaced by AGV No. 2, and the feasible solution progeny C1 for handling the AGV is obtained.

Fit Function and Decoding
The fitness function solved by the genetic algorithm for scheduling of multi-AGV flexible manufacturing units considering charging is f = max( 1≤i≤n C i ), the maximum completion time. The smaller the f is, the better is the individual. The decoding operation of chromosomes is actually the process of converting chromosomes into feasible solutions for scheduling, which can obtain the process profile, the machine used in the process and its processing time, the AGV trolley transported, and its handling time, etc.
Step 1: Select a process chromosome from the process and machine code in turn to judge the task type, convert it into the corresponding process O ij ; the machine M l corresponding to the process; the corresponding processing time T l−ij and the completion time t i(j−1)e of the previous process O i(j−1) in the machine.
Step 2: Obtain the transportation task sequence T ij , and the transportation start point (L or machine), end point (U or machine) and transportation time.
Step 3: Read the AGV chromosome code in sequence, obtain the AGV status information, and assign the handling tasks to the corresponding AGVs in sequence.
Step 4: Calculate the time T r−pos−M i(j−1) from the AGV to the starting point of the handling task and the time R r−ijs when the transportation starts, update time R r−ij it takes for the AGV to handle the j process of Profile i, and calculate the total transportation time R r−total , current actual power R r−actual , and available time R r−able for the AGV to perform each handling task.
Step 5: Based on the AGV status information, see whether the actual power of the AGV is less than the threshold; if it is less than the threshold, it will be charged at the loading station L, and calculate the charging time R r−ct , and then update the available time R r−able of the AGV.

Analysis of Examples
In order to verify the performance of the model and the algorithm, genetic algorithm and MATLAB programming are used to solve the FJSP 10×8 problem, FJSP 15×8 problem and FJSP 25 × 8 problem. We conduct hyper-parameter fine-tuning by GeatPy. Based on Values Exchanged Recombination and Mutation for Binary Chromosomes, the automated machine learning method is applied to obtain the optimal crossover and mutation operation probabilities. With the constructed field vector, objective vector, and fitness vector, we use the Elite Copy Selection method for fitness selection, and use the constraint violation value matrix to store the degree of individual violation constraints. After 1628 times evolution by Evolution Tracker, we acquire the parameters, as shown in Table 2. In addition, to reduce the problem scale, the maximum battery power is set to 100, the power threshold to 10, the number of charging piles to 1, the power consumption per unit time to 2, and the AGV charging rate to 6.

Analysis of Results
According to the conversion time of 1:5, that is, one unit of time represents 5 min, we input the resource list and routing list according to the customer order. The final completion time of the manufacturing unit is optimally 227.5 min, which is about 3.79 h. The specific experimental results are shown in Figure 3. The black line in the figure is the driving path of AGV No. 1, and the red line is the driving path of AGV No. 2. The maximum completion time of the 10 × 8 scale case is a minimum of 45.5. The final completion time is measured by AGV removing all the workpieces. The production planning department can determine an appropriate time for different batches of production orders and draw actual schedules according to the scheduling plan. In the 10 × 8 calculation example, the two AGVs did not reach the power threshold, so the charging state wherein the AGV cannot be used does not appear in the Gantt chart. However, after the AGV completes the previous task and the handling time is greater than 90 units of time, it will fall below the power threshold and shall need to stop work for charging. In the case of 15 × 8 scale, the two AGVs reached the power threshold once and in the case of 20 × 8 scale, the two AGVs reached the power threshold twice. In both cases, the charging wait time is 0 and all transportation tasks are completed. However, in the 25 × 8 scale case, the charging wait time is 6 with all tasks completed. AGV1 reached the power threshold three times, and AGV2 reached the power threshold twice in this case. It means that the AGVs need to be recharged five times in total, which takes 438.06 units of time. Here, the current powers of AGVs when they go to charge are 11.25, 12.08, 12.67, 12.90, and 13.04, respectively. Although the current powers of the AGVs are higher than the minimum power E min , they have to be charged because they cannot complete a single transportation task. Obviously, the larger the number of transportation tasks for workpieces, the more AGV charging times, and the longer the waiting time. From the perspective of AGV load, AGV1 and AGV2 each completed 17 transportation tasks in the case 10 × 8 scale, that is, the load balance ratio reaches the optimal state of value of 0. The load balance ratio is defined as (Ψ max − Ψ min )/Ψ avg . Here, Ψ max , Ψ min and Ψ avg are the maximum, minimum, and average number of tasks completed by AGVs. As for the cases of 15 × 8 scale, 20 × 8 scale, and 25 × 8 scale, the load balance ratios are all less than 0.100, which are 0.074, 0.057, and 0.071, respectively. This shows that our model can effectively avoid AGV resource waste while meeting customer demands. In general, the final completion time of manufacturing unit increases with the size of the problem. As shown in Table 3, when the number of AGVs is sufficient, the completion time grows in proportion to the problem scale. On average, for every 10 additional customer demands, the completion time increases by no more than 40 according to calculation examples. In contrast, if the number of AGVs is too small, the completion time will increase extremely with problem scale, and even some demands cannot be accomplished on time, as shown in the data marked with "*" in Table 3. Only if the AGVs exceeds 4 can all the problems of different scales from 20 × 8 to 100 × 8 be solved. Obviously, increasing the number of AGVs will improve the ability to solve problems. As the amount of AGVs increases exponentially, the completion time first decreases rapidly and then becomes stable. For example, in the case of 80 × 8 scale problem, when the number of AGVs is doubled from 1 to 32 successively, the completion time is improved by 128.57, 85.46, 50.07, 24.45, and 21.49, respectively. This shows that blindly increasing AGVs cannot significantly improve the scheduling effect, but will cause part of the AGVs to be idle. It can be found that when the number of AGVs exceeds 1/5 of the scale of workpieces, the improvement space of completion time is very small. In this case, each additional AGV reduces the completion time by a maximum of 3.17 unites. In order to obtain a more reasonable AGV fleet size, the marginal utility of the AGV is discussed in Section 4.2.

AGV Marginal Utility
The number of AGVs is closely related to transportation allocation, and it also has a greater impact on optimization goals. Usually, the AGV is subject to transportation constraints and a dedicated AGV is equipped for various workpieces, but it may increase the cost of the enterprise. In order to deeply study the marginal utility of AGVs, this paper selects 10 × 8 examples, takes different numbers of AGVs, and calculates the data 10 times. The results are shown in Table 4. When its number is about 20% of the number of workpieces, the optimization effect is prominent and appears as an inflection point. On the contrary, the optimization effect gradually decreases. The reason for the inflection point is that when the AGV input is less than 20% of the number of workpieces, the turnover between the AGV and workpiece is complicated, and the AGV needs more. It takes at least 15 units of time to charge during the next shutdown. It can be seen that AGV transportation and charging greatly affects production efficiency. When the number of AGVs is greater than 80% of the number of workpieces, although a better solution is achieved, the optimal performance remains unchanged and the economic cost increases. Enterprises can assign AGVs according to the economic situation of the workshop and planning of the completion time. As shown in Tables 3 and 4, when the number of AGVs is greater than 2/5 of the number of workpieces, the marginal utility by increasing the AGV is less than 2.5. It means that when the AGV is 40% of the workpieces, the optimal schedule is almost reached and it is uneconomical to increase the number of AGVs again. Thus, according to the results of different scales and considering the fixed cost of AGVs, it is recommended that the number of AGVs should account for 20-40% of the scale of the workpieces, and the marginal utility is the most reasonable.

AGV Load and Charging
In order to verify the optimization of our model on the charging process and load balance, we conducted experiments in the case of 100 × 8 scale. The rapid increase in the scale of the problem makes it difficult to complete all transportation tasks when AGVs are insufficient. As shown in Table 5, while the number of AGVs is 1 and 2, respectively, 4 customer demands and 3 customer demands are uncompleted on time. Until the AGV exceeds 4, all the workpiece transportation tasks can be effectively completed. Thereafter, as the number of AGVs increases, the total charging times decreases almost exponentially and the waiting time drops sharply. When all transportation tasks are completed, the average wait time remains between 4 and 6. This indicates that the AVGs are effectively scheduled to accomplish all tasks, while maximizing the reduction of charging times and charging wait time. Especially when the AGVs exceeds 8, the charging times tend to be flat, and the utility brought by increasing AGV is not obvious. From the perspective of the AGV load, the load balance ratio is always less than 0.25, which means that the difference between the maximum and minimum load is less than 1/4 of the average load. This indicates that the loads of different AGVs are similar and tend to be balanced. In addition, the load balance ratio shows a bell-shaped trend of increasing first and then decreasing. The inflection point occurs when AGVs is 8, where the minimum load of AGVs changes by 20.7% and the maximum load of AGVs changes by only 17.3%. It means that when the charging times of AGVs do not decrease dramatically, the loads of AGVs will gradually become balanced based on scheduling priority. Furthermore, the rational load balance of AGVs is achieved when the charging times remains stable (the number of AGVs is greater than 12). That is, when considering charging, multi-AGV flexible manufacturing cell scheduling can assist decision makers to select a reasonable number of AGVs through simulation to meet the needs of all customers, reduce the charging times, and promote load balance.

Conclusions
AGVs are powered by batteries, they move along the planned path, and have automatic guidance equipment such as magnetic strips, rails, or lasers, which can assist the workshop to complete a series of transportation tasks, providing a strong support for intelligent manufacturing enterprises to reduce the time consumption of the production process. Considering the influence of the available number of AGVs, the power threshold, and the charging time in the workshop scheduling, we adopted minimization of the maximum completion time as the optimization objective, and have constructed a multi-AGV flexible manufacturing unit scheduling model considering charging. The genetic algorithm was used to solve the problem, and the optimized process arrangement, the AGV driving path, and the scheduling plan after the AGV reached the power threshold were obtained, which further confirmed the impact of AGV transportation and charging on production efficiency. Compared with the models given in the literature [18,19], our model more comprehensively considers the charging time and charging waiting. The AGV scheduling priority is also designed to drive AGV load balance. The AGV with earlier completion time, arrival time, and smaller power, has a higher priority for loading workpiece and a lower wait time. To achieve load balancing, the AGV with sufficient power and a small historical load is preferentially selected to undertake the transportation task. After analyzing the marginal utility of the AGV under different problem scales, the results shows that the AGVs are effectively scheduled to complete transportation tasks, while reducing the charging times and charging wait time. It is clear that AGV utilization can be maximized when the number of AGV scales is 20-40% of the number of workpieces. Furthermore, the scheduling model of multi-AGV flexible manufacturing cell when considering charging can help decision makers minimize the maximum completion time by simulation, and seek load balance, while meeting customer demands. The limitations of the model research in this paper are as follows: (1) considering the complexity of research caused by diverse workpiece weights, we ignored the time-consuming differences generated by AGV loads in order to simplify model building; and (2) the objective function focuses on the final completion time cost of manufacturing unit without considering the fixed cost of the AGV. Therefore, future research can try to establish a multi-objective nonlinear programming model including time cost and fixed cost, and discuss the influence of different loads on AGV power consumption.

Data Availability Statement:
The program code and data that support the plots discussed within this paper are available from the corresponding author upon request.

Conflicts of Interest:
The authors declare no conflict of interest.