A sensor senses a phase of cyclic activity of a portion of a subject's body. A control unit, in a first cycle of the cyclic activity, moves a portion of a tool, in a given direction, in response to the sensor sensing that the cyclic activity is at a first given phase thereof. The control unit, following the given phase and prior to an occurrence of the given phase in a subsequent cycle, inhibits the tool's movement. The control unit in a second cycle, subsequent to the inhibiting, moves the tool in the given direction, in response to the sensor sensing that the second cycle is at the given phase, without moving the tool in an opposite direction, between (a) moving the tool in the given direction in the first cycle, and (b) moving the tool in the given direction in the second cycle. Other embodiments are also described.