In a method and an apparatus for controlling the advance movement of a
joining tool, the joining tool fixed to the robot is moved from an
initial position to a pre-position wherein the die of the joining tool is
spaced from the workpieces to be joined for a certain distance. This
distance is detected by a distance detecting means in order to generate a
corresponding distance signal. The joining tool is moved by the
positioning means of the robot in response to the distance signal
precisely to the operating position wherein the die is in engagement with
the workpiece. This allows to compensate for tolerances of the position
of the stationary workpiece.