An Architecture for Hybrid Manufacturing Combining 3D Printing and CNC Machining

Additive manufacturing is one of the key technologies of the 21st century. Additive manufacturing processes are often combined with subtractive manufacturing processes to create hybrid manufacturing because it is useful for manufacturing complex parts, for example, 3D printed sensor systems. Currently, several CNC machines are required for hybrid manufacturing: one machine is required for additive manufacturing and one is required for subtractive manufacturing. Disadvantages of conventional hybrid manufacturing methods are presented. Hybrid manufacturing with one CNC machine offers many advantages. It enables manufacturing of parts with higher accuracy, less production time, and lower costs. Using the example of fused layer modeling (FLM), we present a general approach for the integration of additive manufacturing processes into a numerical control for machine tools. The resulting CNC architecture is presented and its functionality is demonstrated. Its application is beyond the scope of this paper.


Introduction
Modern machine tools are controlled by a computerized numerical control (CNC).For this reason, manufacturing processes, for example, drilling, turning, and milling, are also referred to as CNC machining when the machine tool is controlled by a CNC.The main task of the CNC is to control the relative motion of the tool and the workpiece.All these tools cut away unwanted material to manufacture a part with the desired geometry.Therefore, these processes are also referred to as subtractive manufacturing.Further subtractive manufacturing processes are reaming, threading, or laser cutting, plasma cutting, and water cutting.Because of their commonalities, some processes are contained in one machine.For example, most milling machines allow a tool change so that a drill or reamer can be used.A milling machine with an automatic tool changer and an automatic workpiece changer is called a machining center.A fourth axis offers further processes, for example, threading and turning.The machining center described could carry out many manufacturing processes.The combination of different processes in one machine facilitates more economical manufacturing because, for example, the quantity of clamping can be reduced.Furthermore, the costs of purchase and upkeep for one machine are often lower than for two [1,2].
In contrast to the subtractive manufacturing processes, additive manufacturing processes add material to manufacture parts with the desired geometries.This enables waste reduction because unwanted material will not be added.Particular process steps, such as drilling, do not have to be applied; for example, a hole is formed by not adding material in the desired position.
This paper [3] focuses on energy consumption and indicates that accurate assessment and modeling of manufacturing processes are becoming increasingly important.The case study presented shows that additive manufacturing has greater advantages than conventional manufacturing processes when the number of parts was small.In addition, additive manufacturing offers new manufacturing strategies and makes customized solutions possible, even for small quantities.Furthermore, additive manufacturing makes production on demand and production on site possible [1,2,4].All 2 International Journal of Manufacturing Engineering these properties indicate that additive manufacturing is a key technology for economical manufacturing.Depending on the additive manufacturing processes, postprocessing is required for good results.The postprocessing can be done manually or automatically by CNC machining [1,2].The processes of additive manufacturing are completely different to subtractive manufacturing processes, although they have many commonalities, which are outlined later in this paper.Additionally, [5,6] suggest that a combination of subtractive and additive manufacturing processes is recommended.
This paper describes a general approach for combining subtractive and additive manufacturing in one CNC architecture.In this paper, we will use the term hybrid manufacturing to describe the combination.In Section 2, conventional methods for hybrid manufacturing and its disadvantages are discussed.In Section 3, the fused layer modeling (FLM) process and special benefits of combining FLM with CNC machining are presented.Section 4 highlights the objective of this paper and Section 5 presents commonalities and differences between FLM and CNC machining.The approach is presented in Section 6, but its implementation is divided into several sections: Section 7 describes temperature control, Section 8 describes temperature measurement for temperature control, Section 9 describes physical computing for communication, and Section 10 describes motion control.Section 11 describes the operation principle of the resulting CNC architecture for FLM.Finally, Section 12 concludes the paper.

State of the Art
A manually organized workpiece transport is flexible but not effective: each machine requires reclamping and its own setup, which takes time and reduces the achievable accuracy [2].Therefore, a production strategy is required.

Hybrid Manufacturing with a Production Line.
A production line with machines which complement each other is illustrated in Figure 1.Machines are labeled with rectangles and processes are labeled with letters.On the one hand, the automatic workpiece transport system of the production line reduces the quantity of clamping and setup, increasing the productivity and achievable accuracy.On the other hand, the production line takes up much space and flexibility is reduced.There is no possibility of manufacturing parts which need variants of the process order.This strategy is optimal for manufacturing identical parts but not individual parts; this is a significant disadvantage because one of the main advantages of additive manufacturing is making customized solutions possible, even for small quantities [1,2,4].Therefore, another strategy is required.

Hybrid Manufacturing with a Machining
Center in a Production Line.As previously described, a machining center combines several manufacturing processes in one machine (see Figure 2).This enables several different process steps with a minimum of clamping to reduce time and costs.For example, a machining center which carries out the processes B, C, and D can carry out several process orders (BCD, CBD, CDB, . ..).In addition to the manufacturing processes, the machining center can also be equipped with a measurement system to save a separate measuring machine.This enables the reduction of required space and can be more economical because fewer machines and buffers are needed between the machines.Referring to Figures 1 and 2, the failure of one machine stops the production of the whole line.In contrast to a production line with complementary machines, the production with machining centers enables a concept in which the machines complement and cover each other.
An alternative concept to a production line is a flexible manufacturing system (FMS) [2].

Hybrid Manufacturing with a Flexible
Manufacturing System.The process steps are distributed to particular machines or machining centers which are connected by a rotating workpiece transport system (see Figure 3).The common workpiece transport system offers a minimum of clamping.Each machining center offers different and/or equivalent processes to complement and/or cover the others.The advantage of such an FMS is maximum flexibility.The failure of one machine does not stop the entire production because another machine covers the failed process.Furthermore, different process times do not have to be compensated for by synchronizing machines if agent-based dynamic scheduling for flexible manufacturing systems arranges an intelligent and flexible process order [2,7,8].Scheduling is a separate issue that could fill many papers.Nevertheless, subtractive and additive manufacturing can be combined with an FMS.In some cases, an FMS could be best practice, but an FMS needs a great deal of room and is not the least expensive or most economical variant in every case.

Different Process Times as Bottleneck.
The main problem with the combination of subtractive and additive manufacturing can be the difference in the process times when subtractive manufacturing is only used for postprocessing or short intermediate steps, for example, threading a thread, reaming a fit, or finishing single contours.With a focus on the different process times, the subtractive machine is uneconomical when only one machine for additive manufacturing is available.Depending on the different process times, it could also be uneconomical with two or three additive machines when the subtractive manufacturing processes are ten times faster than the additive.Irrespective of this problem, such an FMS is not applicable in every company.Therefore, a large-scale integrated machining center which provides both additive and subtractive manufacturing could be a better application.

Hybrid Manufacturing with a Large-Scale Integrated
Machining Center.A large-scale integrated machining center prevents other machines from becoming uneconomical when one machining center fails because a large-scale integrated machining center produces independently from the others.Furthermore, the production rate can be increased using less space when large-scale integrated machining centers are used (see Figure 4).As a result, it is the best application when the additive machine offers additional subtractive manufacturing processes.This is a new kind of machining center which needs a common control providing additive and subtractive manufacturing.However, up to now, no control has been found which supports both kinds of processes.Therefore, process integration has to be carried out which requires specific process knowledge.

The Fused Layer Modeling Process
This paper focuses on fused layer modeling (FLM), a generic name for the fused deposition modeling (FDM) developed by S. Scott Crump and trademarked (http://www.trademarkia.com/fdm-74133656.html) by Stratasys, Inc.In the context of the RepRap project (http://www.reprap.org/),an ongoing project that made and freely distributed a replicating rapid prototyper, FLM is also called fused filament fabrication (FFF).As described in [1], FLM is an extrusion process in which thermoplastic material (filament) is continuously squeezed through a nozzle and deposited on a substrate.The material's energy suffices to fuse the substrate; after cooling down, a permanent connection is available.In contrast to other additive processes, the FLM is suitable for both prototyping and production applications because parts with a high mechanical load capacity can be produced.Referring to the RepRap project, a wide range of users choose the fused layer modeling [1,9,10].
3.1.Materials for Fused Layer Modeling.Generally, plastics are used with fused layer modeling, for example, polylactide (PLA), acrylonitrile butadiene styrene (ABS), polycarbonates (PC), or combined plastics, for example, PC-ABS.There are also types of plastic that can be sterilized by gamma or by ethylene oxide for medical technologies.In addition, with small modifications, materials other than plastics can be processed, such as metals and ceramics [1,[11][12][13].

Fast Hybrid Manufacturing for Higher Accuracy.
As described previously, additive manufacturing can be done without subtractive manufacturing processes, for example, drilling.Generally, this also applies to fused layer modeling.The postprocessing was cited as a reason for combining both.This will now be explained with a focus on FLM.The achievable accuracy depends on many parameters, for example, the layer height and nozzle diameter.If the layer height or the nozzle diameter is too large, the resulting staircase effect will reduce accuracy and surface quality of the part as well as the production time.Therefore, postprocessing is required.Improvement of surface finish by staircase machining in fused deposition modeling is outlined in [14].Generally, a smaller nozzle diameter can increase the achievable accuracy (see Figure 5) but also increases manufacturing time, whereas a larger diameter can reduce manufacturing time but also reduces the achievable accuracy (see Figure 6(a)).An approach will be explained for manufacturing a part with accurate holes for fit.Firstly, the part is manufactured with undersized holes using a large nozzle diameter (see Figure 6(a)).Thereafter, the holes are rebored.This strategy enables an optimal result with accurate holes and minimum production time (see Figure 6(b)).This concept is also applicable to threads and other fields requiring high accuracy.

Objective
As described above, there are good reasons to add the subtractive manufacturing processes to an additive manufacturing machine instead of using an FMS with different machines.Considering the mechanical load occurring with subtractive manufacturing, it is much better to equip a subtractive manufacturing machine with the additive manufacturing tool instead of equipping an additive manufacturing machine with the subtractive manufacturing tool.Therefore, the objective of the development work carried out at the Institut für Maschinen und Anlagenbau was to integrate the process of fused layer modeling into a CNC which is designated for subtractive manufacturing.This offers the development of machining centers combining both subtractive manufacturing and additive manufacturing.

Commonalities and Differences between FLM and CNC Machining
As described above, the processes of additive manufacturing are completely different than subtractive manufacturing processes, though they have many commonalities.These commonalities and differences are outlined in the following, with a focus on FLM and CNC machining.

Commonalities.
As described above, a machining center could offer many different manufacturing processes.For this reason, the CNC provides many process-specific functions for a wide range of processes [2].Both kinds of manufacturing processes (subtractive and additive) need a precise control to move the tool and the workpiece on several axes.The movement is determined by an NC program code written in G-code, whereas the processspecific functions are determined by miscellaneous functions (M-codes).The NC program can be generated with computer-aided manufacturing (CAM) software from a drawing created using computer-aided design (CAD) software.
Furthermore, the CNC needs sensors to collect data about the tool and the working area.In addition, actuators, for example, cooling aggregates, have to be controlled.On these grounds, a common CNC is a good choice.
Generally, the process of FLM is not restricted to specific machine kinematics.Unusual kinematics is as suitable as trivial three-axis kinematics for tool and workpiece positioning.The focus is on simple three-axis kinematics, because it is often used for both kinds of processes.

Differences.
The subtractive process needs a clamping device to withstand the mechanical load occurring during manufacturing.Such a clamping device is not intended for FLM.Experiments at the Institut für Maschinen und Anlagenbau in Emden and recommendations of the RepRap project indicate that a heating bed improves the FLM process.
Therefore, a heated clamping device as a combination of both is needed.This could be achieved with a heated vacuum clamp.The challenge of engineering such a heated vacuum clamp is to prevent the additive manufactured parts from absorbing and deforming while clamping.
In addition, a special extrusion tool is required.In contrast to milling and threading, a further axis is needed inside the tool for accurately defined motions of the filament for predefined deposing.This tool has to be compatible with existing tool holder and tool changer systems.
Furthermore, the process-specific M-codes of additive manufacturing are completely different from M-codes for subtractive manufacturing.These M-codes have to be integrated into the CNC to make additive manufacturing possible.The challenge is to make a minimum of modifications and protect the integrity of existing M-codes.

Approach
This approach is based on a fully assembled CNC machine, or, more precisely, a three-axis CNC milling machine.The process of fused layer modeling is integrated into the existing CNC architecture.
6.1.CNC Architecture for FLM.For this approach, a CNC with a customizable architecture is required.The CNC has to offer possibilities for the integration of new hardware, additional M-codes, and self-developed (sub)programs.Furthermore, a programmable logical controller (PLC) is required, because it is an essential component of the CNC architecture.For this approach, an internal PLC is used which is integrated into the CNC software.
Figure 7 shows a CNC architecture for FLM.Several components are integrated into the previously existing CNC architecture for enabling FLM.All components are interconnected by a common interface: the hardware abstraction layer.The CNC core, the PLC, and the human machine interface (HMI) are standard components of a CNC [2].Therefore, the previously existing CNC architecture offers these components although they are modified.The modifications are outlined later in this paper.Furthermore, the fully assembled CNC machine offers a motion controller with its sensors and actuators for three axes, which are used for positioning the FLM tool.A further axis is required for filament transport.Its integration is outlined later in this paper.But the temperature controller is not a CNC standard component.The integration of the temperature controller with its sensors and actuators is a major part of this approach.These hardware components of the temperature control are controlled by a software component called microcontroller interface (CI).The modification of the previously existing CNC components and the integration of the new components are outlined in this paper.

G-Codes and M-Codes.
As described above, the manufacturing process is specified with NC programs.There are three basic standards for NC programs: RS-274-D [15] (Extended Gerber RS-274X [16]); DIN 66025 [17,18]; and ISO 6983 [19].But no NC program standard defines M-codes for the fused layer modeling.Therefore, particular M-codes, which are defined by the RepRap project (http://www.reprap.org/wiki/G-code)(see Table 1), are used in this paper.These M-codes are accepted by a wide range of CAM software programs (slicers), developers, and users.The CNC-Core's interpreter needs to know these M-codes and their meaning.
The M-codes M104, M140, M141, M109, M190, and M191 are designed for setting process-specific temperatures.The Mcodes M109, M190, and M191 have the additional function of waiting until the temperature has been reached.The functionality can be implemented with (sub)programs.Each M-code calls up a (sub)program with well-defined functions regarding temperature control.

Temperature Control
A temperature control is required for the extrusion process at the hot-end (nozzle).A heating bed temperature control can optimize the process during manufacturing the first layers.Furthermore, a working space temperature control and a cooling fan can optimize the process.A distributed microcontroller-based closed-loop temperature control can offer the functionalities of temperature control.Therefore, the microcontroller (C) controls three systems: hot-end temperature, working space temperature, and cooling fan speed.A heating bed is not considered because its effect is restricted to the first layers, while a whole working space temperature control offers also effects in further layers.The principle of the three temperature control systems is similar; therefore, only the hot-end temperature control is outlined.

Heating unit
Sensor 7.1.Hot-End Temperature Control.The microcontroller receives the set temperature  set from the CNC and controls the temperature independently from the CNC with a proportional-plus-integral-plus-derivative (PID) controller algorithm.Any other control algorithm is also applicable but the PID controller algorithm is well documented in literature and easily adaptable to occurring system changes.The temperature controller needs feedback; therefore, a temperature sensor converts the actual hot-end temperature  act to the feedback signal  * act .This can be done, for example, using a thermistor with negative temperature coefficient (NTC), or PT100.

Hot-End
Closed-Loop Control.The control loop (see Figure 8) focuses on hot-end temperature control.During manufacturing, the cold filament is melted inside the hotend.Therefore, a process-related rate of heat flow Q1 is required to heat the filament.Q1 and disturbances Q cause the error   , because they are dissipating heat flows.The rate of heat flow is defined in (1), where  is the thermal energy of the heat flow.The dissipating heat flows are detailed in Section 7.3.
is the difference between the set temperature  set and the actual temperature  act .But the extrusion process requires a constant temperature to manufacture parts with a constant quality.Variations in the filament's feed rate have to be considered, because a lower feed rate requires a lower rate of heat flow Q1 .Therefore,   is counterbalanced by the temperature controller.The controller output   is calculated using (2) to eliminate the occurring error. P ,  I , and  D are the PID parameters, which designate the controller's performance.As described in [20], this algorithm is referred to as the stand (position) algorithm because   is calculated for every value of the sampled data period   .This algorithm is optimal for temperature control using a large   .The signal   is detailed in Section 7.4.
From the point of view of the controller,  Hot-end = constant, or, more precisely,  act =  set is the objective.The heat flow rates have to be balanced for a constant hot-end temperature (see ( 3)).Therefore, the dissipating heat flows are explained.

Hot-End Heat Dissipation.
There are two different dissipating heat flows.On the one hand, the process requires a heat flow for heating and melting the filament.This heat flow is process-related and volitional.It is described by its rate of heat flow: Q1 .On the other hand, disturbances cause further dissipating heat flows.These are described by a common rate of heat flow: Q .It is useful to separate Q1 and Q for the process of energy optimization.Disturbances are, for example, dissipating heat flows, which are caused by thermal convection, thermal radiation, and thermal conduction.Thermal convection is caused by the cooling fan.Thermal conduction is caused by the temperature differences between, for example, the work space and the hot-end as well as the hot-end and a thermal isolator.These dissipating heat flows are summarized in (4) and Figure 9: For practical applications, it is not necessary to determine each effect separately.Instead of considering particular Q , an overall Q is considered with an efficiency factor   .This is useful because each extrusion tool has individual disturbances.Its efficiency depends on hot-end composition, for example, the size and position of the heating resistor.The system is therefore characterized by (5).The parameter   characterizes the system with a minimum of expense, because Q0 is quantifiable by measuring the supplied electrical energy and Q1 is quantifiable using the filament data and the elected process parameters.Furthermore, the parameter   is useful for verifications of system optimizations with a minimum of expense.The greater   (0 ⋅ ⋅ ⋅ 1) the lower the disturbance.
The fan, which is mounted near the hot-end (see Figure 9), cools the deposited filament.The microcontroller receives the set velocity V set from the CNC and controls the fan speed with an open-loop fan control (see Figure 10).V  is the amplified control signal, which controls fan speed. 3 is the parameter which causes Q3 as a secondary effect during cooling of the depositing filament.The process of energy optimization and a detailed thermal analysis are beyond the scope of this paper.Firstly, they are separate issues that could fill many papers (see [21]); and secondly, it is not necessary to determine any rate of heat flow, because the controller needs only the temperature difference which is caused by the heat flows [22].
7.4.Hot-End Heat Supply.As described above, the PID algorithm calculates   for compensation.  is modulated by the microcontroller's pulse-width modulation (PWM) generator.The PWM signal is amplified (see Figure 11) by a metal-oxide-semiconductor field-effect transistor (MOS-FET).The amplified control signal is called   .The heating unit (see Figure 8) is the actuator.It is a heating resistor, which converts the electrical energy from the amplified signal   into the thermal energy  0 for heating the hot-end.The resulting rate of heat flow is called Q0 and counterbalances the dissipating heat flows.Q0 depends on the rate of electrical energy Ė el .It is roughly approximated by ( 6), where  is the electrical voltage;  is the electrical current; and  is the duty cycle which is caused by the PWM.The duty cycle is defined in (7), where   is the total period of the signal and   is the time during which the signal is active [23].

Temperature Measurement
As described above, a temperature sensor is needed.In this paper, an NTC thermistor is used because of its small costs.It is a resistor whose resistance significantly varies with temperature.Temperature measurement is made according to Figure 12, where  0 is the voltage source;  1 is series resistant;   is the resistant of the NTC; and   is the voltage across the NTC.  is the measuring signal.The resistant   is calculated according to (8): The NTC's resistance/temperature characteristic (curve) is required to determine the temperature.It can be described by three variants: a lookup table, the Steinhart-Hart equation (see ( 9)) [24], or the  (or ) parameter equation (see (10)) [25].
A lookup table describes the resistance/temperature characteristic in steps: a specific resistance is assigned to a specific temperature; for example,   = 550 Ω ⇒  = 200 ∘ C;   = 500 Ω ⇒  = 205 ∘ C. Values between the steps can be found by interpolation.The implementation of the lookup table can be done using an array to store the values.A lookup table prevents the microcontroller from having to make complex calculations, but it needs a great deal of memory for storing accurate values

Heating resistor Sensor
is the Kelvin temperature and   is the NTC resistance., , and  are the thermistor's constants, which may be offered by the NTC manufacturer.
As previously described,   is the NTC resistance at the temperature  in Kelvin.  is the resistance at the rated temperature   (e.g., 298.15 K).The  (or ) parameter is a material-specific constant of the NTC thermistor which may be offered by the NTC manufacturer.If no constants are offered or a higher accuracy is required, the constants can be found by calibration.See [26] for further information about thermistor calibration.
As previously described,   is the measuring signal which represents the analog voltage across the NTC.The analog-todigital converter (ADC) converts the analog measuring signal into a digital value , which is available in the microcontroller (see Figure 11).The digital measuring signal  is calculated with (11).Its accuracy depends on the converter's resolution, which is limited to  bits.The accuracy of the measuring signal is limited to the converter's resolution, because the conversion involves quantization of the input.Furthermore, the least significant bit (LSB) voltage  LSB has to be considered.It is determined according to (12) [23]:

Physical Computing
Physical computing describes the interaction of the virtual world (software system) with the real world (physical system).This requires communication hardware and software with a well-defined interface.
T e (Ink) Wireless LAN are two frequently used wireless options, but with a focus on security and reliability, a wired option is advised.Common wired interfaces are, for example, RS-232 and (real-time) Ethernet, but the CNC can restrict the options when it does not support all interfaces.In this paper, a serial communication is used with the universal asynchronous receiver/transmitter (UART) and the universal serial bus (USB) physic.This enables compatibility with a wide range of computer-based CNC.
The interaction between the CNC and the temperaturerelated sensors/actors is shown in Figure 13.The microcontroller's functionality (software system) is highlighted.Figure 14 shows the steps required to calculate the temperature from increments to degrees Celsius and vice versa.

Communication Protocol.
A protocol is required for the communication between the CNC and the microcontroller.The developed protocol supports request-response in plain text.The information is represented in a human-readable format to enable human parsing and interpretation.This supports intuitive use of commands for maintenance and debugging via a command-line interface (CLI), for example, the terminal emulation PuTTY (http://www.putty.org/).The implemented commands are shown in Table 2 for requests and Table 3 for responses.Commands are separated from parameters by the equal sign (=), while parameters are see equations ( 9) and (10) see equations ( 9) and ( 10) see equation ( 11) separated from each other by a comma.An escape sequence is used to indicate the input end.After the input end, input is parsed and interpreted by the microcontroller.Unknown commands cause an error message while correct commands are executed.Figure 15 shows requests and responses between the CNC and the microcontroller.On the left side of Figure 15, the set temperature is set for the hot-end by the CNC.The microcontroller confirms the input.On the right side of Figure 15, the actual temperature is requested by the CNC.The microcontroller sends the actual temperature to the CNC. Figure 16 shows requests and responses between a maintenance PC and the microcontroller.On the left side of Figure 16, the PID parameters are set for hot-end temperature control by the PC.The microcontroller confirms the input.
On the right side of Figure 16, the actual PID parameters for the hot-end temperature control are requested by the PC.The microcontroller sends the actual PID parameters for hot-end temperature control to the PC.9.3.CNC Temperature Control.The M-codes M104, M140, M141, M109, M190, and M191 are designed for setting processspecific temperatures.These M-codes are not reserved for other processes [18].Both M104 and M109 are used to set the hot-end temperature.M104 sets the temperature and continues the process directly, regardless of whether the desired temperature is reached or not.This is good for small changes during the process, but the hot-end needs to be heated before the process starts because a cold hot-end is not useful.Therefore, M109 is used.M109 pauses the process and continues the process when the desired temperature is reached.This is signaled with an enable signal.
Without further conditions, small variations are not tolerated; small variations should be tolerated with a range of tolerance, because the process can accept small variations.Therefore, ( 14) is a better comparing condition where   is the accepted tolerance: The step response  act () in Figure 17 shows that the process can immediately start after  1 , although the temperature  act () is overshooting.This is not practical, because the process needs a constant temperature.Therefore, a further condition is used for checking whether the temperature is settled.A Timer-ON-Delay (TON), which is a standard component of a PLC, is used for checking whether the temperature is constant for a specific time  3 .Currently, the CNC notices deviations of the temperature and prohibits manufacturing before the temperature is settled.No temperature error management is implemented for manufacturing; however, an error management system is required to protect parts and the machine when the difference between the actual temperature and the set temperature becomes too large during manufacturing.This is important to guarantee manufacturing with a consistent quality.A temperature error management system will be outlined in a future paper.

Motion Control
As described above, this approach is based on an existing fully assembled three-axis CNC milling machine.Therefore, this paper does not cover the positioning of the tool.The FLM tool (extruder) by itself needs an extruder axis for extruding the filament.The name of the axis depends on the existing CNC platform, for example, E-axis.For convenience, a rotatory motor is used.Inside the extruder, the rotatory motion is transferred into a linear motion.The E-axis is integrated into the CNC as a linear axis.The trajectory of the extruder's nozzle is analyzed in [27].

Operation Principle
All required components are described for extending the CNC architecture for FLM, which is technically designated for subtractive manufacturing.This section describes the line of action to set the hot-end temperature for manufacturing.
(1) The NC program is parsed and the NC program codes (G-codes and M-codes) are executed.
(2) When the M-code M109 (see Table 1) is reached, the interpreter calls up the appropriate program called M109.The NC program parsing pause during M109 is executed.
(3) The program M109 gets the set temperature by command call (M109 P⟨V⟩) and commits the value to the PLC (see Figure 18).
(4) The PLC commits the value to the microcontroller interface (CI).
(5) The CI commits the value from the PLC to the temperature controller (C) and frequently requests the actual temperature from C.The CI commits the actual temperature from C to the PLC.(6) The PLC checks the comparing conditions while the temperature controller controls the temperature.(7) The PLC sets the enable signal when the comparing condition becomes true and the temperature is settled.
(8) When the program M109 gets the enable signal, M109 is terminated and the NC program parsing is continuous.
This line of action is similarly applicable for M190 and M191.The programs M104, M140, and M141 are immediately terminated after setting the new set temperature.The NC program parsing is not paused.
A software-based CNC with PLC, a microcontroller board with ATmega328, an EPCOS 100k thermistor, an IRFZ44N MOSFET, and a heating resistor are used for the implementation of the CNC architecture presented.The line of action described was followed to set the hot-end temperature to 200 ∘ C. The actual value of the hot-end temperature was logged by the PLC and is shown in Figure 19 to demonstrate the functionality of the CNC architecture.

Conclusion
The approach presented describes the integration of the fused layer modeling process into a CNC architecture which is designated for subtractive manufacturing (milling) but without referring to any specific CNC.This permits engineering of hybrid manufacturing centers which offer FLM with postprocessing in one machine.The benefits are a minimum quantity of clamping, more accurate parts, and less production time.Furthermore, the integration offers another significant advantage over previous approaches because only one hybrid CNC architecture is needed for offering many processes.The same CNC can be used for additive manufacturing with subtractive manufacturing, only additive manufacturing, and only subtractive manufacturing.This prevents customers from assembling individual CNC systems for FLM and milling machines.Machine customers and machine operators do not need knowledge in different CNC systems because the new process (FLM) is integrable in the familiar CNC system.This is economical for developers, customers, and users, regardless of whether they need hybrid manufacturing or not.
The approach presented focuses only on fused layer modeling (FLM).Other additive manufacturing processes need also postprocessing.Therefore, the idea of hybrid manufacturing is also applicable to processes other than fused layer modeling.
As described in Section 5.2, further work is necessary for using the CNC architecture for hybrid manufacturing.Firstly, a clamping device is required which supports additive and subtractive manufacturing.Secondly, an extrusion tool is required which is compatible with the existing tool changer of the CNC machine.Thirdly, an extended CAM system is required which supports additive and subtractive manufacturing at the same time.Therefore, at the time of submitting this paper, the CNC architecture presented was not applied to a real hybrid manufacturing process, but it has been successfully implemented.

Figure 1 :Figure 2 :
Figure 1: Production line with machines which complement each other.

Figure 3 :Figure 4 :
Figure 3: Flexible manufacturing system with a rotating workpiece transport system and machines which complement and cover each other.

Figure 5 :
Figure 5: Additive part manufactured by FLM with a small nozzle diameter and layer height.

Figure 6 :
Figure 6: Additive part manufactured by FLM and subtractive postprocessed by drilling.

Figure 7 :
Figure 7: The extended CNC architecture for fused layer modeling.

9. 1 .
Communication Hardware.Several wired and wireless options exist to connect the CNC with the temperature controller.Criteria for choosing the best options are, for example, costs, data rates, distances, hardware support, environmental conditions, and the requirement for real-time.Bluetooth and International Journal of Manufacturing Engineering

Figure 13 :
Figure 13: Physical computing for temperature control.

Figure 14 :Figure 15 :
Figure 14: Calculation order to determine the temperature from increments to degrees Celsius and vice versa.

Figure 18 :
Figure 18: Involved components of the CNC architecture for handling hot-end temperature.

Table 2 :
The parser and interpreter are used by both microcontroller and CNC.A state machine is implemented in the CNC to frequently check temperatures and set new set temperatures, when changes occur.If no human-readable format is required, a hexadecimal-based format is an alternative to reduce data size.Figure 16: Requests from PC and responses from microcontroller.Protocol for requests to microcontroller. P ,  I ,  D Set PID control parameters for hot-end to  P ,  I ,  D  P ,  I ,  D Set PID control parameters for heating bed to  P ,  I ,  D  P ,  I ,  D Set PID control parameters for work space to  P ,  I ,  D

Table 3 :
Protocol for responses from microcontroller. P ,  I ,  D PID control parameters for hot-end are set to  P ,  I ,  D hp =  P ,  I ,  D PID control parameters for hot-end are  P ,  I ,  D bps =  P ,  I ,  D PID control parameters for heating bed are set to  P ,  I ,  D bp =  P ,  I ,  D PID control parameters for heating bed are  P ,  I ,  D wps =  P ,  I ,  D PID control parameters for work space are set to  P ,  I ,  D wp =  P ,  I ,  D PID control parameters for work space are  P ,  I ,  D 9.3.2.Comparing Conditions.The enable signal signals true when the comparing conditions become true.The simplest condition is shown in