Pipe robots can replace workers to work in harsh environments. Generally, most of the existing pipe robots can only move in pipes with constant diameters, but cannot move in pipes with variable diameters. To this end, we propose a permanent-magnet wheeled pipe robot. We introduce a differential mechanism as well as a slide block and slide rail structure so that the robot can move on the pipe with variable diameters. Firstly, the CAD model is established by SOLIDWORKS, the self-adaptive diameter-variable mechanism of the robot is analyzed, and the applicable pipe diameter range is obtained. Then we use MATLAB to carry out numerical analysis and obtain the relationship of the attraction force of the magnetic wheel. Finally, the MAXWELL module in the ANSYS ELECTRONICS software is used to simulate the magnetic wheel. Through simulation, we obtain the curve of magnetic field strength and the attraction force of the magnetic wheel. The hypothesis of our theory is tested.