The use of electrical receivers with a non-linear load on ships significantly affects the electric power characteristics. The main devices that reduce the distortion of the sinusoid of current and voltage in electrical networks are active, passive and combined filters. There are considered the main types and principles of active filters operation, shown the current methods for detecting a distortion and forming a compensating effect by active filters. Using the active filters for electric drives of reciprocating mechanisms with an uneven, but periodic predictable load on the shaft is demonstrated. The operation of such devices in the ship electrical power system worsens the electric power characteristics (e.g. high iTHD, harmonic components). The effectiveness of using an active filter operating on a perturbation from a reference signal for electric drives of reciprocating compressors has been theoretically grounded. There has been presented an algorithm for operation on a perturbation determining the spectrum of the selected interharmonic distortion and presenting it in the form of a Fourier series to create a compensating effect. Application of the algorithm helps increase the speed of the control system, eliminates temporary errors and simplifies the operation of the system. The range of active filters operation according to this algorithm is found limited due to a necessary periodic load or fixed interference. The control software for a three-phase active filter was designed by using the algorithms. The software project is presented in the MATLAB/Simulink mathematical modeling environment. A specific feature of the software using a memory block to organize the calculation of the compensation pattern for harmonic distortion and using the algorithms for generating a compensating signal in the frequency domain. The hardware modeling is considered and the firmware of the board is made. The interface, code and results of the software work are given. It has been inferred that the software effectively controls the power elements of the active filter with current feedback.