The paper is focused on issues related to the control of electrical drives with oscillations of state variables. The main problem deals with the construction of the mechanical part, which contains elastic elements used as a coupling between the motor machine and the load. In such cases, strict tracking of the reference trajectory is difficult, so damping of the disturbances is necessary. For this purpose, the full state vector of the object is applied as the feedback signal for the speed controller. This method is efficient and relatively easy to implement (including the hardware part). However, the control accuracy is dependent on the quality of the parameters identification and the invariance of the object. Thus, two adaptive structures are proposed for the two-mass system. Moreover, selected coefficients were optimized using metaheuristic algorithms (symbiotic organism search and flower pollination algorithm). After presentation of the preliminaries and mathematical background, tests were conducted, and the numerical simulations are shown. Finally, the experimental verification for the 0.5 kW DC machines was performed. The results confirm the theoretical concept and the initial assumptions: the state controller leads to the precise control of the drive with a long shaft; recalculation of the parameters can improve the work of the drive under changes of time constants; modern design tools are appropriate for this application.