Adaptive control of manipulators through repeated trials