Quaternion-based rate/attitude tracking system with application to gimbal attitude control