Detection of Oscillations with Application in the Pantograph Control