PURPOSE: To prevent the interference with a work of an electromagnetic roll and the derailment from a flange and to perform a good automatic flange welding with the control of the direction by detecting with a visual sensor the position of the rotary welding electrode roll being inside the flange width of a robot holding work.
CONSTITUTION: The flange part Wa of a work W held by the robot 7 of a seam welding machine 1 is subjected to a rotary welding by the pinching by the cylinder 4 of the upper and lower electrode roll 21, 22. In this case, the roll position inside the width of the flange part Wa is detected by a visual sensor 20 and by the position biased signal thereof the rotary direction of the electrode roll 2 driven by a motor 3 according to the motion of the robot 7 is automatically controlled with the rotation of shafts 14, 17 by driving sources 16, 19. the interference with the work W of the electrode roll 2 and the derailment from the flange part Wa are prevented and the flange part Wa can be welded automatically well.