While a robot passes through operating points designated by an operator, an operation to reproduce and perform an operation desired by the operator is taught to the robot, so that the robot can perform a complicated operation such as an assembly operation. When an operator teaches an operation to a robot, the following methods can be used: indirect teaching in which an operation panel is used to designate positions of the respective joints of the robot, the tip of the robot, and tools, and postures of the robot; and direct teaching in which the operator operates a pointing device including a joystick or the like with the same degree of freedom as that of the tip of the robot, or a handle attached to the tip portion.
The direct teaching using a handle has the advantage that the operator can perform the teaching intuitively, and the time required for the teaching can be shortened accordingly. The direct teaching can be performed in the following manner: the servo of a joint of the robot is put into a free state, and a position and posture are designated; or only the torque required for maintaining a posture of the robot in a rest time is applied to the joints (gravity compensation). However, when an operator moves a joint, the operator needs to apply an external force large enough to overcome the friction force originating from the velocity reducer at the joint. Therefore, the manipulability is not very high. In view of this, a force sensor can be provided at the handle attaching portion, so as to construct a force control system to which operating forces applied from the operator are input. In some cases, another force sensor is provided to detect collisions between tools such as a hand and the object.
However, force sensors are costly, and are fragile against impact. Therefore, the use of force sensors is often avoided. Also, a force sensor is often attached to a portion near a tip portion of a robot. Such a force sensor cannot detect an external force applied to a link portion.
As a method of detecting a collision at a tip portion of a robot without an additional sensor, there is a known method by which the drive torque necessary for a joint is calculated from a joint position command or the like, the calculated necessary drive torque is compared with the drive torque determined from the current of the motor that drives each joint, and a collision at the tip portion of the robot is detected.
As described above, by a conventional technique, a collision at a tip portion of a robot can be detected. In the case of direct teaching, teaching needs to be performed through operations only on a tip portion but also on respective link portions. However, a collision at a link portion, or an external force applied to a link portion, cannot be detected by any conventional technique. Therefore, direct teaching to link portions cannot be performed.