The invention relates to a pipeline cleaning robot applied to industrial field, and also relates to a method for controlling the walking robot. The robot comprises a connection shaft (2), a supporting leg (3), a drive plate (4), a pusher dog (5), a connection rope (8), a variable pitch motor (9), a drive motor (10), a cleaning device (12) and a roller wheel device (14), wherein the connection rope (8) passes through the drive plate (4), and is connected with variable pitch motor (9); the supporting leg (3) which can retractably rotate is connected with the drive plate (4); the drive motor (10) is connected with another frame shell end part (18) through a gear disc (17) and the connection shaft (2); the supporting leg extends out of a frame shell (13), and is contacted with the inner surface of the pipeline; and the cleaning device (12) is arranged on the frame shell (13). With the scheme, the robot is more efficient, can turn a curve smoothly, can be controlled more easily, has the advantages of simple structure and convenient manufacture, and is applicable to pipelines with different diameters.