Magnetic field coding device and coding method based on magnetic pole change

Through magnetic field encoding devices and methods based on magnetic pole changes, a multi-pole magnetic field signal is generated using permanent magnets and flipped magnetic pole equipment, combined with Hall sensor detection and encoding module processing, the problem of magnetic field encoding being susceptible to noise interference and a single encoding form is solved, and high accuracy and complex programming logic are achieved.

CN120489185AInactive Publication Date: 2025-08-15JIUYOU (XIAN) MICROELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510759714.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-09
Publication Date
2025-08-15
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, magnetic field encoding methods are susceptible to noise interference and have a single encoding form, resulting in low encoding accuracy and equipment is easily damaged in high temperature, high humidity, strong corrosion or electromagnetic interference scenarios, with a single interaction form and insufficient security.

Method used

A magnetic field encoding device based on magnetic pole changes is adopted, and a permanent magnet and a flip magnetic pole device are used to generate magnetic field signals of different polarities. Combined with bipolar and unipolar Hall sensors to detect magnetic field signals and maintain time, encoded through the encoding module, and set the start bit, the termination bit and the timing encoding formula to realize complex programming logic.

Benefits of technology

It improves the anti-interference ability of encoding, supports multi-level programming logic, adapts to different hardware scenarios, and improves coding accuracy and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120489185A_ABST
    Figure CN120489185A_ABST
Patent Text Reader

Abstract

The invention discloses a magnetic field coding device based on magnetic pole change, which comprises a hollow shell, a chip is arranged in the shell, a magnetic sensor is mounted on the surface of the shell, the chip is connected with the magnetic sensor through a signal line, a permanent magnet and magnetic pole overturning equipment are arranged outside the shell, and the permanent magnet and the magnetic pole overturning equipment are both in signal connection with the magnetic sensor; the permanent magnet is close to or far away from the magnetic sensor to generate a magnetic field signal in a unipolar mode, and the magnetic pole overturning equipment generates a magnetic field signal in a bipolar mode in which the south pole and the north pole are alternated. The problem of low coding accuracy caused by the influence of magnetic field noise and single coding form in the data transmission process in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of magnetic field encoding technology, and in particular relates to a magnetic field encoding device based on magnetic pole changes, and also relates to a magnetic field encoding method based on magnetic pole changes. Background Art

[0002] Traditional programming input methods rely on physical contact (such as keyboards and touch screens) or electromagnetic wave signals (such as Wi-Fi and Bluetooth). However, these methods have the following limitations: Poor environmental adaptability: In scenarios with high temperature, high humidity, strong corrosion, or severe electromagnetic interference, physical contact devices are easily damaged and wireless signals are easily interfered with. Single interaction form: Existing programming input lacks support for contactless natural interaction, such as triggering programming instructions through gestures or magnetic field changes. Insufficient security: Wireless signals may be intercepted or tampered with, and physical interfaces are at risk of malicious intrusion.

[0003] Traditional magnetic field input technologies often rely on changes in magnetic field strength or a single direction to trigger commands. For example, a Hall sensor is used to detect the approach or distance of a magnet to generate a switching signal. However, this method has the following drawbacks: A single information dimension: Using only the presence or direction of a magnetic field, it is impossible to express complex commands through timing characteristics (such as edge triggering and hold time). Weak anti-interference capabilities: Environmental magnetic field noise can easily lead to false triggering, and the timing logic cannot distinguish between random interference and user input. Limited instruction capacity: The lack of the ability to encode the dynamic timing of magnetic pole switching makes it difficult to support multi-level programming logic. Summary of the Invention

[0004] The purpose of the present invention is to provide a magnetic field input encoding method based on magnetic pole timing, which solves the problem in the prior art that the data transmission process is affected by magnetic field noise and a single encoding form, resulting in low encoding accuracy.

[0005] Another object of the present invention is to provide a magnetic field encoding method based on magnetic pole change, which solves the problem in the prior art that encoding is susceptible to noise interference.

[0006] The technical solution adopted by the present invention is a magnetic field encoding device based on magnetic pole changes, including a hollow shell, a chip is arranged inside the shell, a magnetic sensor is installed on the surface of the shell, the chip and the magnetic sensor are connected by a signal line, a permanent magnet and a flip magnetic pole device are arranged outside the shell, and both the permanent magnet and the flip magnetic pole device are connected to the magnetic sensor signal; the permanent magnet approaches or moves away from the magnetic sensor to generate a unipolar mode magnetic field signal, and the flip magnetic pole device generates a bipolar mode magnetic field signal with alternating south pole and north pole.

[0007] The present invention is also characterized in that: The magnetic sensor is used to receive the magnetic field signal generated by the permanent magnet and the magnetic pole reversal device and to count the maintenance time of the magnetic field signal.

[0008] The magnetic pole reversal device is an electromagnetic pen.

[0009] The magnetic sensor includes a bipolar Hall sensor and a unipolar Hall sensor. The bipolar Hall sensor is used to receive a bipolar mode magnetic field signal and the bipolar mode magnetic field signal maintenance time. The unipolar Hall sensor is used to receive a unipolar mode magnetic field signal and the unipolar mode magnetic field signal maintenance time.

[0010] The chip is provided with a coding module, which is used to encode the unipolar mode magnetic field signal and the bipolar mode magnetic field signal and their respective maintenance time.

[0011] Another technical solution adopted by the present invention is a magnetic field encoding method based on magnetic pole change, using a magnetic field encoding device based on magnetic pole change. The specific operation steps are as follows: Step 1: Set encoding parameters in the encoding module, including the start bit, magnetic field polarity mode conversion bit, end bit, abnormal state condition and timing encoding formula; Step 2: Turn on the permanent magnet and the magnetic pole flipping device to emit a magnetic field signal; Step 3: Turn on the magnetic sensor to receive the magnetic field signal and the magnetic field signal maintenance time; Step 4: Set the encoding parameters in the encoding module. The encoding parameters include the start bit, magnetic field polarity mode conversion bit, end bit, abnormal state conditions and timing encoding formula. When the abnormal state conditions are met during encoding, return to step 2 and re-execute until the encoding is completed.

[0012] Another technical solution of the present invention is also characterized in that: The start bit includes a bipolar mode start bit and a unipolar mode start bit, the end bit includes a bipolar mode end bit and a unipolar mode end bit, and the magnetic field polarity mode conversion bit includes a first conversion bit for converting from bipolar mode to unipolar mode and a second conversion bit for converting from unipolar mode to bipolar mode.

[0013] The bipolar mode start bit is: the bipolar mode magnetic field signal is detected continuously for at least three flips and the flip interval is no more than a quarter of a cycle; the unipolar mode start bit is specifically: the unipolar mode magnetic field signal is received and the unipolar mode magnetic field signal is maintained for no less than one cycle; The bipolar mode termination bit is specifically: the magnetic field signal disappears and the disappearance time is not less than two cycles, or the magnetic field signal of the same polarity is maintained for not less than two cycles; The specific termination bit of the unipolar mode is: the magnetic field signal disappears and the disappearance time is not less than two cycles; the first transition bit is specifically: the magnetic field signal of the same polarity lasts for more than four cycles without reversal and there is a zero field gap in every two consecutive cycles; the second transition bit is specifically: the magnetic pole reversal of the magnetic field signal occurs when the zero field lasts for 1.25 cycles.

[0014] The timing coding formula includes bipolar coding formula and unipolar coding formula. The bipolar coding formula is: (1) (2) In formula (1) and formula (2), Indicates the N-pole magnetic field state, Indicates the S-pole magnetic field state, Represents a cycle, Indicates the time the N-pole magnetic field state is maintained in the tth cycle, Indicates the time the S-pole magnetic field state is maintained in the tth cycle; The unipolar encoding formula is: (3) In formula (3), Indicates the magnetic field state of the South Pole or North Pole, represents the Nth cycle, Indicates the duration of the south pole or north pole magnetic field signal in the Nth cycle.

[0015] The specific conditions for judging abnormal status are: the magnetic field signal is lost and the loss time is not less than four cycles; When the code in step 4 meets the abnormal state condition, it returns to step 2 and executes again after waiting for 2.5 cycles.

[0016] The beneficial effects of the present invention are as follows: a magnetic sensor is provided, which can respectively detect the magnetic field signals of the bipolar mode and the unipolar mode and the maintenance time of the corresponding signals; based on the timing coding, the permanent magnet and the flip magnetic pole device can generate the required magnetic field signals, which are received by the magnetic sensor; an encoding module is provided in the chip, which includes the encoding start bit, the magnetic field polarity mode conversion bit, the end bit, the abnormal state condition and the timing coding formula, and can encode the magnetic field signals of the bipolar mode, the unipolar mode and the mixed magnetic field signals of the two, thereby improving the encoding instruction capacity and anti-interference performance, supporting the dynamic generation of complex programming logic, and being able to adapt to different hardware scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a structural schematic diagram of a magnetic field encoding device based on magnetic pole change; Figure 2This is a schematic diagram of the structure of a magnetic sensor in a magnetic field encoding device based on magnetic pole changes; Figure 3 It is a flow chart of a magnetic field encoding method based on magnetic pole change.

[0018] In the figure, 1. housing, 2. chip, 3. magnetic sensor, 4. permanent magnet, 5. magnetic pole reversal device, 6. bipolar Hall sensor, 7. unipolar Hall sensor. DETAILED DESCRIPTION

[0019] The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0020] The magnetic field encoding device based on magnetic pole change of the present invention is as follows: Figure 1 As shown, it includes a hollow shell 1, a chip 2 is provided in the shell 1, a magnetic sensor 3 is installed on the surface of the shell 1, the chip 2 and the magnetic sensor 3 are connected through a signal line, a permanent magnet 4 and a flip magnetic pole device 5 are provided outside the shell 1, and both the permanent magnet 4 and the flip magnetic pole device 5 are connected to the magnetic sensor 3 signal; the permanent magnet 4 approaches or moves away from the magnetic sensor 3 to generate a unipolar mode magnetic field signal, and the flip magnetic pole device 5 generates a bipolar mode magnetic field signal with alternating south pole and north pole.

[0021] The magnetic sensor 3 is used to receive the magnetic field signal generated by the permanent magnet 4 and the magnetic pole reversal device 5 and to count the duration of the magnetic field signal.

[0022] The magnetic pole reversal device 5 is an electromagnetic pen.

[0023] like Figure 2 As shown, the magnetic sensor 3 includes a bipolar Hall sensor 6 and a unipolar Hall sensor 7. The bipolar Hall sensor 6 is used to receive a magnetic field signal in a bipolar mode and the maintenance time of the magnetic field signal in the bipolar mode. The unipolar Hall sensor 7 is used to receive a magnetic field signal in a unipolar mode and the maintenance time of the magnetic field signal in the unipolar mode.

[0024] The chip 2 is provided with a coding module, which is used to encode the unipolar mode magnetic field signal and the bipolar mode magnetic field signal and their respective maintenance time.

[0025] Magnetic field encoding methods based on magnetic pole changes, such as Figure 3 As shown, a magnetic field encoding device based on magnetic pole change is used, and the specific operation steps are as follows: Step 1: Set encoding parameters in the encoding module, including the start bit, magnetic field polarity mode conversion bit, end bit, abnormal state condition and timing encoding formula; Step 2: Turn on the permanent magnet 4 and the magnetic pole reversal device 5 to emit a magnetic field signal; Step 3: Turn on the magnetic sensor 3 to receive the magnetic field signal and the magnetic field signal maintenance time; Step 4: Input the magnetic field signal and the duration of the magnetic field signal into the encoding module and encode according to the encoding parameters. If an abnormal state condition is met during encoding, return to step 2 and re-execute until the encoding is completed.

[0026] The start bit includes a bipolar mode start bit and a unipolar mode start bit, the end bit includes a bipolar mode end bit and a unipolar mode end bit, and the magnetic field polarity mode conversion bit includes a first conversion bit for converting from bipolar mode to unipolar mode and a second conversion bit for converting from unipolar mode to bipolar mode.

[0027] The bipolar mode start bit is: the bipolar mode magnetic field signal is detected continuously for at least three flips and the flip interval is no more than a quarter of a cycle; the unipolar mode start bit is specifically: the unipolar mode magnetic field signal is received and the unipolar mode magnetic field signal is maintained for no less than one cycle; The bipolar mode termination bit is specifically: the magnetic field signal disappears and the disappearance time is not less than two cycles, or the magnetic field signal of the same polarity is maintained for not less than two cycles; The specific termination bit of the unipolar mode is: the magnetic field signal disappears and the disappearance time is not less than two cycles; the first transition bit is specifically: the magnetic field signal of the same polarity lasts for more than four cycles without reversal and there is a zero field gap in every two consecutive cycles; the second transition bit is specifically: the magnetic pole reversal of the magnetic field signal occurs when the zero field lasts for 1.25 cycles.

[0028] The timing coding formula includes bipolar coding formula and unipolar coding formula. The bipolar coding formula is: (1) (2) In formula (1) and formula (2), Indicates the N-pole magnetic field state, Indicates the S-pole magnetic field state, Represents a cycle, Indicates the time the N-pole magnetic field state is maintained in the tth cycle, Indicates the time the S-pole magnetic field state is maintained in the tth cycle; The unipolar encoding formula is: (3) In formula (3), Indicates the magnetic field state of the South Pole or North Pole, represents the Nth cycle, Indicates the duration of the south pole or north pole magnetic field signal in the Nth cycle.

[0029] The specific conditions for judging abnormal status are: the magnetic field signal is lost and the loss time is not less than four cycles; When the code in step 4 meets the abnormal state condition, it returns to step 2 and executes again after waiting for 2.5 cycles.

[0030] This encoding method is suitable for contactless programming scenarios in industrial control, medical equipment and homes.

[0031] The frequency in the bipolar mode magnetic field signal is calculated as: f_bipolar =1 / (t_N +t_S)(4) In formula (4), t_N represents the time when the magnetic field is maintained at the north pole, and t_S represents the time when the magnetic field is maintained at the south pole; After multiple tests, the pulse width is not less than 10ms, the flip frequency is not higher than 50Hz, and the polarity switching duty cycle is 40%-60%.

[0032] The frequency in the unipolar mode magnetic field signal is calculated as: f_unipolar = 1 / (t_on + t_off) (5) In formula (5), t_on represents the time when the magnetic field signal is maintained, and t_off represents the time when there is no magnetic field signal.

[0033] Example 1 The magnetic field encoding device based on magnetic pole change of the present invention includes a hollow shell 1, a chip 2 is provided inside the shell 1, a magnetic sensor 3 is installed on the surface of the shell 1, the chip 2 and the magnetic sensor 3 are connected by a signal line, a permanent magnet 4 and a flip magnetic pole device 5 are provided outside the shell 1, and both the permanent magnet 4 and the flip magnetic pole device 5 are connected to the magnetic sensor 3 signal; the permanent magnet 4 approaches or moves away from the magnetic sensor 3 to generate a unipolar mode magnetic field signal, and the flip magnetic pole device 5 generates a bipolar mode magnetic field signal with alternating south pole and north pole.

[0034] Example 2 The magnetic field encoding device based on magnetic pole change of the present invention includes a hollow shell 1, a chip 2 is provided inside the shell 1, a magnetic sensor 3 is installed on the surface of the shell 1, the chip 2 and the magnetic sensor 3 are connected by a signal line, a permanent magnet 4 and a flip magnetic pole device 5 are provided outside the shell 1, and both the permanent magnet 4 and the flip magnetic pole device 5 are connected to the magnetic sensor 3 signal; the permanent magnet 4 approaches or moves away from the magnetic sensor 3 to generate a unipolar mode magnetic field signal, and the flip magnetic pole device 5 generates a bipolar mode magnetic field signal with alternating south pole and north pole.

[0035] The magnetic sensor 3 is used to receive the magnetic field signal generated by the permanent magnet 4 and the magnetic pole reversal device 5 and to count the duration of the magnetic field signal.

[0036] The magnetic pole reversal device 5 is an electromagnetic pen.

[0037] Example 3 The magnetic field encoding device based on magnetic pole change of the present invention includes a hollow shell 1, a chip 2 is provided inside the shell 1, a magnetic sensor 3 is installed on the surface of the shell 1, the chip 2 and the magnetic sensor 3 are connected by a signal line, a permanent magnet 4 and a flip magnetic pole device 5 are provided outside the shell 1, and both the permanent magnet 4 and the flip magnetic pole device 5 are connected to the magnetic sensor 3 signal; the permanent magnet 4 approaches or moves away from the magnetic sensor 3 to generate a unipolar mode magnetic field signal, and the flip magnetic pole device 5 generates a bipolar mode magnetic field signal with alternating south pole and north pole.

[0038] The magnetic sensor 3 is used to receive the magnetic field signal generated by the permanent magnet 4 and the magnetic pole reversal device 5 and to count the duration of the magnetic field signal.

[0039] The magnetic pole reversal device 5 is an electromagnetic pen.

[0040] The magnetic sensor 3 includes a bipolar Hall sensor 6 and a unipolar Hall sensor 7. The bipolar Hall sensor 6 is used to receive a magnetic field signal in a bipolar mode and the maintenance time of the magnetic field signal in the bipolar mode. The unipolar Hall sensor 7 is used to receive a magnetic field signal in a unipolar mode and the maintenance time of the magnetic field signal in the unipolar mode.

[0041] The chip 2 is provided with a coding module, which is used to encode the unipolar mode magnetic field signal and the bipolar mode magnetic field signal and their respective maintenance time.

[0042] Example 4 The magnetic field encoding device based on magnetic pole change of the present invention includes a hollow shell 1, a chip 2 is provided inside the shell 1, a magnetic sensor 3 is installed on the surface of the shell 1, the chip 2 and the magnetic sensor 3 are connected by a signal line, a permanent magnet 4 and a flip magnetic pole device 5 are provided outside the shell 1, and both the permanent magnet 4 and the flip magnetic pole device 5 are connected to the magnetic sensor 3 signal; the permanent magnet 4 approaches or moves away from the magnetic sensor 3 to generate a unipolar mode magnetic field signal, and the flip magnetic pole device 5 generates a bipolar mode magnetic field signal with alternating south pole and north pole.

[0043] The magnetic sensor 3 is used to receive the magnetic field signal generated by the permanent magnet 4 and the magnetic pole reversal device 5 and to count the duration of the magnetic field signal.

[0044] The magnetic pole reversal device 5 is an electromagnetic pen.

[0045] The magnetic sensor 3 includes a bipolar Hall sensor 6 and a unipolar Hall sensor 7. The bipolar Hall sensor 6 is used to receive a magnetic field signal in a bipolar mode and the maintenance time of the magnetic field signal in the bipolar mode. The unipolar Hall sensor 7 is used to receive a magnetic field signal in a unipolar mode and the maintenance time of the magnetic field signal in the unipolar mode.

[0046] The chip 2 is provided with a coding module, which is used to encode the unipolar mode magnetic field signal and the bipolar mode magnetic field signal and their respective maintenance time.

[0047] The magnetic field encoding method based on magnetic pole change uses a magnetic field encoding device based on magnetic pole change. The specific operation steps are as follows: Step 1: Set encoding parameters in the encoding module, including the start bit, magnetic field polarity mode conversion bit, end bit, abnormal state condition and timing encoding formula; Step 2: Turn on the permanent magnet 4 and the magnetic pole reversal device 5 to emit a magnetic field signal; Step 3: Turn on the magnetic sensor 3 to receive the magnetic field signal and the magnetic field signal maintenance time; Step 4: Input the magnetic field signal and the duration of the magnetic field signal into the encoding module and encode according to the encoding parameters. If an abnormal state condition is met during encoding, return to step 2 and re-execute until the encoding is completed.

[0048] Example 5 The magnetic field encoding device based on magnetic pole change of the present invention includes a hollow shell 1, a chip 2 is provided inside the shell 1, a magnetic sensor 3 is installed on the surface of the shell 1, the chip 2 and the magnetic sensor 3 are connected by a signal line, a permanent magnet 4 and a flip magnetic pole device 5 are provided outside the shell 1, and both the permanent magnet 4 and the flip magnetic pole device 5 are connected to the magnetic sensor 3 signal; the permanent magnet 4 approaches or moves away from the magnetic sensor 3 to generate a unipolar mode magnetic field signal, and the flip magnetic pole device 5 generates a bipolar mode magnetic field signal with alternating south pole and north pole.

[0049] The magnetic sensor 3 is used to receive the magnetic field signal generated by the permanent magnet 4 and the magnetic pole reversal device 5 and to count the duration of the magnetic field signal.

[0050] The magnetic pole reversal device 5 is an electromagnetic pen.

[0051] The magnetic sensor 3 includes a bipolar Hall sensor 6 and a unipolar Hall sensor 7. The bipolar Hall sensor 6 is used to receive a magnetic field signal in a bipolar mode and the maintenance time of the magnetic field signal in the bipolar mode. The unipolar Hall sensor 7 is used to receive a magnetic field signal in a unipolar mode and the maintenance time of the magnetic field signal in the unipolar mode.

[0052] The chip 2 is provided with a coding module, which is used to encode the unipolar mode magnetic field signal and the bipolar mode magnetic field signal and their respective maintenance time.

[0053] The magnetic field encoding method based on magnetic pole change uses a magnetic field encoding device based on magnetic pole change. The specific operation steps are as follows: Step 1: Set encoding parameters in the encoding module, including the start bit, magnetic field polarity mode conversion bit, end bit, abnormal state condition and timing encoding formula; Step 2: Turn on the permanent magnet 4 and the magnetic pole reversal device 5 to emit a magnetic field signal; Step 3: Turn on the magnetic sensor 3 to receive the magnetic field signal and the magnetic field signal maintenance time; Step 4: Input the magnetic field signal and the duration of the magnetic field signal into the encoding module and encode according to the encoding parameters. If an abnormal state condition is met during encoding, return to step 2 and re-execute until the encoding is completed.

[0054] The start bit includes a bipolar mode start bit and a unipolar mode start bit, the end bit includes a bipolar mode end bit and a unipolar mode end bit, and the magnetic field polarity mode conversion bit includes a first conversion bit for converting from bipolar mode to unipolar mode and a second conversion bit for converting from unipolar mode to bipolar mode.

[0055] The bipolar mode start bit is: the bipolar mode magnetic field signal is detected continuously for at least three flips and the flip interval is no more than a quarter of a cycle; the unipolar mode start bit is specifically: the unipolar mode magnetic field signal is received and the unipolar mode magnetic field signal is maintained for no less than one cycle; The bipolar mode termination bit is specifically: the magnetic field signal disappears and the disappearance time is not less than two cycles, or the magnetic field signal of the same polarity is maintained for not less than two cycles; The specific termination bit of the unipolar mode is: the magnetic field signal disappears and the disappearance time is not less than two cycles; the first transition bit is specifically: the magnetic field signal of the same polarity lasts for more than four cycles without reversal and there is a zero field gap in every two consecutive cycles; the second transition bit is specifically: the magnetic pole reversal of the magnetic field signal occurs when the zero field lasts for 1.25 cycles.

[0056] Example 6 The magnetic field encoding device based on magnetic pole change of the present invention includes a hollow shell 1, a chip 2 is provided inside the shell 1, a magnetic sensor 3 is installed on the surface of the shell 1, the chip 2 and the magnetic sensor 3 are connected by a signal line, a permanent magnet 4 and a flip magnetic pole device 5 are provided outside the shell 1, and both the permanent magnet 4 and the flip magnetic pole device 5 are connected to the magnetic sensor 3 signal; the permanent magnet 4 approaches or moves away from the magnetic sensor 3 to generate a unipolar mode magnetic field signal, and the flip magnetic pole device 5 generates a bipolar mode magnetic field signal with alternating south pole and north pole.

[0057] The magnetic sensor 3 is used to receive the magnetic field signal generated by the permanent magnet 4 and the magnetic pole reversal device 5 and to count the duration of the magnetic field signal.

[0058] The magnetic pole reversal device 5 is an electromagnetic pen.

[0059] The magnetic sensor 3 includes a bipolar Hall sensor 6 and a unipolar Hall sensor 7. The bipolar Hall sensor 6 is used to receive a magnetic field signal in a bipolar mode and the maintenance time of the magnetic field signal in the bipolar mode. The unipolar Hall sensor 7 is used to receive a magnetic field signal in a unipolar mode and the maintenance time of the magnetic field signal in the unipolar mode.

[0060] The chip 2 is provided with a coding module, which is used to encode the unipolar mode magnetic field signal and the bipolar mode magnetic field signal and their respective maintenance time.

[0061] Another technical solution adopted by the present invention is a magnetic field encoding method based on magnetic pole change, using a magnetic field encoding device based on magnetic pole change. The specific operation steps are as follows: Step 1: Set encoding parameters in the encoding module, including the start bit, magnetic field polarity mode conversion bit, end bit, abnormal state condition and timing encoding formula; Step 2: Turn on the permanent magnet 4 and the magnetic pole reversal device 5 to emit a magnetic field signal; Step 3: Turn on the magnetic sensor 3 to receive the magnetic field signal and the magnetic field signal maintenance time; Step 4: Input the magnetic field signal and the duration of the magnetic field signal into the encoding module and encode according to the encoding parameters. If an abnormal state condition is met during encoding, return to step 2 and re-execute until the encoding is completed.

[0062] The start bit includes a bipolar mode start bit and a unipolar mode start bit, the end bit includes a bipolar mode end bit and a unipolar mode end bit, and the magnetic field polarity mode conversion bit includes a first conversion bit for converting from bipolar mode to unipolar mode and a second conversion bit for converting from unipolar mode to bipolar mode.

[0063] The bipolar mode start bit is: the bipolar mode magnetic field signal is detected continuously for at least three flips and the flip interval is no more than a quarter of a cycle; the unipolar mode start bit is specifically: the unipolar mode magnetic field signal is received and the unipolar mode magnetic field signal is maintained for no less than one cycle; The bipolar mode termination bit is specifically: the magnetic field signal disappears and the disappearance time is not less than two cycles, or the magnetic field signal of the same polarity is maintained for not less than two cycles; The specific termination bit of the unipolar mode is: the magnetic field signal disappears and the disappearance time is not less than two cycles; the first transition bit is specifically: the magnetic field signal of the same polarity lasts for more than four cycles without reversal and there is a zero field gap in every two consecutive cycles; the second transition bit is specifically: the magnetic pole reversal of the magnetic field signal occurs when the zero field lasts for 1.25 cycles.

[0064] The timing coding formula includes bipolar coding formula and unipolar coding formula. The bipolar coding formula is: (1) (2) In formula (1) and formula (2), Indicates the N-pole magnetic field state, Indicates the S-pole magnetic field state, Represents a cycle, Indicates the time the N-pole magnetic field state is maintained in the tth cycle, Indicates the time the S-pole magnetic field state is maintained in the tth cycle; The unipolar encoding formula is: (3) In formula (3), Indicates the magnetic field state of the South Pole or North Pole, represents the Nth cycle, Indicates the duration of the south pole or north pole magnetic field signal in the Nth cycle.

[0065] The specific conditions for judging abnormal status are: the magnetic field signal is lost and the loss time is not less than four cycles; When the code in step 4 meets the abnormal state condition, it returns to step 2 and executes again after waiting for 2.5 cycles.

Claims

1. A magnetic field encoding device based on magnetic pole change, characterized in that: The invention comprises a hollow shell (1), wherein a chip (2) is provided in the shell (1), a magnetic sensor (3) is mounted on the surface of the shell (1), the chip (2) and the magnetic sensor (3) are connected via a signal line, and a permanent magnet (4) and a flip magnetic pole device (5) are provided outside the shell (1), both the permanent magnet (4) and the flip magnetic pole device (5) are connected to the magnetic sensor (3) by signal; when the permanent magnet (4) approaches or moves away from the magnetic sensor (3), a unipolar magnetic field signal is generated, and when the flip magnetic pole device (5) generates a bipolar magnetic field signal with alternating south and north poles.

2. The magnetic field encoding device based on magnetic pole change according to claim 1, characterized in that: The magnetic sensor (3) is used to receive magnetic field signals generated by the permanent magnet (4) and the magnetic pole reversal device (5) and to calculate the duration of the magnetic field signals.

3. The magnetic field encoding device based on magnetic pole change according to claim 2, characterized in that: The magnetic pole reversal device is an electromagnetic pen.

4. The magnetic field encoding method based on magnetic pole change according to claim 3, characterized in that: The magnetic sensor (3) comprises a bipolar Hall sensor (6) and a unipolar Hall sensor (7), wherein the bipolar Hall sensor (6) is used to receive a magnetic field signal in a bipolar mode and a duration of the magnetic field signal in the bipolar mode, and the unipolar Hall sensor (7) is used to receive a magnetic field signal in a unipolar mode and a duration of the magnetic field signal in the unipolar mode.

5. The magnetic field encoding device based on magnetic pole change according to claim 4, characterized in that: The chip (2) is provided with a coding module, and the coding module is used to encode the unipolar mode magnetic field signal and the bipolar mode magnetic field signal and their respective maintenance times.

6. A magnetic field encoding method based on magnetic pole change, characterized in that: Using the magnetic field encoding device based on magnetic pole change according to claim 5, the specific operating steps are as follows: Step 1: Set encoding parameters in the encoding module, including the start bit, magnetic field polarity mode conversion bit, end bit, abnormal state condition and timing encoding formula; Step 2: Turn on the permanent magnet (4) and the magnetic pole reversal device (5) to emit a magnetic field signal; Step 3: Turn on the magnetic sensor (3), receive the magnetic field signal and count the duration of the magnetic field signal; Step 4: Input the magnetic field signal and the duration of the magnetic field signal into the encoding module and encode according to the encoding parameters. If an abnormal state condition is met during encoding, return to step 2 and re-execute until the encoding is completed.

7. The magnetic field encoding method based on magnetic pole change according to claim 6, characterized in that: The start bit includes a bipolar mode start bit and a unipolar mode start bit, the end bit includes a bipolar mode end bit and a unipolar mode end bit, and the magnetic field polarity mode conversion bit includes a first conversion bit for converting from bipolar mode to unipolar mode and a second conversion bit for converting from unipolar mode to bipolar mode.

8. The magnetic field encoding method based on magnetic pole change according to claim 7, characterized in that: The bipolar mode start bit is: a bipolar mode magnetic field signal is detected continuously for not less than three flips and the flip interval is not greater than a quarter of a cycle; the unipolar mode start bit is specifically: a unipolar mode magnetic field signal is received and the unipolar mode magnetic field signal is maintained for not less than one cycle; The bipolar mode termination bit is specifically: the magnetic field signal disappears and the disappearance time is not less than two cycles, or the magnetic field signal of the same polarity is maintained for not less than two cycles; The unipolar mode termination bit is specifically: the magnetic field signal disappears and the disappearance time is not less than two cycles; the first conversion bit is specifically: the magnetic field signal of the same polarity lasts for more than four cycles without reversal and there is a zero field gap in every two consecutive cycles; the second conversion bit is specifically: the magnetic pole reversal of the magnetic field signal occurs when the zero field lasts for 1.25 cycles.

9. The magnetic field encoding method based on magnetic pole change according to claim 6, characterized in that: The timing coding formula includes a bipolar coding formula and a unipolar coding formula. The bipolar coding formula is: (1) (2) In formula (1) and formula (2), Indicates the N-pole magnetic field state, Indicates the S-pole magnetic field state, Represents a cycle, Indicates the time the N-pole magnetic field state is maintained in the tth cycle, Indicates the time the S-pole magnetic field state is maintained in the tth cycle; The unipolar encoding formula is: (3) In formula (3), Indicates the magnetic field state of the South Pole or North Pole, represents the Nth cycle, Indicates the duration of the south pole or north pole magnetic field signal in the Nth cycle.

10. The magnetic field encoding method based on magnetic pole change according to claim 6, characterized in that: The abnormal state judgment condition is specifically: the magnetic field signal is lost and the loss time is not less than four cycles; When the code described in step 4 meets the abnormal state condition, wait for 2.5 cycles and then return to step 2 to execute again.