Controlling an object containing a nonlinear element with hysteresis in its mathematical model is an extremely difficult task. In some cases, it is possible to control nonlinear objects using the sliding mode method, but this method is completely unsuitable if there is a pure delay in the object model, since the delay does not allow very fast switching with an extremely small amplitude in the system. Ideally, the oscillations should be negligible due to fast switching, but due to the influence of the delay, these oscillations have a period of at least twice the value of the delay, and therefore the amplitude of such oscillations increases. In addition, the parameters of these oscillations remain uncontrollable when using design methods focused on organizing the sliding mode. It is much more effective to introduce forced oscillations into the control loop by introducing a small deviation into the control signal. It is intuitively clear that the amplitude of the signals of this deviation should be close to the hysteresis value, however, the choice of the amplitude and frequency of this deviation can greatly affect the control result, and there are no analytical algorithms for such a choice. The task is complicated by the fact that an element with hysteresis, as a rule, always itself has some dynamic properties, that is, it has both a non-zero signal propagation time and a dependence of the signal amplitude on frequency, so changing the frequency of the deviation signal will require changing its amplitude. The article proposes a solution to this problem of controlling an object with hysteresis in a circuit having dynamic properties by means of numerical optimization, while not only the coefficients of the controller used are subject to calculation by this method, but also the amplitude of the smoothing deviation signal, and the selection of the deviation frequency is carried out by an iterative procedure. Simulation and optimization confirm the effectiveness and robustness of this controller design method.