METHOD OF DIAGNOSING REAL TIME SENSOR

Abstract: A method of diagnosing operational conditions of a real time sensor by storing data obtained therefrom during the operation of a robot. This method includes such steps that: data on the cross section of an object is obtained by scanning the object with a laser sensor (S3); the position of a welding line is detected from said data on the cross section (S4); the position of a welding line and that of the robot at the time of detection are stored in memory (S5); and data on the cross section are stored (S12) when the robot is in a specified position and a conditional value is set at [1] (S7), when the position of a welding line fails to be detected for the first time and a conditional value is set at [2] (S8-S11), and when positional variation in welding line is great and a conditional value is set at [3] (S9). Various detection parameters are set for optimum detection on the basis of the position of a welding line and data on the cross section stored in the memory. In this way, the sensor is constantly watched during operation thereof and parameters can be set at optimum values.

Description: The present invention relates to a diagnostic method for a real time sensor mounted on the distal end portion of an arm of a robot to detect the position of an object on a real-time basis during the operation of the robot. A welding robot, sealing robot, etc. is arranged so that the position of a weld line or sealing line is detected on a real-time basis by means of a sensor, such as a laser sensor, mounted on the distal end portion of a robot arm; the measurement result is delivered to a control device, and the weld line or sealing line is traced by means of a welding torch or sealing head. The laser sensor applies a laser beam to an object, a reflected light beam is received by means of a light sensing element; and the distance (position of the object) from the object is measured on the basis of the principle of triangulation. By scanning the laser beam by means of a rocking mirror, the distance from the object is continuously measured, whereby sectional data of the object with respect to the scanning direction (i.e., data indicative of a surface configuration in a section of the object) are obtained by one scanning cycle. The weld line position or sealing position is obtained from these sectional data. When using a laser sensor of this type, the degree of reflection of the laser beam varies depending on the surface condition of the object, so that the output of a laser generator should be adjusted accordingly. Further, reflected light beams include a primary reflected light beam, which is obtained when an applied laser beam is reflected by the surface of the object and is incident upon the light sensing element, a secondary reflected light beam, which is obtained when the primary reflected light beam is further reflected by the surface of the object and is incident, etc. In order to detect the object position accurately, therefore, the primary and secondary reflected light beams must be distinguished from each other as they are detected, so that various detection parameters, such as a threshold value, for discriminating these reflected light beams must be adjusted. Conventionally, the output of the laser generator and the various detection parameters used to be adjusted on the basis of measurement results obtained by activating the sensor in several suitable places. According to this method, the detection behavior of the sensor during tracking operation performed on a real-time basis cannot be followed, so that whether the respective set values of the various parameters are optimum or not can be determined only indirectly by the way the operation for welding or sealing is finished. Thus, if the measurement conditions during actual operation are not known well, this will cause the problems such as those discussed below. (1) The sensor will not be able to fully perform its function. For example, even if the detection rate can be improved by optimally selecting the parameters, the detection behavior cannot be followed precisely, so that the detection rate cannot be improved. If the detection rate has dropped, the accuracy falls naturally, so that the sensor will no longer be good enough for application to some kinds of objects. (2) Since the influence of modification of the parameters cannot be followed accurately, it is difficult to determine optimum set values. EP-A-378703 and DE-A-3413731 disclose examples of robot control systems wherein a robot is controlled in dependence upon a visual sensor which detects a workpiece. In particular, the latter document discloses a welding robot wherein a sensor is employed to detect a welding joint. According to a first aspect of the present invention there is provided a method of diagnosing a real-time sensor mounted on a robot, for detecting a position of an object to determine a position of an operation target by analyzing object position data indicative of the object position on a real-time basis during operation of the robot, wherein the method comprises the steps of: storing in memory means all of the operation target position data indicative of the operation target position, along with robot position data indicative of robot positions at the time of the detection; diagnosing the operation state of the real-time sensor by analyzing the operation target position data stored in the memory means; and adjusting parameters pertaining to the operation of the real-time sensor, so that the sensor operates in an optimum state. Second and third aspects of the present invention are defined by the attached claims 2 and 6 respectively. The real time sensor may scan an object during the operation of the robot, detect the position of the object with respect to the scanning direction, and detect the operation target position by analyzing the detected object position. According to a development of the present invention, therefore, the object position data and the operation target position data obtained by analyzing the former, along with the robot position, are stored beforehand, and the stored data are displayed or printed out for analysis, whereby the operation state of the sensor can be traced. Also, these data may be entered in a computer by means of a floppy disk or the like or through communication, and analyzed for use in the operation state analysis and the adjustment of various parameters. The volume of operation target position data may be fractional such as one data for each scanning cycle of the sensor compared with the object position data, which is much larger in volume, so that storing all these object position data requires a large memory capacity. According to the third aspect of the present invention, therefore, the object position data are stored only when necessary. More specifically, the object position data is made to be stored in any of the cases where the robot is in a predetermined position, where the operation target position has failed to be detected, or where the detected operation target position is deviated from the operation target position detected in the preceding cycle by a margin not smaller than a certain set value. An arrangement may be provided such that any of these conditions can be selected and set for the storage of the object position data, whereby necessary and sufficient object position data can be stored. Brief Description of the Drawings Fig. 1 is a flow chart showing a data storage routine according to one embodiment of the present invention; Fig. 2 is a schematic view showing a welding robot used according to the embodiment shown in Fig. 1; Fig. 3 is a block diagram showing an outline of a laser sensor; Fig. 4 is a graph showing an example of data detected by means of a light sensing element of the laser sensor; and Fig. 5 is a graph showing another example of the data detected by means of the light sensing element of the laser sensor. The following is a description of one embodiment in which a method of the present invention is applied to a welding robot. In the welding robot shown in Fig. 2, a head 2 of a laser sensor, along with a welding torch 3, is mounted on the distal end of a wrist of the robot 1. The robot 1 is controlled by a robot control device 5, while the laser sensor 2 is controlled by a sensor control section 4, which is disposed in the robot control device 5. The robot control device 5 comprises a processor, memories, an axis control circuit for controlling actuators, such as servomotors for individual joints of the robot, a manual data input device with display unit (hereinafter referred to as CRT/MDI), etc., and the sensor control section 4 also comprises a processor, memories, input and output circuits, etc. Although the robot, the laser sensor, and the control means are constructed substantially in the same manner as those of the conventional welding robot with laser sensor, there are differences in a data storage routine, which will be described later, and in that a writable nonvolatile memory for data storage occupies large capacity. Referring now to Fig. 3, the construction of the laser sensor will be described. A detecting section 10 of the laser sensor includes a laser generator 11 for generating a laser beam, a rocking mirror (galvanometer) 12 for reflecting the laser beam from the laser generator 11 so that the reflected laser beam is used for scanning, a light sensing element 14 for detecting the laser beam, and an optical system 13 for picking up the reflected light and forming an image on the light sensing element 14. A control section 20 includes a laser drive section 21 for driving the laser generator 11, a mirror scanning section 22 for rocking the rocking mirror 12, and a signal detecting section 23 for detecting the position of an object 30 from the position where light is received by means of the light sensing element 14. The laser drive section 21 drives the laser generator 11 to generate the laser beam, and the mirror scanning section 22 is driven to rock the mirror 12 so that the laser beam generated from the laser generator 11 is applied to the surface of the object 30 to scan the same. The laser beam, applied to the object 30 and diffusedly reflected thereby, is caused to form an image on the light sensing element 14 through the optical system 13, depending on the position of reflection on the object. The distance from the position of the image on the light sensing element 14 to the object (position of the object) is measured on the basis of the principle of triangulation. By rocking the rocking mirror (in one of directions of alternating rocking motion) for one scanning cycle, the position of the object is continuously measured, whereby sectional data of the object with respect to the laser beam scanning direction are obtained. The weld line position or sealing position is obtained from these sectional data. The laser sensor is described in detail in PCT/JP92/00630, and this description is incorporated herein for reference. In fillet welding, for example, the sectional data of the object with respect to the scanning direction, as shown in Fig. 4, can be obtained by scanning the rocking mirror by means of the laser sensor, with a fillet joint being used as the object. In Fig. 4, the axes of abscissa and ordinate represent the distance in the laser beam scanning direction and the distance from the object, respectively. Referring now to the flow chart of Fig. 1, the data storage routine, which constitutes a feature of the embodiment of the present invention, will be described. First, the present embodiment is arranged so that conditions for the storage of the sectional data as object position data can selectively be set by means of the CRT/MDI of the robot control device 5 in the following manner: a conditional value is set to "1" in storing the sectional data with respect to a predetermined robot position, to "2" in storing the sectional data when the weld line position has first failed to be detected, and to "3" in storing the sectional data if a detected value for the weld line position is not smaller than a preceding detected value and a set value ε. If the conditional value is set to "1", the robot position for the storage is set by means of the CRT/MDI. The processor of the sensor control section 4 determines in Step S1 whether or not a weld line tracing command is outputted from the robot control device 5; if the command has not been outputted, the routine will be finished at once, while if the weld line tracing command has been outputted, a flag F will be set to "0" in Step S2, and the program proceeds to Step S3, whereupon a sectional data detection processing will be started. In this sectional data detection processing, the rocking mirror of the laser sensor starts to be rocked, and the laser generator is activated, whereby the laser beam is applied to the object for scanning. A number of sampled data (object position data), that is, the sectional data, are obtained for each scanning cycle of the rocking mirror, and are stored in a work memory. In the case where the object is the aforesaid fillet joint, such sectional data as the ones shown in Fig. 4 are obtained. Then, in Step S4, a weld line position detection processing is executed by using the sectional data obtained in this manner, whereupon the weld line position is delivered to the robot control device. In this weld line detection processing, for example, the outer product of a vector directed from an i'th sampled data, out of the sectional data, to an (i - 1)'th sampled data and a vector directed from the i'th sampled data to an (i + 1)'th sampled data is obtained, and a position where this outer product is the largest is determined as a near weld line position. In the example shown in Fig. 4, the object is a fillet joint formed of two flat plates. When a flat surface is scanned, the scanning line is a straight line, so that the outer product is "0." When the weld position is reached, however, the scanning line bends, so that the outer product of the vectors takes a large value, and the position where the outer product takes the largest value is detected as the position near the weld line position to be obtained. The intersection of two straight lines with which two flat surfaces are approximated is obtained by using data sampled in spaced positions at given forward and backward distances from this near weld line position. More specifically, straight lines, each connecting two points which are spaced at the given forward and backward distances from the near weld line position are obtained. The intersection of the two straight lines thus obtained is detected as the weld line position. In the example shown in Fig. 4, the weld position is detected as the intersection of the two straight lines each of which connect two circled points. When the weld line position is detected in this manner, the detected weld line position and the current robot position, which is detected by means of the robot control device in Step S5, are correspondingly stored in a table in the nonvolatile memory. If the weld line position is not detected, a predetermined code which indicates the reason for the failure of detection is stored in the aforesaid table instead of the weld line position, depending on the progress of the detection processing. For example, if an edge portion (near weld line position) fails to be accurately measured, as shown in Fig. 5, and thus the definition of straight lines is not good enough to obtain the intersections of the straight lines, a code indicative of the failure to detect the intersections will be written. Then, whether the conditional value is "1" or "2" or "3" is determined in Step S6. If it is concluded that the conditional value is "1," it is determined in Step S7 whether the current robot position is the preset position or not. If the robot position is the preset one, the program proceeds to Step S12, in which the sectional data obtained in Step S3, along with the robot position, will be loaded into the nonvolatile memory, whereupon the program proceeds to Step S13. In Step S13, it is determined whether or not a weld line tracing end command is inputted through the robot control device. If there has been no input, the program returns to Step S3, whereupon the aforementioned processings will be executed repeatedly. If it is concluded in Step S13 that the weld line tracing end command is delivered from the robot control device 5, the routine will be finished. If it is concluded in Step S7 that the robot position is not the preset position, the program proceeds to Step S13 without storing of the sectional data in Step S12. If the conditional value is "2", the program proceeds from Step S6 to Step S8, whereupon it is determined whether the detection of the weld line position in the processing of Step S4 is unsuccessful or not. If the detection is not unsuccessful, or if it is successful, the program proceeds to Step S13. If the detection is unsuccessful, the program proceeds to Step S10, whereupon it is determined whether the flag F is "0" or not. If the flag F is "0", it is set to "1" in Step S11, whereupon the program proceeds to Step S12. In Step S12, the sectional data obtained in Step S3, along with the current robot position, are loaded into the nonvolatile memory. If it is concluded in Step S10 that the flag F is not "0", the program proceeds to Step S13 without executing the processings of Steps S11 and S12. In this manner, the processing of Step S12 is executed to store the sectional data only when the first failure of weld line position detection has occurred since the start of weld line tracing. If the end command has not been inputted, the processing of Step S3 and its subsequent processings will be repeated. If the conditional value is "3", the program proceeds from Step S6 to Step S9, whereupon it is determined whether or not the difference between value for weld line position detected in the current processing and the value detected in the preceding processings is smaller than a preset value. If the difference is not smaller than the preset value, the program proceeds to Step S12, whereupon the sectional data are loaded into the nonvolatile memory. If the difference is smaller than the preset value, the program proceeds to Step S13, whereupon the sectional data will not be stored. In this manner, the weld line position relative to the robot position will be stored in the table, and the sectional data with respect to the predetermined robot position, the sectional data obtained when the weld line position has first failed to be detected, or the sectional data obtained when the variation of the detected value for the weld line position is not smaller than a predetermined value are stored in the nonvolatile memory. The nonvolatile memory for data storage being designed to store the data cyclically, it need not have a large capacity. Further, this memory need not necessarily be composed of a nonvolatile memory, but may be formed of a RAM instead. The weld line position data and the sectional data, stored in the manner described above, are displayed on a CRT screen or printed out, and these data are analyzed and utilized for the adjustment of various parameters. Also, these data are entered in a computer by means of a floppy disk or through communication, and are analyzed to adjust the various parameters. According to the present embodiment, in adjusting the parameters, three conditions are made available for picking out the sectional data. Firstly, the conditional value has to be set to "2" for obtaining the sectional data for the unsuccessful case of weld line position detection so that the various parameters can be modified to obtain the weld line position in accordance with these data. For example, if such sectional data as the ones shown in Fig. 5 are obtained, the intersection of the straight lines, that is, the weld line position, should be able to be obtained by modifying parameters associated with the distance for defining the straight lines from the near edge portion (near weld line position). While adjusting the parameters in succession, thereafter, the conditional value is set to "2" to pick the data and adjust the parameters until the failure in detecting the weld line position disappears. When the failure in detecting the weld line position disappears, the conditional value will be changed to "3", and the sectional data at the point where the variation of the the detected value for the weld line position is not smaller than the predetermined value ε will be picked. The parameters are adjusted on the basis of these data, whereupon they are set so that there will be no possibility of unsuccessful weld line position detection, as well as lest the variation of the weld line position data exceed the set value ε . After setting the parameters in this manner, a robot position will be set so that the condition of the welding operation can best be observed, and the sectional data are picked with in the predetermined robot position, with the conditional value for the sectional data detection being set to "1". If necessary, in this case, the sectional data may be picked with the conditional value set at "2" or "3". According to the present embodiment, the sensor is activated so that the data detected by the sensor are picked and stored as hysteresis during the execution of the operation. Thus, the data can be analyzed and diagnosed, and the various parameters can be adjusted so that the sensor operates in an optimum state, thereby enabling the sensor to fully perform its function. By detecting and storing the two types of data, including, in particular, the data detected by means of the sensor and the data of operation target positions such as the weld line position to be obtained by analyzing the detected data, an analytic diagnosis of the sensor operation state can be made very easy, and the parameters can be efficiently set at optimum values.

Claims: A method of diagnosing a real-time sensor (2) mounted on a robot (1), for detecting a position of an object (30) to determine a position of an operation target by analyzing object position data indicative of the object position on a real-time basis during operation of the robot (1), wherein the method comprises the steps of: storing in memory means all of the operation target position data indicative of the operation target position, along with robot position data indicative of robot positions at the time of the detection; diagnosing the operation state of the real-time sensor (2) by analyzing the operation target position data stored in the memory means; and adjusting parameters pertaining to the operation of the real-time sensor (2), so that the sensor (2) operates in an optimum state. A method of diagnosing a real-time sensor (2) mounted on a robot (1), for detecting a position of an object (30) to determine a position of an operation target by analyzing object position data indicative of the object position on a real-time basis during operation of the robot (1), wherein the method comprises the steps of: storing in memory means operation target position data indicative of the position of the operation target and the object position data, along with robot position data indicative of the robot positions at a time of the detection; diagnosing the operation state of the real-time sensor (2) by analyzing the operation target position data and the object position data stored in the memory means; and adjusting parameters pertaining to the operation of the real-time sensor (2), so that the sensor (2) operates in an optimum state. A method of diagnosing a real-time sensor (2) according to claim 2, characterised in that the object position data are stored only when the robot (1) is at predetermined positions (S7). A method of diagnosing a real-time sensor (2) according to claim 2, characterised in that the object position data are stored together with a robot position at a point where the operation target position has failed to be detected (S8). A method of diagnosing a real-time sensor (2) according to claim 2, characterised in that the object position data are stored when a difference between the value of the operation target position obtained in the present cycle and the value of the operation target position obtained in the preceding cycle exceeds a predetermined value (S9). A method of diagnosing a real-time sensor (2) mounted on a robot (1), for detecting a position of an object (30) to determine a position of an operation target by analyzing object position data indicative of the object position on a real-time basis during operation of the robot (1), wherein the method comprises the steps of: selecting a conditional value representing one of the cases where the robot is at a predetermined position (S7), where the operation target position has failed to be detected (S8), and where the variation of the operation target position exceeds a set value (S9); storing operation target position data indicative of the operation target position, along with robot position data indicative of the robot positions at a time of the detection; storing the object position data in accordance with the selected conditional value when the robot (1) has reached the predetermined position, when the operation target position has failed to be detected, or when the variation of the operation target position exceeds the set value; diagnosing the operation state of the real-time sensor (2) by analyzing the stored operation target position data and the object position data; and adjusting parameters pertaining to the operation of the real-time sensor (2), so that the sensor (2) operates in an optimum state.

Inventors: IWAMOTO TAKASHI, NAITO YASUO, NIHEI RYO, WAKIO HIROSHI, IWAMOTO, TAKASHI, NAITO, YASUO, NIHEI, RYO, WAKIO, HIROSHI, IWAMOTO, TAKASHI FANUC DAI-3 VIRA-KARAMATSU, NAITO, YASUO ROOM 7-205, FANUC MANSHONHARIMOMI, NIHEI, RYO ROOM 7-210, FANUC MANSHONHARIMOMI, WAKIO, HIROSHI FANUC DAI-3 VIRA-KARAMATSU
Applicants: FANUC LTD, FANUC LTD.
Application year: 1992
Main classification: G01B21
IPC codes: G01B11, B25J19, G01S17, B23K9, G01D21, G01D3, G05D3