Displacement switch

The displacement sensor addresses the challenge of intuitively indicating stable threshold settings by using a head unit, light-receiving unit, and display generation unit to show displacement and threshold values, enhancing detection accuracy for thin objects.

JP7883639B2Active Publication Date: 2026-07-01KEYENCE CORP

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
KEYENCE CORP
Filing Date
2025-04-11
Publication Date
2026-07-01

Smart Images

  • Figure 0007883639000001
    Figure 0007883639000001
  • Figure 0007883639000002
    Figure 0007883639000002
  • Figure 0007883639000003
    Figure 0007883639000003
Patent Text Reader

Abstract

To allow a user to intuitively recognize or confirm that setting a safely operable threshold value is possible, in a tuning mode of automatically setting a threshold value.SOLUTION: A displacement to detect and a threshold value are displayed side by side. In a distance mode, the displacement to detect is displayed as a current value of an unsigned distance based on the position of a head part 2. In a height mode, the displacement to detect is displayed as a current value of a signed distance with a sign which becomes positive when the distance to the head part 2 becomes smaller than a preset reference.SELECTED DRAWING: Figure 19
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a displacement switch that detects displacement and outputs an ON / OFF signal.

Background Art

[0002] There are two types of displacement switches: those including an image sensor that performs photoelectric conversion and those not including an image sensor, and they are used appropriately according to various applications. Specifically, displacement switches include, in addition to proximity switches, contact switches, ultrasonic switches, etc., triangulation sensors, TOF (Time Of Flight), photoelectric switches, etc. These are applied to the detection of the height of the detection object, the unevenness of the surface of the detection object, the presence or absence of the detection object, etc.

[0003] Patent Document 1 discloses a photoelectric switch provided with a 7-segment display unit. The photoelectric switch has a plurality of operation buttons adjacent to the 7-segment display unit, and by the user properly using the plurality of operation buttons or pressing each operation button briefly or for a long time, the display of the threshold value, the current value, the peak hold value, etc. can be switched.

[0004] This photoelectric switch has functions related to the automatic setting of the threshold value, such as a two-point tuning mode and a full auto-tuning mode. In the two-point tuning mode, the first detection value at the time when the user operates the first operation button and the second detection value at the time when the user operates the second operation button are captured. Then, for example, an intermediate value between the first detection value and the second detection value is set as the threshold value, and this automatically set threshold value is numerically displayed on the 7-segment display unit.

[0005] The fully automatic tuning mode is used, for example, to automatically set thresholds when multiple objects are traveling along a conveyor line. In other words, in fully automatic tuning mode, multiple detection values ​​are taken in, and the threshold is automatically set to a value that is, for example, an intermediate value between the maximum value (peak value) and the minimum value (bottom value) within the distribution of these multiple detection values. This threshold is then displayed numerically on the 7-segment display.

[0006] Patent Document 2 discloses a photoelectric switch employing a dot matrix display as its display unit. It discloses a color liquid crystal display as a typical dot matrix display and an organic light-emitting diode (OELD) display as a modified example.

[0007] Patent Document 3 discloses a type of photoelectric switch in which multiple switch bodies are fixed to a DIN rail. "DIN" is an abbreviation for the German Institute for Standardization. The DIN rail is fixedly placed in an open, exposed location, and numerous switch bodies are fixed adjacent to each other on the DIN rail. For this reason, this type of photoelectric switch is called a "series photoelectric switch". Since the switch bodies are installed in a location convenient for installing the DIN rail, the switch bodies fixed to the DIN rail are positioned at a distance from the head portion that constitutes the detection unit.

[0008] In a series of photoelectric switches, the switch body is equipped with a 7-segment display or a dot matrix display. This display shows the current value and / or threshold values. To check the display on the switch body, the user needs to access the switch body, which is fixed to a DIN rail at a relatively distant location from the head unit. [Prior art documents] [Patent Documents]

[0009] [Patent Document 1] Japanese Patent Publication No. 2013-127943 [Patent Document 2] Japanese Patent Publication No. 2015-81870 [Patent Document 3] Japanese Patent Publication No. 2019-61888 [Overview of the project] [Problems that the invention aims to solve]

[0010] As mentioned above, displacement switches are used to detect "steps" such as the height of the object to be detected (workpiece), the surface irregularities of the workpiece, and the presence or absence of the workpiece. For example, when detecting the "presence" or "absence" of a thin sheet, if the thin sheet is thinner than the detection limit of the displacement switch, a threshold will be automatically set and displayed even though it is practically impossible to automatically set a threshold that allows for stable operation. The user sees the threshold displayed on the display and believes that stable operation is possible under this automatically set threshold, and actually operates the system accordingly.

[0011] The objective of the present invention is to provide a displacement sensor that allows the user to intuitively recognize or confirm that a threshold value capable of stable operation can be set in a tuning mode that automatically sets the threshold value. [Means for solving the problem]

[0012] According to the present invention, the above technical problems can be resolved. The head section, The head unit is positioned to emit light for measuring the detection area, A light receiving unit is arranged in the head portion and converts the measurement light from the detection area into photoelectric signals to generate a light receiving signal, A measuring unit that measures the displacement of the object to be detected based on the light-receiving signal generated by the light-receiving unit, A determination unit that generates a determination signal based on a comparison between a threshold value and the displacement of the object to be detected measured by the measurement unit, A display generation unit generates a display screen that shows the displacement of the object to be detected measured by the measurement unit and the threshold value side by side, and in distance mode generates a display screen that shows the displacement of the object to be detected measured by the measurement unit as the current value of an unsigned distance with respect to the position of the head unit, and in height mode generates a display screen that shows the displacement of the object to be detected measured by the measurement unit as the current value of a signed distance that becomes positive as it approaches the head unit from a preset reference, The above table Shisei This is achieved by providing a displacement sensor that includes an elongated dot matrix display that displays a screen generated by the sensor.

[0013] The effects and other objectives of the present invention will become clear from the detailed description of the following preferred embodiments. [Brief explanation of the drawing]

[0014] [Figure 1] This is a diagram illustrating the optical triangulation sensor of the embodiment. [Figure 2] This diagram illustrates how the main body, which constitutes part of the optical triangulation sensor of the embodiment, can be fixed in a desired position, and the main body includes an OELD. [Figure 3] This diagram illustrates how the relay cable connecting the head and main body of the optical triangulation sensor in the embodiment, and the output cable of the main body, are soldered to the circuit board of the main body. [Figure 4] This diagram illustrates the components built into the head portion, which constitutes part of the optical triangulation sensor of the embodiment. [Figure 5] Figure 2 is a schematic diagram of the main body shown, and is a diagram that explains the mounting surface of the main body. [Figure 6] This is a diagram illustrating a first modified example of the contour shape of the main body. [Figure 7] This is a diagram illustrating a second modified example of the contour shape of the main body. [Figure 8]This is a diagram for explaining an example of forming an installation surface with an attachment assembled to the main body part. [Figure 9] This is a block diagram for explaining the internal structure of the head part. [Figure 10] This is a block diagram for explaining the internal structure of the main body part. [Figure 11] This is a diagram for explaining the power supply circuits included in the head part and the main body part. [Figure 12] This is a flowchart for explaining the control for limiting the intensity and power of the green laser light emitted by the head part. [Figure 13] This is a diagram for explaining the processing in tuning for automatically setting a threshold value. [Figure 14] This is a diagram for explaining the display during tuning execution. (I) shows the display during operation, and (II) shows the display during tuning. [Figure 15] This is a flowchart for explaining the processing in the two-point tuning mode. [Figure 16] This is a flowchart for explaining the processing in the full-auto (automatic) tuning mode. [Figure 17] This is a flowchart for explaining the reference value update process. [Figure 18] This is a diagram for explaining an example of a screen display for making it easier for the user to visually select between the "height mode" and the "distance mode" in displacement measurement during operation. [Figure 19] This is a diagram for explaining a screen where numerical values are displayed as an example of the screen display when the "height mode" is selected. [Figure 20] This is a diagram for explaining a screen where numerical values are displayed as an example of the screen display when the "distance mode" is selected. [Figure 21] This is a diagram showing the screen with bar display in the "height mode". [Figure 22] This is a diagram showing the screen with bar display in the "distance mode". [Figure 23]This figure shows an example of an application where the triangulation sensor of the embodiment faces the workpiece through a viewport. [Figure 24] This diagram illustrates the normal light reception waveform. [Figure 25] This diagram illustrates the received light waveform in which a disturbing peak appears. [Figure 26] This is a flowchart illustrating the process of setting a mask area based on user input. [Figure 27] This diagram illustrates an example of plotting thresholds and disturbance peaks on the display screen. [Figure 28] This diagram illustrates the rendering of the near-field mask area setting and explains how the mask area changes in response to user actions when the setting is modified. [Figure 29] This diagram illustrates the rendering of the far-side mask area setting and explains how the mask area changes in response to user actions when the setting is modified. [Figure 30] The mask area setting display screen is shown, where (I) is the first pattern of the first display mode, which displays a numerical value with circles indicating the number of disturbance peaks, (II) is the second pattern of the first display mode, which displays a numerical value without the circles indicating the number of disturbance peaks, and (III) is the second display mode, which displays the mask area pictorially with diagonal lines. [Figure 31] This is a flowchart illustrating the display process in step S54 of Figure 26. [Figure 32] This is a flowchart to explain the process of automatically setting the mask area. [Figure 33] This flowchart illustrates an example of a process that uses a gyro sensor to detect changes in the mounting orientation of the head unit. [Figure 34] This is a display screen that shows the displacement detected by the gyro sensor. [Figure 35] This diagram illustrates an example of how to indicate that the gyro sensor is operating by drawing three frames on a display screen that shows the displacement detected by the gyro sensor. [Figure 36] This is a display screen that shows the displacement detected by the gyro sensor, and displays the class selected by the user from a categorized group using a character. [Figure 37] This figure shows an example of an alarm display that appears when the angular velocity detected by the gyro sensor exceeds a threshold, and also displays the elapsed time when this was detected. [Figure 38] This is an example of a pairing display that indicates that the head unit and the main unit, which constitute part of the optical triangulation sensor of the embodiment, are working in coordination with each other. [Modes for carrying out the invention] [Examples]

[0015] A preferred embodiment of the present invention will be described below with reference to the attached drawings. Figure 1 shows a displacement switch of an embodiment, more specifically an optical triangulation sensor 200. Referring to Figure 1, the triangulation sensor 200 is composed of first and second housings 2 and 4, which are connected by a relay cable 6. At least the first housing 2 is preferably made of metal, which generally has better strength and rigidity than synthetic resin. The second housing 4 may be made of metal or synthetic resin.

[0016] Of the components typically found in a triangulation sensor, the optical components and related elements required for triangulation, as well as the power supply board, are housed in the first housing 2, while the remaining components, such as the dot matrix display, or organic light-emitting diode (OELD), are housed in the second housing 4. This allows for a miniaturization of the first housing 1. For the sake of clarity, the first housing 2 will be referred to as the "head unit," and the second housing 4 as the "main unit."

[0017] Figure 2 shows the main body 4. The main body 4 has an elongated external shape with a somewhat flattened, roughly rectangular cross-section, and has a head-side end 4a located at one end in the longitudinal direction and an output-side end 4b located at the other end in the longitudinal direction. The side surface of the main body 4, which is composed of four surfaces, includes a relatively wide first side surface 4c and a narrow second side surface 4d adjacent to the first side surface 4c.

[0018] An output cable 8 is connected to the main body 4, and a judgment signal, i.e., an ON / OFF signal, is output from the main body 4 through the output cable 8 to a control device 10 (Figure 1), such as a PLC. Both the relay cable 6 and the output cable 8 are flexible and bendable, and as shown in Figure 1, the distance between the head unit 2 and the main body 4 can be arbitrarily adjusted by folding and bundling the relay cable 6. Referring to Figure 2, the main body 4 has a circumferentially extending groove-shaped neck portion N that protrudes longitudinally from the head-side end 4a and the output-side end 4b, respectively, and the circumferential surface of this neck portion N is preferably circular. By attaching a cable tie B to the neck portion N, it can be fixed to any installation location IL close to the head unit 2, for example, about 30 cm away.

[0019] As a variation regarding the placement of the neck portion N, instead of the neck portion N, grooves for receiving cable ties B may be provided in the main body portion 4 near the head-side end 4a and the output-side end 4b. The wide first side surface 4c is equipped with an OELD 12. On this first side surface 4c, a first indicator light 14 is provided on one end of the OELD 12, and a SET button 16 is provided on the other end. The SET button 16 is used to select an operating mode, such as automatic threshold setting (teaching mode). On the narrow second side surface 4d, an UP button 18 and a DOWN button 20 are arranged adjacent to each other, and a mode button 22 is also provided. The UP / DOWN buttons 18 and 20 are used, for example, to adjust thresholds or select menus. The mode button 22 is used to switch the operating mode of the triangulation sensor 200. The SET button 16 described above may be placed on the narrow second side surface 4d instead of the first side surface 4c.

[0020] Figure 3 illustrates how the relay cable 6 and output cable 8 are connected to the main body 4 by soldering. Reference numeral C indicates a contact on the main body substrate 36. Specifically, the relay cable 6 is connected to the flexible substrate 38, and the flexible base end 38 is soldered to the main body substrate 36. On the other hand, the output cable 8 is soldered to the main body substrate 36 via a vertical relay substrate 40 or a flexible substrate. By adopting this configuration, the longitudinal dimensions of the main body 4 can be reduced. Soldering the relay cable 6 and output cable 8 to the main body substrate 36 using a flexible substrate provides flexibility in attaching the ends of the relay cable 6 and output cable 8. On the other hand, soldering the output cable 8 using the vertical relay substrate 40 allows the orientation of the output cable 8 to be uniquely fixed. Note that the output cable 8 may also be connected to the main body 4 using a connector (not shown). Similarly, the relay cable 6 may also be connected to the main body 4 using a connector (not shown).

[0021] Figure 4 is a diagram illustrating the elements arranged inside the head unit 2. The head unit 2 includes a motion sensor 50 for detecting changes in its installation orientation. A typical example of the motion sensor 50 is a gyro sensor, while other examples include an acceleration sensor and a geomagnetic sensor. The motion sensor 50 is installed integrally with the head unit 2. Specifically, the motion sensor 50 is assembled to the head unit 2 so as not to undergo relative displacement in relation to the head unit 2. This allows the motion sensor 50 to sensitively detect when the head unit 2 receives an external force, changes in its installation orientation, and experiences optical axis displacement.

[0022] Optical axis displacement will be explained with reference to Figure 4. Light emitted from the light-emitting unit 52 is focused by the light-emitting lens 54, forming a spot on the surface of the workpiece W. If the installation posture of the head unit 2 changes for any reason, the optical axis Lax of the light emitted from the light-emitting unit 52 will deviate, and the position of the spot on the surface of the workpiece W will change. This phenomenon is called "optical axis displacement". The motion sensor 50 installed on the head unit 2 is assembled to the head unit 2 so that it cannot be displaced relative to the head unit 2. Changes in the posture of the head unit 2 can be detected by the motion sensor 50. This means that the motion sensor 50 can detect when the position of the spot has changed. Furthermore, since changes in the posture of the head unit 2 are accompanied by deviations in the optical axis Lax of the emitted light, the user can know that a change in the posture of the head unit 2 has occurred by visually checking whether the spot on the surface of the workpiece W has changed from the desired position. In other words, "optical axis displacement" refers to the displacement of the optical axis Lax of the head unit 2, or light-emitting unit 52. It is important for proper operation to be able to visually confirm whether the position of the spot on the workpiece W is in the correct position, along with the optical axis displacement signal from the motion sensor 50.

[0023] The head unit 2 includes a light-emitting unit 52, a light-emitting lens 54, a light-receiving lens 56, a mirror 58, and an image sensor 60, and these elements form an optical path for triangulation. The image sensor 60 is composed of a linear image sensor and includes a charge storage element. The image sensor 60 and the light-receiving circuit 62 constitute the light-receiving unit 64. The light-emitting unit 52 is preferably composed of a semiconductor laser light source (InGaN / GaN gallium nitride system) that emits green laser light. The head unit 2 emits green laser light, which is the measurement light, towards the detection area of ​​the object to be detected. The state of the spot light irradiated onto the workpiece affects the detection accuracy. The more focused the spot light, the better the detection accuracy. Green laser light has a better spot light state than red laser light. As will be explained later, green has excellent luminous efficiency. By utilizing this characteristic, the visibility of the spot light can be ensured even if the intensity and power of the green laser light are limited. It goes without saying that it is desirable for the user to be able to visually confirm that the light-emitting beam is irradiated to the desired position on the workpiece in order to properly perform detection.

[0024] The green laser light emitted from the light-emitting unit 52 reaches the workpiece through the light-emitting lens 54 and light-emitting window 66. The reflected light reflected from the surface of the workpiece passes through the light-receiving window 67 and light-receiving lens 56, is refracted by the mirror 58, and is received by the light-receiving unit 64. In other words, the light-receiving unit 64 receives the green laser light reflected from the detection area of ​​the workpiece, converts it into photoelectric light, and generates a received signal. The light-emitting unit 52 and the light-receiving unit 64 are controlled by the processor 68 built into the head unit 2.

[0025] As can be seen from Figures 1 and 4, the head unit 2 has a relatively thin, roughly rectangular shape, and the light-emitting window 66 and light-receiving window 67 are arranged on the narrow first side surface 2a. Between the light-emitting window 66 and the light-receiving window 67, a first operation indicator light 70, composed of, for example, two-color LEDs, red and green, is provided. The first operation indicator light, or front operation indicator light 70, can be illuminated or flashed in red, green, or yellow (a mixture of red and green).

[0026] Of the first and second ends 2b and 2c in the longitudinal direction of the head portion 2, the corner 2e between the second end 2c, which is furthest from the light-emitting window 66, and the second side 2d, which is opposite the first side 2a, has a cut-out shape, and this corner 2e is formed as a 45° inclined surface. A hole is formed in this corner 2e through which the relay cable 6 passes, and the hole is sealed to prevent water from entering by a watertight member 72. Directly adjacent to the watertight member 72, two LEDs 74 of the same color as the first operation indicator light 70 are arranged inside the head portion 2. The watertight member 72 is made of a light-transmitting light guide member, and the LEDs 74 and the light-guiding watertight member 72 constitute the second operation indicator light 76. The first and second operation indicator lights 70 and 76 light up in yellow or green in synchronization with the ON / OFF output signal, and an error is indicated by, for example, flashing red.

[0027] In the installation of the head unit 2, the first side 2a where the light-transmitting and receiving windows 66 and 68 are located, and the corner 2e where the relay cable 6 is located are usually left exposed. In actual operation, by arranging the first and second indicator lights 70 and 76 on the exposed first side 2a and corner 2e, it is not necessary to make the first and second operation indicator lights 70 and 76 protrude from the outer contour of the head unit 2. In other words, the user can recognize the illumination and flashing of the first and second indicator lights 70 and 76 without having to make them protrude, which would hinder the miniaturization of the outer contour of the head unit 2.

[0028] As described above, the relay cable 6 is connected to the corner 2e, which is formed by a 45° inclined surface. The second operation indicator light 76 is formed by the light guide water-stopping member 72. Therefore, the second operation indicator light 76, positioned at the corner 2e, is located inside the extension lines L1 and L2 of the second end 2c and the second side surface 2d that define the outer contour of the head unit 2 (Figure 4). In other words, the second indicator light 76 does not protrude outward from the extension lines L1 and L2. As a result, the outer dimensions of the head unit 2, which have been miniaturized by the presence of the second operation indicator light 76, do not increase. If miniaturization is not a concern, the first and second indicator lights 70 and 76 may protrude from the outer contour of the head unit 2.

[0029] As described above with reference to Figure 2, the main body 4 can be fixed to any location IL near the head 2 by attaching the cable tie B to the groove-shaped neck portion N of the main body 4. Figure 5 is a schematic cross-sectional view of the main body 4. The main body 4 has a square or rectangular cross-sectional shape. The first side 4c on which the OELD 12 is installed and the narrow second side 4d on which the UP / DOWN buttons 18, 20, etc. are installed intersect at right angles to each other. The third side 4e, which is opposite the first side 4c, and the fourth side 4f, which is opposite the second side 4d, are composed of flat surfaces, and these third side 4e and fourth side 4f constitute the installation surface. With the third side 4e and / or the fourth side 4f in contact with the installation location, it can be fixed to any relatively flat location IL (e.g., a column) near the head 2 using the cable tie B.

[0030] Figure 6 shows a first modified example of the cross-sectional shape of the main body 4. As can be seen from Figure 6, the first side surface 4c on which the OELD 12 is installed and the narrow second side surface 4d on which the UP / DOWN buttons 18, 20, etc. are installed may intersect each other at an angle greater than 90°.

[0031] Figure 7 shows a second modified example of the cross-sectional shape of the main body 4. As can be seen from Figure 7, the third and fourth side surfaces 4e and 4f that constitute the aforementioned mounting surface may be composed of three or more surfaces, in the illustrated example, three flat surfaces 4g to 4i. According to this second modified example, the three surfaces 4g to 4i each constitute a mounting surface.

[0032] Figure 8 shows a third modified example of the cross-sectional shape of the main body 4. The third modified example illustrates that the main body 4 has an elliptical cross-sectional shape, and that the attachment AT may be assembled to this elliptical main body 4 to form a mounting surface with the attachment AT. The illustrated attachment AT includes mounting surfaces Sf(1) and Sf(2) having two planar contours, but the number of mounting surfaces is arbitrary.

[0033] Figure 9 is a block diagram illustrating the control system of the head unit 2. The laser light emitted by the green laser diode (LD) 520 constituting the light-emitting unit 52 is monitored by a photodiode (monitor PD) 522, and the output current of this monitor PD 522 is input to the light-emitting control circuit 680 via the I / V conversion circuit 524 and the A / D conversion circuit 526. The green LD 520 is controlled by the LD drive circuit 530, which in turn is controlled by the light-emitting control circuit 680. The LD drive circuit 530 includes a current control circuit 532 and a light-emitting switch circuit 534. A control signal is input from the light-emitting control circuit 680 to the current control circuit 532 via the D / A conversion circuit 536, and a control signal is also input from the light-emitting control circuit 680 to the light-emitting switch circuit 534. As a result, the green LD 520 emits laser light at a predetermined period and with a predetermined power. When an overcurrent flows through the LD drive circuit 530, it is detected by the overcurrent detection circuit 538, and the detection information from the overcurrent detection circuit 538 is supplied to the light projection control circuit 680. As a result, the light projection control circuit 680 performs control to suppress the overcurrent.

[0034] The light-receiving information from the light-receiving circuit 62, which constitutes the light-receiving unit 64, is input to the processor 68 via the A / D conversion circuit 640. The processor 68 consists of a light-emitting control unit 680, a peak light-receiving amount detection unit 682, a peak position detection unit 684, a distance calculation unit 686, a distance determination unit 688, and an output unit 690. The light-receiving information output from the A / D conversion circuit 640 is input to the peak light-receiving amount detection unit 682 and the peak position detection unit 684. The peak light-receiving amount detection unit 682 detects the peak light-receiving amount based on the light-receiving information, and this peak light-receiving amount is input to the light-emitting control unit 680 and reflected in the light-emitting control. The peak position detection unit 684 detects the peak position of the light-receiving amount based on the input light-receiving information and measures the displacement of the peak position. This information is supplied to the distance calculation unit 686. The distance calculation unit 686 calculates the detected displacement of the workpiece based on the displacement of the peak position. A table 692 showing the correspondence between the peak position and the distance is referred to in calculating this displacement. The calculated detected displacement is used by the distance determination unit 688 to determine whether it is greater than or equal to the determination threshold by comparing it with a threshold value read from the determination threshold 694 stored in memory. Measurement information (including the determination threshold value) including data related to this determination and light reception information necessary for displaying the OELD 12, which will be explained later, is supplied to the main unit 4 via the output unit 690 and the communication unit 80.

[0035] The output of the gyro sensor, which constitutes the motion sensor 50 described above, is input to the optical axis displacement detection unit 696. The optical axis displacement detection unit 696 reads a threshold value from the memory reference unit 698, and when the output of the gyro sensor is greater than or equal to the threshold value, it generates an optical axis displacement detection signal and supplies this optical axis displacement detection signal to the output unit 690. This optical axis displacement detection signal is supplied to the main unit 4 via the communication unit 80 and reflected in the display of the OELD 12.

[0036] Figure 10 is a block diagram illustrating the control system of the main unit 4. The main unit 4 includes a processor 24, an input circuit 26, an output circuit 28, a power supply circuit 30, a memory 32, and a communication unit 34. The illustrated operation unit 402 represents the SET button 16, UP button 18, DOWN button 20, and mode button 22. By operating the operation unit 402, the user can perform tuning settings, mask settings, gyro sensor (motion sensor 50) threshold settings, output logic settings for the main unit 4, clear input, etc. When the user operates the operation unit 402, this operation is received by the operation reception unit 240, and if the user performs an operation to change, for example, the optical axis displacement threshold or distance judgment threshold, the optical axis displacement threshold and distance judgment threshold stored in the memory 32 are updated.

[0037] The optical axis displacement detection signal received from the head unit 2 via the data receiving unit 340 is supplied to the optical axis displacement control unit 242. When the optical axis displacement control unit 242 receives the optical axis displacement detection signal, it supplies the optical axis displacement detection signal to the display screen generation unit 244. Upon receiving the optical axis displacement detection signal, the display screen generation unit 244 immediately generates a display screen to be displayed on the OELD 12. The display screen generated by the display screen generation unit 244 is supplied to the display control unit 250, which controls the drawing of the OELD 12 based on the display screen generated by the display screen generation unit 244.

[0038] Measurement information, including light reception information and a judgment threshold received from the head unit 2, is received by the display screen generation unit 244. The display screen generation unit 244 generates a display screen to be displayed on the OELD 12 based on the light reception information. The display screen generated by the display screen generation unit 244 is supplied to the display control unit 250, which controls the drawing of the OELD 12 based on the display screen generated by the display screen generation unit 244.

[0039] Measurement information, including light reception information, and optical axis displacement detection signals received from the head unit 2 via the data receiving unit 340 are supplied to the output generation unit 246. Based on the determination information contained in the light reception information received from the head unit 2, the output generation unit 246 generates output information according to a user-configurable output logic 248. This output information is supplied to external devices via the output cable 8 through the output circuit 28. In addition, when the output generation unit 246 receives an optical axis displacement detection signal, it may also supply an alarm signal to an external device via the output circuit 28.

[0040] The output information described above may be generated by the main unit 4 or by the head unit 2, as described above. Generally, the presence of the relay cable 6 connecting the head unit 2 and the main unit 4 makes them susceptible to noise. When the judgment ON / OFF signal is generated by the head unit 2, the judgment ON / OFF signal supplied to the main unit 4 via the relay cable 6 is a binarized signal and is therefore less susceptible to noise. On the other hand, when the judgment ON / OFF signal is generated by the main unit 4, there is no need to generate this judgment ON / OFF signal in the head unit, thus avoiding complexity in the circuit board of the head unit 2, and making it possible to miniaturize the head unit 2 when aiming for miniaturization.

[0041] Figure 11 is a diagram illustrating the power supply circuits included in the head unit 2 and the main unit 4. The main unit 4 has a built-in power supply circuit 30. The power supply circuit 30 includes two power supply circuits 30A and 30B. One power supply circuit 30A adjusts the voltage of the power supply received from an external source and supplies the adjusted voltage to the other power supply circuit 30B and the head unit 2. This other power supply circuit 30B adjusts the voltage and supplies it to the processor 24 and the head unit 2. In the head unit 2, the power supply received from the main unit 4 drives the motion sensor (gyro sensor) 50 and the processor 68, and also drives the green LD520. The second power supply circuit 78 of the head unit 2 adjusts the voltage, and after the adjusted voltage is stabilized by the linear regulator 82, it is supplied to the image sensor 60 and the light receiving circuit 62.

[0042] Figure 12 is a flowchart illustrating the control of limiting the intensity and power of the LD520 (Figure 9) that emits green laser light. Referring to Figure 11, a light emission signal is generated in step S1. This light emission signal has a predetermined emission period. In the next step S2, the green LD520 is driven with a predetermined current. The driving control of the green LD520 may also be performed by pulse width. In the next step S3, it is determined whether the amount of light received by the light receiving unit 64 is within a predetermined range, and if YES, the process returns to step S1. In step S3, if NO, i.e., the amount of light received is outside the specified range, the process proceeds to step S4 to determine whether this deviation has occurred for a predetermined number of consecutive times or more. In step S4, if YES, i.e., the deviation has occurred for a predetermined number of consecutive times or more, it is determined that some kind of malfunction has occurred, and the power supply to the green LD520 is stopped (S5). In step S4, if NO, the process proceeds to step S6 to adjust the current and pulse width controlling the green LD520, and the process returns to step S2.

[0043] Steps S3 through S6 described above constitute a de facto limiter that restricts the intensity and power of the green laser light. The intensity and power of the green laser light emitted by the light-emitting unit 52 are limited to a level that does not affect the user even if the user visually confirms the position of the green laser light spot on the workpiece. This limit should be set with the "Class 1" or "Class 2" safety standards in mind. Green has a wavelength of 500 nm to 555 nm and has superior luminous efficiency (light luminous efficiency and dark luminous efficiency) compared to other colors. Therefore, even if the intensity and power of the green laser light are limited to the above levels, the visibility of the spot light can be ensured.

[0044] Next, the process related to tuning will be explained with reference to Figure 13. In the head unit 2, a determination distance is calculated from the amount of light received by the light receiving unit 64, and this determination distance, along with the threshold value to be tuned, is supplied to the main unit 4 via the communication units 80 and 34. In the main unit 4, a display screen is generated by the display screen generation unit 244, and based on this display screen, the display control unit 250 (Figure 10) executes control of the drawing of the OELD 12.

[0045] <Reverse display> Figure 14(I) shows an example of the OELD12 display during operation. Figure 14(II) shows an example of the OELD12 display during tuning. The numerical value "199.9mm" in the figures is the current value. The unit "mm" can be changed to "inch" according to the user's settings. It is preferable that the entire screen is inverted during operation (Figure 14(I)) and tuning (Figure 14(II)). Based on the difference in display mode, including the background color of the OELD12, the user can instantly recognize or confirm whether the display mode is currently in operation mode or tuning mode.

[0046] <Indicator of tuning stability> As a capability of the triangulation sensor 200, if the threshold for setting a stable operating threshold is 0.5 mm, then when the difference in height (distance difference) between the first and second points to be detected is greater than 0.5 mm, automatic setting of a stable operating threshold is possible. To inform the user of this, "0.5 mm," which is the threshold for setting a stable operating threshold for the triangulation sensor 200, is displayed next to the current value (Figure 14 (II)). In addition, an inequality sign (>) indicating that the current value is greater than the allowable threshold may be displayed. This allows the user to immediately recognize or confirm that an automatic setting of a threshold that does not cause operational problems has been performed by visually inspecting it. As an indication that automatic setting of a threshold that does not cause operational problems is possible, for example, a circular character 85 may be displayed, as will be explained later with reference to Figure 18.

[0047] <2-point tuning> Figure 15 is a flowchart illustrating the process in two-point tuning mode. When the user selects tuning mode, the calculation of the workpiece displacement begins in step S11. In the next step, S12, when the user presses down the SET button 16 (Figure 2) (the first time the SET button 16 is pressed), the first detected displacement at that point is acquired according to this first acquisition instruction (S13), and this first detected displacement is set as the "first reference value" (S14).

[0048] The system continuously detects the displacement of the workpiece and acquires the detected displacement in real time (S15). Then, it calculates the difference between the real-time detected displacement and the reference value, i.e., the "relative displacement" (S16), and displays this on the OELD12 (S17). After the user presses down the SET button 16 for the first time, as they move the workpiece to the point where they press down the SET button 16 for the second time, the current value on the OELD12 will continue to change. The user searches for the point where they press down the SET button 16 for the second time while visually observing the spot light on the surface of the workpiece. During this time, the user can check the relative displacement changing as they move the workpiece by looking at the display on the OELD12.

[0049] In the next step, S18, it is determined whether the above relative displacement is greater than or equal to the detection step height at which tuning is successful. Here, "successful tuning" means that a threshold value that does not cause operational problems can be automatically set in relation to the capabilities of the triangulation sensor 200. It is preferable that the limit value for "successful tuning," which is "0.5 mm" in the above example, is stored in memory 32 beforehand.

[0050] In step S18, if the answer is YES, meaning the relative displacement is greater than or equal to the step that allows for successful tuning, the screen of OELD12 displays "0.5 mm," which is the step that allows for the setting of a threshold that enables stable operation of the aforementioned triangulation sensor 200. Preferably, an inequality sign may also be displayed. By seeing that the displayed current value is much larger than the step of "0.5 mm," the user can understand that the threshold can be set with ample margin. Also, when the displayed current value is close to the step of "0.5 mm," by comparing the current value with "0.5" and seeing that the current value is greater than "0.5," and by seeing the aforementioned inequality sign, the user can understand that a threshold that does not cause operational problems can be set. This allows the user to confidently press the SET button 16 a second time to instruct the second acquisition.

[0051] If, at the current location, the relative displacement is less than the above "0.5 mm", then in step S18, the system determines NO and skips to step S19. Since the user does not see the above step difference "0.5 mm" or the inequality sign on the OELD12 screen, they can refrain from pressing the SET button 16 a second time.

[0052] When the user sees "0.5mm" or an inequality sign on OELD12, they can confidently press the SET button 16 a second time, knowing that a stable threshold can be set. If necessary, they can visually confirm the point where the spotlight is shining before pressing the SET button 16 a second time. Upon this second press, the process proceeds from step S20 to S21, where the second detected displacement at the point where the SET button 16 was pressed a second time is obtained and set as the second reference position. Then, the difference between this second reference position and the aforementioned first reference value, i.e., the step value, is calculated (S22). In the next step S23, for example, half of this step value is set as the threshold (S23). The threshold setting algorithm is not limited to this method; it may also be an algorithm that sets upper and lower threshold limits so that the judgment is ON in the case of either the detection distance of the first reference position or the second reference position.

[0053] <Fully Automatic Tuning> The user can choose between the two-point manual tuning described above and the fully automatic tuning when setting the judgment threshold. In fully automatic tuning, the detected displacement is calculated while the user continues to press down the SET button 16, and while updating this detected displacement, the peak value (the peak value on the side furthest from the head unit 2) is determined as the "first reference value," the bottom value (the peak value on the side closer to the head unit 2) is determined as the "second reference value," and the midpoint between the first and second reference values ​​is set as the "threshold."

[0054] Figure 16 is a flowchart illustrating the basic processing in full auto tuning mode. In full auto tuning mode, in step S31, when the user presses down the SET button 16, the workpiece displacement is acquired (S32). Based on the acquired workpiece displacement, first and second reference values ​​are determined, and these first and second reference values ​​are registered (S33). When the user stops pressing down the SET button 16, the process proceeds from step S34 to step S35, where a threshold value for judgment is set based on the registered first and second reference values. Examples of threshold setting algorithms include setting the threshold value to the midpoint between the first and second reference values, or setting the threshold value so that the judgment between the first and second reference values ​​is turned ON. On the other hand, if the operation of pressing down the SET button 16 continues, the process of updating the first and second reference values ​​is executed from step S34 to step S36.

[0055] Figure 17 is a flowchart illustrating an example of the reference value update process in step S36 (Figure 16) described above. In the reference value update process, the displacement of the workpiece is continuously acquired (S361), and the detected workpiece displacement is compared with the first reference value (S362). If the workpiece displacement is greater than or equal to the first reference value, in step S363, the first reference value is updated based on the detected workpiece displacement.

[0056] Furthermore, in step S364, the detected workpiece displacement is compared with the second reference value. If the workpiece displacement is less than or equal to the second reference value, in step S365, the second reference value is updated based on the detected workpiece displacement.

[0057] In the next step S366, the relative displacement between the first reference value and the second reference value is calculated, and a determination is made based on this calculated relative displacement as to whether or not the displacement is such that tuning can be successfully performed (S367). If the calculated relative displacement is greater than or equal to the displacement at which tuning can be successfully performed, the process proceeds to step S368, where a circular character 85 (Figures 19 and 20) is displayed on OELD12, indicating that a stable judgment threshold can be set, and the relative displacement between the first reference value and the second reference value is also displayed on OELD12 (S369).

[0058] Users who select the fully automatic tuning mode can confirm that stable operation is possible under the threshold automatically set by fully automatic tuning by seeing the circular character 85 displayed on OELD12. Then, after confirming that character 85 is displayed, they can release the SET button 16 and stop acquiring new workpiece displacement data, thereby achieving stable operation under the automatically set judgment threshold.

[0059] The optical triangulation sensor 200 has a "height mode" and a "distance mode" for measuring the displacement of a workpiece, and the user can arbitrarily set either the height mode or the distance mode. In "height mode," the displacement of the workpiece from the surface on which it is placed, i.e., the height, is measured. Instead of the surface on which the workpiece is placed, the top surface of the workpiece may be set as the reference surface. When measuring a workpiece whose top surface is higher than the reference surface, a "+" icon is displayed on OELD12, and when the top surface of the workpiece is lower than the reference surface, a "-" icon is displayed on OELD12.

[0060] Figure 18 shows the selection screen for "height mode" and "distance mode". Figure 18(I) represents height mode, and Figure 18(II) represents distance mode. The OELD12 alternately displays the height mode selection screen (Figure 18(I)) and the distance mode selection screen (Figure 18(II)). In the height mode selection screen (Figure 18(I)), an arrow is displayed extending from the reference plane marked with "0" (zero) towards the character 84 representing the head unit 2. On the other hand, in the distance mode selection screen (Figure 18(II)), an arrow is displayed extending away from the head unit character 84 marked with "0" (zero).

[0061] Figure 19(I) shows the display screen for the height mode selected by the user based on the height mode selection screens shown in Figure 18(I) and Figure 19(II). In Figure 19(I), the number "199.9" represents the current value. The "+" icon to its left means, as described above, that the top surface of the workpiece is higher than the reference plane, i.e., closer to the head unit 2 than the reference plane. The number "67.8" represents the judgment threshold. Below this judgment threshold, the circular character 85 described above is displayed, indicating that stable operation is possible.

[0062] Figure 20(I) shows the display screen for the distance mode when the user selects the distance mode based on the distance mode selection screen shown in Figure 18(II) and Figure 20(II). Comparing Figure 19(I) (height mode) with Figure 20(I) (distance mode), it can be seen that in distance mode (Figure 20(I)), the position of the sensor head is used as the reference, so the "+" icon (Figure 19(I)) is not displayed.

[0063] In Figure 19(I), the number "199.9" represents the current value. The "+" icon to its left indicates, as mentioned above, that the top surface of the workpiece is higher than the reference surface, i.e., closer to the head unit 2 than the reference surface. The number "67.8" represents the judgment threshold. Below this judgment threshold, the circular character 85 mentioned above is displayed, indicating that stable operation is possible.

[0064] In the height mode (I) of Figure 19 and the distance mode (I) of Figure 20, numerical values ​​are displayed, but the user can switch to a bar display. Figure 21 shows the bar display in height mode. Figure 22 shows the bar display in distance mode. The numerical value "12.3 mm" shown in Figures 21 and 22 represents the current value. In the bar display in height mode in Figure 21, a "+" icon is displayed next to the current value "12.3 mm". As mentioned above, this "+" icon means that the top surface of the workpiece is higher than the reference plane, that is, it is closer to the head part 2 than to the reference plane.

[0065] In Figures 21 and 22, the bar Br, which represents the current value, extends from the reference plane towards the head icon 84 in the height mode display (Figure 21). On the other hand, in the distance mode display (Figure 2), the bar Br extends from the head icon 84. In the figures, the vertical line of reference numeral 88, which includes "P", indicates the maximum value of the detected displacement acquired so far. The judgment threshold is displayed by a vertical line 90 that extends in the direction crossing the bar Br of the current value. When the user changes the threshold setting by operating the UP / DOWN buttons 18 and 20, the judgment threshold character (vertical line) 90 moves in accordance with the user's operation. This allows the user to fine-tune the judgment threshold while looking at the display of the current value bar Br and the maximum value P on the OELD12 and confirming the position of the judgment threshold character 90.

[0066] The above describes two-point tuning and fully automatic tuning regarding threshold setting. In addition, the triangulation sensor 200 may also have a DATUM tuning function. DATUM tuning is a function that sets a reference value by performing tuning when no workpiece is present, and turns on the judgment when the state is different from when DATUM tuning is being performed. DATUM measurement based on DATUM tuning detects whether or not there is a change from the set reference value. Therefore, DATUM measurement makes it possible to effectively and quickly detect workpieces with low reflected light or workpieces that exhibit multiple reflections. The "reference value" used in DATUM measurement can be registered by DATUM tuning, and may also be updated by external input.

[0067] <Detection range mask display> The triangulation sensor 200 has a masking function to suppress the effects of ambient light, and the user can set the masking range. Referring to Figure 23, for example, when light is transmitted and received through the viewport 100, the triangulation sensor 200 receives the first light L(1) reflected from the surface of the workpiece W and the second light L(2) reflected from the viewport 100. In relation to the workpiece W and the viewport 100 from the perspective of the triangulation sensor 200, the workpiece W is farther away from the viewport 100. As a result, in the multiple image sensors 60 constituting the light receiving unit 64, the reflected light L(1) from the workpiece W and the reflected light L(2) from the viewport 100 are imaged at different pixel positions.

[0068] Figure 24 shows the received light waveform under normal conditions. Reference numeral P(1) represents the peak due to reflected light L(1) from the workpiece W, and reference numeral P(2) represents the peak due to reflected light L(1) from the viewport 100. As can be seen from Figure 24, the peak P(1) associated with the workpiece W is higher than the peak P(2) associated with the viewport 100, indicating that the workpiece displacement can be measured correctly.

[0069] Figure 25 shows the received light waveform during an abnormal situation. As can be seen from Figure 25, the peak P(2) associated with viewport 100 is higher than the peak P(1) associated with workpiece W, making it virtually impossible to measure the workpiece displacement. By setting a mask in the pixel range shown by the shaded area in Figure 25, the workpiece displacement can be measured based on the peak P(1) associated with workpiece W.

[0070] <User-defined mask area> Figure 26 is a flowchart illustrating an example of a series of processes related to setting the mask area. Figure 27 shows the display screen of the OELD12 when setting the mask area. In Figure 26, image data is created based on the received waveform and the mask area (S41). The display screen of the OELD12 shows a vertical line 90 representing the judgment threshold, a received peak 102, and a head unit character 84. When the first and second peaks P(O) and P(d) appear on the display screen of the OELD12, the user can recognize that the second peak P(d) is ambient light, taking into account the measurement environment and the distance from the head unit 2. In other words, it can be understood that the first peak P(O) is the measurement light. It can also be recognized whether the measurement light and the judgment threshold are too close together. If it is determined that the judgment threshold is too close, the judgment threshold can be adjusted by operating the UP / DOWN buttons 18 and 20. When this adjustment is made, the vertical line 90 of the judgment threshold displayed in OELD12 moves in real time.

[0071] In step S42, it is determined whether there is an operation to change the near-field mask area close to the head body 2. If YES (operation performed), the process proceeds to step S43, where the near-field mask area is changed according to the operation performed by the user on the operation unit 402 (Figure 10), and the image data is updated based on the received waveform and the mask area (S44). The mask area can be changed in increments of, for example, 0.1 mm. The displacement amount of one row of the OELD 12 and the minimum changeable amount do not necessarily have a one-to-one correspondence. Here, the displacement amount of one row of the OELD 12 depends on the size (resolution) of the display part of the OELD 12 and the maximum detectable range. Therefore, the processor 68 may determine whether there is a change of more than one row of the OELD 12, and change the display of the mask area only if there is a change of more than one row.

[0072] The processing of the received waveform involves acquiring the peak position and calculating where on the OELD12 the acquired peak position should be drawn. As a variation, the received waveform is normalized within the display area of ​​the OELD12 based on the maximum detectable range of the triangulation sensor 200 and the peak amount of received light in the received waveform. In Figure 28, the area Ms(1) shown by the diagonal lines on the display screen of the OELD12 is the near-range mask area. The near-range mask area Ms(1) changes in real time according to the user's operation of the control unit 402. In (I) on the left, the boundary of the near-range mask area Ms(1) is numerically displayed as 12.0 mm from the head unit 2. In (II) on the right, the boundary of the near-range mask area Ms(1) is numerically displayed as 30.0 mm from the head unit 2. This value also changes in real time according to the user's operation of the control unit 402.

[0073] Once the near-field mask area has been set, the process proceeds from step S45 to step S46 to update the image data. In this embodiment, the mask area is not set. If the system is equipped with an automatic mask area setting function, which will be described later, the automatically set mask area may be displayed. Next, in step S47, it is determined whether or not there is an operation to change the far-field mask area, which is far from the head unit 2. If the answer is YES (operation), the process proceeds to step S48, where the far-field mask area is changed according to the operation of the operation unit 402 performed by the user, and the image data is immediately updated (S49). Referring to Figure 29, the area Ms(2) shown in shaded areas is the far-field mask area. The far-field mask area Ms(2) changes in real time according to the operation of the user's operation unit 402. In (I) on the left, the boundary of the far-field mask area Ms(2) is numerically displayed as 45.0 mm from the head unit 2. In (II) on the right, the boundary of the far-field mask area Ms(2) is numerically displayed as 40.0 mm from the head unit 2. This value also changes in real time in response to the user's operation of the control unit 402.

[0074] If we refer to the boundary of the near-field mask region Ms(1) as the "lower limit" and the boundary of the far-field mask region Ms(2) as the "upper limit," the user can configure the mask region settings to ensure reliable masking by arbitrarily specifying the upper and lower limits while viewing the OELD12 display.

[0075] In the mask setting, which will be explained later with reference to Figure 32, the mask region Ms is determined based on the peak detection distance. After the mask region Ms is determined based on a predetermined algorithm in this way, it is preferable to configure the system so that the mask region Ms can be adjusted by the user.

[0076] As can be seen in Figures 28 and 29, it is preferable to display the boundary distance of the near-field mask area Ms(1), for example, "12.0 mm", and the boundary distance of the far-field mask area Ms(2), for example, "45.0 mm", in a position close to the center of the horizontally elongated OELD12. When designing to miniaturize the main body 4, the vertical and horizontal dimensions of the horizontally elongated OELD12 are limited. Therefore, displaying the boundary distance values ​​of the mask areas Ms(1) and (2), which are of interest to the user, in a position close to the center of the OELD12 improves visibility for the user.

[0077] In the flowchart of Figure 26, once the setting of the far-side mask area is complete, the process proceeds from step S50 to step S52, acquiring the amount of light received from each pixel of the image sensor 60, and obtaining the peak position of the amount of light received (current peak position) from the area not masked. Then, the current peak position is compared with a threshold (S53). In the next step, S54, the display process is performed. This display process will be explained below based on Figures 30 and 31.

[0078] The mask setting display screen offers two main display modes. Figure 30 shows a specific example of the mask setting display screen. Figures 30(I) and (II) show the first display mode, which displays the boundaries of the mask area numerically. The first display mode (Figure 30(I)) includes a threshold value of "5.0", a mask area boundary of "12.3", a "+" signifying a nearby mask area, and the aforementioned circular character 85, which indicates that a judgment threshold capable of stable operation has been set. As can be seen from Figure 30(II), the display of the circular character 85 may be omitted from the first display mode (Figure 30(I)).

[0079] Figure 30(III) shows a second display mode in which the mask area is pictorially displayed with diagonal lines. The illustrated example shows the display when the near-range and far-range mask areas Ms(1) and Ms(2) are set. In the second display mode, the vertical line character 90 representing the threshold, the character 84 representing head 2, and the character 102P representing the disturbance peak are displayed. The peak character 102P is drawn in a shape that resembles a telescopic shape, and the magnitude of the peak light reception is displayed in steps as a telescopic figure that extends upward. This allows the user to intuitively grasp the magnitude of the peak light reception by looking at the shape of the peak character 102P.

[0080] Figure 31 is a flowchart illustrating an example of the display process. In step S61, the set display mode is determined. If the first display mode is set, the process proceeds to step S62 to determine whether there is one peak in the received waveform. If there is one peak, the process proceeds to step S63 to generate display screen information based on the first pattern A of the first display mode (Figure 30(I)). In step S62, if there are multiple peaks in the received waveform, the process proceeds to step S64 to generate display screen information based on the second pattern B of the first display mode (Figure 30(II)). Also, if the second display mode is set in step S61, the process proceeds to step S66 to generate display screen information based on the second display mode (Figure 30(III)). In the next step S65, the generated display screen information is drawn on the OELD12.

[0081] <Automatic mask area setting> Figure 32 is a flowchart illustrating an example of the process for automatically setting the mask area. Automatic setting of the mask area applies not only when the mask area is set by internal processing of the main unit 4 at the user's request, but also when correcting or changing the mask area that the user has manually set as described above.

[0082] Referring to Figure 32, in step S71 the received waveform is acquired, and in the next step S72 the peak detection distance is acquired from the received waveform. Then, in step S73, a mask area Ms that can mask the relevant portion is determined based on the peak detection distance. For example, based on the peak detection position on the near-field side, the mask area is automatically determined so that this position becomes the center of the detection range. Then, image data is generated based on the received waveform and the current mask area Ms (S74). This automatically sets the mask area Ms. Here, the mask area Ms may then be arbitrarily set and modified, such as by changing the upper and lower limits or the mask area itself.

[0083] In the next step S75, it is determined whether there is an instruction to change the mask area. If there is an instruction to change the mask area, in step S76, the screen data is updated based on the received waveform and the mask area. Next, in step S77, it is determined whether there is an operation to change the mask area. If there is a user operation to change the mask area, the mask area is changed according to the amount of operation (S78), and then in the next step S79, the screen data is updated based on the received waveform and the mask area. Once the setting of the mask area Ms is complete, the process proceeds from step S80 to step S81, and the pixels in the mask area Ms are set as invalid pixels. In the next step S82, the amount of light received is obtained from each of the valid pixels, and in the next step S83, a received waveform is generated based on the amount of light received by the valid pixels (S83). Next, the peak position is obtained from the area that is not masked (S84), and the displacement is calculated from this peak position (S85). Next, a light-receiving waveform is generated from the amount of light received by this effective pixel (S86), the peak position is obtained from this light-receiving waveform (S87), and this peak position is compared with a threshold (S88). Then, in the next step S89, the display processing is performed. The display processing is the same as described above based on Figures 30 and 31.

[0084] The automatic mask setting described with reference to Figure 32 is effectively used to achieve high-speed response. When the mask area is automatically set to achieve this high-speed response, it may be necessary to limit the data acquisition area in order to ensure response time. In this case, user modification of the mask area may be configured to only increase the mask area compared to the automatically set mask area, i.e., to narrow the detection area, or it may be a parallel shift of the automatically set mask area. In this case, the response time can be shortened by making the masked area an invalid pixel and acquiring light reception data from the valid pixels.

[0085] When a mask is set in the triangulation sensor 200, the image pixels in the mask area may be set as invalid pixels, or the mask area may be excluded from the peak detection range. If invalid pixels are set, light reception data is not acquired from the mask area. In this case, the masked area is set as invalid pixels, and the peak position may be acquired based on the light reception information acquired in the pixels that are not invalid pixels, i.e., the valid pixels, and the displacement of the workpiece may be measured based on the said peak position. In this case, the area from which data is acquired is reduced, making it possible to achieve a high-speed response.

[0086] Alternatively, when setting a mask, the peak position may be obtained based on the light reception information acquired for all pixels, and the measurement may be performed based on whether or not the acquired peak position is within the mask area. That is, if the acquired peak position is not within the mask area, that position is acquired as the peak position. On the other hand, if the acquired peak position is within the mask area, that position is not acquired as the peak position, and a second peak position (i.e., the second position in terms of light reception) is acquired, and it is determined whether or not this second peak position is within the mask area. If the second peak position is not within the mask area, that position is acquired as the peak position.

[0087] <Display related to the gyro sensor> The triangulation sensor 200 in this embodiment has a gyro sensor 50 mounted on the head unit 2 as an example of a motion sensor, and this gyro sensor 50 detects changes in the installation orientation of the head unit 2, i.e., optical axis displacement. An example of this process will be explained based on the flowchart shown in Figure 33. Step S91 is the initial setup process performed by the manufacturer of the triangulation sensor 200 at the time of shipment. This initial setup may also be performed by the user. In this initial setup, the sampling frequency and detection range of the gyro sensor are set. These are reset at each set sampling frequency, i.e., at predetermined time intervals.

[0088] In step S92, angular velocity information for the three axes is acquired from the gyro sensor. In the next step S93, the angular velocity values ​​for the three axes over a certain period are averaged to generate current angular velocity information for the three axes, and the largest value from this information is taken as the current value (S94). In the next step S95, it is determined whether the current value is above a threshold, and if YES, i.e., the current value is above the threshold, it is determined that the optical axis of the head unit 2 has been displaced and is affecting the detection accuracy, and the process proceeds to step S96 to start measurement for ON output and elapsed time display. As a result, for example, the operation indicator lights 70, 76, and 14 flash red. This allows the user to know that an abnormality has occurred regarding the installation of the head unit 2. The ON output and the elapsed time since the optical axis displacement occurred are displayed on the OELD 12 of the main unit 4. An example of this display will be explained later.

[0089] The ON output and measurement for the elapsed time display in step S96 continue until the user presses down the SET button 16 to perform a clear operation, for example, if the clear operation function is assigned to the SET button 16 (S97, S98). This clear operation may also be performed by a clear instruction via a signal input from an external device such as the PLC 10 (Figure 1). The clear operation of the elapsed time timer includes stopping the count and resetting the count value.

[0090] Figure 34 shows an example of the gyro bar monitor display shown on the OELD12 at the user's selection. In Figure 34, reference numeral 120 indicates the gyro sensor character. The gyro character 120 consists of two arcs with opposing arrows, and while the gyro sensor is detecting angular velocity, for example, three frames are displayed sequentially, as shown in Figure 35. This allows the user to know that the gyro sensor is currently detecting angular velocity by watching the character 120, which consists of two arcs with arrows rotating.

[0091] In the gyro bar monitor display of Figure 36, reference numeral 122 indicates the current value shown in bar format. The longer this current value bar extends from left to right, the larger the value. Reference numeral 136 indicates a vertical line indicating a threshold. In the illustrated bar monitor display, reference numeral 126 indicates a vertical line character that shows the maximum value of the angle change (optical axis displacement) acquired by the head unit 2 so far. To differentiate it from the vertical line character 136 that shows the threshold, it is preferable to display a character 128, for example, "P", on the maximum value line 126.

[0092] The threshold value for optical axis displacement can be changed by the user by operating the UP button 18 and / or the DOWN button 20. This change is reflected in real time on the threshold display line 124, and when the threshold value is increased, for example, the vertical line of the threshold character 124 moves to the left.

[0093] To simplify the user's threshold setting, it is preferable to divide the threshold magnitude settings into, for example, five classes, allowing the user to select from Class 1, which is highly sensitive to slight optical axis displacements, to Class 5, which is relatively insensitive. It is preferable to display the class selected by the user with, for example, a character 130 from "1" to "5". Figure 36 shows an example of displaying the class character 110 on top of the threshold line character 124. The class character 110 of "5" on top of the threshold line character 124 in the figure indicates that the class selected by the user is "5".

[0094] When the displacement amount calculated based on the angular velocity detected by the gyro sensor 50 is greater than a threshold, an abnormality occurrence signal (optical axis displacement occurrence) is generated and output, or, instead of outputting the abnormality occurrence signal, preferably the display of OELD12 immediately switches from the normal operation display to the alarm display shown in Figure 37. The alarm display includes a first alarm display mode that displays "Position deviation detected" in text, and a second alarm display mode that displays the elapsed time since the gyro sensor detected that the displacement amount based on the angular velocity detected is greater than or equal to a threshold. It is preferable to display these first and second alarm display modes alternately.

[0095] <Pairing display> Figure 38 shows an example of a display related to pairing. This display example is not limited to the triangulation sensor 200 of the embodiment. It is generally applicable to displacement sensors. Pairing means that the head unit 2 and the main unit 4 that constitute a pair are working in coordination. During pairing between the head unit 2 and the main unit 4, the word "PAIRING" is displayed along with the character 84 of the head unit. When pairing is successful, the word "PAIRING" is highlighted and the character 140, which indicates that the head unit 2 and the main unit 4 are working in coordination, is displayed on the character 84 of the head unit. By seeing this, the user can confirm that the pair of head units 2 and the main unit 4 have been successfully paired. For example, in an environment where many head units 2 are installed, displaying the above pairing information on the OELD 12 of the main unit 4 can prevent confusion regarding the correspondence between the pair of head units 2 and the main unit 4. [Explanation of symbols]

[0096] 200 Optical Triangulation Sensor 2. Head of the triangulation sensor 4. Main body of the triangulation sensor 6. Relay Cable 8 output cables 12 OELD (display section) 52 Light-emitting section 64 Light receiving part 84 Head section character 88. Line indicating the maximum distance. 90 threshold characters 102 Peak light reception 244 Display generation section 684 Peak position detection unit (measurement unit) 688 Judgment section

Claims

1. The head section, The head unit is positioned to emit light for measuring the detection area, A light receiving unit is arranged in the head portion and converts the measurement light from the detection area into photoelectric signals to generate a light receiving signal, A measuring unit that measures the displacement of the object to be detected based on the light-receiving signal generated by the light-receiving unit, A determination unit that generates a determination signal based on a comparison between a threshold value and the displacement of the object to be detected measured by the measurement unit, A display generation unit generates a display screen that shows the displacement of the object to be detected measured by the measurement unit and the threshold value side by side, and in distance mode generates a display screen that shows the displacement of the object to be detected measured by the measurement unit as the current value of an unsigned distance with respect to the position of the head unit, and in height mode generates a display screen that shows the displacement of the object to be detected measured by the measurement unit as the current value of a signed distance that becomes positive as it approaches the head unit from a preset reference, A displacement sensor characterized by comprising: an elongated dot matrix display that displays a display screen generated by the display generation unit.

2. The displacement sensor according to claim 1, further comprising: the display generation unit further generates a display screen that displays a head character at the longitudinal edge of the dot matrix display to visually indicate the correspondence between the displacement of the detected object measured by the measurement unit and the head unit, corresponding to the distance mode and the height mode.

3. The displacement sensor according to claim 1, wherein the display generation unit further generates a display screen that displays a head character positioned at the longitudinal end of the dot matrix display, a zero reference for the current distance value, and an increasing direction of the current distance value shown along the longitudinal direction of the dot matrix display, corresponding to the distance mode and the height mode.

4. The displacement sensor according to claim 1, wherein the display generation unit further generates a display screen in which, in the distance mode and the height mode, the current value of the distance is displayed together with a unit arranged on one end of the longitudinal direction of the dot matrix display, and a threshold value is displayed on the other end of the longitudinal direction of the dot matrix display.

5. The aforementioned dot matrix display can be switched to a bar display. The displacement sensor according to claim 1, wherein the display generation unit, when switched to a bar display, displays the current value of the distance as a bar extending along the longitudinal direction of the dot matrix display, and generates a display screen for a bar display mode in which a head unit character is displayed at a position corresponding to the bar, corresponding to the distance mode and the height mode.

6. The displacement sensor according to claim 5, wherein in the display screen of the bar display mode, a threshold character indicating the threshold is displayed along with the bar at a position corresponding to the bar, and the displayed threshold character moves along the longitudinal direction of the dot matrix display in accordance with changes in the threshold setting.

7. The displacement sensor according to claim 5, wherein the display screen in the bar display mode displays a threshold character indicating the threshold at a position corresponding to the bar, and a line indicating the maximum distance, along with the bar.

8. The displacement sensor is a triangulation sensor, The light-receiving unit has multiple pixels and generates a light-receiving waveform that indicates the amount of light received at each pixel as the light-receiving signal. The measuring unit measures the displacement of the object to be detected based on the peak of the light-receiving waveform generated by the light-receiving unit. The displacement sensor according to claim 1, wherein the display generation unit, when displaying the peak position of the received light waveform, displays the peak position of the received light waveform at corresponding positions in the longitudinal direction of the dot matrix display, and if there are multiple peak positions of the received light waveform, displays each peak position at corresponding positions in the longitudinal direction of the dot matrix display, and generates a display screen for a peak position display mode in which a head character is displayed at the longitudinal end of the dot matrix display.

9. The displacement sensor according to claim 8, wherein the display generation unit displays a threshold character indicating the threshold at a position corresponding to the peak position along with the peak position, and generates a display screen in which the displayed threshold character moves along the longitudinal direction of the dot matrix display in accordance with changes in the threshold setting.

10. The aforementioned dot matrix display can be switched to bar display mode. The displacement sensor according to claim 1, wherein the display generation unit, when switched to bar display mode, displays the current value of the distance as a bar extending along the longitudinal direction of the dot matrix display, displays a head character at a position corresponding to the bar in correspondence with the distance mode and the height mode, and generates a display screen at the longitudinal end of the dot matrix display, in distance mode, displaying the displacement of the detected object measured by the measurement unit as the current value of an unsigned distance with respect to the position of the head, and in height mode, displaying the displacement of the detected object measured by the measurement unit as the current value of a signed distance that becomes positive as it approaches the head from a preset reference.

11. The displacement sensor according to claim 10, wherein in the bar display mode, a threshold character indicating the threshold is displayed along with the bar at a position corresponding to the bar, and the displayed threshold character moves along the longitudinal direction of the dot matrix display in accordance with changes in the threshold setting.

12. The displacement sensor according to claim 10, wherein in the bar display mode, a threshold character indicating the threshold and a line indicating the maximum distance are displayed along with the bar at the position corresponding to the bar.