Quaternion gradient descent feedback control system