*2.2. Approach*

In this paper, an agent-based approach is proposed, whereby di fferent agents undertake the role of representing diverse stakeholders and resources in the process of designing and manufacturing a product utilising AM technology. Design Agents, in the form of desktop software applications, represent product design engineers and their role is to automate the process of identifying and then submitting the technical specifications of a product or part, while Machine Agents represent the process engineers who would analyse the part geometry and technical specifications and would then return to the designer with information about the process cost and time performance as well as about the process configuration itself. Both Design and Machine Agents are in essence software modules that may potentially replace human operators in a series of activities related to the negotiation and handling of 3D printing orders as well as to the selection of a suitable machine and process configuration. The Design Agent may, in the end, select the AM service provider (represented by a Machine Software Agent) who would make the best o ffer, considering cost, time, and process criteria. The proposed approach allows Machine Agents to communicate with specific CAM systems that correspond to each 3D printer they represent. These CAM systems are typically associated with a number of process profiles that contain special parameters values for di fferent combinations of materials, process accuracy, part density, and support options. In this paper, the Fused Deposition Modelling (FDM) AM processes have been modelled, but other AM technologies, such as Powder Bed Fusion or Direct Energy Deposition, could also be modelled, taking advantage of the same platform and design principles. Each Machine Agent may choose from a multitude of process configuration profiles. Specifically, each AM process profile associated with a specific AM machine and its CAM software contains the following information:


Each of these profiles corresponds to a specific combination of material, support option, part density, and quality. The standard and most accurate way to check the print feasibility of a part, for a specific AM machine, is to simulate the execution of its G-code, that is generated by a CAM software programmed for that AM machine. This simulation could provide useful information, such as material usage, cost, and build times. It is assumed that the CAM software utilises the latest firmware update for the 3D printer, as well as the most updated information pertaining to the availability of the machines. This information is typically not known to the organisation that wishes to place an order for their parts. It can become quite challenging for a design engineer working for that organisation to explore possible combinations of available equipment, suitable material, process configurations, and service providers [60]. The proposed platform (Figure 3) is based on the Java Agent Development Framework (JADE) [61]. Design Agents are software modules representing design engineers and provide engineers with a Graphical User Interface for specifying the CAD file of the part and its technical specifications, including support options, materials that could be used, the minimum density, the maximum layer thickness (minimum 3D printing accuracy), quantity, and the order due date. One of the main reasons why an agent-based approach was selected is that this way it is easier to distribute the overall computational load to all Machine Agents that are available. Since the proposed approach is in principle simulation-based, the overall computational time required for simulating the 3d printing process for a wide range of machines would be quite long. Instead, by using agents, the

designer will only have to wait for as long as it is required for the slowest Machine Agent to return its process alternatives. At the same time, the interaction of each agen<sup>t</sup> with operators and other IT systems could also be done independently, i.e., each Agent may be interfaced to a different MES or CAM platform.

**Figure 3.** Agent-based platform.

A part geometry analysis tool has been developed and integrated with a commercial CAD platform for launching the Design Agent and for automatically passing to it basic design information, such as the CAD file and the maximum external dimensions and the minimum wall thickness of the part. The designer may edit these values, especially in cases where the geometry of the parts is complex and the calculation of the values of certain features, such as the wall thickness, is not straightforward.

Each platform (belonging, for instance, to a particular manufacturing OEM) will have to host the main container and can have as many other containers (each one belonging, for instance, to a particular AM service provider) as needed. Different platforms may also be connected, which in principle would allow different networks of service providers to be connected. An Agent Management System (AMS) is also part of the platform, providing an assigning service. The Directory Facilitator (DF) provides a Yellow Pages service, allowing agents to find other agents that are also part of the proposed JADE framework.

The sequence of steps followed, and the information contained in the messages exchanged among the Design and Machine Agents and the platform components, including the CAM software and the MES are depicted in the UML sequence diagram of Figure 4. The list below provides more details about each of these steps:


by the Designer, including the link to the repository containing the CAD file, while asking for a bid.


**Figure 4.** UML Sequence diagram showing the interaction among agents and platform components.

A simplified example of the overall information exchange and alternatives generation process is presented in Figure 5. The Designer submits a part design together with the associated technical specifications to the Design Agent, which are then sent, as part of a 'MessageA' type message, to 2 Machine Agents, representing two 3D printers. Each Machine Agent generates all alternatives that satisfy the technical specifications and then invoke their corresponding CAM tool, providing as input the process parameters for each alternative and the CAD file. As soon as the CAM process simulation (G-code generation) is completed, the output of the simulation together with planning information from the MES are used for calculating the performance indicators for each alternative. This information is sent back to the Design Agent as part of a 'MessageB' type message. The Design Agent ranks all received alternatives, by calculating the utility of each one of them after considering the relative importance of all decision criteria, using the Simple Additive Weighting method, and presents the best ones to the designer.

**Figure 5.** Example of the information exchange process.

#### *2.3. Software Design and Implementation*

The main components of the proposed platform are the Design and the Machine Agents both implemented in the 'DesignAgent' and 'MachineAgent' classes, respectively (Figure 6). Both components are implemented in Java, inheriting the initialisation, lifecycle, and communication functions from the JADE core Agent class. Each Agent has its own settings, such as the location of the Agents' facilities, the decision criteria weights for the Design Agent and the process profiles and cost parameters for the Machine Agent. The information sent from the Design Agent to Machine Agents is contained in a 'MessageA' object, while all alternatives generated by each Machine Agent and sent back to the Design Agent are part of a 'MessageB' object.

Each Agent can be instantiated in a computer that has a Java Runtime Environment. The platform has been tested and used in networked environments with multiple nodes (computers). A special interface has been built, allowing a commercial CAD system to launch a Design Agent.

**Figure 6.** UML Class diagram of main platform components.

#### *2.4. Cost Function*

Significant consideration must be given while assessing the cost function for an AM process. The selection criteria of an AM technology largely depend on machines, location, materials, post-processing operations, and many other factors that are deployed in an AM production line. This must also be considered while deriving a cost function for an AM technology. This will determine the most viable AM technology to build a product. The calculation of a cost function will vary significantly in different AM technologies that are currently available in the market. This is because, depending on the AM technology deployed, the values of these factors will vary. For example, the cost factors of a material extrusion process are different when compared with the ones associated with a powder bed fusion process. This could be in the form of energy consumption, labour, overheads, materials cost, capital investment for an AM machine, support volume generated for a build, which in particular can affect the material cost depending on the chosen orientation, or it could be in the form of necessary post-processing operations required for a finished product.

The cost per order is calculated by each Machine Agent for every machine and process profile by considering process material and time requirements as well as shipping cost elements [62,63]. Equation (1) shows a generic cost function used for estimating the overall cost. This equation is derived based on existing techno-economical models used for conventional manufacturing processes [63].

$$C\_{\rm s\mathcal{E}} = Q\_{\rm \cdot} \left[ A\_{\rm s\mathcal{E}} \cdot \left[ 1 \text{-} d(Q\_{\prime} \mathcal{W}\_{\rm \mathcal{K}}) \right] \cdot T\_{\rm \mathcal{K}} + M\_{\rm \mathcal{K}} \cdot \left[ \mathcal{W}\_{\rm \mathcal{K}} + P\_{\rm \mathcal{K}} + K\_{\rm \mathcal{K}} \cdot \mathcal{W}\_{\rm \mathcal{K}} \cdot D\_{\rm \mathcal{S}} \right] + F \cdot \left[ 1 - d(Q\_{\prime} \mathcal{W}\_{\rm \mathcal{K}}) \right] \right] \tag{1}$$

where:


Since the cost function is generic enough so that it can be applied across multiple machine profiles and configurations irrespective of the AM technology or machine used, machine and build plate utilisation were assumed to be at their maximum of 100%. Furthermore, the costs regarding labour or energy consumption would be categorized under the cost rate (*Asc*). Fixed cost (*F*) includes overheads and the initial cost of the machines and infrastructure required for the production facility.

## **3. Test Cases**

The test cases in this paper were devised for validating the proposed approach, utilising the latest stable version of a platform, which is being used by researchers of the I-Form Advanced Manufacturing Research Centre for designing and planning 3D printing experiments. Part of these experiments are conducted in cooperation with the industry. The cases are related to an injection moulding company in Ireland that wishes to produce several prototype plastic parts for allowing their client (OEM) and their sales representatives to review the part before committing to the final design that will lead to the development of the mould, which is an expensive process. It is assumed that six different service providers are available in five European countries, using three different types of FDM 3D printers.

#### *3.1. Test Case 1*

In the first test case, a relatively simple part was selected, where lower layer thickness, cost, and tardiness are favoured. The criteria weights for evaluating the alternative process configurations from all six service providers were: layer thickness (40%), density (0%), tardiness (30%), and cost (30%). The materials to be considered were Polylactic Acid (PLA) and Acrylonitrile Butadiene Styrene (ABS). Once the product design is completed, a design engineer has the option to use the part geometry analysis tool, which will automatically convert the native CAD file to an STL file and will calculate the external dimensions of the part (Figure 7). Then it will launch the Design Agent (Figure 8). For all 3D printers, the Prusa Slicer CAM tool [18] was interfaced with the corresponding Machine Agents for generating the G-code, while plain text files were used for representing the information related to the machines' availability as stored in standard MES platforms. The process profiles that are available for each machine correspond to 3 different layer thicknesses, i.e., 0.05 mm, 0.15 mm, and 0.30 mm, 2 materials (PLA, ABS), 4 infill densities (0%, 20%, 50%, 70%), and 3 support options. The overall number of profiles is therefore 72 per machine. More process configuration profiles could be prepared and used but for illustration purposes, the number of profiles in this paper was limited to 72. In this case, as per the user's layer thickness, density and material requirements, 2 layer thicknesses (0.05 mm, 0.15 mm), 2 materials (ABS, PLA), 2 infill densities (50%, 70%), and 1 support option were tested. The overall number of combinations is therefore 8, which is equal to the total number of profiles tested and simulated per agen<sup>t</sup> and machine. Figure 9 presents the least and most expensive process alternatives, as well as the one that was selected as the best.


**Figure 7.** Test Case 1—Part geometry analysis tool integrated with a commercial Computer-Aided Design (CAD) system.


**Figure 8.** Test Case 1—Design Agent Graphical User Interface (GUI) with technical data and information from Machine Agents.

For the test case 1, agen<sup>t</sup> MA6 provided the least expensive configuration. However, due to its lower degree of availability, this alternative was not the one selected. MA4 provided the best-balanced configuration, exhibiting low cost and tardiness. The most expensive process configuration was provided by agen<sup>t</sup> MA2, since the AM service provider the agen<sup>t</sup> represents is the most expensive one and this particular configuration is related to the lowest possible layer thickness and the highest infill density, leading also to very high tardiness.

**Figure 9.** Test Case 1—Cost and tardiness of different configurations.

#### *3.2. Test Case 2*

In the second test case, a more complex part was selected (Figure 10). The company would prefer a part with a higher infill density, while cost would not be as important as density, delivery date, and layer thickness. The criteria weights for evaluating the alternative process configurations from all six service providers were: layer thickness (20%), density (50%), tardiness (20%), and cost (10%). The materials to be considered were PLA and ABS. All cost parameters and machines' availability have been assumed to be the same as in test case 1. The parameters used for launching the Design Agent and the information received from the Machine Agents are shown in Figure 11.

**Figure 10.** Test Case 2—Part geometry analysis tool integrated with a commercial CAD system.


**Figure 11.** Test Case 2—Design Agent GUI with technical data and information from Machine Agents.

The best and least expensive alternatives were generated by Agent MA6 (Figure 12).

**Figure 12.** Test Case 2—Cost and tardiness of different configurations.

The best alternative, in particular, is a balanced solution, where a profile with the highest density and medium layer thickness was chosen so that cost and tardiness could be kept at low levels. The most expensive alternative was produced by Agent MA2, whose cost rates are the highest among the six AM service providers.

#### *3.3. Cases Results Comparison and Simulation Validation*

The results obtained from the two cases are summarised in Table 1. The 30% higher volume of the part corresponding to test case 2, together with the fact that a higher density was selected led to higher process times (and therefore tardiness) and cost.



For the validation of the test cases, two alternatives were chosen: the best alternative of test case 1 and a randomly selected alternative generated for test case 2. The corresponding parts were printed, using the process parameters suggested by the corresponding Machine Agents in the same 3D printer type, which is associated with these agents. The process time and the weight of the parts were measured. The variations observed from the values simulated versus actual part build time and weight are summarised in Table 2:

**Table 2.** Observations from the test cases for time and weight of the build.


The differences between simulated and actual process times and part weights are:


Assuming that a 95% accuracy is expected from the simulation process, these variations are well within range. The printed parts are shown in Figure 13.

(**a**) (**b**)

**Figure 13.** Builds for test cases 1 (**a**) and 2 **(b**).
