Abstract:To address the issues with traditional oil pipe inspection methods—such as lengthy inspection cycles, a high risk of missed defects, and the difficulty of real-time identification of defects in in-service oil pipes—as well as the problems associated with existing coupling adaptive mechanisms, such as rigid collisions and their tendency to affect inspection results, this paper focuses on oil pipes with an outer diameter of 73 mm and a wall thickness of 5.5 mm. Based on this, a set of online magnetic flux leakage detection equipment featuring a rolling-type coupling adaptive mechanism has been developed. First, the structural and functional design of the device was completed. Subsequently, the three-dimensional magnetic circuit model of the device was simulated to verify the device’s ability to detect circumferential defects in oil pipes. Finally, a physical prototype of the device was fabricated, and an experimental system simulating the hoisting motion of oil pipes during workover operations was established. Dynamic inspection experiments were conducted on 20# steel test pipes equipped with couplings and various artificial defects. The experimental results demonstrate that the developed device can adaptively pass through the couplings and stably acquire magnetic field signals from both the tubing defects and the couplings; after signal preprocessing—including polynomial fitting for baseline removal, wavelet thresholding for noise reduction, and Savitzky-Golay (SG) smoothing—combined with a random forest algorithm, quantitative inversion of the diameter and depth of cylindrical defects was achieved. The coefficient of determination (R2) for the inversion models was 0.957 4 and 0.930 6, respectively, with the mean absolute percentage error (MAPE) consistently stabilizing at around 5%.