The article focusses on detecting the unbalance of a mechanical component in the electric drive system of a two-mass servomechanism with a permanent magnet synchronous motor (PMSM), which is connected to the load via a long, flexible shaft. In the example analysed, the degree of unbalance was determined using the reference current signal from the speed controller of the field-orientated control (FOC) system. The authors presented a two-mass model with an unbalanced mechanical system. The short-time Fourier transform (STFT) transform was used to analyse the symptoms of unbalance, and an artificial neural network multi-layer perceptron (MLP) was used for system state inference. The effectiveness of the presented analysis, based on the reference current signal from the sensor embedded in the control system, was experimentally confirmed.