Magnetic switch and control method thereof

By combining horizontal and perpendicular magnetic field strength detection devices in magnetic switches, the problem of misjudgment of magnetic switches in strong welding magnetic field environments is solved, and the accurate positioning of magnet positions in the cylinder and anti-interference ability is achieved in complex magnetic environments.

CN120261218APending Publication Date: 2025-07-04ELCO TIANJIN ELECTRONICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510392806.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-31
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

When detecting the position of the cylinder push rod, existing magnetic switches are easily disturbed by the strong welded magnetic field environment, resulting in misjudgment. Especially in cylinders of different specifications and models, single-axial magnetic field strength detection cannot accurately determine the magnetic steel position, resulting in inaccurate installation and incorrect triggering.

Method used

The horizontal and perpendicular magnetic field strength detection device is combined, and the magnetic field is detected simultaneously through the horizontal magnetic field strength detection device and the perpendicular magnetic field strength detection device (including a reverse mounted bipolar latch switch chip), and controlled in combination with the MCU chip to achieve accurate positioning of the magnet position in the cylinder.

Benefits of technology

It effectively reduces the probability of misjudgment of magnetic switches in strong welding magnetic field environments, ensures that the magnetic switch can accurately judge the position of magnets in the cylinder in complex magnetic environments, and improves installation accuracy and anti-interference ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120261218A_ABST
    Figure CN120261218A_ABST
Patent Text Reader

Abstract

The invention provides a magnetic switch and a control method thereof, and the method comprises the following steps: obtaining the magnetic field intensity detected by a current horizontal magnetic field intensity detection device as the current magnetic field intensity, and obtaining two level states detected by a current vertical magnetic field intensity detection device as the current magnetic field intensity; the states are respectively used as a current first level state and a current second level state; and determining a position relationship between the circular magnet and a target position based on the current working state of the magnetic switch, the current magnetic field intensity and the current level state, and adjusting the working state of the magnetic switch based on the determined position relationship. The probability of misjudgment of the magnetic switch caused by the influence of the change of the environmental magnetic field in the strong welding magnetic field on the magnetic field formed by the magnetic steel in the cylinder can be effectively reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of magnetic switch control, and particularly to a magnetic switch and a control method thereof. Background Art

[0002] By installing a magnetic switch at an optimal position in the outer groove of a cylinder, it is determined whether the magnetic steel installed on the cylinder push rod reaches a specified position to judge the telescopic state of the push rod in the cylinder, so as to output a switching value to report to a programmable logic controller PLC to achieve the purpose of automatic control. Since the magnetic switch needs to adapt to cylinders of many specifications and models, that is, in addition to the different magnetic intensities of the magnetic steel, the vertical distance H from the magnetic steel to the outer chute of the cylinder and the entire stroke distance L of the outer chute of the cylinder may also be different, and there will be many combinations. This leads to a great difference in the magnetic field distribution of the magnet magnetic steel in the outer chute with the differences of H and L. And it is also necessary to ensure that the magnetic switch can still work normally when the installation direction of the magnetic steel is different. The current magnetic switch only detects the change characteristics of the magnetic field intensity in a single axial direction. For example, it only detects the magnetic field intensity in the X axial direction and determines the position of the magnetic steel through the maximum magnetic field intensity, or only detects the magnetic field intensity in the Y axial direction and determines the position of the magnet magnetic steel through the reversal of the magnetic field direction. Both of these determination methods will have mis-triggering situations under certain specific H and L settings. For example, if only the magnetic field intensity in the X-axis direction is detected, when the value of H is small and the value of L is large, there will be multiple trigger points when the magnetic switch slides and installs in the outer chute of the cylinder. And since the installation of the magnetic steel does not distinguish or ensure the consistency of the installation of N / S poles, the Hall linear sensor often can only use the magnetic field intensity in the X axis as the determination condition without including its polarity characteristics. This causes that when the user installs the magnetic switch, it may also be triggered at the peak position below the X axis, resulting in inaccurate detection positions and the user cannot find the most accurate installation position. If only the magnetic field intensity in the Y-axis direction is detected, a lower magnetic intensity will be selected as the trigger threshold or the magnetic field reversal will be used as the trigger condition. Either of these two determination conditions will either include a 0 magnetic field intensity within the threshold range, resulting in the magnetic switch being mis-triggered even without an external magnetic field, or only the approximate area range can be determined through the reversal of the magnetic field direction, and the best installation position cannot be clearly indicated by red and green indicator lights, and it is even easily interfered by the external magnetic field and mis-triggered. Because in an environment where a large current welding torch with a set current threshold greater than or equal to 16,000 A is used, the magnetic environment around the welding torch is extremely complex. It is difficult to achieve the effect of anti-strong magnetic interference only relying on the change characteristics of the magnetic field intensity in a single direction. Summary of the Invention

[0003] For the above technical problems, the technical solution adopted by the present invention is as follows:

[0004] According to a first aspect of the present invention, a magnetic switch is provided. The magnetic switch includes a housing, and a circuit board and a position indicator light are disposed inside the housing. An MCU chip, a horizontal magnetic field intensity detection device connected to the MCU chip, and a vertical magnetic field intensity detection device are disposed on the circuit board. The vertical magnetic field intensity detection device includes two bipolar latching switch chips mounted in reverse, and the two bipolar latching switch chips are respectively disposed on both sides of the horizontal magnetic field intensity detection device.

[0005] According to a second aspect of the present invention, a method for controlling a magnetic switch is provided. The magnetic switch is the magnetic switch provided in the first aspect of the present invention. The magnetic switch is disposed in an outer chute of an outer shell of a cylinder, and a circular magnet is disposed on a push rod of the cylinder. The outer chute is parallel to the central axis of the circular magnet. The method includes the following steps:

[0006] Obtain the magnetic field intensity detected by the current horizontal magnetic field intensity detection device as the current magnetic field intensity, and obtain the two level states detected by the current vertical magnetic field intensity detection device as the current first level state and the current second level state respectively;

[0007] Based on the current working state of the magnetic switch, the current magnetic field intensity, and the current level state, control the current working state of the magnetic switch.

[0008] The present invention has at least the following beneficial effects:

[0009] The magnetic switch provided by the embodiment of the present invention is provided with a horizontal magnetic field intensity detection device and a vertical magnetic field intensity detection device. In practical applications, by simultaneously detecting the magnetic field intensities in the horizontal and vertical directions to determine whether the circular magnet in the cylinder is in the target position, the probability of misjudgment of the magnetic switch caused by the influence of the change of the ambient magnetic field on the magnetic field formed by the magnetic steel in the cylinder in a strong welding magnetic field can be effectively reduced.

[0010] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0012] Figure 1 It is a magnetic field distribution diagram of a circular magnet;

[0013] Figure 2 is Figure 1 a sectional view of;

[0014] Figure 3 is a schematic diagram of the magnetic field components of the spatial magnetic field of a permanent magnet in the X-axis and Y-axis directions, where the positive and negative represent polarities;

[0015] Figure 4 is a schematic diagram of the magnetic switch provided by an embodiment of the present invention;

[0016] Figure 5 is a schematic diagram of the circuit board and detection device of the magnetic switch provided by an embodiment of the present invention;

[0017] Figure 6 is an application schematic diagram of the magnetic switch provided by an embodiment of the present invention;

[0018] Figure 7 is a flowchart of the control method of the magnetic switch provided by an embodiment of the present invention. Specific Embodiments

[0019] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present invention.

[0020] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0021] It should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the steps as sequential processes, many of the steps can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but there can also be additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0022] The magnetic field formed by a circular magnet (hereinafter also referred to as a permanent magnet) is a spatial magnetic field. Existing magnetic switches all detect the change trend of the magnetic field in a single direction within the spatial magnetic field range to determine the position of the permanent magnet, such as Figure 1 andFigure 2 as shown

[0023] In the plane perpendicular to any section passing through the central axis of the annular permanent magnet, the spatial magnetic field in this plane can be orthogonally decomposed into magnetic field components in the X-axis and Y-axis directions, as Figure 3 shown, where Figure 3 the range indicated by the horizontal arrow in is the determination range in the X-axis direction, and the range between the two vertical lines is the determination range in the Y-axis direction. The magnetic field components in these two directions respectively satisfy two distribution states of sine and cosine. It can be seen that the magnetic field formed by the permanent magnet in the outer chute also satisfies this distribution state.

[0024] The inventor of the present application realized that since the magnetic switch needs to adapt to cylinders of many specifications and models, that is, in addition to the different magnetic intensities of the permanent magnets, the vertical distance H from the permanent magnet to the outer chute of the cylinder and the entire stroke distance L of the outer chute of the cylinder may also be different, and there will be many combinations. This results in a large difference in the magnetic field distribution of the magnet permanent magnet in the outer chute with the differences in H and L. And it is also necessary to ensure that when the installation direction of the permanent magnet is different, the magnetic switch can still work properly. The current magnetic switch only detects the change characteristics of the magnetic field intensity in a single axial direction. For example, it only detects the magnetic field intensity in the X-axis direction, and determines the position of the permanent magnet by judging the maximum magnetic field intensity, or only detects the magnetic field intensity in the Y-axis direction, and judges the position of the magnet permanent magnet by the reversal of the magnetic field direction. Both of these judgment methods will have false triggering situations under certain specific settings of H and L. For example, if only the magnetic field intensity in the X-axis direction is detected, when the value of H is small and the value of L is large, there will be multiple trigger points when the magnetic switch slides and installs in the outer chute of the cylinder, that is Figure 3 the position of the peak below the X-axis shown, and since the installation of the permanent magnet does not distinguish or ensure the consistency of the installation of N / S poles, the Hall linear sensor often can only use the magnetic field intensity in the X-axis as the judgment condition, without including its polarity characteristics. This causes the user that when installing the magnetic switch, it may be triggered at the peak positions on both the left and right sides of the X-axis, resulting in inaccurate detection positions, and the user cannot find the most accurate installation position. If only the magnetic field intensity in the Y-axis direction is detected, a lower magnetic intensity will be selected as the trigger threshold or the magnetic field reversal will be used as the trigger condition. Either of these two judgment conditions will either include the 0 magnetic field intensity within the threshold range, resulting in the magnetic switch being mis-triggered even without an external magnetic field, or only the approximate area range can be judged by the reversal of the magnetic field direction, and the best installation position cannot be clearly indicated by the red and green indicator lights, and it is even easily interfered by the external magnetic field and mis-triggered. Because in the working environment of a large current welding torch using a current threshold greater than or equal to a set value, such as 16,000 A, the magnetic environment around the welding torch is extremely complex. It is very difficult to achieve the effect of anti-strong magnetic interference only by the change characteristics of the magnetic field intensity in a single direction.

[0025] In view of this, the present invention aims to provide a magnetic switch control solution that can effectively reduce the probability of misjudgment of the magnetic switch caused by the influence of the change of the ambient magnetic field on the magnetic field formed by the magnetic steel in the cylinder in a strong welding magnetic field.

[0026] An embodiment of the present invention provides a magnetic switch, as Figure 4 and Figure 5 shown. The magnetic switch includes a housing 1, and a circuit board 2 is disposed inside the housing. An MCU chip (not shown) and a horizontal magnetic field intensity detection device 3 and a vertical magnetic field intensity detection device 4 connected to the MCU chip are disposed on the circuit board.

[0027] In the embodiment of the present invention, the horizontal magnetic field intensity detection device 3 is used to detect the magnetic field intensity in the horizontal direction, that is, the X-axis direction, and the vertical magnetic field intensity detection device 4 is used to detect the magnetic field intensity in the vertical direction, that is, the Y-axis direction.

[0028] In the embodiment of the present invention, according to the characteristics of the magnetic field itself, the mounting position of the horizontal magnetic field intensity detection device should be located on the bottom edge close to the magnet direction, and the closer it is to the magnet movement direction, the better. In a schematic embodiment of the present invention, the horizontal magnetic field intensity detection device may be a linear Hall sensor with low power consumption, small volume, and high linearity. In another schematic embodiment, it may also be a non-full-range linear Hall sensor or an angle sensor.

[0029] In the embodiment of the present invention, the MCU chip converts the magnetic field intensity detected by the horizontal magnetic field intensity detection device into a corresponding AD value.

[0030] In the embodiment of the present invention, the vertical magnetic field intensity detection device 4 may include two bipolar latch switch chips mounted in reverse. The two bipolar latch switch chips are respectively disposed on both sides of the horizontal magnetic field intensity detection device. In the embodiment of the present invention, reverse mounting means that the chip mounting directions are opposite, so as to ensure that when the magnet reaches directly below the horizontal magnetic field intensity detection device, the two bipolar latch switch chips on both sides are just distributed on both sides of the magnet, and two different magnetic polarities can be detected. The bipolar latch switch chip has characteristics such as low power consumption, high frequency response, and bipolar latch, and can realize the determination of the magnetic polarity inversion region in the Y-axis direction.

[0031] In the embodiment of the present invention, the specific mounting positions of the two bipolar latch switch chips can be determined based on the actual situation, specifically based on the layout and size of the circuit board. The distance between the two bipolar latch switch chips is determined by the trigger value of the bipolar latch switch chip.

[0032] In an embodiment of the present invention, the trigger magnetic field intensity of the bipolar Hall latch switch chip needs to select a model lower than the required detection magnetic field intensity. When the magnetic field of either the N pole or the S pole is higher than its operating point, it outputs a reverse logic level and maintains this level until the magnetic field polarity flips and is higher than the release point before restoring its original logic level. The MCU chip collects the level states of these two latch switch chips. If the two level states are the same, it means that the two latch switch chips are in different polarities. At this time, the position of the magnet is at the middle position between the two latch magnetic switch chips, which is the position that meets the trigger condition.

[0033] Further, a position indicator light (not shown) is provided inside the housing. A transparent window is also opened on the housing so that the light of the indicator light can shine out.

[0034] In a schematic embodiment, the position indicator light can be an LED light. The position indicator light can be lit in a first color and a second color. The first color can be green and the second color can be red.

[0035] Further, in an embodiment of the present invention, a switching element is also provided on the circuit board, which can be in two states of closed and open under the control of the MCU chip.

[0036] Another embodiment of the present invention provides a magnetic switch control method, and the magnetic switch is the magnetic switch described in the foregoing embodiment.

[0037] As Figure 6 shown, the magnetic switch A is installed in an outer chute (not shown) of the outer shell of the cylinder 6. A circular magnet 7 is provided on the push rod of the cylinder, and the outer chute is parallel to the central axis of the circular magnet.

[0038] In an embodiment of the present invention, the magnetic switch can detect whether the magnet installed in the cylinder has completely reached the set trigger area and the target position. In an embodiment of the present invention, the set trigger area is the area in the outer chute where the AD value corresponding to the magnetic field intensity detected by the horizontal magnetic field intensity detection device is greater than or equal to the set AD threshold, and the level states of the two bipolar Hall latch switch chips are the same. The target position is the middle position of the outer chute. In an embodiment of the present invention, the installation position of the magnetic switch in the outer chute can be obtained through the following steps:

[0039] Control the circular magnet to be at the set target position, and control the magnetic switch to slide from one end of the outer chute to the other end. During the movement of the magnetic switch, if when moving to a certain position, the position indicator light is lit in the first color, it means that this position is the installation position of the magnetic switch, and the magnetic switch can be fixed at this position by fixing tools such as screws.

[0040] In an embodiment of the present invention, the magnetic switch is also connected to a programmable logic controller (PLC).

[0041] Further, as Figure 7 shown, the method provided by the embodiment of the present invention may include the following steps:

[0042] Obtain the magnetic field strength detected by the current horizontal magnetic field strength detection device as the current magnetic field strength, and obtain the two level states detected by the current vertical magnetic field strength detection device as the current first level state and the current second level state, respectively.

[0043] Control the current working state of the magnetic switch based on the current working state of the magnetic switch, the current magnetic field strength, and the current level state.

[0044] Further, the controlling the current working state of the magnetic switch based on the current working state of the magnetic switch, the current magnetic field strength, and the current level state specifically includes:

[0045] If the current working state of the magnetic switch is the first working state, and if the AD value corresponding to the current magnetic field strength is greater than or equal to the set AD threshold, and the current first level state and the current second level state are the same, control the current working state of the magnetic switch to change from the first working state to the second working state, where the first working state and the second working state are different, the first working state is the working state indicating that the magnetic switch is open or closed, and the second working state is the working state indicating that the magnetic switch is closed or open, that is, if the first working state is the open state, the second working state is the closed state, and if the first working state is the closed state, the second working state is the open state. When the current working state of the magnetic switch is the first working state, if the AD value corresponding to the current magnetic field strength is greater than or equal to the set AD threshold, and the current first level state and the current second level state are the same. If the level states of the two bipolar latch switch chips are the same, it means that the position of the permanent magnet is within the trigger range. At this time, the MCU chip will control the output of a switching quantity to control the magnetic switch to be in the second working state. After the magnetic switch is closed, the PLC will receive the closing signal of the magnetic switch, and then obtain the motion state of the cylinder.

[0046] If the current working state of the magnetic switch is the second working state, and if the AD value corresponding to the current magnetic field strength is less than the set AD threshold, and the current first level state and the current second level state are different, control the current working state of the magnetic switch to change from the second working state to the first working state.

[0047] When the current working state of the magnetic switch is the second working state, if the AD value corresponding to the magnetic field strength detected by the horizontal magnetic field strength detection device is less than the set AD threshold, and the level states of the two bipolar latch switch chips are different, it indicates that the permanent magnet has completely left the trigger area. At this time, the MCU chip will control the output of a switching quantity to control the magnetic switch to be in the first working state. After the magnetic switch is turned on, the PLC will receive the opening signal of the magnetic switch, and then obtain the motion state of the cylinder.

[0048] As is known to those skilled in the art, the voltage signal output by the horizontal magnetic field strength detection device is an analog signal, and its magnitude is proportional to the magnetic field strength.

[0049] Furthermore, the method provided by the embodiment of the present invention further includes the following steps:

[0050] If the current working state of the magnetic switch is the first working state, and if the AD value corresponding to the current magnetic field strength is less than the set AD threshold, but the current first level state and the current second level state are the same, it indicates that the permanent magnet has reached the set trigger area, but has not reached the target position, and the current working state of the magnetic switch is not adjusted, that is, the current working state is maintained.

[0051] If the current working state of the magnetic switch is the first working state, and if the AD value corresponding to the current magnetic field strength is greater than or equal to the set AD threshold, but the current first level state and the current second level state are different, this situation may indicate: (1) The permanent magnet may be affected by the external magnetic field strength, resulting in inaccurate detection results. Specifically, the magnetic field strength in the X-axis direction may be affected by the external magnetic field, causing the magnetic field strength detected by the current horizontal magnetic field strength detection device to change from a value actually lower than the set AD threshold to a value greater than or equal to the set AD threshold, but the magnetic field in the Y-axis direction is not affected by the external magnetic field or the influence of the external magnetic field on the magnetic field in the Y-axis direction is not sufficient to change its level state. At this time, the current first level state and the current second level state are different. Therefore, to reduce the probability of false triggering, the current working state of the magnetic switch is not adjusted, that is, the current working state is maintained. (2) During the movement of the magnet from right to left, the magnetic field strength in the X-axis direction reaches above the threshold, but the magnetic field strength in the Y-axis direction has not yet caused the level states of the two bipolar latch switch chips to be the same.

[0052] If the current working state of the magnetic switch is the second working state, and if the AD value corresponding to the current magnetic field strength is less than the set AD threshold, but the current first level state and the current second level state are different, it indicates that the permanent magnet has left the target position, but is still within the set detection area, and the current working state of the magnetic switch is not adjusted.

[0053] If the current working state of the magnetic switch is the second working state, and if the AD value corresponding to the current magnetic field intensity is greater than or equal to the set AD threshold, but the current first level state and the current second level state are the same, this situation may indicate that: (1) The magnetic steel may be affected by the external magnetic field intensity, resulting in inaccurate detection results. Specifically, the magnetic field intensity in the Y-axis direction may be affected by the external magnetic field, causing the current first level state and the current second level state to be different, but the magnetic field in the X-axis direction is not affected by the external magnetic field or the influence of the external magnetic field on the magnetic field in the X-axis direction is not sufficient to make the detected magnetic field intensity value in the X-axis direction lower than the threshold. At this time, the AD value corresponding to the current magnetic field intensity is greater than or equal to the set AD threshold. Therefore, to reduce the probability of false triggering, the current working state of the magnetic switch is not adjusted. (2) During the movement of the magnet, the magnetic field intensity in the Y-axis direction can cause the level states of the two bipolar latch switch chips to be the same, but the magnetic field intensity in the X-axis direction has not reached the threshold.

[0054] Due to the uncertainty of the relative position installation of the magnetic steel and the strong magnetic welding torch, the control method of the magnetic switch provided by the embodiments of the present invention realizes anti-interference through the parallelism of two-way determination conditions, and can maintain the current working state when the external strong magnetic interference only changes the magnetic field intensity or polarity in a certain direction, relatively reducing the probability of false triggering. In this way, the principle that the magnetic switch can still maintain its original working state under external strong magnetic interference and effectively reduce the probability of false triggering is realized.

[0055] Further, the method provided by the embodiments of the present invention further includes the following steps:

[0056] If it is detected that the magnet is in the second position, control the position indicator light to light up with a first color. If it is detected that the magnet reaches the first position and the third position, control the indicator light to light up with a second color; where the first position is the position where the magnet has reached the set trigger area but has not reached the target position, the second position is the position where the magnet has reached the set trigger area and reached the target position, and the third position is the position where the magnet has left the target position but is still within the set trigger area. In this way, the movement state of the magnet can be more intuitively known.

[0057] In the embodiments of the present invention, the set AD threshold can be obtained through the following steps:

[0058] Based on the specified minimum detected magnetic field intensity, obtain the corresponding magnetic field intensity determination range from the preset set threshold reference table.

[0059] In the embodiments of the present invention, the specified minimum detected magnetic field intensity can be the magnetic field intensity specified by the user, for example, 50 Gs, etc.

[0060] The preset setting threshold reference table stores the magnetic field strength determination ranges corresponding to multiple specified minimum detected magnetic field strengths. The magnetic field strength determination ranges can be empirical values. For example, if the minimum detected magnetic field strength is 50 Gs, the corresponding magnetic field strength determination range can be 45 Gs to 49 Gs, etc.

[0061] Divide the magnetic field strength determination range into n magnetic field strengths according to the preset unit magnetic field strength △c, where n satisfies the following condition: I n = I1 + (n - 1)△c; I n is the maximum magnetic field strength corresponding to the magnetic field strength determination range, and I1 is the minimum magnetic field strength corresponding to the magnetic field strength determination range.

[0062] In the embodiments of the present invention, △c can be determined based on the situation. For example, it can be 0.1 to 0.5 Gs, etc.

[0063] Obtain the AD values corresponding to the n magnetic field strengths respectively to obtain n AD values.

[0064] In the embodiments of the present invention, the AD value of the magnetic field strength is the result of converting the analog signal output by the horizontal magnetic field strength detection device into a digital value through an analog-to-digital converter, and is used to reflect the quantization information of the magnetic field strength. Those skilled in the art know that any method for obtaining the AD value of the magnetic field strength belongs to the protection scope of the present invention.

[0065] Obtain the set AD threshold based on the n AD values.

[0066] In an illustrative embodiment of the present invention, the set AD threshold is the mode of the n AD values.

[0067] In another illustrative embodiment of the present invention, the set AD threshold is the average value of the n AD values.

[0068] In the embodiments of the present invention, by simultaneously detecting the magnetic field strengths in the horizontal and vertical directions to determine whether the circular magnet in the cylinder is in the target position, it can be applicable to a wide range of detected magnetic field strengths (20 Gs and above) and different cylinder size specifications, and can effectively reduce the probability of misjudgment of the magnetic switch caused by the influence of the change of the ambient magnetic field on the magnetic field formed by the magnetic steel in the cylinder in a strong welding magnetic field where the use current is greater than the set current threshold.

[0069] It should be understood that the various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in the present invention can be achieved, and no limitations are imposed herein.

[0070] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub - combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A magnetic switch, characterized in that, The magnetic switch includes a housing, inside which a circuit board and a position indicator light are provided. The circuit board is provided with an MCU chip, a horizontal magnetic field intensity detection device and a vertical magnetic field intensity detection device connected to the MCU chip. The vertical magnetic field intensity detection device includes two bipolar latching switch chips mounted in reverse, and the two bipolar latching switch chips are respectively arranged on both sides of the horizontal magnetic field intensity detection device.

2. The magnetic switch according to claim 1, wherein The horizontal magnetic field intensity detection device is a linear Hall sensor, a non-linear Hall sensor or an angle sensor.

3. A magnetic switch control method, characterized in that, The magnetic switch is the magnetic switch described in Claim 1 or 2. The magnetic switch is installed in an outer sliding groove of the outer shell of the cylinder. A circular magnet is arranged on the push rod of the cylinder, and the outer sliding groove is parallel to the central axis of the circular magnet. The method includes the following steps: Obtain the magnetic field intensity detected by the current horizontal magnetic field intensity detection device as the current magnetic field intensity, and obtain the two level states detected by the current vertical magnetic field intensity detection device as the current first level state and the current second level state respectively; Control the current working state of the magnetic switch based on the current working state of the magnetic switch, the current magnetic field intensity and the current level state.

4. The method according to claim 3, characterized in that, The controlling the current working state of the magnetic switch based on the current working state of the magnetic switch, the current magnetic field intensity and the current level state specifically includes: If the current working state of the magnetic switch is the first working state, and if the AD value corresponding to the current magnetic field intensity is greater than or equal to the set AD threshold, and the current first level state and the current second level state are the same, control the current working state of the magnetic switch to change from the first working state to the second working state, where the first working state and the second working state are different. The first working state represents the working state where the magnetic switch is open or closed, and the second working state represents the working state where the magnetic switch is closed or open; If the current working state of the magnetic switch is the second working state, and if the AD value corresponding to the current magnetic field intensity is less than the set AD threshold, and the current first level state and the current second level state are different, control the current working state of the magnetic switch to change from the second working state to the first working state.

5. The method according to claim 4, characterized in that, It also includes the following steps: If the current working state of the magnetic switch is the first working state, and if the AD value corresponding to the current magnetic field intensity is less than the set AD threshold, but the current first level state and the current second level state are the same, or if the AD value corresponding to the current magnetic field intensity is greater than or equal to the set AD threshold, but the current first level state and the current second level state are different, do not adjust the current working state of the magnetic switch. If the current working state of the magnetic switch is the second working state, and if the AD value corresponding to the current magnetic field intensity is less than the set AD threshold, but the current first level state and the current second level state are different, or if the AD value corresponding to the current magnetic field intensity is greater than or equal to the set AD threshold, but the current first level state and the current second level state are the same, do not adjust the current working state of the magnetic switch.

6. The method according to claim 4, wherein It further includes the following steps: If it is detected that the magnet is in the second position, control the position indicator light to light up in the first color. If it is detected that the magnet reaches the first position and the third position, control the indicator light to light up in the second color; wherein, the first position is the position where the magnet has reached within the set trigger area but has not reached the target position, the second position is the position where the magnet has reached within the set trigger area and has reached the target position, and the third position is the position where the magnet has left the target position but is still within the set trigger area. The set trigger area is the area within the outer chute where the AD value corresponding to the magnetic field intensity detected by the horizontal magnetic field intensity detection device is greater than or equal to the set AD threshold, and the level states of the two bipolar Hall latch switch chips are the same. The target position is the middle position of the outer chute.

7. The method according to claim 5, characterized in that, The set AD threshold is obtained through the following steps: Based on the specified minimum detection magnetic field intensity, obtain the corresponding magnetic field intensity determination range from the preset set threshold reference table; Divide the magnetic field strength determination range into n magnetic field strengths according to a preset unit magnetic field strength △c, where n satisfies the following condition: I n = I1 + (n - 1)△c; I n is the maximum magnetic field strength corresponding to the magnetic field strength determination range, and I1 is the minimum magnetic field strength corresponding to the magnetic field strength determination range; Respectively obtain the AD values corresponding to n magnetic field intensities to obtain n AD values; Based on the n AD values, obtain the set AD threshold.

8. The method according to claim 7, wherein The set AD threshold is the mode of the n AD values.

9. The method according to claim 7, characterized in that, The set AD threshold is the average value of the n AD values.