## 1 Introduction  
Positive Displacement Motors (PDM) are extensively used in the oilfield to drill the formation towards the reservoir or to mill through any other restriction down hole. They have been developed in the 1940s and commercialized in the 1950s [1]. PDMs (also called mud motors in drilling applications) are being used in drilling complex formation to improve the rate of penetration (ROP). In this type of rotation drilling, PDM converts the energy mud flow to mechanical energy (Figure 1). On the slide drilling, PDM is responsible to generate bit rotation when drilling fluid is pumped. The performance of PDM can be controlled by the rotor/stator lobe configuration, rotary speed, and torque [2]. Drilling with positive displacement motors dominates oilfield drilling operations due to its operational and economic advantages over conventional rotary drilling [3]. PDMs are also very important in the coiled tubing (CT) industry, where they are mostly used to mill isolation plugs after hydraulic fracturing operations, which are common in shale gas environments, being one of the crucial parts of the Bottom Hole Assembly (BHA). \"It is estimated that between 100,000 to 140,000 composite plugs are installed and milled each year in the US alone. Efficient removal of these composite plugs is critical in achieving operational efficiencies for both the operator and service suppliers\" [4]. In the PDM, the rotor has one lobe less than the stator, which leaves a gap where the fluid circulates and as the rotor fluid forces the rotor for the next free lobe in the stator. The resulting rotation generates torque to drive the drill bit. PDMs are prone to failure, particularly due to stalling and the overpressure that this event produces. As more stalls are accumulated over time, this interruption to drilling can amount to significant losses of productive drilling time [5]. A damaged motor downhole can lead to a loss up to hundreds of thousands of dollars in an offshore drilling rig. Stalling can also leave big cuts of the material being milled inside the wellbore, which are harder to circulate back to surface due to their size and shape, leading to an improper wellbore cleanout and finally to a stuck pipe situation. \"Applying too much weight to the bit/mill increases the risk of stalling the motor. Stalls lead to a reduction in motor run life, increased coiled tubing fatigue, inefficient operation, and significant increase in the risk of leaving large chunks of composite material. These large composite chunks considerably increase the risk of the BHA becoming stuck in the well, and the risk that the chunks will block flowback equipment\" [4]. Because water or mud contain very little compressive fluids, the pressure can raise too quickly, so a distracted operator does not have time to react and stop the operation. Avoiding or minimizing the time the PDM stalls during a milling operation is one of the main duties of the equipment operator during the job. However, this same operator is prone to the following human errors [6; 7]: perceptual errors, when the operator does not notice the data from the sensors are abnormal; skill-based errors, when even after noticing the parameters are off, he or she cannot assess the situation based on this data; and decision errors, where the operator acknowledges the situation, however does not carry on with the proper action to address the problem. In an effort to minimize those errors and their detrimental effect, this work studies the use of Artificial Intelligence (AI) on the data available during the milling job with PDM as procedure decision-taking and operational troubleshooting are some of the application areas for AI in the oilfield and drilling industry  
Figure 1: PDM Operation ([PERSON] et al., 2016 [2]). being discussed in the literature [8], and equipping the personnel with intelligent systems that improve the decision-making process can avoid the human-induced errors [9].