Singularity-free neural network controller with iterative training