Position detection sensor

The position detection sensor addresses the challenge of installing sensors by displaying the piston's position within the movement range, simplifying the installation process through precise visual indicators.

JP2026096302APending Publication Date: 2026-06-15KEYENCE CORP

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
KEYENCE CORP
Filing Date
2024-12-03
Publication Date
2026-06-15

AI Technical Summary

Technical Problem

Existing position detection sensors for air cylinders only indicate when the piston reaches a predetermined position, failing to provide specific location information within the movement section, making installation cumbersome.

Method used

A position detection sensor with a detection device, display unit, and control unit that displays symbols indicating the piston's position along a direction, facilitating precise installation by showing the piston's location at different positions within the movement range.

🎯Benefits of technology

Eases the installation of position detection sensors by providing clear visual indicators of the piston's position, enhancing usability and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026096302000001_ABST
    Figure 2026096302000001_ABST
Patent Text Reader

Abstract

To simplify the installation of position detection sensors. [Solution] The position detection sensor generates a detection signal corresponding to the position of a magnet provided on the displacement body, and identifies the position of the displacement body in a first direction based on the detection signal. The display unit of the position detection sensor has a plurality of display elements arranged on the housing at different positions along the first direction, and displays a symbol indicating the position of the displacement body along the first direction. The position detection sensor controls the display unit to display the first state in which the displacement body is located at a first position corresponding to one end of the displacement range, the second state in which the displacement body is located at a second position corresponding to the other end of the displacement range, and the intermediate state in which the displacement body is located at an intermediate position between the first and second positions in different manner by displaying the symbol at different positions on the plurality of display elements.
Need to check novelty before this filing date? Find Prior Art

Description

【Technical Field】 , , , , , , 【0004】 , , , , , 【0005】 , , , , , 【0003】 , , , , , , 【0001】 The present invention relates to a position detection sensor. 【Background Art】 【0002】 In factory automation, air cylinders are used to realize operations such as pushing, pulling, and grasping. According to Patent Document 1, it has been proposed to detect the position of a piston that moves inside an air cylinder by air pressure or hydraulic pressure. Further, according to Patent Document 1, a display unit that emits light when the piston reaches a predetermined position has also been proposed. 【Prior Art Documents】 【Patent Documents】 【0003】 【Patent Document 1】 Japanese Patent Application Laid-Open No. 2003-240531 【Summary of the Invention】 【Problems to be Solved by the Invention】 【0004】 However, the invention described in Patent Document 1 only knows that the piston has reached a predetermined position. Generally, the piston moves in a movement section from a movement start position to a movement end position. Therefore, it would be convenient if it could specifically indicate where the piston is located in the movement section. In particular, the work of installing a position detection sensor for detecting the position of the piston on a working machine such as an air cylinder would be facilitated. Therefore, an object of the present invention is to facilitate the installation work of the position detection sensor. 【Means for Solving the Problems】 【0005】 The present invention is, for example, a position detection sensor for detecting the position of a displacement body movable parallel to a first direction, a detection device that generates a detection signal corresponding to the position of a magnet provided on the displacement body, A positioning unit that identifies the position of the displaced body in the first direction based on the detection signal generated by the detection device, A housing comprising at least a portion of the detection device and extending along the first direction, A display unit having a plurality of display elements arranged in the housing at mutually different positions along the first direction, which displays a symbol indicating the position of the displaced body along the first direction, A display control unit controls the display unit to display the symbols at different positions on the plurality of display elements, thereby displaying in different ways a first state in which the displaced body is located at a first position corresponding to one end of the displacement range, a second state in which the displaced body is located at a second position corresponding to the other end of the displacement range, and an intermediate state in which the displaced body is located at an intermediate position between the first and second positions. A position detection sensor is provided that includes the following features. [Effects of the Invention] 【0006】 According to the present invention, the installation of position detection sensors becomes easier. [Brief explanation of the drawing] 【0007】 [Figure 1] A diagram illustrating a position detection sensor. [Figure 2] A perspective view illustrating the cylinder sensor and cylinder. [Figure 3] Exploded perspective view of the cylinder sensor. [Figure 4] A schematic cross-sectional view of the cylinder sensor and cylinder. [Figure 5] A diagram showing the control system for the cylinder sensor. [Figure 6] A diagram showing the control system of a relay amplifier. [Figure 7] A diagram explaining the symbol. [Figure 8] A diagram explaining the symbol. [Figure 9] A flowchart illustrating the display control method. [Figure 10] A diagram explaining the symbol. [Figure 11] Figure for explaining symbols. [Figure 12] Flowchart showing the setting method. [Figure 13] Flowchart showing the deletion method. [Figure 14] Figure for explaining symbols. [Figure 15] Figure for explaining the user interface in the relay amplifier. [Figure 16] Figure showing other examples of symbols. [Figure 17] Figure showing other examples of symbols. [Figure 18] Figure showing other examples of symbols. [Figure 19] Figure showing other examples of the control system of the cylinder sensor. [Figure 20] Figure for explaining other examples of the position detection sensor. [Figure 21] Figure showing other examples of the control system of the relay amplifier. 【Mode for Carrying Out the Invention】 【0008】 Hereinafter, embodiments will be described in detail with reference to the accompanying drawings. Note that the following embodiments do not limit the invention according to the claims, and not all combinations of the features described in the embodiments are essential for the invention. Two or more of the features described in the embodiments may be arbitrarily combined. Also, the same or similar configurations are assigned the same reference numerals, and duplicate descriptions are omitted. 【0009】 1. Position detection sensor Figure 1 shows the position detection sensor 100. The valve system 101 includes one or more valves 122 connected to the air cylinder 102 via an air tube 111, and a controller 121 that controls the valves 122. The controller 121 communicates with the relay amplifier 104 via an IO-Link cable 112. IO-Link is merely an example of a communication standard, and other communication standards may be used. The relay amplifier 104 is a relay device that relays the detection results of the cylinder sensor 103 to the controller 121, and relays the power supplied from the valve system 101 to the cylinder sensor 103. The relay amplifier 104 does not need to have a signal amplification function. The relay amplifier 104 communicates with the cylinder sensor 103 via an IO-Link cable 113. The cylinder sensor 103 detects the position of a piston that is movably installed in the air cylinder 102 and outputs the detection result to the relay amplifier 104. The relay amplifier 104 outputs the detection result of the cylinder sensor 103 to the controller 121. As a result, the controller 121 recognizes the position of the piston and controls the direction of air supply to the air cylinder 102 by the valve 122 according to the position of the piston. 【0010】 The position detection sensor 100 may optionally have a display panel 105. In the work site (factory) where the position detection sensor 100 is installed, it may be required to display the detection results of the position detection sensor 100 on a larger screen. This is to allow users located at a distance from the air cylinder 102 to see the detection results. Alternatively, this may be because the display area of ​​the display function of the air cylinder 102 is smaller than the display area of ​​the display panel 105. The controller 121 of the valve system 101 and the display panel 105 are connected by an Ethernet® cable, and various signals are sent and received. In particular, the valve system 101 has a dedicated communication port 123 to which the display panel 105 is connected, and the display panel 105 is connected to this dedicated communication port 123. 【0011】 The cylinder sensor 103 is positioned relative to the air cylinder 102 according to the user's preference. Indications may be provided to the user to facilitate the installation of the cylinder sensor 103. 【0012】 The cylinder sensor 103 and the relay amplifier 104 may be integrated into one unit. Alternatively, the cylinder sensor 103 (sensor head) and the relay amplifier 104 (main unit) may be separated. This allows, for example, the sensor head to be miniaturized. As a result, it may be possible to install the cylinder sensor 103 even on air cylinders 102 with limited mounting space. 【0013】 2. Arrangement of cylinder sensor and air cylinder Figure 2 shows how the cylinder sensor 103 is installed on the air cylinder 102. In this example, the air cylinder 102 has one or more grooves 131 that extend along the longitudinal direction of the air cylinder 102. The cylinder sensor 103 is inserted into and fixed in one of the grooves 131. Here, the external dimensions of the housing 200 of the cylinder sensor 103 are slightly smaller than the dimensions of the internal space of the groove 131. This allows the cylinder sensor 103 to slide within the groove 131. Note that the cylinder sensor 103 can also be installed on a cylinder 102 that does not have grooves 131. In this case, the cylinder sensor 103 may be fixed to the cylinder 102 using a band and fittings. 【0014】 A translucent cover 201 is provided on the top of the housing 200. Below the cover 201 are a power LED 204 indicating power on / off, a first output LED 205 indicating that the first output signal is being output, and a second output LED 206 indicating that the second output signal is being output. LED is an abbreviation for light-emitting diode. The user can configure which detection results are assigned to the first output signal and the second output signal. For example, when it is detected that the position of the piston of the air cylinder 102 is within the first detection range, the level of the first output signal may change from low to high. When it is detected that the position of the piston of the air cylinder 102 is within the second detection range, the level of the second output signal may change from low to high. 【0015】 The operation button 202 is used by the user to make various settings for the cylinder sensor 103. 【0016】 The display window 203 displays a symbol indicating the position of the piston in the air cylinder 102. Here, the symbol may be realized by lighting up an LED corresponding to the piston position. The symbol may also be a bar indicating the piston position, or a bar indicating the distance the piston has traveled from a reference position. LEDs are just one example; liquid crystal displays or organic light-emitting diode (OLED) displays may also be used. EL is an abbreviation for electroluminescence. OLED is an abbreviation for organic light-emitting diode. In this case, the symbol may be a numerical value, or a combination of an image (e.g., a bar) and a numerical value. Furthermore, LEDs and displays may be combined. 【0017】 3. Structure of the cylinder sensor Figure 3 is an exploded perspective view of the cylinder sensor 103. The cover 201 is provided with a housing hole 301 for accommodating the operation button 202. A control board 302 is fixed inside the housing 200. A switch 303 is provided on the control board 302. The switch 303 may be, for example, a tact switch in which a movable contact contacts a fixed contact and conducts electricity when pressed by the operation button 202. 【0018】 The control board 302 further has a plurality of LEDs 305 located below the display window 203. The plurality of LEDs 305 may be arranged at predetermined fixed intervals (e.g., 2 mm). The plurality of LEDs 305 display symbols indicating the position detection result. The plurality of LEDs 305 may be RGB LEDs capable of displaying information in color, having red light-emitting elements, green light-emitting elements, and blue light-emitting elements. The plurality of LEDs 305 may simultaneously display a symbol indicating a first detection range corresponding to a first output signal, a symbol indicating a second detection range corresponding to a second output signal, and a symbol indicating the current position of the piston. For example, the plurality of LEDs 305 corresponding to the first detection range may light up in blue, the plurality of LEDs 305 corresponding to the second detection range may light up in orange, and one or more LEDs 305 corresponding to the current position of the piston may light up in green. When the piston enters the first detection range, the LED 305 corresponding to the current position of the piston may light up in another color (e.g., white, red, yellow, flashing green, flashing blue). 【0019】 Multiple Hall elements 304 are arranged on the side of the control board 302, in the area closest to the bottom. The multiple Hall elements 304 are an example of magnetic sensing elements that detect changes in magnetic flux density received from a magnet built into the piston and output a detection signal. The multiple Hall elements 304 are arranged at predetermined fixed intervals (e.g., 4 mm or more and 6 mm or less). Thus, the spacing between the multiple Hall elements 304 is larger than the spacing between the multiple LEDs 305. The spacing between the multiple Hall elements 304 may be about 10 mm. The fact that the spacing between the multiple Hall elements 304 is larger than the spacing between the multiple LEDs 305 is just one example, and this condition is not essential. 【0020】 The top surface of the housing 200 has a screw hole 311. A fixing screw 312 is screwed into the screw hole 311. The tip of the fixing screw 312 protrudes from the side of the housing 200 and presses against the groove 131 of the air cylinder 102. This firmly fixes the cylinder sensor 103 within the groove 131 of the air cylinder 102. When the fixing screw 312 is loosened, the cylinder sensor 103 can slide freely within the groove 131. 【0021】 Figure 4 is a schematic cross-sectional view showing the air cylinder 102 and the cylinder sensor 103. The air cylinder 102 includes a cylinder tube 400 located below the groove 131, a piston 402 that can slide inside the cylinder tube 400, a magnet 403 provided on the piston 402, and a piston rod 401. The piston 402 moves in conjunction with the push-out or draw-in of air by the valve system 101, thereby moving the piston rod 401. The piston rod 401 may also operate a robot hand (gripper) or the like. 【0022】 The cylinder sensor 103 calculates the position of the piston 402 based on the detection results output from multiple Hall elements 304, and controls the illumination and extinguishing of multiple LEDs 305, the first output LED 205, and the second output LED 206 based on the calculation result. The illumination control may include control of the illumination color. 【0023】 4. Control System 4-1. Cylinder Sensor Figure 5 shows the controller of the cylinder sensor 103. The CPU 501 is a processor or processing circuit that realizes various functions by executing a control program 521 stored in the memory 502. One or more of the functions described below may be implemented in an integrated circuit provided outside the CPU 501. A drive circuit is provided between the CPU 501 and the load to generate a drive current for driving the load, but the drive circuit is not shown in Figure 5. The Hall element control unit 511 supplies power to a plurality of Hall elements 304, which are an example of magnetic sensing elements, and acquires detection signals output from the plurality of Hall elements 304. The position identification unit 512 identifies the position of the piston 402 based on the detection signals output from the plurality of Hall elements 304. 【0024】 The setting unit 513 performs various settings necessary for the valve system 101 to utilize the detection results of the cylinder sensor 103. The range setting unit 514 sets the position of the i-th detection range corresponding to the i-th output signal. i is an integer of 1 or more. For example, the start and end positions of the i-th detection range may be set. Alternatively, either the start or end position of the i-th detection range and the width of the i-th detection range may be set. In the following, i is 1 or 2, but i may be 3 or more. The width setting unit 515 sets the width of the i-th detection range. The setting unit 513 may set the cylinder sensor 103 in response to setting instructions input from the relay amplifier 104, valve system 101, or display panel 105 via the external input terminal 503. The setting unit 513 may perform various settings in response to a predetermined operation on the operation switch 303 (e.g., long press for a predetermined number of seconds, short press, double-click). 【0025】 The display control unit 516 controls the indicator lights 504 and the symbol display 505 to display various information to the user. For example, when the CPU 501 is started up by power supplied through the power terminal 507 connected to the power line included in the IO-Link cable 113, the display control unit 516 lights up the power LED 204. If the position of the piston 402 identified by the position identification unit 512 is included in the first detection range, the display control unit 516 lights up the first output LED 205. If the position of the piston 402 identified by the position identification unit 512 is included in the second detection range, the display control unit 516 lights up the second output LED 206. The display control unit 516 lights up one or more LEDs 305 corresponding to the first detection range. The display control unit 516 lights up one or more LEDs 305 corresponding to the second detection range. The display control unit 516 lights up one or more LEDs 305 corresponding to the third detection range. In this way, the display control unit 516 lights up one or more LEDs 305 corresponding to the i-th detection range. 【0026】 The output unit 517 outputs position information indicating the position of the piston 402 identified by the position identification unit 512 to the relay amplifier 104 via the external output terminal 506 and the IO-Link cable 113. Here, the information output from the output unit 517 may include at least one of the following pieces of information. ●Position information of the piston 402 of the air cylinder 102...Information indicating the position of the piston 402 inside the air cylinder 102. The position information may include the distance from a predetermined reference point to the current position of the piston 402. ●Operating speed of air cylinder 102...This is the operating speed of piston 402. Unit information specifying the unit of operating speed (e.g., mm / sec, m / sec, inches / sec, feet / sec) may be included. ●Acceleration...The acceleration of the piston 402. This information is included if the cylinder sensor 103 can detect the acceleration of the piston 402. Unit information specifying the unit of acceleration (e.g., mm / s^2, m / s^2) may also be included. ●Output information...Information indicating whether the piston 402 is within the detection range of the piston 402's position, which is set when the cylinder sensor 103 is installed on the air cylinder 102. This may be an output signal that is output only when the piston 402 is within the detection range. ●Position deviation detection status...Information output when piston 402 is stopped outside the detection range. ●Aircraft condition, model...Model-specific information such as the length and slot type of cylinder sensor 103. ●Error...Information indicating damage to cylinder sensor 103, etc. ●Setting parameters (internal memory information)...Setting information such as output position, output width (range in which the output signal is turned on), span (slope of the actual travel distance relative to the travel distance of the piston 402 / mainly used in chucks, etc.), offset (any position is set to zero), installation direction (up, down, left, or right direction in which the cylinder sensor 103 is installed), NPN / PNP (output polarity), and units (e.g., mm, mm, inches, feet, etc.). 【0027】 The CPU 501 may also receive the following information from the relay amplifier 104. ●Setting parameters such as teaching (setting the output position), span (the slope of the actual travel distance relative to the travel distance of the piston 402 / mainly used in chucks, etc.), offset (setting any position as zero), installation direction (which direction the cylinder sensor 103 is installed in, up, down, left, or right), output position, NPN / PNP (output polarity), output logic (whether to close or open the contact when ON), and units (e.g., mm, m, inches, feet). ● Instruction information such as communication synchronization (communication synchronization signal), output set (output position setting signal), and factory reset (initialization). ●Error...Error information sent to the cylinder sensor 103 when an abnormal condition is detected in the installed air cylinder 102, such as in the valve system 101 or the air cylinder 102 itself. 【0028】 If the position of piston 402 falls within the first detection range, the output unit 517 outputs a first output signal. If the position of piston 402 falls within the second detection range, the output unit 517 outputs a second output signal. If the position of piston 402 falls within the third detection range, the output unit 517 outputs a third output signal. Thus, if the position of piston 402 falls within the i-th detection range, the output unit 517 outputs the i-th output signal. Here, outputting an output signal may also involve changing the logic of the output signal according to predetermined rules. 【0029】 Memory 502 is a storage device that includes memory elements such as random access memory (RAM) and non-volatile memory elements such as read-only memory (ROM). 【0030】 4-2. Relay Amplifier Figure 6 shows the controller of the relay amplifier 104. The CPU 601 is a processor or processing circuit that implements various functions by executing the control program 621 stored in memory 602. One or more of the functions described below may be implemented in an integrated circuit located outside the CPU 601. 【0031】 The communication circuit 604 is a circuit that communicates with the valve system 101 via the IO-Link cable 112 and with the cylinder sensor 103 via the IO-Link cable 113. The power terminal 607 receives power from the valve system 101 via the IO-Link cable 112 and supplies power to the cylinder sensor 103 via the IO-Link cable 113. The external input terminal 603 includes a terminal to which the IO-Link cable 112 is connected and a terminal to which the IO-Link cable 113 is connected, and is a terminal for receiving information transmitted from the cylinder sensor 103 and the valve system 101. The external output terminal 606 includes a terminal to which the IO-Link cable 112 is connected and a terminal to which the IO-Link cable 113 is connected, and is a terminal for transmitting information to the cylinder sensor 103 and the valve system 101. 【0032】 The operation switch 605 is a switch for receiving various operation inputs from the user. The indicator light 614 is an LED that displays the detection status of the cylinder sensor 103. The indicator light 614 may also include a power LED 624 that indicates whether the relay amplifier 104 is on or off, a first output LED 625 that indicates whether the first output signal is being output from the cylinder sensor 103, and a second output LED 626 that indicates whether the second output signal is being output from the cylinder sensor 103. 【0033】 The OLED display 630 is a display composed of organic EL light-emitting diodes. The memory 602 is a memory device that includes memory elements such as random access memory (RAM) and non-volatile memory elements such as read-only memory (ROM). 【0034】 The following functions are implemented by the CPU 601: The device identification unit 611 communicates with the devices connected to the relay amplifier 104 (valve system 101 and cylinder sensor 103) to specifically identify the devices. The device update unit 612 updates the setting information and control program 521 of the devices connected to the relay amplifier 104 (e.g., cylinder sensor 103). 【0035】 The setting unit 613 sets the operation of the relay amplifier 104. Furthermore, the setting unit 613 may set the cylinder sensor 103 instead of, or in cooperation with, the setting unit 513. For example, the range setting unit 634 sets the position of the detection range of the piston 402 in the cylinder sensor 103. The width setting unit 635 sets the width of the detection range of the piston 402 in the cylinder sensor 103. The range setting unit 634 and the width setting unit 635 may operate when the cylinder sensor 103 does not have a symbol indicator 505. In this case, the OLED display 630 functions as the symbol indicator 505. 【0036】 The display control unit 615 controls the lighting and extinguishing of the indicator light 614 and displays information on the OLED display 630. For example, the display control unit 615 may display a position symbol indicating the position of the piston 402 on the OLED display 630 according to the position information of the piston 402 output from the cylinder sensor 103. Furthermore, the display control unit 615 may display a range symbol indicating the detection range on the OLED display 630 based on range information indicating the detection range of the piston 402. The position symbol and range symbol may be displayed in conjunction with both the cylinder sensor 103 and the relay amplifier 104. This is because the relay amplifier 104 can obtain the position information of the piston 402 and the range information of the detection range from the cylinder sensor 103. 【0037】 The output unit 617 generates an output signal corresponding to the detection result received from the cylinder sensor 103 and outputs it to the valve system 101. The output unit 617 may also transfer various information received from the cylinder sensor 103 to the valve system 101. 【0038】 5. Teaching (Installation of cylinder sensor) Figure 7(A) shows the display state when the cylinder sensor 103 is powered on by an external power supply. The power LED 204 indicates that power is being supplied to the cylinder sensor 103 (power ON state). Multiple LEDs 305 may display a symbol indicating that the power has just been turned on. For example, multiple LEDs 305 may be controlled so that the lit LEDs 305 switch sequentially. This may result in the output of light like a wave moving from right to left. Multiple LEDs 305 may continuously display a symbol indicating that the power has just been turned on until the position identification unit 512 can identify the position of the piston 402. Alternatively, after displaying the symbol for a certain period of time, multiple LEDs 305 may turn off simultaneously. 【0039】 Figure 7(B) shows the state in which the position identification unit 512 has identified the position of the piston 402. Of the multiple LEDs 305, only the LED 305 corresponding to the position of the piston 402 is lit. Here, the LED 305 may be lit in the first color (e.g., green). When the user moves the cylinder sensor 103 relative to the air cylinder 102, the multiple LEDs 305 will light up or turn off to follow the position of the piston 402. In other words, only the LED 305 corresponding to the position of the piston 402 may be lit. Alternatively, all LEDs 305 to the right of the position of the piston 402 may be lit. Or, all LEDs 305 to the left of the position of the piston 402 may be lit. In this case, the position of the piston 402 may be displayed as a bar symbol. 【0040】 Figure 7(C) shows the symbols for cases where there is no LED 305 corresponding to the position of piston 402 identified by the position identification unit 512, or where piston 402 is located outside the detectable range of cylinder sensor 103. In this example, since there is no LED 305 corresponding to the position of piston 402, only the leftmost LED 305, which is the outermost of the multiple LEDs 305, may light up. The leftmost LED 305 may light up in a second color (e.g., red) or blink in the first or second color to indicate that piston 402 is located outside the detectable range. 【0041】 Figure 8(A) shows the symbol when the first detection range 801 and the second detection range 802 have been set by teaching. In this example, three LEDs 305 are assigned to the first detection range 801 and three to the second detection range 802, respectively. The three LEDs 305 assigned to the first detection range 801 may indicate the position and width of the first detection range 801 by lighting up in a third color (e.g., blue). The three LEDs 305 assigned to the second detection range 802 may indicate the position and width of the second detection range 802 by lighting up in a fourth color (e.g., orange). 【0042】 In Figure 8(A), the piston 402 is located in the intermediate range between the first detection range 801 and the second detection range 802. Therefore, of the multiple LEDs 305 located in the intermediate range, only one LED 305 corresponding to the position of the piston 402 is lit. Here, LED 305 may be lit in the first color (e.g., green). 【0043】 Figure 8(B) shows the symbol when the piston 402 is located in the first detection range 801. In this example, the piston 402 is located in the center of the first detection range 801. Therefore, of the three LEDs 305 corresponding to the first detection range 801, the central LED 305 is lit in a different color (e.g., white) than the other two LEDs 305. In this way, by using different colors to indicate the first detection range 801 and the position of the piston 402, the user will be able to clearly recognize the position of the piston 402. Note that when the piston 402 is located in the first detection range 801, the LED 305 corresponding to the position of the piston 402 may blink. When blinking occurs in this way, the color of the LED 305 corresponding to the position of the piston 402 may be different from or the same as the color of the other two LEDs 305. 【0044】 According to Figure 8(B), the first output LED 205 is also lit. This indicates that the position of the piston 402 is within the first detection range 801, and that the first output signal is being output (the first output signal is high). The logic of the output signal (High / Low) is configurable by the user. Therefore, the logic of the output signal depends on the user setting. 【0045】 Figure 8(C) shows the symbol when the piston 402 is located in the second detection range 802. In this example, the piston 402 is located in the center of the second detection range 802. Therefore, of the three LEDs 305 corresponding to the second detection range 802, the central LED 305 is lit in a different color (e.g., white) than the other two LEDs 305. In this way, by using different colors to indicate the second detection range 802 and the position of the piston 402, the user will be able to clearly recognize the position of the piston 402. Note that when the piston 402 is located in the second detection range 802, the LED 305 corresponding to the position of the piston 402 may blink. In this case, the color of the LED 305 corresponding to the position of the piston 402 may be different from or the same as the color of the other two LEDs 305. 【0046】 According to Figure 8(C), the second output LED 206 is also lit. This indicates that the position of the piston 402 is within the second detection range 802, and that the second output signal is being output (the second output signal is high). 【0047】 Here, the first output LED 205 and the second output LED 206 are shown as examples, but third, fourth, ... output LEDs may also be implemented. 【0048】 6. Flowchart of display control method Figure 9 shows the display control method executed by the CPU 501 of the cylinder sensor 103 according to the control program 521. When the CPU 501 is started up by power supplied from the relay amplifier 104, it performs the following processes. 【0049】 In S901, the CPU 501 (display control unit 516) refers to the setting information stored in memory 502 and determines whether one or more detection ranges are set. If one or more detection ranges are not set, the CPU 501 skips S902 and proceeds to S903. If one or more detection ranges are set, the CPU 501 proceeds to S902. 【0050】 In step S902, the CPU 501 (display control unit 516) lights up the LED 305 corresponding to the detection range. The memory 502 may store a table showing the relationship between the detection range and the identification information of the LED 305. The N LEDs 305 may be assigned identification numbers in ascending order from the LED 305 on the right to the LED 305 on the left. In this case, the identification information of the LED 305 may be the identification number. The setting information may also include color information indicating the lighting color of the LED 305 corresponding to the i-th detection range. The CPU 501 lights up Mi LEDs 305 corresponding to the i-th detection range in the color corresponding to the color information. Mi is a variable indicating the width of the i-th detection range and corresponds to the number of LEDs 305 to be lit. 【0051】 In S903, the CPU 501 (position determination unit 512) performs a position calculation to determine the position of the piston 402 based on the detection results of multiple Hall elements 304. The position calculation may be a calculation that determines the position corresponding to the Hall element 304 that outputs the largest detection signal among the multiple Hall elements 304. Alternatively, the position of the piston 402 may be calculated by performing a weighting calculation or interpolation calculation on the magnitude of the detection signals output from the multiple Hall elements 304. In the latter case, the position can be determined with finer precision. 【0052】 In S904, the CPU 501 (position determination unit 512 or display control unit 516) determines whether it has been able to determine the position of the piston 402. For example, if the cylinder sensor 103 is not attached to the air cylinder 102, the position calculation fails. On the other hand, if the cylinder sensor 103 is correctly attached to the air cylinder 102, the position calculation succeeds. If the position of the piston 402 has not been determined, the CPU 501 proceeds to S905. In S905, the CPU 501 (display control unit 516) displays a symbol indicating that position determination is in progress using multiple LEDs 305. After that, the CPU 501 returns from S905 to S903 and continues the position calculation. On the other hand, if the position of the piston 402 has been determined, the CPU 501 proceeds to S906. 【0053】 In S906, the CPU 501 (position identification unit 512 or display control unit 516) determines the LED 305 corresponding to the position of the piston 402. Memory 502 stores a table showing the correspondence between the position of the piston 402 and the identification number of the LED 305. The CPU 501 identifies the identification number of the LED 305 corresponding to the position of the piston 402 by referring to this table. 【0054】 In S907, the CPU 501 (position identification unit 512 or display control unit 516) determines whether there is an LED 305 corresponding to the position of the piston 402. If there is an LED 305 corresponding to the position of the piston 402, the CPU 501 proceeds to S908. In S908, the CPU 501 (display control unit 516) lights up the LED 305 corresponding to the position of the piston 402. After that, the CPU 501 proceeds from S908 to S909. On the other hand, there may be cases where there is no LED 305 corresponding to the position of the piston 402. For example, as shown in Figure 7(C), the position of the piston 402 may become impossible to determine if the piston 402 moves further after its position has been identified. In this case, the CPU 501 proceeds from S907 to S920. In S920, the CPU 501 (display control unit 516) lights up the outermost LED 305 among the multiple LEDs 305. For example, the last leftmost or rightmost LED 305 to light up may be determined as the LED 305 corresponding to the position of the piston 402. Furthermore, the CPU 501 selects a color for the last leftmost or rightmost LED 305 to indicate that position detection failed, or that the piston 402 is outside the detectable range. The CPU 501 then proceeds from S920 to S912. 【0055】 In S909, the CPU 501 (position identification unit 512 or display control unit 516) determines whether the position of the piston 402 is within the detection range. Here, the position of the piston 402 is compared with the first detection range 801 and the second detection range 802 included in the setting information. If the position of the piston 402 is not within either detection range, the CPU 501 proceeds from S909 to S912. If the position of the piston 402 is within either detection range, the CPU 501 proceeds from S909 to S910. 【0056】 In S910, the CPU 501 (display control unit 516) lights up the output LED corresponding to the detection range that includes the position of the piston 402 among multiple detection ranges. If the piston 402 is in the first detection range 801, the first output LED 205 lights up. If the piston 402 is in the second detection range 802, the second output LED 206 lights up. If the piston 402 is in the j-th detection range, the LEDs corresponding to the j-th detection range and the j-th output signal light up. 【0057】 In S911, the CPU 501 (output unit 517) outputs an output signal (control output) corresponding to the detection range that includes the position of the piston 402 from among multiple output signals (control outputs) to the relay amplifier 104. If the piston 402 is in the first detection range 801, the first output signal is output. If the piston 402 is in the second detection range 802, the second output signal is output. If the piston 402 is in the j-th detection range, the j-th output signal is output. 【0058】 In S912, CPU501 determines whether the power has been turned off (power supply from relay amplifier 104 has stopped). If the power is not off, CPU501 returns from S912 to S903. If the power is off, the display control method ends. 【0059】 7. Flowchart for setup instructions Figure 10(A) shows the process of attaching the cylinder sensor 103 to the air cylinder 102 and positioning the cylinder sensor 103 in the desired location. The user pushes and pulls the piston rod 401 to position the piston 402 in the desired location within the air cylinder 102. The user inserts the cylinder sensor 103 into the groove 131 of the air cylinder 102 and positions the cylinder sensor 103 by sliding it within the groove 131. In this example, of the multiple LEDs 305, the leftmost LED 305 corresponding to the position of the piston 402 is illuminated. Note that the order of performing the temporary installation of the cylinder sensor 103 on the air cylinder 102 and the positioning of the piston rod 401 may be reversed. In either case, fine adjustment of the position of the cylinder sensor 103 will be performed as follows. 【0060】 Figure 10(B) shows that the cylinder sensor 103 has been moved further to the left. The air cylinder 102 has moved to the right relative to the cylinder sensor 103. The CPU 501 detects the position of the piston 402 and lights up the second LED 305 from the left, which corresponds to the position of the piston 402. When the user positions the piston 402 to the desired position, they press and hold the operation button 202. The press and hold period is, for example, 2 seconds. The CPU 501 may measure the time the operation button 202 is pressed and identify the user's instruction according to the measured time. The memory 502 may store a table showing the relationship between time and instruction. The CPU 501 identifies the user instruction by referring to the table based on the measured time. 【0061】 When the CPU 501 (setting unit 513) detects a long press of the operation button 202 via the operation switch 303, it transitions from operation mode to setting mode. 【0062】 As shown in Figure 10(C), in setting mode, the CPU 501 displays a symbol indicating that it is in setting mode by lighting up several LEDs 305. This symbol may be, for example, caused by blinking the four LEDs on the far right of the multiple LEDs 305. The LEDs 305 that are lit up may switch sequentially from right to left. 【0063】 The CPU 501 illuminates Mi LEDs 305 corresponding to the i-th detection range based on the position of the piston 402 detected using the Hall element 304 and the width of the detection range. In this example, the width Mi of the i-th detection range is set to 3. Therefore, one LED 305 corresponding to the position of the piston 402, the LED 305 to its right, and the LED 305 to its left are illuminated. This allows the user to visually confirm the detection range. The user may further slide the cylinder sensor 103 while confirming that the Mi LEDs 305 corresponding to the i-th detection range are illuminated. Once the position of the i-th detection range is determined, the user presses and holds the operation button 202. The holding period is, for example, 2 seconds. 【0064】 Figure 11(A) shows a symbol indicating that the detection range has been determined. In this example, the CPU 501 displays the determination symbol by simultaneously lighting up all of the LEDs 305 among the multiple LEDs 305. 【0065】 Figure 11(B) shows a symbol indicating that the detection range setting is complete. In this example, the CPU 501 displays the setting completion symbol by blinking the LED 305 located in the center of the set detection range for a predetermined time. Note that the symbol shown in Figure 11(B) may be displayed after the symbol shown in Figure 11(A), or only one of the symbols may be displayed. Alternatively, as long as the operation button 202 is pressed for more than the predetermined time, the confirmation symbol shown in Figure 11(A) may be displayed. After that, when the finger is released from the operation button 202, the setting completion symbol in Figure 11(B) may be displayed. 【0066】 Figure 11(C) shows the state after the setting completion symbol shown in Figure 11(B) has been displayed for a predetermined period of time. Here, a symbol indicating the set detection range is displayed. In other words, CPU 501 transitions from setting mode to operation mode. 【0067】 Figure 12 is a flowchart showing the method for setting the detection range that the CPU 501 executes according to the control program 521. The memory 502 may store a variable h that indicates the number of set detection ranges. If no set detection ranges exist, the variable h is assigned the value of zero. If one detection range has been set, the variable h is assigned the value of 1. 【0068】 In S1201, the CPU 501 (setting unit 513) determines whether a setting start operation has been input. The setting start operation may be, for example, the operation button 202 being pressed down continuously for a predetermined time (e.g., 2 seconds) in the operating mode. The setting start operation may also be the operation button 202 being double-clicked. 【0069】 In S1202, the CPU 501 (display control unit 516) displays a setting symbol using multiple LEDs 305. For example, a setting symbol like the one shown in Figure 10(C) may be displayed. 【0070】 In S1203, the CPU 501 (position determination unit 512) performs a position calculation to determine the position of the piston 402 based on the detection result of the Hall element 304. 【0071】 In S1204, the CPU 501 (position identification unit 512 or display control unit 516) determines the LED 305 corresponding to the position of the piston 402. 【0072】 In S1205, the CPU 501 (position identification unit 512 or display control unit 516) determines whether there is a corresponding LED 305 that corresponds to the position of the piston 402. The cylinder sensor 103 may not yet be installed on the air cylinder 102, or the piston 402 may be outside the detectable range. In this case, the CPU 501 determines that there is no corresponding LED 305 and returns from S1205 to S1202. If there is a corresponding LED 305, the CPU 501 proceeds from S1205 to S1206. 【0073】 In S1206, the CPU 501 (display control unit 516) lights up the corresponding LED 305 and the adjacent LED 305. As described above, Mi LEDs 305 corresponding to the width of the detection range are lit. 【0074】 In S1207, the CPU 501 (range setting unit 514) determines whether a confirmation operation for the detection range has been input to the operation button 202. If no confirmation operation has been input, the CPU 501 returns from S1207 to S1202. If a confirmation operation has been input, the CPU 501 proceeds from S1207 to S1208. 【0075】 In S1208, the CPU 501 (display control unit 516) displays a confirmed symbol using multiple LEDs 305. For example, the confirmed symbol may be one of the symbols exemplified in Figure 11(A). 【0076】 In S1209, the CPU 501 (display control unit 516) displays a setting completion symbol using multiple LEDs 305. For example, the setting completion symbol may be the symbol exemplified in Figure 11(B). 【0077】 In S1210, the CPU 501 (range setting unit 514) stores setting information indicating the i-th detection range in memory 502. Here, i is the variable h plus 1. The setting information may include position information indicating the location of the i-th detection range and width information indicating the width (initial value or a value set by the user). Here, the position information indicates at least one of the left edge, center, or right edge of the detection range. The range setting unit 514 may assign a lighting color that has not been assigned to any of the detection ranges from the 1st detection range to the i-1th detection range to the i-th detection range, and store color information indicating the lighting color in the setting information. 【0078】 In S1211, the CPU 501 (range setting unit 514) updates the variable h, which indicates the number of set detection ranges. That is, 1 is added to the value of variable h. Alternatively, the value of variable i is assigned to variable h. 【0079】 Figure 13 is a flowchart showing how to delete pre-configured detection ranges all at once. 【0080】 In S1301, the CPU 501 (setting unit 513) determines whether a batch delete operation has been input to the operation button 202. For example, in operation mode, if the operation button 202 is pressed continuously for a predetermined time (e.g., 3 seconds) or if three short presses are input to the operation button 202, the CPU 501 may determine that a batch delete has been instructed. An upper limit may be set for the number of detection ranges. In this case, a batch delete operation may also be defined as the number of set detection ranges matching the upper limit and a long press of the operation button 202 being detected. When a batch delete is instructed, the CPU 501 proceeds from S1301 to S1302. 【0081】 In S1302, the CPU 501 (range setting unit 514) deletes the previously set detection ranges. For example, the CPU 501 deletes all previously set detection range information from the setting information stored in memory 502. 【0082】 In S1303, the CPU 501 (range setting unit 514) resets the number h of the set detection ranges to zero. 【0083】 8. Setting the width of the detection range Figures 14(A) and 14(B) show the process of setting the width of the detection range in setting mode. Setting the width of the detection range may be included, for example, in S1206. 【0084】 Figure 14(A) shows that the width Mi is set to 3. Figure 14(B) shows that the width Mi is set to 5. For example, if there are multiple selectable widths, each time the operation button 202 is briefly pressed, the CPU 501 (width setting unit 515 and display control unit 516) switches the width and turns the adjacent LED corresponding to the width on and off. For example, if the operation button 202 is briefly pressed when the width Mi is 3 as shown in Figure 14(A), the width Mi is changed to 5 as shown in Figure 14(B). If the operation button 202 is briefly pressed when the width Mi is 5 as shown in Figure 14(B), the width Mi is changed to 3 as shown in Figure 14(A). Multiple width values ​​may be switched in a cyclical manner in this way. There may be three or more selectable widths. In this case as well, the width values ​​will be switched in a cyclical manner. 【0085】 9. Distance display in relay amplifiers Figure 15 shows the screen displayed on the OLED display 630 of the relay amplifier 104. The relay amplifier 104 can receive information indicating the detection range (threshold) and information indicating the detection position of the piston 402 from the cylinder sensor 103. Furthermore, the relay amplifier 104 can receive the first output signal, the second output signal, and the i-th output signal. 【0086】 As shown in Figure 15, the distance display area 1501 is an area that displays the position of the piston 402 as the distance from the reference position. The distance display area 1501 may also display the unit of distance (e.g., mm). 【0087】 The threshold display area 1502 shows the threshold for each detection range (output signal). In this example, it is shown that the threshold for the first output signal corresponding to the first detection range 801 is 1056.50 mm. Here, the threshold may be at the right end, center, or left end of the first detection range 801. It is also shown that the threshold for the second output signal corresponding to the second detection range 802 is 36.20 mm. 【0088】 The output identification area 1503 is an area that displays whether the first output signal or the second output signal is being output. In other words, the output identification area 1503 may display which detection range the piston 402 is located in. For example, if the piston 402 is in the first detection range 801, the output identification area 1503 may light up in blue. If the piston 402 is in the second detection range 802, the output identification area 1503 may light up in orange. If the piston 402 is in an intermediate range between the first detection range 801 and the second detection range 802, the output identification area 1503 may display another color (e.g., black, white, green). 【0089】 10. Examples of other symbols Figures 16(A) and 16(B) show other examples of symbols indicating the position of piston 402. Here, it is assumed that a reference position is set on the left end of cylinder sensor 103. When CPU 501 detects the position of piston 402, it lights up all LEDs 305 that are located from the left end to the detection position. The user can recognize the distance traveled by piston 402 from the reference position from the number of lit LEDs 305. Thus, a symbol indicating the position of piston 402 may be implemented as a bar whose length changes according to the distance traveled. 【0090】 In the embodiment described above, multiple LEDs 305 are arranged directly below the display window 203, but this is merely one example. For example, a light guide (e.g., optical fiber, light-transmitting resin) may be placed between the multiple LEDs 305 arranged on the control board 302 and the display window 203. This would increase the flexibility in the placement of the multiple LEDs 305. 【0091】 Figure 17 shows another example of a symbol indicating the position of the piston 402. The OLED display 1700 shows a position image 1701 that mimics the LED 305 indicating the position of the piston 402, the first detection range 801, and the second detection range 802. Thus, the OLED display 1700 may be used in place of multiple LEDs 305. The OLED display 1700 may also be a liquid crystal display. 【0092】 Figure 18 shows another example of symbols indicating the position of the piston 402, the first detection range 801, and the second detection range 802. The bar symbol 1801 is an image indicating the position of the piston 402. The CPU 501 lengthens or shortens the bar symbol 1801 depending on the position of the piston 402. The range symbols 1802 and 1803 are images indicating the boundaries of the detection ranges. The CPU 501 may display the range symbols 1802 and 1803 indicating each detection range based on the position information and width information of the detection ranges contained in the setting information stored in memory 502. 【0093】 Furthermore, the OLED display 1700 may also display the first output LED 205 and the second output LED 206 as part of the image. 【0094】 12. Summary As shown in Figure 4, the position detection sensor 100 detects the position of a displacement body (e.g., piston 402) that is movable parallel to a first direction (e.g., the longitudinal direction of the air cylinder 102). The cylinder sensor 103 is an example of a detection device that generates a detection signal corresponding to the position of a magnet 403 provided on the displacement body. The CPU 501 and position identification unit 512 are an example of a position identification unit that identifies the position of the displacement body in the first direction based on the detection signal generated by the detection device. As shown in Figures 2 and 4, the housing 200 is an example of a housing that houses at least a part of the detection device and extends along the first direction. The symbol display 505 is an example of a display unit that has a plurality of display elements (e.g., LED 305, display pixels of OLED display 1700) arranged on the housing 200 at different positions along the first direction and displays a symbol indicating the position of the displacement body along the first direction. The CPU 501 and the display control unit 516 are an example of a display control unit that controls the display unit to display the first state in which the displacement body is located at a first position corresponding to one end of the displacement range (e.g., first detection range 801), the second state in which the displacement body is located at a second position corresponding to the other end of the displacement range (e.g., second detection range 802), and the intermediate state in which the displacement body is located at an intermediate position between the first and second positions, in different manner by displaying symbols at different positions on multiple display elements. Note that the one end and the other end may be the outermost positions, or they may be positions inside the outermost positions. 【0095】 According to this embodiment, not only the first and second states, but also intermediate states in between can be displayed, making the installation of the position detection sensor 100 easier. 【0096】 As Figures 2 and 3 suggest, the external input terminal 503 and the external output terminal 506 are examples of signal interface units provided at the ends of the housing 200. The CPU 501 and the output unit 517 are examples of output units that output position-related information (e.g., analog values ​​indicating the position of the piston 402, digital values ​​such as the first output signal and the second output signal) based on the position identified by the position identification unit 512 via the signal interface unit. By outputting this position-related information to the relay amplifier 104 and the valve system 101, it will be possible to display the position-related information in the relay amplifier 104 and control the valve 122 in the valve system 101 based on the position-related information. 【0097】 The multiple display elements may include at least three or more light sources (e.g., LED 305, display pixels of the OLED display 1700) arranged along the first direction. The multiple display elements may also include at least four or more light sources (e.g., LED 305, display pixels of the OLED display 1700) arranged along the first direction. The display control unit 516 may control the multiple display elements to display an intermediate state in which the displaced body is located at the third position as an intermediate position, and another intermediate state in which the displaced body is located at the fourth position as an intermediate position, in different manners. For example, the display control unit 516 may represent the intermediate state in which the displaced body is located at the third position with a first color, and display the other intermediate state in which the displaced body is located at the fourth position with a second color. 【0098】 As shown in Figure 3, the detection device (e.g., cylinder sensor 103) may include a plurality of magnetic detection elements (e.g., Hall elements 304) arranged along a first direction. 【0099】 As shown in Figure 3, multiple magnetic detection elements may be arranged at a first interval (e.g., 4 mm or more and 6 mm or less). Multiple display elements (e.g., LED 305, position image 1701) may be arranged at a second interval shorter than the first interval. For example, the second interval may be less than 10 mm and 1 mm or more. Alternatively, the second interval may be less than 4 mm and 2 mm or more. 【0100】 As shown in Figures 14(A) and 14(B), the display control unit 516 may display the first state, the second state, and the intermediate state using a variable-length bar realized by a plurality of display elements. As shown in Figures 16 and 18, the display control unit 516 may also display the position of the displacement body using a bar symbol 1801. 【0101】 As shown in Figures 14(A) and 14(B), the display control unit 516 may change the length of the bar by controlling the number of light sources that are lit among a plurality of light sources (e.g., LED 305, display pixels of the OLED display 1700). 【0102】 The display control unit 516 may control the display unit (e.g., LED 305, OLED display 1700) to display the first state, second state, and intermediate state in different colors. This will allow the user to clearly distinguish between the three states. 【0103】 The output unit 517 may output a first output signal when the displaced body is located in a first detection range 801 which includes the first position, and a second output signal when the displaced body is located in a second detection range 802 which includes the second position. 【0104】 The setting unit 513 is an example of a teaching unit that performs teaching, which is the process of setting the first detection range 801 and the second detection range 802 according to the user's instructions. 【0105】 As explained in relation to Figure 12, the operation button 202 and the operation switch 303 are examples of input units to which a first operation is input. When a first operation (e.g., pressing and holding the operation button 202 for 2 seconds) is input to the input unit, the setting unit 513 may start setting the first detection range 801. When a second operation (e.g., pressing and holding the operation button 202 for 2 seconds) is input to the input unit, the setting unit 513 may determine the first detection range 801 based on a first position where the displacement body exists and a predetermined width. 【0106】 The setting unit 513 may start setting the second detection range 802 after the first detection range 801 has been determined and a first operation is input at the input unit. The setting unit 513 may determine the second detection range 802 based on a second position where the displacement body is located and a predetermined width when the second operation is input at the input unit. Note that the operation to determine the first detection range 801 may be used in conjunction with the operation to start setting the second detection range 802. This will allow the user to continuously set the first detection range 801 and the second detection range 802. 【0107】 Incidentally, the number of detection ranges and output signals may be three or more. The output unit 517 may output a third output signal when the displaced body is located in a third detection range that includes the third position. The setting unit 513 may start setting the third detection range when a first operation is input to the input unit after the second detection range has been determined. The setting unit 513 may determine the third detection range based on the third position where the displaced body is located when the second operation is input to the input unit and a predetermined width. This may realize so-called three-point output. Here, three-point output means outputting output signals corresponding to three positions of the displaced body. For example, if the displaced body is a gripper (chuck) that grasps or releases an object, the states of two jaws being open, two jaws grasping an object, and two jaws failing to grasp an object (empty state) may be realized by the position of the piston 402 that opens and closes the jaws. In this case, three detection ranges and three corresponding output signals are set to distinguish between the three states. 【0108】 The setting unit 513 may include a width setting unit 515 that sets a predetermined width in response to instructions input from the input unit. As explained with reference to Figures 14(A) and 14(B), the width setting unit 515 may switch the width each time the operation button 202 is briefly pressed in setting mode. 【0109】 As explained using Figure 13, the setting unit 513 may reset (delete at once) the first detection range 801 and the second detection range 802 when the first operation is input to the input unit. Resetting the detection range with such a simple operation will make the reset process easier. 【0110】 The symbol indicator 505 may further include a first display element (e.g., first output LED 205) that indicates that a first output signal is being output, and a second display element (e.g., second output LED 206) that indicates that a second output signal is being output. 【0111】 As shown in Figures 8(A) to 8(C), the symbol indicator 505 may change the position of the symbol indicating the position of the displacement body in conjunction with the movement of the displacement body. This will make the installation of the cylinder sensor 103 easier. 【0112】 The detection device (e.g., cylinder sensor 103) may be powered and operated via a relay device (e.g., relay amplifier 104) installed between the moving device (e.g., valve system 101) that moves the displaced body and the housing 200. 【0113】 13. Other variations (1)External I / F5060 In the control system for the cylinder sensor 103 shown in Figure 5, the output unit 517 outputs position information indicating the position of the piston 402, which has been identified by the position identification unit 512, to the relay amplifier 104 via the external output terminal 506 and the IO-Link cable 113. However, as shown in Figure 19, for example, the external output terminal 506 may be changed to an external I / F 5060. 【0114】 In Figure 19, the external I / F 5060 includes a control output circuit 5060a for sending control outputs such as ON / OFF to a programmable logic controller (PLC), a communication circuit 5060b for sending position information and setting information to a relay amplifier 104 and an I / O link master (not shown), and an external output terminal 5060c. Here, one external output terminal 5060c is shared by the control output circuit 5060a and the communication circuit 5060b, but this is just one example. Two separate external output terminals 5060c may be provided. In this case, the control output circuit 5060a and the communication circuit 5060b can each use their respective corresponding individual external output terminals 5060c. 【0115】 The control output circuit 5060a is a circuit that has the function of converting a voltage value (e.g., 3.3V) output by the output unit 517, which indicates the control output, to a desired voltage level (e.g., 24V). The communication circuit 5060b is a circuit that has the function of converting a voltage value (e.g., 3.3V) output by the output unit 517, which indicates location information, to a desired voltage level (e.g., 24V). 【0116】 Furthermore, in Figure 19, the control output circuit 5060a and the communication circuit 5060b are physically implemented in a single integrated circuit, which improves the usability of the cylinder sensor 103 while keeping manufacturing costs down. Also, since the cylinder sensor 103 is often attached to grippers (chucks) or other movable parts, it is required to make its size as small as possible. By physically combining the control output circuit 5060a and the communication circuit 5060b, the size of the cylinder sensor 103 can be reduced. More specifically, when setting thresholds or other parameters for the cylinder sensor 103, a relay amplifier 104 is connected to the cylinder sensor 103. In this case, the cylinder sensor 103 can communicate with the relay amplifier 104 via the communication circuit 5060b of the external I / F 5060. On the other hand, when sending control output to a PLC, the relay amplifier 104 may be removed from the cylinder sensor 103, and the cylinder sensor 103 and the PLC may be directly connected. At this time, the cylinder sensor 103 can send a control output to the PLC via the control output circuit 5060a of the external I / F 5060. 【0117】 (2) I / O Link Master 1041 In the position detection sensor 100 shown in Figure 1, an example was described in which the cylinder sensor 103 is connected to the valve system 101 via the relay amplifier 104. The present invention is not limited to this, and for example, as shown in Figure 20(A), the cylinder sensor 103 can also be connected to the PLC 1042 via the I / O link master 1041. 【0118】 The I / O link master 1041 functions as a so-called data relay device, connecting sensors and actuators located at a distance from the PLC 1042 to the network to which the PLC 1042 is connected (e.g., Ethernet®), and relaying the measurement results of the sensors and actuators to the PLC 1042. To realize this relay function, the I / O link master 1041 has a CPU, storage device, relay memory (for temporary storage), communication circuitry, etc. The I / O link master 1041 communicates with the cylinder sensor 103 according to a predetermined communication protocol (e.g., IEC61131-9) to receive identification information and measurement results, and stores them in the relay memory. The measurement results are received cyclically and transferred to the PLC 1042 via the relay memory. When the PLC 1042 performs an input / output refresh, the I / O link master 1041 transfers (transmits) the measurement results held in the relay memory to the PLC 1042. Note that the first cycle (acquisition cycle) in which the I / O link master 1041 acquires information from the cylinder sensor 103 and the second cycle (so-called control cycle) in which the I / O link master 1041 transmits information to the PLC 1042 may be the same or different. If the first cycle is longer than the second cycle, the number of data acquired by the PLC 1042 will be relatively smaller, and the data processing load on the PLC 1042 will be reduced. If the first cycle is shorter than the second cycle, the PLC 1042 will be able to acquire the values ​​from the cylinder sensor 103 without missing any, but the same value will be acquired multiple times, increasing the load on the PLC 1042. 【0119】 In Figure 20(A), the cylinder sensor 103 generates process data (such as position information) according to a predetermined output format at predetermined measurement intervals and transmits it to the I / O link master 1041. As described above, the PLC 1042 communicates with the I / O link master 1041 via an industrial network. The PLC 1042 receives the position information measured by the cylinder sensor 103 via the I / O link master 1041 and stores it in a predetermined recording area (data memory, relay device, word device, etc.). The PLC 1042 may perform either cyclic communication, which acquires data from the I / O link master 1041 at predetermined communication intervals, or message communication, which acquires data as a response by sending a command. 【0120】 On the other hand, as shown in Figure 20(B), if the cylinder sensor 103 is connected to the relay amplifier 104, the relay amplifier 104 may be connected to the mobile battery 1040. In this case, the external I / F 5060 (communication circuit 5060b) of the cylinder sensor 103 communicates with the relay amplifier 104. 【0121】 As shown in Figure 20(A), when the cylinder sensor 103 is connected to the PLC 1042 (via the I / O link master 1041), the control output circuit 5060a of the external I / F 5060 of the cylinder sensor 103 functions. On the other hand, as shown in Figure 20(B), when the cylinder sensor 103 is connected to the relay amplifier 104, the communication circuit 5060b of the external I / F 5060 of the cylinder sensor 103 functions. By sharing the external I / F 5060 in this way, the cylinder sensor 103 can be miniaturized. Furthermore, as mentioned above, by making the control output circuit 5060a and the communication circuit 5060b physically the same circuit, it is possible to further miniaturize the cylinder sensor 103. 【0122】 Here, as shown in Figure 20(B), the relay amplifier 104 may be connected to the mobile battery 1040. The relay amplifier 104 may have a desired voltage request unit 6070 and a voltage conversion unit 6071, for example, as shown in Figure 21. The desired voltage request unit 6070 requests a desired voltage (e.g., 5V) from the mobile battery 1040. In response to this request, the mobile battery 1040 supplies the desired voltage (a predetermined voltage) to the relay amplifier 104. The voltage conversion unit 6071 has the function of converting the voltage supplied from the mobile battery 1040 to an optimal voltage for supplying to the cylinder sensor 103. The relay amplifier 104 can also function as a power supply for communication. 【0123】 (3) Error handling Next, as another variation, we will describe the error handling that occurs when the cylinder sensor 103 is disconnected from the relay amplifier 104 and then reconnected to the relay amplifier 104. 【0124】 First, let's explain how to determine that the cylinder sensor 103 is connected to the relay amplifier 104. To make the cylinder sensor 103 recognize that it is connected to the relay amplifier 104 and to enable communication using the output line, the relay amplifier 104 sends pulses of a specific duration to the cylinder sensor 103 via the output line, causing the cylinder sensor 103 to transition into communication mode. After that, the relay amplifier 104 initiates communication, causing the cylinder sensor 103 to respond and enable communication. 【0125】 If the cylinder sensor 103 is disconnected from the relay amplifier 104, a communication error is determined if there is no response from the cylinder sensor 103 within a certain period of time to the transmission from the relay amplifier 104 to the cylinder sensor 103. The transmission from the relay amplifier 104 to the cylinder sensor 103 may be retried multiple times before a communication error is determined. 【0126】 Next, we will explain the process when the cylinder sensor 103 is disconnected from the relay amplifier 104 and then reconnected. For example, the following processing methods are possible: Pattern 1) To restore communication, the relay amplifier 104 sends pulses for a specific duration to transition the cylinder sensor 103 into communication mode. After that, the cylinder sensor 103 communicates with the relay amplifier 104, enabling transmission and reception. Pattern 2) The relay amplifier 104 does not attempt to automatically restore communication, but rather transitions the cylinder sensor 103 into communication mode through some kind of user operation (for example, pressing a button on the relay amplifier 104). 【0127】 Other error handling methods include, for example, errors in detecting magnetic flux density. Since the magnetic flux density threshold is stored on the cylinder sensor 103 side, it is possible to determine whether the magnetic flux density detected by the cylinder sensor 103 is within a predetermined threshold range and transmit the result of the determination to the relay amplifier 104. 【0128】 The invention is not limited to the embodiments described above, and various modifications and changes are possible within the scope of the gist of the invention. [Explanation of symbols] 【0129】 100: Position detection sensor, 304: Hall element, 501: CPU, 200: Enclosure, 305: LED

Claims

[Claim 1] A position detection sensor for detecting the position of a displacement body that is movable parallel to a first direction, A detection device that generates a detection signal corresponding to the position of a magnet provided on the displacement body, A positioning unit that identifies the position of the displaced body in the first direction based on the detection signal generated by the detection device, A housing comprising at least a portion of the detection device and extending along the first direction, A display unit having a plurality of display elements arranged in the housing at mutually different positions along the first direction, which displays a symbol indicating the position of the displaced body along the first direction, A display control unit controls the display unit to display the symbols at different positions on the plurality of display elements, thereby displaying in different ways a first state in which the displaced body is located at a first position corresponding to one end of the displacement range, a second state in which the displaced body is located at a second position corresponding to the other end of the displacement range, and an intermediate state in which the displaced body is located at an intermediate position between the first and second positions. A position detection sensor equipped with the following features. [Claim 2] A signal interface section provided at the end of the housing, An output unit that outputs position-related information based on the position identified by the position identification unit via the signal interface unit, The position detection sensor according to claim 1, further comprising: [Claim 3] The position detection sensor according to claim 1, wherein the plurality of display elements include at least three or more light sources arranged along the first direction. [Claim 4] The plurality of display elements include at least four or more light sources arranged along the first direction, The position detection sensor according to claim 1, wherein the display control unit controls the plurality of display elements to display an intermediate state in which the displaced body is located at the third position as the intermediate position, and another intermediate state in which the displaced body is located at the fourth position as the intermediate position, in different manners. [Claim 5] The position detection sensor according to claim 1, wherein the detection device includes a plurality of magnetic detection elements arranged along the first direction. [Claim 6] The plurality of magnetic detection elements are arranged at a first interval, The position detection sensor according to claim 5, wherein the plurality of display elements are arranged at a second interval shorter than the first interval. [Claim 7] The position detection sensor according to claim 6, wherein the second interval is less than 10 mm and 1 mm or more. [Claim 8] The position detection sensor according to claim 1, wherein the display control unit controls the display unit to display the first state, the second state, and the intermediate state using a variable-length bar realized by the plurality of display elements. [Claim 9] The aforementioned multiple display elements include multiple light sources, The position detection sensor according to claim 8, wherein the display control unit changes the length of the bar by controlling the number of light sources that are lit among the plurality of light sources. [Claim 10] The position detection sensor according to claim 1, wherein the display control unit controls the display unit to display the first state, the second state, and the intermediate state in different colors. [Claim 11] The position detection sensor according to claim 2, wherein the output unit outputs a first output signal when the displaced body is located in a first detection range including the first position, and outputs a second output signal when the displaced body is located in a second detection range including the second position. [Claim 12] The position detection sensor according to claim 11, further comprising a teaching unit that performs teaching, which is the process of setting the first detection range and the second detection range in accordance with the user's instructions. [Claim 13] It further includes an input section into which the first operation is input, The position detection sensor according to claim 12, wherein the teaching unit starts setting the first detection range when the first operation is input to the input unit, and determines the first detection range based on the first position where the displaced body is located and a predetermined width when the second operation is input to the input unit. [Claim 14] The position detection sensor according to claim 13, wherein the teaching unit, after the first detection range has been determined, starts setting the second detection range when the first operation is input to the input unit, and determines the second detection range based on the second position where the displaced body is located and the predetermined width when the second operation is input to the input unit. [Claim 15] The output unit outputs a third output signal when the displaced body is located within a third detection range including the third position. The position detection sensor according to claim 14, wherein the teaching unit, after the second detection range has been determined, starts setting the third detection range when the first operation is input to the input unit, and determines the third detection range based on the third position where the displaced body is located when the second operation is input to the input unit and a predetermined width. [Claim 16] The position detection sensor according to claim 13, further comprising a width setting unit that sets a predetermined width in accordance with an instruction input from the input unit. [Claim 17] The position detection sensor according to claim 13, wherein the teaching unit resets the first detection range and the second detection range when the first operation is input to the input unit. [Claim 18] The position detection sensor according to claim 11, wherein the display unit further includes a first display element indicating that the first output signal is being output, and a second display element indicating that the second output signal is being output. [Claim 19] The position detection sensor according to claim 1, wherein the display unit changes the position of the symbol indicating the position of the displaced body in conjunction with the movement of the displaced body. [Claim 20] The position detection sensor according to claim 1, wherein the detection device is powered and operated via a relay device installed between a moving device that moves the displaced body and the housing.