This article considers the problem of optimal control of a mathematical pendulum, which also describes controlled rotation of a satellite in the plane of a circular orbit. A numerical and qualitative investigation of the programmed problem of reorientation of a satellite is carried out for small values of the control moment, and the response time and number of switching as functions of the moment is plotted.