A dynamic model for current-based nozzle condition monitoring in fused deposition modelling

3D printing and particularly fused deposition modelling (FDM) is widely used for prototyping and fabricating low-cost customised parts. However, present fused deposition modelling 3D printers have limited nozzle condition monitoring techniques to minimize nozzle clogging errors. Nozzle clogging is one of the significant process errors in fused deposition modelling 3D printers, and it affects the quality of prototyped parts in terms of mechanical properties and geometrical accuracy. This paper proposes a dynamic model for current-based nozzle condition monitoring in fused deposition modelling, which is briefly described as follows. First, all the process forces in filament extrusion of the fused deposition modelling were identified and derived theoretically, and theoretical equations of the feed rolling forces and flow-through-nozzle forces were derived. In addition, the effect of the nozzle clogging on the current of extruding motor were identified. Second, based on the proposed dynamic model, current-based nozzle condition monitoring method was proposed. Next, sets of experiments on FDM machine using polylactic acid (PLA) material were carried out to verify the proposed theoretical model, and the results were analysed and evaluated. Findings of the present study indicate that nozzle clogging in FDM 3D printing can be monitored by sensing the current of the filament extruding motor. The proposed model can be used efficiently for monitoring nozzle clogging conditions in fused deposition modelling 3D printers as it is based on the fundamental process modelling.


Introduction
Additive manufacturing (AM) is the process of joining materials layer by layer to build three-dimensional (3D) objects [1], and its applications have been introduced in various engineering areas. One of the most widely used AM processes is fused deposition modelling (FDM) [2]. The FDM machine fabricates 3D parts that were first modelled using computer-aided design (CAD) software, then converted into a STereoLithography format (.stl) with surface geometry parameters. During the FDM process, a filament material is fed into the heater block where it melts and extrudes onto a build platform via controlled three axis stage. This forms a thin cross-sectional layer of a part, and the process repeats by forming all cross-sectional layers until the part is fully fabricated. FDM filaments are commonly made of thermoplastics, for example, acrylonitrile butadiene styrene (ABS), polylactic acid (PLA), polyurethane (PUR), and others. The applications of the FDM technology have been explored in various areas, such as education [3,4], rapid prototyping [5,6], robotics [7,8], scientific tools [9,10], and tissue engineering [11,12]. However, current FDM 3D printed parts have lower reliability standards in comparison with other consumer products [13]. Previous studies estimated about 20% failure rate during FDM 3D printing by inexperienced users [14]. This is mainly because FDM 3D printing has number of challenges, such out of filament extruder [15], print head misses the printing platform [15], extrusion stops mid-print [15], print does not stick to the platform [15], print bows out at bottom [15], print peels away from the platform or warps [15], extruder over-extrudes or under-extrudes [15], print has inaccurate dimensional accuracy [16][17][18] or too weak structure [19,20].
Process monitoring in FDM is essential for tracking the quality of the print during the fabrication before any print failure happens. Previous research has established that it can be possible to detect extreme print failures during 3D printing using various sensors, which are discussed below.
Several vision-based techniques were capable to monitor 3D printed part during fabrication using cameras or laser profile sensors, track the geometry using digital image processing techniques, and compare 3D printed geometry with the CAD model to detect various print errors. For example, geometry of each layer was tracked to detect under-extrusion or over-extrusion defects [21]. Moreover, detection of local area defects, such as a blob of filament, and global defects, such as low flow in 3D printed parts were studied [22]. In addition, monitoring of such defects as incomplete 3D print, blocked nozzle, loss of filament for different object geometries and filament colours were presented using low-cost camera system [23,24]. Monitoring layer height inconsistencies and overall 3D printed part geometry was performed using high resolution laser profile sensors [25][26][27].
Other AM process monitoring methods using various types of sensors, such as vibration sensors, acoustic emission sensors, and temperature sensors were reported in literature. Accelerometers, thermocouples, infrared temperature sensor, video borescope were used to monitor the quality of 3D printed parts, and most optimal parameters of feed/flow ratio, extruder temperature, and layer height were recommended for better dimensional accuracy and surface roughness [28,29]. Acoustic emission monitoring technique was used to detect such 3D printing process errors as semiblocked extruder, completely blocked extruder, and run out of the material [30], and filament breakage [31]. Orientation, motion, hygrometry, temperature, and vibration sensors were utilised to track printing and not printing conditions in FDM [32].
It can be noted that the above-mentioned works concentrated on advanced signal processing and machine learning techniques to analyse the data gathered from various sensors, paying less attention to the physics of the AM process. Due to this, the print errors were detected only after they accumulated and actually happened, which can cause extreme print failures.
One of the main challenges in monitoring in AM is tracking the print errors long before they cause extreme print failures. For addressing this challenge, there is a need in fundamental understanding of the FDM process dynamics. FDM is a recent manufacturing process compared to conventional processes, and in FDM material goes through rolling, melting, and extrusion processes involving number of multi-physical parameters. Due to this complexity of the process, there are little detailed investigation of the FDM process dynamics in literature.
A physics model-based process monitoring technique using vibration sensors was developed by Bukkapatnam and Clark [33], where a layered AM machine was theoretically modelled as a lumped mass system with a system of process forces and accelerometers were placed on the machine frame and on the extruder head to track defects as under-extrusion and over-extrusion. Although the abovementioned study derived theoretical formulations of the dynamics of the extrusion-based AM system, several assumptions were made that paid less attention to the relatively small forces resulting from filament extrusion and filament flow in the nozzle.
To the authors knowledge, there are no reliable theoretical models that can relate the current of the extruding motor to the nozzle effective diameter and the use of such model to monitor precise nozzle clogging conditions in FDM 3D printing.
Therefore, the main objective of the current study is to propose a theoretical model that represents FDM process forces in relation to the effective nozzle diameter and the use of this model for current-based nozzle condition monitoring in FDM. FDM process modelling and nozzle condition monitoring was performed by two steps. First, the theoretical equations of feed rolling forces and flowthrough-nozzle forces were derived. After, the influence of the effective nozzle diameter on the current of the filament extruding motor was identified. Second, based on the proposed model, current-based nozzle condition monitoring method was proposed. Next, sets of experiments on FDM machine using PLA material were carried out to verify the proposed theoretical model, and the results were analysed and evaluated.
This study provides an opportunity to advance the knowledge of FDM process monitoring, because it is based on a theoretical model that relates extruding motor current with nozzle clogging conditions. Thus, more detailed information of the nozzle clogging condition can be tracked before extreme blockage or print failure happens, allowing to pause/ stop/control the 3D printing process. Moreover, it can be possible to place a sensor more accurately because the proposed model includes a direct relationship between the process error-nozzle clogging, and the monitoring parameter-filament extruding motor's current.
The remaining part of the paper is organised as follows. The Sect. 2 presents the methods used for this work. The Sect. 3 analyses the results, following by the discussions. The Sect. 5 shows the conclusion and recommendations.

Theoretical modelling of FDM process
One of the main challenges in FDM 3D printing development is a limited understanding of the physics of the process [34]. Models of the FDM process describing the dynamics of material extrusion and melt are essential for intelligent monitoring and control for AM machines. Deriving the relationships between FDM process parameters and nozzle clogging conditions are important for monitoring the quality of 3D printed parts in terms of geometrical accuracy and mechanical strength. To model the process relationships, let us consider direct FDM extruder of Makerbot Replicator 1 3D printer presented in Fig. 1. As can be seen, it consists of two main blocks, namely filament feeding mechanism and filament melting mechanism. The filament feeding mechanisms has a gear, and a roller pushed towards the gear via spring-loaded lever. The filament melting mechanism consists of a heating block and a nozzle. Thus, the two main elements of FDM process are filament feed dynamics and filament melt dynamics. The forces acting on the filament along the vertical direction are: where F GF is gear-feed force, F R is rolling friction between roller and filament, F BP is backpressure force. Derivation of these forces is discussed in the following subsection. (1)

Filament extrusion dynamics
Commercially available extrusion mechanisms in FDM 3D printers are designed to feed thermoplastic polymer filaments with diameters ranging from 1.5 to 3 mm through a heated liquefier and then extrude onto a build platform. The filament is inserted into a guide tube and pushed towards a heater via gear-roller extrusion mechanism, as shown in Figs. 1 and 2. An extruding gear is powered by a stepper motor and a roller is pushed by a spring via lever to create a pressure on the filament to avoid slippage. The filament is in tension above the gear-roller mechanism and pulls the material from the spool. After the filament enters the gearroller mechanism, it is in compression and pushed through a heated liquefier towards the nozzle. The gear-roller extrusion feed rate is controlled to keep the volumetric flow rate of filament constant. The gear-feed force and the rolling friction between roller and filament are opposite to each other, and the resultant of these two forces is pushing the filament into the liquefier. The derivation of these two forces is presented as follows. First, gear-feed force depends on the torque of the extruding stepper motor: where T extr is extruding torque, r gear is radius of extruding gear. Second, friction force between roller and filament is rolling friction: where R is coefficient of rolling friction between roller and filament, N R is normal force between roller and filament. The normal force N R depends on the spring characteristics and the lever geometry of an extruder: or where F C is a force exerted by a spring via lever at point C and it is perpendicular to BC , is angle between F C and N R , F A is a vertical force exerted by a spring at point A , AB and BC lever geometrical distances illustrated in Fig. 2, is angle between AB and BC . In summary, the filament extrusion dynamics includes: 1. Gear-feed force, which is a function of a stepper motor and an extruder gear parameter; and 2. Rolling friction force, which is a function of a roller friction coefficient and lever-spring characteristics.

Filament melt dynamics
In FDM-based 3D printers a filament is melted in a heated liquefier before it extrudes from the nozzle. The heated liquefier is generally a block machined from a metal with a guide channel for the filament to go through. The heating of the liquefier is performed by a resistive cartridge heater inserted into the metal block to maintain a certain temperature. The temperature is controlled using a thermocouple/ thermistor which is also inserted into the heated liquefier. Heat flux is generated by the temperature increase which leads to the decrease in the viscosity of the filament melt. This allows the molten part of the filament to be pushed by the solid part of the filament from top to flow through the nozzle. The rate of the flow through liquefier and nozzle is limited by a pressure drop. The pressure drop inside the FDM nozzle can be estimated according to its shape as presented in Fig. 3, such as: cylindrical, conical, and then cylindrical, divided to regions L 1 , L 2 , and L 3 , respectively. Several assumptions made in the current modelling are: (a) melt is incompressible; (b) flow is fully developed and laminar; (c) walls of the nozzle have no-slip boundary condition. Hence, pressure drop in the nozzle can be identified as a sum of all three pressure drops in the nozzle [35,36,37]: where ΔP is overall pressure drop in the nozzle, ΔP 1 , ΔP 2 , ΔP 3 are three pressure drops according three regions in the nozzle L 1 , L 2 , L 3 , respectively. Each of the pressure drop values can be derived as [35][36][37]: where v is flow mean velocity, is flow consistency index, q is flow behavior index, R 1 , R 2 are nozzle radius values at the entry and at the outer regions, respectively, L 1 , L 3 are nozzle length values at the regions 1 and 3, respectively, is inside angle of a nozzle. By taking into consideration the Arrhenius Law for the temperature dependence [35][36][37]: where is activation energy, T is operating temperature, T 0 is reference temperature. Thus, total temperature dependent pressure drop is: After estimating the total temperature dependent pressure drop values, it can be possible to derive the backpressure force: where A fil is cross-sectional area of the filament. After substituting Eqs. (7)-(9) into (12) the backpressure force can be written as:

Total force dynamics
After modelling the filament extrusion dynamics and filament melt dynamics, the total force dynamics can be estimated. After substituting Eqs. (2), (5), (13) into (1), the forces acting on the filament along vertical direction can be derived as:

Relationship between extruding torque and effective nozzle diameter
To identify the relationship between the extruding torque and the effective nozzle diameter, the Eq. (1) was written as: where F GF is a function of extruding torque T extr , and F BP is a function of nozzle effective radius R 2 or diameter D 2 . Because extruding torque is a function of stepper motor current: where k t is stepper motor torque constant, I is stepper motor current. After writing extruding torque as in Eq. (16) in terms of stepper motor current and substituting Eqs. (2), (5), (13) to Eq. (15) and changing nozzle radiuses R 1 and R 2 to diameters D 1 and D 2 the relationship can be written as: To simplify the Eq. (17), several terms from (17) can be re-written as: Therefore, Eq. (17) can be rewritten as: which is the relationship between extruding stepper motor current I and the effective nozzle diameter D 2 . As can be seen, the changes in the effective nozzle diameter D 2 affect the extruding stepper motor current, thus it can be possible to track any nozzle clogging conditions by monitoring the current of the extruding stepper motor.

Current-based nozzle condition monitoring
To verify the above mentioned theoretical model, the current-based nozzle condition monitoring technique in 3D printing was developed. According to the proposed model, when the nozzle starts to clog during 3D printing, its effective nozzle diameter decreases, and the current of extruding motor will change. Thus, the monitoring technique was required to track the current of extruding motor in FDM 3D printer during fabrication for identifying the nozzle clogging conditions. The block diagram of the process monitoring board used for the current study is presented in Fig. 4. As can be seen, it consists of: • Microcontroller ATSAMD21G18A-MF, ARM Cortex-M0 + processor running at up to 48 MHz with up to 256 KB Flash and 32 KB of SRAM; • Stepper motor driver A4954 dual full-bridge DMOS PWM driver with current sensing; • Encoder AS5047D magnetic rotary position sensor.
The assembly of the above-mentioned elements on a PCB board is shown in Fig. 5. The NEMA17 Nano Zero Stepper board was manufactured by The Island of Misfit Electronics. Diametrically Magnetized NdFeBr magnet was glued to the back of the extruding motor shaft. The magnet was mounted Fig. 4 Block diagram of the process monitoring board accurately in the centre and was calibrated later to correct minor misalignments. Next, the process monitoring board was mounted by bolts to the back of the extruding motor so that the magnet was right under the encoder at the distance of 1-2 mm. In addition, standard stepper driver used for FDM 3D printer's extruding motor was removed from the controller board, and A4954 motor driver was connected to the control board instead. The attachment of the process monitoring board to the extruding motor of FDM 3D printer is shown in Fig. 6.
The working principle of the current-based nozzle condition monitoring method is as follows. The extruding feed rate is commonly set before any FDM 3D printing operation by the user, and it keeps constant until part is fully fabricated. Therefore, process monitoring board was set to operate in a velocity mode. While the extruder maintained the constant feed rate set by the user, the position of the  extruding motor's shaft was tracked by the encoder. When the nozzle started to clog, the filament extrusion started to become more difficult, resulting in position error of the extruding motor shaft. Next, the position error of the motor shaft was sent to the microcontroller. To keep the feed velocity constant, the microcontroller sent corrective signals to the motor driver, by increasing the current to overcome the difficulty in extrusion. This current increase was monitored by a Yageo PT1206FR-070R2L current sensing resistor, and the real-time data were sent to the computer via USB port.

Experimental setup, materials, and process parameters
Makerbot Replicator 1 FDM 3D printer and polylactic acid (PLA) filament with diameters of 1.75 mm and tolerances of ± 0.05 mm were used for experiments in the present study. The filament was stored in a dry container after opening the package for minimising the effect of moisture absorption. The printing platform was heated to 50 °C and covered with a Kapton tape. Print parameters were controlled via Mak-erWare software. The main process parameters are listed in Table 1.
The experimental and theoretical methodology of nozzle condition monitoring were carried out in four main steps, which are discussed as follows: The theoretical values of extruding motor current during nozzle clogging were calculated using the process parameters listed in Table 1.

Results
The results of the current study are reported as follows. First, theoretical and experimental values of extruding motor current during 3D printing using three different nozzles of 0.4 mm, 0.3 mm, 0.2 mm in diameter are shown in Fig. 7. The experimental error bars represent the results during measuring the current of the motor, and 50 measurements were recorded for each nozzle size, resulting in 150 values As can be seen, the reduction in nozzle size increased the amount of current exerted by the extruding motor, as it was calculated using the proposed dynamic model.
Second, theoretical and experimental results of extruding motor current during 3D printing with completely clogged nozzle due to part warping are shown in Figs. 8 and 9. The current signal was recorded with respect to time, and a window of 2 s during part warping is illustrated. As can be seen from Fig. 8, the signal is fluctuating for the value of ± 2 mA during normal 3D printing, and there is a sharp increase of current signal during nozzle clogging due to part warping. During normal 3D printing, the current values were around 545 mA, but during part warping with no room for extrusion which resulted in completely clogged nozzle the current values rose up to the maximum of 1000 mA. This increase in the current values during nozzle clogging from part warping were monitored real-time, as the data were send to the computer via USB port. 50 experimental sets of part warping have been performed, and the variability of the current signal values are illustrated as error bars in Fig. 9. The experimental results varied from the theoretical calculations by 8%. As previously, the completely clogged nozzle caused rapid increase of the current.
Third, theoretical and experimental results of extruding motor current during 3D printing with partial clogged nozzle due to decrease in chamber temperature are illustrated in Figs. 10 and 11. The current values were measured with respect to time, and a window of 2 s during chamber temperature decrease is presented. As can be seen from Fig. 10, the signal is fluctuating for the value of ±3 mA during normal 3D printing, and there is an increase of current signal during nozzle clogging due to decreased chamber temperature. For normal 3D printing with chamber temperature of 25°C the current of extruding motor was 545 mA. However, when  Theoretical and experimental results of extruding motor current versus effective nozzle diameter during 3D printing with completely clogged nozzle due to part warping the fan started to blow the cool air towards the extrusion region, by decreasing the chamber temperature to 15°C, the extruding current was monitored real-time and increased to 560 mA. 50 experimental sets of nozzle clogging due to chamber temperature decrease have been performed, and the variability of the current signal values are illustrated as error bars in Fig. 11. Differences in the results between theoretical and experimental results were in the region of 2%.
Fourth, theoretical and experimental results of extruding motor current during 3D printing for a long period of time until nozzle became partially clogged is presented in Fig. 12. The 3D printer was running for 6 weeks continuously to cause a clogged nozzle and the effective nozzle diameter was monitored continuously. In total, there were 50 sets of current signals recorded for each value of the effective nozzle diameter. The variations of these experimental data of the current values are shown as error bars in Fig. 12.
The current values were monitored during 6 different stages of the effective nozzle diameter D 2 : 0.4 mm, 0.396 mm, 0.390 mm, 0.381 mm, 0.365 mm, 0.345 mm according to the 6 stages of partial nozzle clogging measurements from the video camera. For normal 3D printing the extruding current values were near 545 mA, but when the nozzle started to clog partially, the current values started to rise slowly until a certain point, and later increased sharply. As an example, when the nozzle just started to clog partially with effective nozzle diameters of 0.396 mm, 0.390 mm, and 0.381 mm the current values stayed below 590 mA. But when the nozzle clogged even further with effective nozzle diameters of 0.365 mm and 0.345 mm, the current values increased to 670 mA and 750 mA, respectively. In other words, up to 4% decrease in the effective nozzle diameter caused only up to 8% increase in extruding motor current; but 8% and 13% decrease in the effective nozzle diameter sharply increased the current values to 23% and 38%, respectively. Experimental results varied from the theoretical calculations by 6%, and the current values increased during partial nozzle clogging, as it was estimated from the proposed model.

Discussions
This study proposed a theoretical model for current-based nozzle condition monitoring technique in 3D printing. As presented in previous section, the theoretical modelling of FDM 3D printing process showed a very accurate correlation with the experimental tests. It was found that the proposed theoretical model can efficiently estimate the current of the extruding motor during nozzle clogging in FDM 3D printing. The findings of this study indicate that the nozzle clogging decreases the effective nozzle diameter, makes the extrusion more difficult and affects the current of the extruding motor. When the extruding mechanism is fitted with a current-based monitoring system, the nozzle clogging conditions can be tracked relatively accurately using the proposed theoretical model.
The proposed model and the current-based nozzle condition monitoring method is in contrast to the earlier works [21,27,32], where the AM process monitoring methods were purely empirical. On the other hand, the results of the present research are similar to the study developed by Bukkapatnam and Clark [33], where they introduced a theoretical model-based vibration monitoring in 3D printing. The difference between the present work and their study is focussing on the extrusion process and the nozzle clogging, but their work focussed more on the severe vibrations of the 3D printer machine structure.
The significance of the present work is the ability to predict the nozzle clogging conditions in FDM 3D printing before any serious process failure might happen. The overall differences between the theoretical estimations and the experimental results are in the range of 8%. The present method is based on theoretical dynamics of FDM extrusion process, and it can be very promising for developing nozzle condition monitoring and control techniques in FDM 3D printing.
There are several limitations of the present study. First, theoretical calculation results of the extruding motor current were slightly different from the experimental results in the maximum range of 8%. This is because the theoretical model treats the filament diameter as ideally constant value. However, the actual diameter of the filament tends to vary due to the manufacturing limitations and tolerances, for example, tolerance of filaments used in present study was ± 0.05 mm. To overcome this limitation, the actual diameter of the filament can be measured at the location before it enters the heated liquefier. The actual filament diameter measurement can be achieved using computer vision system, similar as in work presented by Greeff and Schilling [38], where they measured the filament width using a low-cost USB microscope video camera and image processing. Then, the actual filament radius values R 1 should be placed in Eqs. (7)- (9) and subsequently used for estimating the current of extruding motor. Second, the present model is based on most common FDM system based on a wire feeding mechanism and a heated liquefier. For other types of systems, for example, with pressurised material heating tank, the model can be applied similarly. For example, the additional pressure in the pressure tank can be written as ΔP 4 and added into Eq. (12). The remaining calculations can be done similarly as in the model proposed in this study. As a result, to have a reliable and good 3D printing results with the pressurised tank, the pressure is to be maintained constant in the material heating tank. If the pressure in the tank is constant, the decrease in effective nozzle diameter (or nozzle clogging) has a direct effect on the current of extruding motor.
Future work might be focussed on the usage of the proposed model for nozzle condition monitoring and control in FDM 3D printing for avoiding process failures. In addition, the proposed dynamic model would be tested with a PEEK polymer to evaluate the effect of temperature on results.

Conclusion
Nozzle clogging is one of the significant process errors in FDM 3D printing, because it has a direct effect on the quality of 3D printed part in terms of mechanical strength and geometrical accuracy. This work proposed a dynamic model for current-based nozzle condition monitoring in FDM 3D printing, and it is based on a theoretical relationship between the extruding motor current and the nozzle clogging condition. To summarise the results of the present study, the following recommendations are suggested.
• When the nozzle starts to clog, its effective diameter decreases, which increases the backpressure. The backpressure increase makes the filament extrusion more difficult, and to maintain the constant extruding velocity, the current (and the torque) is increased. • Thus, nozzle clogging in FDM 3D printing can be monitored by sensing the current of the filament extruding motor. • Theoretical and experimental results show that the nozzle clogging in FDM 3D printing directly affects the current of the extruding motor, which increases non-linearly with nozzle blockage. • Theoretical estimations of the current of the extruding motor during nozzle clogging varied from the experiments by the maximum error of 8%.
In conclusion, the findings of the current work can be one step towards developing nozzle condition monitoring and control in FDM 3D printing for avoiding process failures as