Constant speed is a necessary condition for inspection pigs because they have enough time to get data from their installed sensors. Keeping the pig in constant speed is very important especially in gas pipelines because of high velocity of the fluid. This paper suggests a simple method based on sliding mode control, which is a time-domain robust control method, for speed control of an inspection pig in gas pipelines. A bypass valve is installed in the pig’s body which can be closed or opened by controller input. Dynamic equations of pig’s motion in two-dimensional gas pipeline is derived and written in the normal state-space form at first. Then, continuous control input for two-dimensional pipelines in two cases is obtained using a smoothed approximation of the discontinuous sliding mode control. The designed control system is simulated numerically using the MATLAB software. The simulation results show that this type of controller can keep the pig’s speed perfectly constant at desired value during the pig’s motion in the gas pipelines.