Patent Publication Number: US-2023158687-A1

Title: Device for correcting robot teaching position, teaching device, robot system, teaching position correction method, and computer program

Description:
TECHNICAL FIELD 
     The present invention relates to a device for correcting a teaching position of a robot, a teaching device, a robot system, a teaching position correction method, and a computer program. 
     BACKGROUND ART 
     A device for correcting a teaching position of a robot has been known (e.g., PTL 1). 
     CITATION LIST 
     Patent Literature 
     
         
         PTL 1: JP 2018-202559 A 
       
    
     SUMMARY OF INVENTION 
     Technical Problem 
     In the related art, a technique for further simplifying a task involved in a teaching position correction of a robot has been demanded. 
     Solution to Problem 
     In one aspect of the present disclosure, a device configured to correct a teaching position of a robot when an arrangement of a workpiece with respect to the robot changes, by using an index arranged at a predetermined position with respect to the workpiece, includes a first position data acquisition section configured to acquire first position data of the robot when a hand-tip portion of the robot is arranged in a predetermined positional relationship with the index in a state where the hand-tip portion is arranged at a first orientation, before change of the arrangement of the workpiece, a second position data acquisition section configured to acquire second position data of the robot when the hand-tip portion is arranged in the predetermined positional relationship with the index in a state where the hand-tip portion is arranged at the first orientation, after the change of the arrangement of the workpiece, an orientation change data acquisition section configured to acquire orientation change data indicating a change amount in an orientation of the workpiece with respect to the robot due to the change of the arrangement, based on the first position data and the second position data, a third position data acquisition section configured to acquire third position data of the robot when the hand-tip portion is arranged in the predetermined positional relationship with the index in a state where the hand-tip portion is arranged at a second orientation which is corrected from the first orientation by using the orientation change data, and a position change data acquisition section configured to acquire position change data indicating a change amount in a position of the workpiece with respect to the robot due to the change of the arrangement, based on the first position data and the third position data. 
     In another aspect of the present disclosure, a method of correcting a teaching position of a robot when an arrangement of a workpiece with respect to the robot changes, by using an index arranged at a predetermined position with respect to the workpiece, includes acquiring first position data of the robot when a hand-tip portion of the robot is arranged in a predetermined positional relationship with the index in a state where the hand-tip portion is arranged at a first orientation, before change of the arrangement of the workpiece, acquiring second position data of the robot when the hand-tip portion is arranged in the predetermined positional relationship with the index in a state where the hand-tip portion is arranged at the first orientation, after the change of the arrangement of the workpiece, acquiring orientation change data indicating a change amount in an orientation of the workpiece with respect to the robot due to the change of the arrangement, based on the first position data and the second position data, acquiring third position data of the robot when the hand-tip portion is arranged in the predetermined positional relationship with the index in a state where the hand-tip portion is arranged at a second orientation which is corrected from the first orientation by using the orientation change data, and acquiring position change data indicating a change amount in a position of the workpiece with respect to the robot due to the change of the arrangement, based on the first position data and the third position data. 
     In still another aspect of the present disclosure, a computer program for correcting a teaching position of a robot when an arrangement of a workpiece with respect to the robot changes, by using an index arranged at a predetermined position with respect to the workpiece, causes a computer to function as a first position data acquisition section configured to acquire first position data of the robot when a hand-tip portion of the robot is arranged in a predetermined positional relationship with the index in a state where the hand-tip portion is arranged at a first orientation, before change of the arrangement of the workpiece, a second position data acquisition section configured to acquire second position data of the robot when the hand-tip portion is arranged in the predetermined positional relationship with the index in a state where the hand-tip portion is arranged at the first orientation, after the change of the arrangement of the workpiece, an orientation change data acquisition section configured to acquire orientation change data indicating a change amount in an orientation of the workpiece with respect to the robot due to the change of the arrangement, based on the first position data and the second position data, a third position data acquisition section configured to acquire third position data of the robot when the hand-tip portion is arranged in the predetermined positional relationship with the index in a state where the hand-tip portion is arranged at a second orientation which is corrected from the first orientation by using the orientation change data, and a position change data acquisition section configured to acquire position change data indicating a change amount in a position of the workpiece with respect to the robot due to the change of the arrangement, based on the first position data and the third position data. 
     Effects of Invention 
     According to the present disclosure, position change data for a teaching position correction can be acquired with third position data without performing an actual machine touch-up operation. Therefore, a task involved in a teaching position correction can be simplified. 
    
    
     
       BRIEF DESCRIPTION OF DRAWINGS 
         FIG.  1    is a diagram of a robot system according to an embodiment. 
         FIG.  2    is a block diagram of the robot system illustrated in  FIG.  1   . 
         FIG.  3    is an enlarged diagram of a hand-tip portion illustrated in  FIG.  1   . 
         FIG.  4    is a diagram of the hand-tip portion illustrated in  FIG.  3    as seen from a positive direction of a z-axis of an MIF coordinate system. 
         FIG.  5    is a diagram for explaining a workpiece and an index according to an embodiment. 
         FIG.  6    is a flowchart illustrating an example of an advance flow. 
         FIG.  7    is a flowchart illustrating an example of a flow of step S 2  in  FIG.  6    and a flow of step S 2 ′ in  FIG.  10   . 
         FIG.  8    illustrates an example of image data imaged by a vision sensor in step S 12  in  FIG.  7   . 
         FIG.  9    is a flowchart illustrating an example of a teaching position correction flow. 
         FIG.  10    is a flowchart illustrating an example of a flow of step S 23  in  FIG.  9   . 
         FIG.  11    is a block diagram of a robot system according to another embodiment. 
     
    
    
     DESCRIPTION OF EMBODIMENTS 
     Hereinafter, embodiments of the present disclosure will be described in detail with reference to the drawings. Note that in various embodiments described below, the same elements are denoted by the same reference signs, and redundant description will be omitted. First, a robot system  10  according to an embodiment will be described with reference to  FIG.  1    to  FIG.  4   . The robot system  10  includes a robot  12 , a vision sensor  14 , a control device  16 , and a teaching device  18 . 
     In the present embodiment, the robot  12  is a vertical articulated robot, and includes a robot base  20 , a rotating torso  22 , a robot arm  24 , and a wrist  26 . The robot base  20  is fixed on a floor of a work cell. The rotating torso  22  is provided on the robot base  20  to be pivotable about a vertical axis. The robot arm  24  includes a lower arm  28  rotatable about a horizontal axis and provided on the rotating torso  22 , and an upper arm  30  rotatably provided on a tip part of the lower arm  28 . 
     The wrist  26  includes a wrist base  32  rotatably coupled to a tip part of the upper arm  30 , and a wrist flange  34  rotatable about an axis line A is provided on the wrist base  32 . The wrist flange  34  is a cylindrical member having the axis line A as a central axis, and includes an attachment surface  34   a  on a tip side thereof. 
     An end effector  36  for performing a task on a workpiece is removably attached to the attachment surface  34   a . The end effector  36  is, for example, a robot hand, a welding gun, a laser machining head, a coating material applicator, or the like, and performs a predetermined task (work-handling, welding, laser machining, coating, etc.) on a workpiece W. The wrist flange  34  and the end effector  36  attached to the tip side of the wrist flange  34  constitute a hand-tip portion  38  of the robot  12 . 
     Each of the components (i.e., the robot base  20 , the rotating torso  22 , the robot arm  24 , and the wrist  26 ) of the robot  12  includes a servo motor  39  inside ( FIG.  2   ). The servo motors  39  each drive the corresponding movable component (i.e., the rotating torso  22 , the robot arm  24 , and the wrist  26 ) of the robot  12  in response to a command from the control device  16 . 
     A robot coordinate system C 1  ( FIG.  1   ) is set in the robot  12 . The robot coordinate system C 1  is a coordinate system for automatically controlling an operation of each movable component of the robot  12 , and is fixed in a three-dimensional space. In the present embodiment, the robot coordinate system C 1  is set with respect to the robot  12  such that its origin is arranged at the center of the robot base  20  and its z-axis coincides with a rotating axis of the rotating torso  22 . 
     On the other hand, as illustrated in  FIGS.  1 ,  3  and  4   , a mechanical interface (hereinafter abbreviated as “MIF”) coordinate system C 2  is set in the hand-tip portion  38 . The MIF coordinate system C 2  is a coordinate system for controlling a position and an orientation of the hand-tip portion  38  (i.e., the end effector  36 ) in the robot coordinate system C 1 . 
     In the present embodiment, the MIF coordinate system C 2  is set with respect to the hand-tip portion  38  such that its origin is arranged at the center of the attachment surface  34   a  of the wrist flange  34  and its z-axis coincides with the axis line A. When the hand-tip portion  38  is moved, a processor  40  sets the MIF coordinate system C 2  in the robot coordinate system C 1 , and controls each servo motor  39  of the robot  12  such that the hand-tip portion  38  is arranged at a position and an orientation represented by the set MIF coordinate system C 2 . In this way, the processor  40  can position the hand-tip portion  38  in any position and any orientation in the robot coordinate system C 1 . 
     The vision sensor  14  is, for example, a camera or a three-dimensional vision sensor, and includes an optical system (a focusing lens, a focus lens, etc.) and an imaging sensor (a CCD, a CMOS, etc.). The vision sensor  14  images an object and transmits the imaged image data to the control device  16 . The vision sensor  14  is fixed in a predetermined position with respect to the hand-tip portion  38 . 
     More specifically, as illustrated in  FIG.  4   , the vision sensor  14  is provided in the wrist flange  34  in a built-in manner and fixed immovably, and is arranged such that a subject image is incident on the optical system of the vision sensor  14  along an optical axis O through an opening  34   b  formed in the attachment surface  34   a . A sensor coordinate system C 3  is set in the vision sensor  14 . 
     The sensor coordinate system C 3  is a coordinate system for defining coordinates of each pixel of the image data imaged by the vision sensor  14 , and is set with respect to the vision sensor  14  such that its x-y plane is orthogonal to the optical axis O of the vision sensor  14 . Here, in the present embodiment, a positional relationship between the MIF coordinate system C 2  and the sensor coordinate system C 3  is not calibrated and is assumed to be unknown. 
     The control device  16  controls an operation of the robot  12  and the vision sensor  14 . Specifically, the control device  16  is a computer including the processor  40 , a memory  42 , and an I/O interface  44 . The processor  40  includes a CPU, a GPU, or the like, and is communicably connected to the memory  42  and the I/O interface  44  via a bus  46 . While communicating with the memory  42  and the I/O interface  44 , the processor  40  transmits a command to the robot  12  and the vision sensor  14  and controls an operation of the robot  12  and the vision sensor  14 . 
     The memory  42  includes a RAM, a ROM, or the like, and stores various types of data temporarily or permanently. The I/O interface  44  includes, for example, an Ethernet (trade name) port, a USB port, a fiber optic connector, a HDMI (trade name) terminal, or the like, and communicates data to or from an external equipment through wireless or wired communications under a command from the processor  40 . The servo motor  39  and the vision sensor  14  described above are communicably connected to the I/O interface  44  by wired or wireless manner. 
     The teaching device  18  is, for example, a hand-held device (a teaching pendant or portable equipment such as tablet portable equipment) used to teach the robot  12  an operation for executing a predetermined task. Specifically, the teaching device  18  is a computer including a processor  50 , a memory  52 , an I/O interface  54 , an input device  56 , and a display device  58 . The processor  50  includes a CPU, a GPU, or the like, and is communicably connected to the memory  52 , the input device  56 , the display device  58 , and the I/O interface  54  via a bus  60 . 
     The memory  52  includes a RAM, a ROM, or the like, and stores various types of data temporarily or permanently. The I/O interface  54  includes, for example, an Ethernet (trade name) port, a USB port, a fiber optic connector, a HDMI (trade name) terminal, or the like, and communicates data to or from an external equipment through wireless or wired communications under a command from the processor  50 . The I/O interface  54  is connected to the I/O interface  44  of the control device  16 , and the control device  16  and the teaching device  18  can communicate with each other. 
     The input device  56  includes a push button, a switch, a touch panel, or the like, accepts input from an operator, and transmits input information to the processor  50 . The display device  58  includes an LCD, an organic EL display, or the like, and displays various types of information under a command from the processor  50 . The operator can perform a jog operation on the robot  12  by operating the input device  56 , and teach the robot  12  an operation. 
     By teaching the robot  12 , the operator can construct a work program WP for causing the robot  12  to execute a predetermined task. In the work program WP, a teaching position TP 0  in which the hand-tip portion  38  (specifically, the end effector  36 ) of the robot  12  needs to be positioned for a task is defined. The work program WP is stored in the memories  42  and  52  in advance. 
     The processor  50  transmits a command for operating the robot  12  to the control device  16 , and the processor  40  of the control device  16  controls the robot  12  in response to a command from the teaching device  18 . In this way, the processor  50  can control an operation of the robot  12  via the control device  16 . 
     As illustrated in  FIGS.  1  and  5   , in the present embodiment, the workpiece W being a task target of the robot  12  is fixed in a predetermined position of a holding structure B by a jig (not illustrated) or the like. A workpiece coordinate system C 4  is set in the work piece W. The workpiece coordinate system C 4  is a coordinate system for defining a position and an orientation of the workpiece W in the robot coordinate system C 1 , and is fixed with respect to the workpiece W (or the robot coordinate system C 1 ). In the present embodiment, the workpiece coordinate system C 4  is arranged with respect to the workpiece W such that its origin is arranged at one vertex angle of a top face of the workpiece W and its x-y plane is parallel to the top face of the workpiece W. 
     Here, the robot  12 , the workpiece W, and the holding structure B may be transferred to another manufacturing line, or at least one of the robot  12 , the workpiece W, and the holding structure B may be replaced. In such a case, there is a possibility that an arrangement of the workpiece W with respect to the robot  12  (or the robot coordinate system C 1 ) changes, and, as a result, a task cannot be accurately executed on a target position on the workpiece W even when the robot  12  is operated according to the work program WP and the hand-tip portion  38  is positioned at the teaching position TP 0 . 
     Thus, in the present embodiment, the teaching device  18  corrects the teaching position TP 0  of the robot  12  defined in the work program WP by using indices ID 1 , ID 2 , and ID 3  arranged at a predetermined position with respect to the workpiece W. As illustrated in  FIG.  5   , in the present embodiment, a total of three indices ID 1 , ID 2 , and ID 3  are provided on a top face of the holding structure B. 
     Each of the first index ID 1 , the second index ID 2 , and the third index ID 3  is formed of a circular line D and two straight lines E and F orthogonal to each other. The indices ID 1 , ID 2 , and ID 3  are provided to the holding structure B as a visually recognizable feature such as, for example, a pattern using a coating material or an engraving (unevenness) formed on the top face of the holding structure B. 
     Next, an operation flow of the teaching device  18  will be described. First, the processor  50  of the teaching device  18  executes an advance flow illustrated in  FIG.  6    before an arrangement of the robot  12  and the workpiece W changes (i.e., the robot  12 , the workpiece W, or the holding mechanism B is transferred or replaced). The advance flow illustrated in  FIG.  6    starts when the processor  50  receives an advance flow start command from an operator, a host controller, or a computer program CP for a teaching position correction. 
     In step S 1 , the processor  50  sets a number “n” (in the present embodiment, n=1, 2, 3) that specifies an n-th index ID n  to “1”. In step S 2 , the processor  50  executes processing of arranging the hand-tip portion  38  in a predetermined positional relationship with the n-th index ID n . Step S 2  will be described with reference to  FIG.  7   . 
     In step S 11 , the processor  50  arranges the hand-tip portion  38  in an initial position P A_n  with respect to the n-th index ID n  and a first orientation OR 1 . Here, the initial position P A_n  is predetermined as a position of the hand-tip portion  38  in which the n-th index ID n  falls within a field of vision of the vision sensor  14 . Further, the first orientation OR 1  is defined as coordinates (W 1 , P 1 , R 1 ) of the robot coordinate system C 1 . 
     Herein, the coordinate W 1  indicates an angle about the x-axis of the robot coordinate system C 1 , the coordinate P 1  indicates an angle about the y-axis of the robot coordinate system C 1 , and the coordinate R 1  indicates an angle about the z-axis of the robot coordinate system C 1 . Data of the initial position P A_n  and the first orientation OR 1  (i.e., the coordinates of the robot coordinate system C 1 ) is defined in the computer program CP. 
     The processor  50  controls the robot  12  via the control device  16 , operates the robot  12 , and arranges the hand-tip portion  38  in the initial position P A_n  and the first orientation OR 1 . At this time, the vision sensor  14  moves along with the hand-tip portion  38  by the robot  12 , and is arranged at a position in which the n-th index ID n  falls within the field of vision. 
     If n=1 is set at a point in time at which step S 11  starts, the processor  50  operates the robot  12 , and arranges the hand-tip portion  38  in the initial position P A_1  with respect to the first index ID 1  and in the first orientation OR 1 . In this way, in the present embodiment, the processor  50  functions as a robot control section  72  ( FIG.  2   ) that controls an operation of the robot  12  so as to move the hand-tip portion  38  and the vision sensor  14 . 
     In step S 12 , the processor  50  operates the vision sensor  14 , and images the n-th index ID n . An example of image data JD n  imaged by the vision sensor  14  is illustrated in  FIG.  8   . As illustrated in  FIG.  8   , in the present embodiment, the origin of the sensor coordinate system C 3  is arranged at the center (specifically, a pixel arranged at the center) of the image data JD n . 
     The processor  50  acquires the image data JD n  from the vision sensor  14  via the control device  16 , and stores the image data in the memory  52 . Therefore, the processor  50  functions as an image acquisition section  74  ( FIG.  2   ) that acquires the image data JD n  in which the vision sensor  14  images the n-th index ID n . Note that the processor  50  may directly acquire the image data JD n  from the vision sensor  14  not via the control device  16 . In this case, the I/O interface  54  may be communicably connected to the vision sensor  14  by wired or wireless manner. 
     In step S 13 , the processor  50  determines whether a position IP n  of the n-th index ID n  is arranged at a predetermined target position PO and a size SZ n  of the n-th index ID n  coincides with a predetermined target value TS in the image data JD n  acquired in most recent step S 12 . 
     Specifically, the processor  50  analyzes the acquired image data JD n , and specifies an intersection point G of the straight lines E and F of the n-th index ID n  imaged in the image data JD n . Then, the processor  50  acquires, as data indicating the position IP n , coordinates (x, y) of the intersection point Gin the sensor coordinate system C 3 . Here, in the present embodiment, the target position PO is set as the origin of the sensor coordinate system C 3 . 
     As an example, the processor  50  determines that the position IP n  is arranged at the target position PO when the x coordinate of the position IP n  in the sensor coordinate system C 3  falls within a range of −x th ≤x≤x th  (i.e., a range [−x th , x th ]) and they coordinate falls within a range of −y th ≤y≤y th  (i.e., a range [−y th , y th ]). As another example, the processor  50  calculates a distance δ G =(x 2 +y 2 ) 1/2  between the origin of the sensor coordinate system C 3  and the intersection point G, and determines that the position IP n  is arranged at the target position PO when the distance δ G  is equal to or less than a threshold value δ Gth . 
     In this way, in the present embodiment, the processor  50  functions as an image determination section  76  ( FIG.  2   ) that determines whether the position IP n  of the n-th index ID n  is arranged at the target position PO in the image data JD n . Note that the target position PO may be set at any position: coordinates (x0, y0), other than the origin of the sensor coordinate system C 3 . In this case, the above-described ranges [−x th , x th ] and [−y th , y th ] may be set as [−x th +x 0 , x th +x 0 ] and [−y th +y 0 , y th +y 0 ]. 
     Further, the processor  50  analyzes the image data JD n , and specifies the circle D of the n-th index ID n  imaged in the image data JD n . Then, the processor  50  acquires, as data indicating the size SZ n , an area of the circle D (or the number of pixels included in an image region of the circle D) in the sensor coordinate system C 3 . Then, the processor  50  determines that the size SZ n , coincides with the target value TS when the size SZ n  falls within a predetermined range (e.g., [0.95×TS, 1.05×TS]) with reference to the target value TS. 
     In step S 13 , the processor  50  determines YES when the position IP n  is arranged at the target position PO and the size SZ n  coincides with the target value TS, and ends step S 2  in  FIG.  7   , and the processing proceeds to step S 3  in  FIG.  6   . On the other hand, the processor  50  determines NO when the position IP n  is not arranged at the target position PO or the size SZ n  does not coincide with the target value TS, and the processing proceeds to step S 14 . 
     When YES is determined in step S 13 , the hand-tip portion  38  is arranged in a predetermined positional relationship with the n-th index ID n  in a state where the hand-tip portion  38  is arranged at the first orientation OR 1 . The predetermined positional relationship is a positional relationship between the hand-tip portion  38  and the n-th index ID n  when the vision sensor  14  images the image data JD n  in which YES is determined in step S 13 . In other words, in a state where the hand-tip portion  38  is arranged at the first orientation OR 1 , the hand-tip portion  38  is arranged in a positional relationship with the n-th index ID n  in which the optical axis O of the vision sensor  14  passes through the intersection point G and the vision sensor  14  is separated from the intersection point G by a predetermined distance. 
     In step S 14 , the processor  50  translates the hand-tip portion  38  in a direction H by a distance d in a state where the hand-tip portion  38  is arranged at the first orientation OR 1 . Here, in step S 14  executed for the first time, the processor  50  may translate the hand-tip portion  38  by predetermined (or randomly selected) distance d 0  and direction H 0 . 
     Subsequently, the distance d and the direction H in which the hand-tip portion  38  is translated in step S 14  executed for the second and subsequent times may be determined from a displacement amount and a direction of the n-th index ID n  displaced in the sensor coordinate system C 3  as a result of the translation in the image data JD n  imaged in step S 12  executed for the second and subsequent times. 
     Specifically, the processor  50  determines the distance d and the direction H such that the position IP n  and the size SZ n  can be brought closer to the target position PO and the target value TS, respectively. After step S 14  is executed, the processing returns to step S 12  and loops step S 12  to step S 14  until the processor  50  determines YES in step S 13 . 
     Again, with reference to  FIG.  6   , in step S 3 , the processor  50  acquires position data PD 1_n  (first position data) of the robot  12  when the processor  50  determines YES in step S 13 . For example, at a point in time at which the processor  50  determines YES in step S 13 , the processor  50  acquires, as the position data PD 1_n , coordinates (x 1_n , y 1_n , z 1_n ) of the origin of the MIF coordinate system C 2  in the robot coordinate system C 1 , and stores the coordinates in the memory  52 . 
     Note that the processor  50  may obtain coordinates (x 1_n , y 1_n , z 1_n ), based on a position feedback from a rotation detector (an encoder, a hall element, etc.) provided in each of the servo motors  39  of the robot  12 . In this way, in the present embodiment, the processor  50  functions as a first position data acquisition section  78  ( FIG.  2   ) that acquires the position data PD 1_n  (first position data). 
     In step S 4 , the processor  50  increments the number “n” that specifies the n-th index ID n  by “1” (n=n+1). In step S 5 , the processor  50  determines whether the number “n” that specifies the n-th index ID n  is “4” (n=4). The number “4” is the number of a total of the index ID n +1. The processor  50  determines YES when n=4 and ends the advance flow illustrated in  FIG.  6   , whereas the processor  50  determines NO when n≤3 holds and the processing returns to step S 2 . Then, the processing loops step S 2  to S 5  until the processor  50  determines YES in step S 5 . 
     At a point in time at which the advance flow in  FIG.  6    ends, position data PD 1_1  acquired for the first index ID 1 : coordinates (x 1_1 , y 1_1 , z 1_1 ), position data PD 1_2  acquired for the second index ID 2 : coordinates (x 1_2 , y 1_2 , z 1_2 ), and position data PD 1_3  acquired for the third index ID 3 : coordinates (x 1_3 , y 1_3 , z 1_3 ) are acquired and stored in the memory  52 . 
     After the arrangement of the robot  12  and the workpiece W is changed (i.e., the robot  12 , the workpiece W, or the holding mechanism B is transferred or replaced), the processor  50  executes a teaching position correction flow illustrated in  FIG.  9   . Note that, in the same position before the change of arrangement as illustrated in  FIG.  5   , the first index ID 1 , the second index ID 2 , and the third index ID 3  are also provided with respect to the workpiece W after the change of arrangement. The teaching position correction flow illustrated in  FIG.  9    starts when the processor  50  receives a position correction flow start command from an operator, a host controller, or the computer program CP. 
     In step S 21 , the processor  50  executes a second position data acquisition process. The flow in step S 21  is the same as the flow illustrated in  FIG.  6   . Specifically, the processor  50  executes steps S 1  to S 5  for the n-th index ID n  after the change of arrangement. In step S 3  executed in step S 21 , the processor  50  acquires position data PD 2_n  (second position data) of the robot  12  when the hand-tip portion  38  is arranged in the above-described predetermined positional relationship (i.e., the positional relationship when YES is determined in step S 13 ) with the n-th index ID 1  after the change of arrangement, in a state where the hand-tip portion  38  is arranged at the first orientation OR 1 . 
     As a result of step S 21 , position data PD 2_1  acquired for the first index ID 1 : coordinates (x 2_1 , y 2_1 , z 2_1 ), position data PD 2_2  acquired for the second index ID 2 : coordinates (x 2_2 , y 2_2 , z 2_2 ), and position data PD 2_3  acquired for the third index ID 3 : coordinates (x 2_3 , y 2_3 , z 2_3 ) are acquired and stored in the memory  52 . In this way, in the present embodiment, the processor  50  functions as a second position data acquisition section  80  ( FIG.  2   ) that acquires the position data PD 2_n  (second position data). 
     In step S 22 , the processor  50  acquires orientation change data, based on the position data PD 1_n  and PD 2_n . Specifically, the processor  50  first obtains the following matrix V 1 . 
     
       
         
           
             
               
                 
                   
                     V 
                     ⁢ 
                     1 
                   
                   = 
                   
                     ( 
                     
                       
                         
                           
                             n 
                             1 
                           
                         
                         
                           
                             o 
                             1 
                           
                         
                         
                           
                             a 
                             1 
                           
                         
                         
                           0 
                         
                       
                       
                         
                           0 
                         
                         
                           0 
                         
                         
                           0 
                         
                         
                           1 
                         
                       
                     
                     ) 
                   
                 
               
               
                 
                   [ 
                   
                     Equation 
                     ⁢ 
                         
                     1 
                   
                   ] 
                 
               
             
           
         
       
     
     Here, n 1  can be obtained from an equation formed of n 1 =(PD 1_2 −PD 1_1 )/|PD 1_2 −PD 1_1 | by using the above-described position data PD 1_1  and PD 1_2 . (PD 1_2 −PD 1_1 ) is a vector VT 1  from the coordinates (x 1_1 , y 1_1 , z 1_1 ) to the coordinates (x 1_2 , y 1_2 , z 1_2 ), and n 1  represents a unit vector of the vector VT 1 . 
     Further, a 1  can be obtained from an equation formed of a 1 =r 1 /|r 1 |. r 1  can be obtained from an equation formed of r 1 =(PD 1_3 −PD 1_1 )·n 1  by using the above-described position data PD 1_1  and PD 1_3  and the unit vector n 1 . Here, (PD 1_3 −PD 1_1 ) is a vector VT 2  from the coordinates (x 1_1 , y 1_1 , z 1_1 ) to the coordinates (x 1_3 , y 1_3 , z 1_3 ), and r 1  is a vector orthogonal to the vector VT 2  and the above-described unit vector n 1  (i.e., r 1  is an outer product of the vector VT 2 : (PD 2_3 −PD 2_1 ) and the vector n 1 ). In this way, the processor  50  can calculate each parameter of the matrix V 1 , based on the position data PD 1_n . 
     Next, the processor  50  obtains the following matrix V 2 . 
     
       
         
           
             
               
                 
                   
                     V 
                     ⁢ 
                     2 
                   
                   = 
                   
                     ( 
                     
                       
                         
                           
                             n 
                             2 
                           
                         
                         
                           
                             o 
                             2 
                           
                         
                         
                           
                             a 
                             2 
                           
                         
                         
                           0 
                         
                       
                       
                         
                           0 
                         
                         
                           0 
                         
                         
                           0 
                         
                         
                           1 
                         
                       
                     
                     ) 
                   
                 
               
               
                 
                   [ 
                   
                     Equation 
                     ⁢ 
                         
                     2 
                   
                   ] 
                 
               
             
           
         
       
     
     Here, n 2  can be obtained from an equation formed of n 2 =(PD 2_2 −PD 2_1 )/PD 2_2 −PD 2_1 | by using the above-described position data PD 2_1  and PD 2_2 . Here, (PD 2_2 −PD 2_1 ) is a vector VT 3  from the coordinates (x 2_1 , y 2_1 , z 2_1 ) to the coordinates (x 2_2 , y 2_2 , z 2_2 ), and n 2  represents a unit vector of the vector VT 3 . 
     Further, a 2  can be obtained from an equation formed of a 2 =r 2 /|r 2 |. r 2  can be obtained from an equation formed of r 2 =(PD 2_3 −PD 2_1 ) n 2  by using the above-described position data PD 2_1  and PD 2_3  and the unit vector n 2 . 
     Here, (PD 2_3 −PD 2_1 ) is a vector VT 4  from the coordinates (x 2_1 , y 2_1 , z 2_1 ) to the coordinates (x 2_3 , y 2_3 , z 2_3 ), and r 2  is a vector orthogonal to the vector VT 4  and the above-described unit vector n 2  (i.e., r 2  is an outer product of the vector VT 4 : (PD 2_3 −PD 2_1 ) and the vector n 2 ). In this way, the processor  50  can calculate each parameter of the matrix V 2 , based on the position data PD 2_n . 
     Next, the processor  50  obtains a matrix M 1  from an equation formed of M 1 =inv(V 2 )·V 1  by using the calculated matrices V 1  and V 2 . The matrix M 1  corresponds to orientation change data indicating a change amount in an orientation of the workpiece W with respect to the robot  12  (or the robot coordinate system C 1 ) due to the change of arrangement. In this way, in the present embodiment, the processor  50  functions as an orientation change data acquisition section  82  ( FIG.  2   ) that acquires the orientation change data M 1 , based on the position data PD 1_n  and PD 2_n . 
     In step S 23 , the processor  50  executes a third position data acquisition process. Step S 23  will be described with reference to  FIG.  10   . In step S 31 , the processor  50  corrects the first orientation OR 1 . Specifically, the processor  50  obtains a second orientation OR 2  (W 2 , P 2 , R 2 ) of the hand-tip portion  38  by correcting the first orientation OR 1  (W 1 , P 1 , R 1 ) of the hand-tip portion  38  (or the tool coordinate system C 2 ) by using the orientation change data M 1 . 
     Each of the coordinates (W 2 , P 2 , R 2 ) of the second orientation OR 2  can be obtained by converting the coordinates (W 1 , P 1 , R 1 ) of the first orientation OR 1  by the matrix M 1  (=inv(V 2 ) V 1 ) obtained in step S 22  (i.e., OR 2 =M 1 ·OR 1 ). The second orientation OR 2  is an orientation of the hand-tip portion  38  (i.e., a direction of each axis of the tool coordinate system C 2 ) corrected from the first orientation OR 1  so as to accommodate a change amount in an orientation of the workpiece W with respect to the robot  12  (or the robot coordinate system C 1 ) due to the change of arrangement. 
     Next, the processor  50  executes step S 2 ′. Step S 2 ′ includes steps S 11  to S 14  illustrated in  FIG.  7   , but is different from above-described step S 2  in the following points. Specifically, in step S 2 ′, the processor  50  executes steps S 11  to S 14  in a state where the hand-tip portion  38  is arranged at the second orientation OR 2  after the correction is performed in step S 31 . 
     Specifically, in step S 11 , the processor  50  arranges the hand-tip portion  38  in the initial position P A_n  with respect to one index ID n  in a state where the hand-tip portion  38  is arranged at the second orientation OR 2 . The one index ID n  is one index selected from the three indices ID 1 , ID 2 , and ID 3 , and may be specified in advance by an operator. 
     Next, the processor  50  executes steps S 12  to S 14  related to the one index ID n  in a state where the hand-tip portion  38  is arranged at the second orientation OR 2 . As a result, the hand-tip portion  38  is arranged in a predetermined positional relationship with the one index ID n  (i.e., a positional relationship between the hand-tip portion  38  and the one index ID 1  when the vision sensor  14  images the image data JD n  in which YES is determined in step S 13 ) in a state where the hand-tip portion  38  is arranged at the second orientation OR 2 . 
     Again, with reference to  FIG.  10   , after step S 2 ′ ends, the processor  50  executes step S 3 , and acquires position data PD 3_n  (third position data) of the robot  12  at this time. Specifically, the processor  50  acquires, as the position data PD 3_n , coordinates (x 3_n , y 3_n , z 3_n ) of the origin of the MIF coordinate system C 2  in the robot coordinate system C 1  at a point in time at which YES is determined in step S 13  in step S 2 ′, and the processor  50  stores the coordinates in the memory  52 . 
     In this way, in the present embodiment, the processor  50  functions as a third position data acquisition section  84  ( FIG.  2   ) that acquires the third position data PD 3_n  of the robot  12  when the hand-tip portion  38  is arranged in a predetermined positional relationship with one index ID n  in a state where the hand-tip portion  38  is arranged at the second orientation OR 2 . 
     Again, with reference to  FIG.  9   , in step S 24 , the processor  50  acquires position change data, based on the position data PD 1_n  (first position data) and PD 3_n  (third position data). Specifically, the processor  50  obtains a matrix M 2  from an equation formed of M 2 =W B inv(M 1 ·W A ). 
     Here, W A  is position orientation data representing the first position data PD 1_n  acquired for one index ID n  selected in above-described step S 2 ′, and the first orientation OR 1 . If the first index ID 1  is selected as the one index ID n  in step S 2 ′, the position orientation data W A  is represented as coordinates (x 1_1 , y 1_1 , z 1_1 , W 1 , P 1 , R 1 ). 
     Further, W B  is position orientation data representing the third position data PD 3_n  acquired in step S 3  in  FIG.  10   , and the second orientation OR 2  acquired in step S 31 . If the first index ID 1  is selected as the one index ID n , the position orientation data W B  is represented as coordinates (x 3_1 , y 3_1 , z 3_1 , W 2 , P 2 , R 2 ). 
     The matrix M 2  corresponds to position change data indicating a change amount in a position of the workpiece W with respect to the robot  12  (the robot coordinate system C 1 ) due to the change of arrangement. In this way, in the present embodiment, the processor  50  functions as a position change data acquisition section  86  ( FIG.  2   ) that acquires the position change data M 2 , based on the position data PD 1_n  and PD 3_n . 
     In step S 25 , the processor  50  acquires, based on the orientation change data M 1  and the position change data M 2 , conversion data for correcting the teaching position T 0  defined in the work program WP. Specifically, the processor  50  obtains, as the conversion data, a matrix M 3  from an equation formed of M 3 =M 2 ·M 1 . In this way, in the present embodiment, the processor  50  functions as a conversion data acquisition section  88  ( FIG.  2   ) that acquires the conversion data M 3 , based on the orientation change data M 1  and the position change data M 2 . 
     In step S 26 , the processor  50  corrects the teaching position TP 0 . Specifically, the processor  50  converts the original teaching position TP 0  into a new teaching position TP 1  with an equation formed of TP 1 =M 3 ·TP 0  by using the conversion data M 3  acquired in step S 25 , and stores the teaching position in the memory  52 . In this way, the processor  50  corrects the teaching position TP 0  defined in the work program WP in advance to the teaching position TP 1 . 
     The corrected teaching position TP 1  is acquired by canceling out a change amount in a position and an orientation of the workpiece W with respect to the robot  12  (the robot coordinate system C 1 ) caused by the change of arrangement. In other words, a position and an orientation of the hand-tip portion  38  with respect to the workpiece W when the hand-tip portion  38  is positioned at the teaching position TP 0  before the change of arrangement, and a position and an orientation of the hand-tip portion  38  with respect to the workpiece W when the hand-tip portion  38  is positioned at the teaching position TP 1  after the change of arrangement can coincide with each other. 
     As described above, in the present embodiment, the processor  50  functions as the robot control section  72 , the image acquisition section  74 , the image determination section  76 , the first position data acquisition section  78 , the second position data acquisition section  80 , the orientation change data acquisition section  82 , the third position data acquisition section  84 , the position change data acquisition section  86 , and the conversion data acquisition section  88 , and corrects the teaching position TP 0  by using the n-th index ID n . 
     Thus, the robot control section  72 , the image acquisition section  74 , the image determination section  76 , the first position data acquisition section  78 , the second position data acquisition section  80 , the orientation change data acquisition section  82 , the third position data acquisition section  84 , the position change data acquisition section  86 , and the conversion data acquisition section  88  constitute a device  70  ( FIG.  1   ) for correcting the teaching position TP 0  by using the n-th index ID n . 
     According to the present embodiment, the position change data M 2  needed for correcting the teaching position TP 0  is acquired based on the third position data PD 3_1  acquired in a state where the hand-tip portion  38  is corrected in the second orientation OR 2 . According to this configuration, an actual machine touch-up operation by the actual robot  12 , which has been necessary in the related art, can be made unnecessary. 
     The actual machine touch-up operation is an operation of bringing a tip of a pin attached to the hand-tip portion  38  into contact with a tip of a pin on the opponent side being fixed with respect to the holding structure B. In the related art including PTL 1 described above, in order to cause a robot to execute an actual task, it has been necessary to perform the actual machine touch-up operation after a matrix for a teaching position correction is acquired. 
     According to the present embodiment, by only acquiring the third position data PD 3_n  in step S 23  without performing the actual machine touch-up operation, the position change data M 2  can be acquired, and a task of calibrating a positional relationship between the MIF coordinate system C 2  and the sensor coordinate system C 3  can also be made unnecessary. Therefore, a task involved in a teaching position correction can be simplified. 
     Further, according to the present embodiment, by only acquiring one piece of the position data PD 3_n  related to the selected one index ID n  in above-described step S 23 , the position change data M 2  can be acquired. According to this configuration, a task process required for acquiring the position change data M 2  can be reduced, and thus the process of the teaching position correction flow illustrated in  FIG.  9    can be simplified, and thus the task involved in the teaching position correction can be simplified. 
     Further, in the present embodiment, the processor  50  executes above-described steps S 2  and S 2 ′, and thus arranges the hand-tip portion  38  in a predetermined positional relationship with the n-th index ID n  (i.e., a positional relationship between the hand-tip portion  38  and the index ID n  when the vision sensor  14  images the image data JD n  in which YES is determined in step S 13 ) by using the image data JD n  imaged by the vision sensor  14 . According to this configuration, the hand-tip portion  38  can be accurately arranged in a predetermined positional relationship with a relatively simple algorithm. 
     Note that the processor  50  may execute the flow illustrated in  FIGS.  6 ,  7 ,  9 , and  10    according to the computer program CP. The computer program CP may be stored in advance in the memory  52 . In this case, the computer program CP causes the processor  50  to function as the robot control section  72 , the image acquisition section  74 , the image determination section  76 , the first position data acquisition section  78 , the second position data acquisition section  80 , the orientation change data acquisition section  82 , the third position data acquisition section  84 , the position change data acquisition section  86 , and the conversion data acquisition section  88 . 
     Note that, when a position and an orientation of the workpiece W are changed due to the change of arrangement, the processor  50  may correct the teaching position TP 0  in above-described step S 26 , and may also correct a position (origin position) and an orientation (direction of each axis) of the workpiece coordinate system C 4  in the robot coordinate system C 1 , based on the orientation change data M 1  and the position change data M 2 . In this way, the workpiece coordinate system C 4  can be automatically and accurately set again with respect to the workpiece W after the change of arrangement. 
     Note that the vision sensor  14  may be a three-dimensional vision sensor that images an object and also measures a distance to the object, and may acquire the image data JD n  by imaging the n-th index ID n  in above-described step S 12 , and may also measure a distance k from the vision sensor  14  (origin of the sensor coordinate system C 3 ) to the n-th index ID n  (e.g., the intersection point G). 
     In this case, in above-described step S 13 , the processor  50  may determine whether the position IP n  of the n-th index ID n  is arranged at the target position PO in the most recently acquired image data JD n  and the distance k falls within a predetermined range [k th1 , k th2 ]. In this case, the hand-tip portion  38  can be arranged in a predetermined positional relationship with the n-th index ID n  without using the size SZ n  of the circle D of the index ID n , and thus the circle D can be omitted from the index ID n . 
     Further, the vision sensor  14  may be a laser scanner type three-dimensional sensor including an optical system (a laser diode, etc.) that emits light (e.g., laser light) along the optical axis O and an imaging sensor (a CCD, a CMOS, etc.) that receives and photoelectrically converts the light reflected by an object. Further, the vision sensor  14  may be constituted by a two-dimensional camera, and a laser device (e.g., a laser pointer) that can emit laser light may be further fixed with respect to the hand-tip portion  38  of the robot  12 . 
     In this case, the vision sensor  14  may image the image data JD n  in which an irradiation point of the laser light from the laser device is imaged together with the index ID n  in above-described step S 12 , and the processor  50  may determine whether the irradiation point of the laser light is arranged on the intersection point G in step S 13 . 
     Alternatively, the vision sensor  14  may be omitted from the robot system  10 , and in step S 12 , an operator may determine, by a visual check, whether an irradiation point of laser light from the above-described laser device (laser pointer) is arranged on the intersection point G of the index ID n . Further, the operator may manually measure a distance from the laser device to the intersection point G at this time, and determine whether the distance falls within a predetermined target range. 
     Then, in step S 14 , the operator may operate the input device  56  of the teaching device  18 , and manually perform a jog operation on the robot  12 . In other words, in this case, steps S 2  and S 2 ′ are executed by the operator. Even with such a method, the hand-tip portion  38  can be arranged in a predetermined positional relationship with the index ID n . In this case, the robot control section  72 , the image acquisition section  74 , and the image determination section  76  can be omitted from the device  70 . 
     Further, the conversion data acquisition section  88  can also be omitted from the device  70 . For example, the teaching device  18  in a factory may be communicably connected to external equipment (e.g., a PC) located at a facility other than the factory via a communication network (the Internet, a LAN, etc.), and the teaching device  18  may transmit, to the external equipment, the orientation change data M 1  and the position change data M 2  acquired by the teaching device  18  functioning as the device  70 . Then, at the other facility, an operator may operate the external equipment, and acquire the conversion data M 3  by using the orientation change data M 1  and the position change data M 2  that are received from the teaching device  18 . 
     Note that four or more indices ID n  may be provided for the workpiece W. Further, the index ID is not limited to the artificial pattern as illustrated in  FIG.  5   , and any visual feature that can be visually recognized, such as a hole, an edge, or an uneven part formed in the holding structure B or the workpiece W, for example, may be used as an index. Further, an origin position and a direction of each axis of the robot coordinate system C 1 , the IMF coordinate system C 2 , the sensor coordinate system C 3 , or the workpiece coordinate system C 4  are not limited to the above-described embodiment. 
     Further, as the first position data PD 1_n , the second position data PD 2_n , and the third position data PD 3_n , not only the origin of the MIF coordinate system C 2  but also position data of any point located in a known position with respect to the origin of the MIF coordinate system C 2  (or the hand-tip portion  38 ) may be acquired. For example, a tool coordinate system C 5  is set in a known position with respect to the MIF coordinate system C 2 . 
     The tool coordinate system C 5  is a coordinate system for defining a position and an orientation of the end effector  36  in the robot coordinate system C 1 , and its origin is arranged at a work point of the end effector  36  (e.g., a workpiece gripping position of a robot hand, a welding point of a welding gun, a laser exit port of a laser machining head, a coating material exit port of a coating material applicator, etc.). 
     Coordinates of the origin of the tool coordinate system C 5  in the robot coordinate system C 1  can be represented as (x+α, y+β, z+γ) when coordinates of the origin of the MIF coordinate system C 2  in the robot coordinate system C 1  are (x, y, z). The processor  50  may acquire the coordinates of the origin of the tool coordinate system C 5  as the first position data PD 1_n , the second position data PD 2_n , and the third position data PD 3_n . 
     Note that, in the above-described embodiment, a case where the device  70  (i.e., the robot control section  72 , the image acquisition section  74 , the image determination section  76 , the first position data acquisition section  78 , the second position data acquisition section  80 , the orientation change data acquisition section  82 , the third position data acquisition section  84 , the position change data acquisition section  86 , and the conversion data acquisition section  88 ) is implemented, in the teaching device  18 , as the function executed by the processor  50  is described. However, the device  70  may be implemented in the control device  16 . Such an embodiment is illustrated in  FIG.  11   . 
     In a robot system  10 ′ illustrated in  FIG.  11   , the processor  40  of the control device  16  executes the flow illustrated in  FIGS.  6 ,  7 ,  9 , and  10   , and functions as the robot control section  72 , the image acquisition section  74 , the image determination section  76 , the first position data acquisition section  78 , the second position data acquisition section  80 , the orientation change data acquisition section  82 , the third position data acquisition section  84 , the position change data acquisition section  86 , and the conversion data acquisition section  88 . 
     In this case, the processor  40  may execute the flow illustrated in  FIGS.  6 ,  7 ,  9 , and  10    according to the computer program CP that is stored in the memory  42  in advance. Note that the robot system  10 ′ may or may not include the teaching device  18 . Further, the robot  12  is not limited to being the vertical articulated robot, and may be any other type of robot that can move the end effector  36 , such as a horizontal articulated robot, or a parallel link robot, for example. In this case, the end effector  36  and the member (wrist flange  34 ) of the robot to which the end effector  36  is attached constitute the hand-tip portion  38 . Although the present disclosure is described above through the embodiments, the above-described embodiments do not limit the invention according to the claims. 
     REFERENCE SIGNS LIST 
     
         
           10 ,  10 ′ Robot system 
           12  Robot 
           14  Vision sensor 
           16  Control device 
           18  Teaching device 
           38  Hand-tip portion 
           40 ,  50  Processor 
           70  Device 
           72  Robot control section 
           74  Image acquisition section 
           76  Image determination section 
           78  First position data acquisition section 
           80  Second position data acquisition section 
           82  Orientation change data acquisition section 
           84  Third position data acquisition section 
           86  Position change data acquisition section 
           88  Conversion data acquisition section