Control and diagnostics of a gear test rig for aerospace applications