According to an aspect, a system for stimulating muscle comprises a set of stimulators to stimulate a first muscles, a set of sensors providing first measurement comprising a set of electromyograms (EMG) from another set of muscles coupled to the body part, a set of sensors mounted in the vicinity of the set of stimulator and the set of sensors, providing a measurement representing a motion and orientation of the first body part, another set of sensors providing a measurement representing a condition external to the body part, a processor generating a first position of the body part at a first time instance from the measurements and a processor adjusting at least one of a time duration, trigger instance, and trigger strength of the set of stimulator. In that, the comparator generates a position error as difference between the first position and a reference.