With the development of information technology and smart technology to meet the Industrial Revolution 4.0, and to meet life requirements. Automatic control devices require high-precision control quality. Therefore, in this paper, we focus on researching the Sliding mode controller to improve the control quality compared to the PID controller. First, the sliding mode control is designed using the Lyapunov algorithm. Next, the process of simulating the position signal of a DC motor with a PID controller is compared with a sliding mode control to prove the effectiveness of the proposed controller.