Disclosure of Invention
The present invention is directed to an electromagnetic induction device and a touch positioning method thereof, which can improve the positioning speed and accuracy of an electromagnetic handwriting system when the number of coils of an electromagnetic induction antenna board is large.
In order to achieve the purpose, the invention adopts the following technical scheme:
the invention provides an electromagnetic induction device, comprising:
an electromagnetic writing pad, and
an electromagnetic pen for handwriting input on the electromagnetic handwriting board;
the electromagnetic handwriting board comprises an antenna board and a control board for controlling the antenna board;
the antenna board comprises a transmitting coil for transmitting electromagnetic waves to the electromagnetic pen, and a receiving coil which is vertically intersected with the transmitting coil and used for receiving a resonance signal generated by the electromagnetic pen in a resonance mode on the electromagnetic waves transmitted by the transmitting coil;
and the control board controls the antenna board to simultaneously gate at least two groups of transmitting coils and receiving coils for scanning until all boundary transmitting coils and boundary receiving coils in the area of the antenna board are scanned, and touch signals of the electromagnetic pen on the electromagnetic handwriting board are obtained according to the detected maximum value of the electromagnetic pen signal and the coil combination corresponding to the maximum value of the electromagnetic pen signal.
In the above scheme, the controlling of the antenna board by the control board simultaneously gates at least two sets of the transmitting coils and the receiving coils for scanning includes:
and simultaneously gating at least two groups of transmitting coils and receiving coils to form a detection area of the electromagnetic pen signals, scanning the combination of each pair of transmitting coils and receiving coils, and detecting and recording the electromagnetic pen signals.
In the above scheme, obtaining a touch signal of the electromagnetic pen on the electromagnetic handwriting board according to the detected maximum value of the electromagnetic pen signal and the coil combination corresponding to the maximum value of the electromagnetic pen signal includes:
acquiring the maximum value of the detected electromagnetic pen signal, and performing primary positioning on the electromagnetic pen according to the coil combination corresponding to the maximum value of the electromagnetic pen signal;
and obtaining a touch signal of the electromagnetic pen on the electromagnetic handwriting board according to the maximum value of the electromagnetic pen signal and the result of the primary positioning of the electromagnetic pen.
In the above-mentioned scheme, according to the maximum value of electromagnetic pen signal and the result to the preliminary location of electromagnetic pen, obtain the touch-control signal of electromagnetic pen on the electromagnetism handwriting pad, include:
comparing the maximum value of the electromagnetic pen signal with a preset initial positioning threshold value, and if the maximum value of the electromagnetic pen signal is smaller than the initial positioning threshold value, accurately positioning the electromagnetic pen according to a coil combination corresponding to the maximum value of the electromagnetic pen signal obtained through initial positioning; otherwise, the control panel processes the maximum value of the electromagnetic pen signal and the coil combination corresponding to the maximum value of the electromagnetic pen signal, determines the position of the electromagnetic pen, and further determines the touch signal of the electromagnetic pen on the electromagnetic handwriting board.
In the above scheme, the controlling of the antenna board by the control board simultaneously gates at least two sets of the transmitting coils and the receiving coils for scanning includes:
step 10: simultaneously gating at least two groups of initial transmitting coils and initial receiving coils to form an initial detection area, scanning the combination of each pair of transmitting coils and receiving coils, and detecting and recording electromagnetic pen signals;
step 11: keeping the gated receiving coil unchanged, closing the currently gated transmitting coil, gating an ADD (additive manufacturing address) transmitting coil adjacent to the transmitting coil, and reforming a new detection area; wherein ADD is a positive integer;
step 12: detecting and recording an electromagnetic pen signal in the new detection area if the ADD root transmitting coil does not exceed a boundary transmitting coil; after scanning the boundary transmitting coil, re-gating the initial transmitting coil, closing the currently-gated receiving coil, gating the ADD receiving coil adjacent to the receiving coil, returning to the step 11 until all the boundary transmitting coils and the boundary receiving coils in the antenna board area are scanned, and ending the cycle; or,
step 20: simultaneously gating two or more groups of initial transmitting coils and initial receiving coils to form an initial detection area, scanning the combination of each pair of transmitting coils and receiving coils, and detecting and recording electromagnetic pen signals;
step 21: keeping the gated transmitting coil unchanged, closing the currently gated receiving coil, gating an ADD (additive manufacturing address) receiving coil adjacent to the receiving coil, and reforming a new detection area; wherein ADD is a positive integer;
step 22: detecting and recording an electromagnetic pen signal in the new detection area if the ADD root receive coil does not exceed a boundary receive coil; and after the boundary receiving coil is scanned, re-gating the initial receiving coil, closing the currently-gated transmitting coil, gating the ADD root coil adjacent to the transmitting coil, returning to the step 21 until all the boundary transmitting coils and the boundary receiving coils in the antenna board area are scanned, and ending the cycle.
In the above scheme, the boundary transmitting coil is a first or last transmitting coil of the antenna board area, and the boundary receiving coil is a first or last receiving coil of the antenna board area;
gating a boundary transmit coil if the ADD root transmit coil exceeds the boundary transmit coil;
gating the boundary receive coil if the ADD root receive coil exceeds the boundary receive coil.
In the above-mentioned solution, in the combination of the transmitting coil and the receiving coil, if the numbers of the transmitting coil and the receiving coil are respectively greater than or equal to 2, the ADD is less than or equal to the interval between the gated initial transmitting coils and less than or equal to the interval between the gated initial receiving coils.
In the above-mentioned scheme, according to the coil combination that the electromagnetic pen signal maximum value that preliminary positioning obtained corresponds carries out the accurate positioning to the electromagnetic pen, include:
respectively gating m transmitting coils and m receiving coils which are adjacent to the transmitting coil and the receiving coil corresponding to the maximum value of the electromagnetic pen signal to form an accurate positioning area; wherein m is a positive integer;
detecting and recording the electromagnetic pen signals of each pair of combination of the gated transmitting coil and the gated receiving coil, and calculating the maximum value of the detected electromagnetic pen signals;
if the maximum value of the electromagnetic pen signal is larger than or equal to a preset accurate positioning threshold value, the control panel processes the maximum value of the electromagnetic pen signal and a coil combination corresponding to the maximum value of the electromagnetic pen signal, determines the position of the electromagnetic pen, and further obtains a touch signal of the electromagnetic pen on the electromagnetic handwriting board; otherwise, other m groups of transmitting coils and receiving coils are gated again to form a new accurate positioning area, and the maximum value of the electromagnetic pen signal is detected and calculated.
In the above scheme, the accurate positioning threshold is greater than the preliminary positioning threshold; the value of m is any integer from 1 to ADD + 1.
In the above solution, the gated initial transmitting coil at least includes a boundary transmitting coil, and/or the gated initial receiving coil at least includes a boundary receiving coil.
In the scheme, the number of the initial transmitting coils and the number of the initial receiving coils are both even numbers, and the antenna plates are respectively divided into equal areas;
when the number of the transmitting coils and the number of the receiving coils of the antenna plate coil are both odd, a boundary coil of the transmitting coils and the boundary coil of the receiving coils are gated separately at first, and then the number of the initial transmitting coils and the number of the initial receiving coils which need to be gated are determined in the rest coils of the antenna plate.
The invention also provides a touch positioning method based on the electromagnetic induction device, and the electromagnetic induction device comprises the following steps: the electromagnetic handwriting board is used for handwriting input on the electromagnetic handwriting board; the electromagnetic handwriting board comprises an antenna board and a control board for controlling the antenna board; the antenna board comprises a transmitting coil for transmitting electromagnetic waves to the electromagnetic pen, and a receiving coil which is vertically intersected with the transmitting coil and used for receiving a resonance signal generated by the electromagnetic pen in a resonance mode on the electromagnetic waves transmitted by the transmitting coil; the method comprises the following steps:
and simultaneously gating at least two groups of transmitting coils and receiving coils for scanning until all boundary transmitting coils and boundary receiving coils in the antenna board area are scanned, and acquiring touch signals of the electromagnetic pen on the electromagnetic handwriting board according to the detected maximum value of the electromagnetic pen signal and the coil combination corresponding to the maximum value of the electromagnetic pen signal.
The simultaneously gating at least two sets of transmit coils and receive coils for scanning comprises: simultaneously gating at least two groups of transmitting coils and receiving coils to form a detection area of electromagnetic pen signals, scanning the combination of each pair of transmitting coils and receiving coils, and detecting and recording the electromagnetic pen signals;
the obtaining of the touch signal of the electromagnetic pen on the electromagnetic handwriting board according to the detected maximum value of the electromagnetic pen signal and the coil combination corresponding to the maximum value of the electromagnetic pen signal includes: acquiring the maximum value of the detected electromagnetic pen signal, and performing primary positioning on the electromagnetic pen according to the coil combination corresponding to the maximum value of the electromagnetic pen signal;
and obtaining a touch signal of the electromagnetic pen on the electromagnetic handwriting board according to the maximum value of the electromagnetic pen signal and the result of the primary positioning of the electromagnetic pen.
The obtaining of the touch signal of the electromagnetic pen on the electromagnetic writing pad according to the maximum value of the electromagnetic pen signal and the result of the preliminary positioning includes: comparing the maximum value of the electromagnetic pen signal with a preset initial positioning threshold value, and if the maximum value of the electromagnetic pen signal is smaller than the initial positioning threshold value, accurately positioning the electromagnetic pen according to a coil combination corresponding to the maximum value of the electromagnetic pen signal obtained through initial positioning; otherwise, the control panel processes the maximum value of the electromagnetic pen signal and the coil combination corresponding to the maximum value of the electromagnetic pen signal, determines the position of the electromagnetic pen, and further determines the touch signal of the electromagnetic pen on the electromagnetic handwriting board.
The simultaneous gating of at least two sets of transmit coils and receive coils for scanning until scanning of the boundary transmit coils and the boundary receive coils of the antenna plate area comprises:
step 10: simultaneously gating at least two groups of initial transmitting coils and initial receiving coils to form an initial detection area, scanning the combination of each pair of transmitting coils and receiving coils, and detecting and recording electromagnetic pen signals;
step 11: keeping the gated receiving coil unchanged, closing the currently gated transmitting coil, gating an ADD (additive manufacturing address) transmitting coil adjacent to the transmitting coil, and reforming a new detection area; wherein ADD is a positive integer;
step 12: detecting and recording an electromagnetic pen signal in the new detection area if the ADD root transmitting coil does not exceed a boundary transmitting coil; after scanning the boundary transmitting coil, re-gating the initial transmitting coil, closing the currently-gated receiving coil, gating the ADD receiving coil adjacent to the receiving coil, returning to the step 11 until all the boundary transmitting coils and the boundary receiving coils in the antenna board area are scanned, and ending the cycle; or,
step 20: simultaneously gating two or more groups of initial transmitting coils and initial receiving coils to form an initial detection area, scanning the combination of each pair of transmitting coils and receiving coils, and detecting and recording electromagnetic pen signals;
step 21: keeping the gated transmitting coil unchanged, closing the currently gated receiving coil, gating an ADD (additive manufacturing address) receiving coil adjacent to the receiving coil, and reforming a new detection area; wherein ADD is a positive integer;
step 22: detecting and recording an electromagnetic pen signal in the new detection area if the ADD root receive coil does not exceed a boundary receive coil; and after the boundary receiving coil is scanned, re-gating the initial receiving coil, closing the currently-gated transmitting coil, gating the ADD root coil adjacent to the transmitting coil, returning to the step 21 until all the boundary transmitting coils and the boundary receiving coils in the antenna board area are scanned, and ending the cycle.
The method further comprises the following steps: the boundary transmitting coil is a first transmitting coil or a last transmitting coil of the antenna board area, and the boundary receiving coil is a first receiving coil or a last receiving coil of the antenna board area; gating a boundary transmit coil if the ADD root transmit coil exceeds the boundary transmit coil; gating the boundary receive coil if the ADD root receive coil exceeds the boundary receive coil.
In the combination of the transmitting coil and the receiving coil, if the numbers of the transmitting coil and the receiving coil are respectively more than or equal to 2, the ADD is less than or equal to the interval between the gated initial transmitting coils and less than or equal to the interval between the gated initial receiving coils.
The method for accurately positioning the electromagnetic pen according to the coil combination corresponding to the maximum value of the electromagnetic pen signal comprises the following steps:
respectively gating m transmitting coils and m receiving coils which are adjacent to the transmitting coil and the receiving coil corresponding to the maximum value of the electromagnetic pen signal to form an accurate positioning area; wherein m is a positive integer;
detecting and recording the electromagnetic pen signals of each pair of combination of the gated transmitting coil and the gated receiving coil, and calculating the maximum value of the detected electromagnetic pen signals;
if the maximum value of the electromagnetic pen signal is larger than or equal to a preset accurate positioning threshold value, the control panel processes the maximum value of the electromagnetic pen signal and a coil combination corresponding to the maximum value of the electromagnetic pen signal, determines the position of the electromagnetic pen, and further obtains a touch signal of the electromagnetic pen on the electromagnetic handwriting board; otherwise, other m groups of transmitting coils and receiving coils are gated again to form a new accurate positioning area, and the maximum value of the electromagnetic pen signal is detected and calculated.
The precise positioning threshold is greater than the preliminary positioning threshold; the value of m is any integer from 1 to ADD + 1.
The gated initial transmit coil comprises at least one boundary transmit coil and/or the gated initial receive coil comprises at least one boundary receive coil.
The number of the initial transmitting coils and the number of the initial receiving coils are both even numbers, and the antenna plate is divided into equal areas;
when the numbers of the transmitting coils and the receiving coils of the antenna plate coil are both odd numbers, the first roots or the last roots of the transmitting coils and the last roots of the receiving coils are gated separately, and then the number of the initial transmitting coils and the number of the initial receiving coils which need to be gated are determined in the rest coils of the antenna plate.
The invention has the beneficial effects that: according to the invention, the plurality of transmitting coils and the plurality of receiving coils are simultaneously gated for scanning, so that the electromagnetic pen can be accurately positioned in a shorter time, and especially under the condition that the number of the coils of the electromagnetic induction antenna plate is more, compared with a method for sequentially scanning the transmitting coils and the receiving coils one by one, the electromagnetic pen positioning method can greatly improve the positioning efficiency and accuracy of the electromagnetic pen, and effectively avoid the problems of contact loss, delayed positioning and the like. For example: when the number of coils of the antenna board is greater than or equal to 20 x 20, the scanning time of about 150ms can be effectively shortened by adopting the scheme of the invention, and when the electromagnetic pen moves on the antenna board quickly, the position of the electromagnetic pen can be quickly positioned without losing a touch point, so that the positioning speed and the positioning precision of the electromagnetic pen are effectively improved.
Detailed Description
The invention will be further described with reference to the accompanying drawings and examples.
Referring to fig. 1 and 2, a schematic circuit diagram of an electromagnetic induction device according to the present invention is shown. The electromagnetic induction device includes an electromagnetic pen 11, and an antenna board 21, a transmitting part 41, a receiving part 51, and a control module 31.
The electromagnetic pen 11 is a handwriting input device having a filter circuit therein, and generates an electromagnetic induction signal when it is excited.
The antenna board 21 has a transmission coil 211 and a reception coil 212 perpendicularly intersecting each other, the transmission coil 211 and the reception coil 212 having a common origin. In the area of the antenna board, the number of transmitting coils is p, Tx0...Txp-1The receiving coils are q, Ry0...Ryq-1. One end of the transmitting coil and one end of the receiving coil are respectively controlled by a Micro Control Unit (MCU)20 on the Control module 31.
The Micro Control Unit (MCU)20 on the control module 31 controls the on and off of the transmitting coil 211 and the receiving coil 212 by controlling the transmitting part 41 and the receiving part 51, respectively. As shown in fig. 1 in conjunction with fig. 2, the receiving section 41 includes: a signal processing circuit 17, an integrating circuit 18, an a/D sampling circuit 19, a primary amplifier 14, and a secondary Amplifier (AGC) 15. The transmitting section 51 includes: an amplifier 13 and a signal generator 16.
A Micro Control Unit (MCU)20 controls the signal processing circuit 17 and the integrating circuit 18 to work, controls the a/D sampling circuit 19 to collect the signal of the integrating circuit 18, calculates the collected signal, and transmits the signal to the upper computer through the interface.
A Micro Control Unit (MCU)20 controls a Multiplexer (MUX)10, 12 to gate the transmit coil and the receive coil, respectively. The Micro Control Unit (MCU)20 controls the signal generator 16 to generate an excitation signal, which is amplified by the amplifier 13 to obtain the amplified excitation signal 4, and is transmitted to the electromagnetic pen 11 through the transmitting coil by the multi-way selection switch (MUX) 10. The Micro Control Unit (MCU)20 controls the Multiplexer (MUX)12 to gate the receiving coil, which receives the electromagnetic induction signal from the electromagnetic pen 11. The electromagnetic induction signal is amplified into a signal 1 by a first-stage amplifier 14, and then is amplified by a second-stage Amplifier (AGC)15 and processed by a signal processor 17 to obtain a signal 2, and the signal 2 is integrated by an integrating circuit 18 to obtain an integrated signal 3. The integrated signal 3 is collected by an a/D sampling circuit 19 and calculated by a Micro Control Unit (MCU) 20. The Micro Control Unit (MCU)20 analyzes the electromagnetic pen signals processed step by step to obtain the touch signals of the electromagnetic pen 11 on the electromagnetic writing pad.
Fig. 3 is a schematic diagram illustrating the direction of the antenna board transmitting coil set Tx of the electromagnetic induction device according to the present invention. The transmitting coils 211 have p pieces, and one ends thereof are connected together and grounded through a resistor. The other end of the transmitting coil is respectively connected with a multi-way selection switch (MUX)10, the multi-way selection switch (MUX)10 selects to gate the transmitting coil, and an excitation signal is sent to the electromagnetic pen 11.
Fig. 4 is a schematic view of the direction Ry of the antenna board receiving coil assembly of the electromagnetic induction device of the present invention. The receiving coils have q total number, and one end of the receiving coil is grounded through an analog switch with low on-resistance. The analog switch is switched on and off by a micro control unit 20 on the control module 31. The other end of the receiving coil is respectively connected with a multi-way selection switch (MUX)12, and is used for being selectively gated by the multi-way selection switch (MUX)12 to receive electromagnetic induction signals generated by resonance of electromagnetic waves transmitted by the electromagnetic pen and the transmitting coil.
Fig. 5 is a flowchart illustrating a touch positioning method based on an electromagnetic induction device according to the present invention.
The embodiment of the invention realizes the positioning of the electromagnetic pen of the electromagnetic handwriting system by a method of simultaneously gating at least two transmitting coils and at least one receiving coil and simultaneously scanning.
The implementation steps of the scheme are as follows:
s501: simultaneously gating an initial transmitting coil and an initial receiving coil in an antenna board area to form an initial detection area;
the number of the gated transmitting coils or the gated receiving coils is at least two, so that two or more groups of coil combinations are formed, and an initial detection area of the electromagnetic pen signal is formed. Assume that the number of transmit coils gated is n1 and the number of receive coils gated is n 2.
Preferably, to quickly locate the position of the electromagnetic pen, the n1 and n2 are even numbers, and the gated transmit coil and receive coil divide the transmit coil and receive coil into approximately equal regions, respectively. When selecting the gating initial coil, in order to ensure that the scanning is not repeated in the process of scanning the whole antenna board area and the step of moving the scanning area is simpler, preferably, one transmitting coil positioned at the boundary of the transmitting coil is gated and/or one receiving coil positioned at the boundary of the receiving coil is gated. The boundary coils refer to the 1 st transmitting coil Tx on the antenna board respectively0And the p-th transmitting coil Txp-1And the 1 st receiving coil Ry0And the q-th receiving coil Ryq-1。
For example, when p and q are both even, n1 and n2 are both even, and assuming that n1 and n2 are both 2, it is preferable,
the initial gated transmit coil is: tx0And Txp/n1Or T isxp-1And Txp/n1;
The initial gated receive coil is: ry0And Ryq/n2Or Ryq-1And Ryq/n2。
Thus, the initially gated transmit coil divides the antenna board area into two regions, and the initially gated receive coil divides the antenna board area into two regions.
As another example, when both p and q are even, assuming both n1 and n2 are 4, it is preferable,
the initially gated transmit coils are:
Tx0、Txp/n1、Tx2*p/n1、Tx3*p/n1or Txp-1、Txp-1-p/n1、Txp-1-2*p/n1、Txp-1-3*p/n1;
The initially gated receive coils are:
Ry0、Ryp/n1、Ry2*p/n1、Ry3*p/n1or Ryp-1、Ryp-1-p/n1、Ryp-1-2*p/n1、Ryp-1-3*p/n1。
Thus, the initially gated transmit coil divides the antenna board area into four regions, and the initially gated receive coil divides the antenna board area into four regions.
If p and q are both odd, the first or last of the transmit and receive coils is preferably scanned individually, and the remaining (p-1) transmit and (q-1) receive coils are gated simultaneously with n1 transmit and n2 receive coils, preferably n1, n2 being an even number, i.e., n2, 4.
The interval Δ Tx between the initially gated transmitting coils or the interval Δ Ry between the initially gated receiving coils is determined according to the number of coils provided in the antenna board area, and when the number of coils is large, the gated coil interval may be appropriately increased, and when the number of coils is small, the gated coil interval may be appropriately decreased.
S502: the gated combinations of transmit and receive coils are scanned separately, and the electromagnetic pen signals for each pair of coil combinations are detected and recorded.
And detecting whether the electromagnetic pen exists in an initial detection area, wherein at least two coils are gated by at least one of the transmitting coil and the receiving coil due to the fact that the transmitting coil and the receiving coil are initially gated simultaneously in the area of the antenna board, so that at least three coils including the transmitting coil and the receiving coil are gated simultaneously, namely at least two transmitting coils and one receiving coil are gated simultaneously, or at least one transmitting coil and two receiving coils are gated simultaneously, detecting the electromagnetic pen signal combined by each pair of coils, and recording the detection result.
The transmitting coil gated on the electromagnetic induction antenna board sends out an excitation signal, the resonant circuit in the electromagnetic pen receives the excitation of the excitation signal and then generates an electromagnetic induction signal, and the electromagnetic induction signal is received by the receiving coil gated on the electromagnetic induction antenna board, so that each pair of coil combinations can detect the electromagnetic pen signal.
S503: judging whether the boundary transmitting coil and the boundary receiving coil of the antenna board area are scanned or not, if so, executing S505, otherwise, executing S504;
s504: gating another transmitting coil and receiving coil combination to reform the detection area, and then returning to S502;
s505: calculating the maximum value of the detected electromagnetic pen signal;
s506: comparing the maximum value of the electromagnetic pen signal with a preset preliminary positioning threshold t1, and if the maximum value of the electromagnetic pen signal is smaller than the preliminary positioning threshold t1, indicating that the coil combination corresponding to the maximum value of the currently detected electromagnetic pen signal is not the accurate position of the electromagnetic pen, further accurate positioning is required, and an accurate positioning process of the electromagnetic pen is executed; if the maximum value of the electromagnetic pen signal is greater than the preliminary positioning threshold t1, it is indicated that the coil combination corresponding to the maximum value of the electromagnetic pen signal detected currently is the accurate position of the electromagnetic pen, and S507 is executed; the preliminary positioning threshold t1 is related to the positioning speed of the electromagnetic pen and the noise signal.
S507: and determining the intersection point of the transmitting coil and the receiving coil corresponding to the maximum value of the electromagnetic pen signal as the position of the electromagnetic pen, and obtaining the touch signal of the electromagnetic pen on the electromagnetic handwriting board according to the maximum value of the electromagnetic pen signal and the position of the electromagnetic pen.
In the embodiment of the invention, the electromagnetic pen can be accurately positioned in a short time by simultaneously gating the plurality of transmitting coils and the plurality of receiving coils for scanning, and particularly, under the condition that the number of the coils of the electromagnetic induction antenna plate is more, compared with a method for sequentially scanning the transmitting coils and the receiving coils one by one, the electromagnetic pen positioning method can greatly improve the positioning efficiency and accuracy of the electromagnetic pen and effectively avoid the problems of contact loss, delayed positioning and the like.
In this embodiment, the method for reforming the detection area includes the following two methods:
the method comprises the following steps: as shown in fig. 6
S600: judging whether all boundary transmitting coils are scanned completely, if not, keeping the gated receiving coil unchanged, closing the currently gated transmitting coil, gating an ADD (additive address) transmitting coil adjacent to the transmitting coil, and reforming a new detection area; otherwise, executing S603;
preferably, in the combination of the transmitting coils and the receiving coils, if the numbers of the transmitting coils and the receiving coils are respectively equal to or greater than 2, ADD is equal to or less than an interval Δ Tx between the strobed transmitting coils, and ADD is equal to or less than an interval Δ Ry between the strobed receiving coils.
For example, initially strobes the TxiRoot and TxjRoot transmitting coil, gated in this step is the Txi+ADDRoot and Txj+ADDAnd transmitting coils to reform the detection area. Here, ADD takes a value of 3.
S601: judging whether the ADD transmitting coil exceeds a boundary transmitting coil or not, and if not, executing a step S602; otherwise, gating the boundary transmitting coil, and then executing the step S602;
s602: detecting and recording the electromagnetic pen signal in the new detection area according to the gated transmitting coil and the gated receiving coil, and then returning to the step S600;
s603: and gating an initial transmitting coil, closing a currently gated receiving coil, gating an ADD receiving coil adjacent to the receiving coil, reforming a detection area, detecting and recording an electromagnetic pen signal, and then returning to the step S600 to perform reciprocating circulation until all boundary transmitting coils and boundary receiving coils in the antenna board area are scanned.
The second method comprises the following steps: as shown in fig. 7
S700: judging whether all boundary receiving coils are scanned completely, if not, keeping the gated transmitting coil unchanged, closing the currently gated receiving coil, gating an ADD (additive address) root receiving coil adjacent to the receiving coil, and reforming a new detection area; otherwise, executing S703;
wherein, the value of ADD is the same as S600, which is not described herein.
S701: judging whether the ADD root receiving coil exceeds a boundary receiving coil or not, and executing S702 if the ADD root receiving coil does not exceed the boundary receiving coil; otherwise, gating the boundary receiving coil, and then executing S702;
s702: detecting and recording the electromagnetic pen signal in a new detection area according to the gated transmitting coil and the gated receiving coil, and then returning to S700;
s703: and gating an initial receiving coil, closing the currently gated transmitting coil, gating an ADD transmitting coil adjacent to the currently gated transmitting coil, reforming a detection area, detecting and recording an electromagnetic pen signal, and then returning to the step S700 to perform reciprocating circulation until all boundary transmitting coils and boundary receiving coils in the antenna board area are scanned.
In this embodiment, the method for determining whether the gated coil exceeds the boundary of the antenna panel area includes:
if the detection area is moving in the direction of the pth transmit coil or the qth receive coil, p-1 is compared to the gated transmit coil number, or q-1 is compared to the gated receive coil number. When the gated transmitting coil number is greater than or equal to p-1 or the gated receiving coil number is greater than or equal to q-1, indicating that the gated transmitting coil or the gated receiving coil exceeds the boundary coil, numbering the gated transmitting coil as p-1 and numbering the gated receiving coil as q-1; when the number of the strobed transmitting coil is less than p-1 or the number of the strobed receiving coil is less than q-1, the strobed transmitting coil or the strobed receiving coil does not exceed the boundary coil, and the next ADD transmitting coil or receiving coil needs to be strobed continuously.
If the detection area is moved toward the 1 st transmitter coil or the 1 st receiver coil, 0 is compared with the gated transmitter coil number or 0 is compared with the gated receiver coil number. When the number of the gated transmitting coil is less than or equal to 0 or the number of the gated receiving coil is less than or equal to 0, the gated transmitting coil or the gated receiving coil is indicated to exceed the boundary coil, the number of the gated transmitting coil is 0, and the number of the gated receiving coil is 0; when the number of the strobed transmitting coil is larger than 0 or the number of the strobed receiving coil is larger than 0, the strobed transmitting coil or the strobed receiving coil does not exceed the boundary coil, and the next ADD transmitting coil or the next ADD receiving coil needs to be strobed continuously.
When a plurality of transmitting coils or receiving coils are initially gated, judging whether the gating coils reach the boundary of the antenna area, and comparing the number of the gating coils with the number of turns of the boundary line of the antenna when the detection area moves to the opposite direction of the 1 st coil; when the detection area moves to the 1 st coil direction, the smaller gate coil number is compared with 0.
In the electromagnetic pen positioning method of the present invention, the accurate positioning process of the electromagnetic pen, as shown in fig. 8, includes the following steps:
s801: respectively gating m transmitting coils and m receiving coils which are adjacent to the transmitting coil and the receiving coil corresponding to the maximum value of the electromagnetic pen signal to form an accurate positioning area;
preferably, m is an integer from 1 to ADD + 1. In this embodiment, m is 4.
S802: detecting and recording the electromagnetic pen signals of each pair of combination of the transmitting coil and the receiving coil which are gated;
s803: calculating the maximum value of the detected electromagnetic pen signal;
s804: comparing the maximum value of the electromagnetic pen signal with a preset precise positioning threshold t2, which is t2 greater than the preliminary positioning threshold t1, and if the maximum value of the electromagnetic pen signal is greater than or equal to the precise positioning threshold t2, performing S805; if the maximum value of the electromagnetic pen signal is smaller than the accurate positioning threshold t2, which indicates that the coil corresponding to the maximum value of the electromagnetic pen signal detected currently is not the accurate position of the electromagnetic pen, and further accurate positioning is required, returning to S801; the preliminary positioning threshold t1 is related to the positioning speed of the electromagnetic pen and the noise signal.
S805: and processing according to the combination of the transmitting coil and the receiving coil corresponding to the maximum value of the electromagnetic pen signal, determining the position of the electromagnetic pen, and obtaining the touch signal of the electromagnetic pen on the electromagnetic handwriting board.
The waveform of the electromagnetic pen signal is a sine curve, and the MCU calculates the maximum value and the phase of the electromagnetic pen signal waveform, so that the coordinate and the pressure information of the electromagnetic pen are obtained and are transmitted to the computer for processing.
The method of the present invention is described in detail below with reference to specific examples.
Example one
Suppose that the antenna board area is 40 × 50, 40 transmitting coils are taken, and p is 40; taking 50 receiving coils, wherein q is 50; n1 ═ 2, n2 ═ 2; ADD ═ 3; m is 4; the preliminary positioning threshold of the electromagnetic pen signal is t1 and the precise positioning threshold is t 2.
S101: gating two initial transmitting coils Tx respectively0,Tx20And two initial receiving coils Ry0,Ry20。
Opentx(0);Opentx(20);Openry(0);Openry(20);
S102: separately scan for Tx0,Tx20,Ry0,Ry20And (3) combining the coils, and detecting and recording the electromagnetic pen signals of each pair of coil combinations.
The following coil combinations were scanned separately:
{Opentx(0),Openry(0)};
{Opentx(0),Openry(20)};
{Opentx(20),Openry(0)};
{Opentx(20),Openry(20)};
s103: judging whether all antenna board areas are scanned or not, if all antenna board areas are scanned, calculating the maximum value of the detected electromagnetic pen signals, and accurately positioning the electromagnetic pen according to the maximum value and the corresponding coil combination; otherwise, S104 is executed.
S104: and forming a detection area again, and continuously detecting and recording the electromagnetic pen signal until all the antenna board areas are scanned.
In this embodiment, as all the antenna board areas have not been scanned, reshaping is requiredForming a detection region in the receiving coil Ry0,Ry20And under the unchanged condition, gating an ADD-th transmitting coil adjacent to the currently gated transmitting coil, wherein ADD is 3, and the gated transmitting coil and the gated receiving coil are respectively as follows:
{Opentx(3),Opentx(23);Openry(0),Openry(20)}
judging whether the ADD transmitting coil exceeds the boundary of the transmitting coil or not; since 23 < 40, which means that the boundary of the transmitting coil is not exceeded at this time, a new detection area is formed again according to the gated transmitting coil and receiving coil, the electromagnetic pen signal is detected and recorded, and then step S104 is executed in a loop, where the combinations of the sequentially gated transmitting coil and receiving coil are:
{Opentx(6),Opentx(26);Openry(0),Openry(20)};
{Opentx(9),Opentx(29);Openry(0),Openry(20)};
{Opentx(12),Opentx(32);Openry(0),Openry(20)};
{Opentx(15),Opentx(35);Openry(0),Openry(20)};
{Opentx(18),Opentx(38);Openry(0),Openry(20)}。
when { Opentx (18), Opentx (38); openry (0), Openry (20) }, the judgment 38 is less than 40, which indicates that the boundary of the transmitting coil is not exceeded. The gating continues on to the next transmit coil if necessary.
The next transmit coil Tx to be gatedjThe 41 st coil is needed, and the 40 th transmitting coil, namely the boundary transmitting coil is gated because the boundary of the transmitting coil is exceeded; correspondingly gated transmit coil TxiThe 21 st coil. At this time, the combinations of the gated transmitting coil and the gated receiving coil are:
{Opentx(21),Opentx(40);Openry(0),Openry(20)}。
all the transmitting coils are scannedAfter finishing, the initial transmitting coil is re-gated, i.e. Tx is re-gated0,Tx20And strobes the ADD-th receiving coil adjacent to the currently strobed receiving coil to form a new detection area.
Here, the R < th > gate is turned ony0+ADD,Ry20+ADDThe root coil, the transmitting coil and the receiving coil which are gated at the moment are respectively:
{Opentx(0),Opentx(20);Openry(3),Openry(23)}。
a decision 23 < 50 indicates that the boundary of the receive coil has not been reached. Hold the current receive coil Ry3And Ry23Unchanged, gating Tx0+ADD,Tx20+ADDA root coil. The combination of the sequentially gated transmitting coil and receiving coil is:
{Opentx(6),Opentx(26);Openry(3),Openry(23)};
{Opentx(9),Opentx(29);Openry(3),Openry(23)};
{Opentx(12),Opentx(32);Openry(3),Openry(23)};
{Opentx(15),Opentx(35);Openry(3),Openry(23)};
{Opentx(18),Opentx(38);Openry(3),Openry(23)}。
until the gated transmit coil again reaches the transmit coil's boundary, and so on until { Opentx (0), Opentx (20); openry (30), Openry (50) }, reaching the boundary of the receiving coil, and continuing to move the detection area along the direction of the transmitting coil.
When { Opentx (18), Opentx (38); and when Opery (30) and Opery (50) }, judging that 38 is less than 40, indicating that the boundary of the transmitting coil is not exceeded, and continuously gating the transmitting coil again to form a detection area again. The next gated transmit coil TxjShould be the 41 th coil, the 40 th transmitting coil Tx is gated because the boundary of the transmission is exceeded40(ii) a Correspondingly gated transmit coil TxiIs the 21 st lineRing Tx20。
By adopting the scheme of the invention, the position of the electromagnetic pen can be quickly positioned, particularly, the scanning time of about 150ms can be effectively shortened for the area of the antenna board which is more than or equal to 20X 20, the position of the electromagnetic pen can be quickly positioned when the electromagnetic pen is quickly moved on the antenna board, the phenomenon that a touch point is lost can be avoided, and the positioning speed and the positioning precision of the electromagnetic pen are effectively improved.
Example two
The number of the antenna area is 40 x 50, 40 transmitting coils are adopted, and p is 40; taking 50 receiving coils, wherein q is 50; ADD ═ 3; and m is 4, the preliminary positioning threshold value of the electromagnetic pen signal is t1, and the accurate positioning threshold value is t 2. Steps S101 to S103 are the same as in the first embodiment, and are not described in detail. The present embodiment differs from the first embodiment in that all the antenna board areas have been scanned in step 103.
The following coils are gated: { Opentx (0), Opentx (20); openry (0), Openry (20).
S105: and calculating the maximum value (MAX) of the detected electromagnetic pen signal, and preliminarily determining the intersection point of the transmitting coil and the receiving coil corresponding to the maximum value of the electromagnetic pen signal as the position of the electromagnetic pen.
Suppose that the maximum value of the electromagnetic pen signal corresponds to a combination of the transmitting coil and the receiving coil of (Tx)20,Ty20)
S106: and comparing the maximum value (MAX) of the electromagnetic pen signal with a preset preliminary positioning threshold value t1, wherein, assuming that MAX is less than t1, it indicates that the coil combination corresponding to the maximum value of the currently detected electromagnetic pen signal is not the precise position of the electromagnetic pen, and the electromagnetic pen needs to be further precisely positioned, and then S107 is executed.
S107: if the maximum value obtained in the gating step S106 corresponds to the 4 adjacent transmitting coils and 4 adjacent receiving coils, the range of the gating coils is 16 ═ Txcoil ≦ 24 and 2 ═ Rycoil ≦ 10. Namely, gating the transmit coil: tx16、Tx17、Tx18、Tx19、Tx21、Tx22、Tx23、Tx24And a gated receive coil: ry16、Ry17、Ry18、Ry19、Ry21、Ry22、Ry23、Ry24。
The combinations of the transmitter coil and the receiver coil are scanned, and 64 pairs of combinations are obtained, so that the electromagnetic pen signals MAX ' 1 to MAX ' 64 are obtained, and if the maximum value MAX ' of the electromagnetic pen signal is MAX ' 1, the combination of the transmitter coil and the receiver coil corresponding to MAX ' is obtained as (MaxTxcoil is 16, MaxRycoil is 16).
And comparing the MAX 'with a precise positioning threshold t2, and if MAX' > t2, indicating that MaxTxcoil is 16, and MaxRycoil is 16, which is the precise position of the electromagnetic pen.
And further processing according to MAX' and MaxTxCoil-16 and MaxRycoil-16 to obtain a touch signal of the electromagnetic pen on the electromagnetic handwriting board.
The steps are circularly carried out, after the coordinate information is calculated, the program continuously returns to the step S101 to carry out circulation and calculation to obtain the coordinates of the electromagnetic pen, the position of the pen is ensured to be continuously found, and lines drawn by the electromagnetic pen and written characters are presented to a user.
By adopting the scheme of the invention, the position of the electromagnetic pen can be quickly positioned, particularly, the scanning time of about 150ms can be effectively shortened for the area of the antenna board which is more than or equal to 20X 20, the position of the electromagnetic pen can be quickly positioned when the electromagnetic pen is quickly moved on the antenna board, the phenomenon that a touch point is lost can be avoided, and the positioning speed and the positioning precision of the electromagnetic pen are effectively improved.
EXAMPLE III
The difference from the first embodiment and the second embodiment is that the antenna area of the third embodiment is composed of an odd number of transmitting coils and receiving coils, and the antenna area is 19 × 19, the number of the transmitting coils is 19, and p is 19; 19 receiving coils are taken, and q is 19; ADD ═ 3; and m is 4, the preliminary positioning threshold value of the electromagnetic pen signal is t1, and the accurate positioning threshold value is t 2.
In this embodiment, the number of the transmitting coils and the receiving coils are both odd, and it is preferable to individually gate the 1 st transmitting coil Tx0And the 1 st receiving coil Ry0N1 and n2 are even numbers, and in this embodiment, n1 is 2, and n2 is 2.
Individually gating the 1 st transmit coil Tx0Simultaneously, sequentially selecting the direction of the receiving coil to scan the electromagnetic pen signals and detecting the electromagnetic pen signals; and the number of the first and second groups,
gating the 1 st receive coil Ry separately0And simultaneously, sequentially selecting the direction of the transmitting coil to scan the electromagnetic pen signals and detect the electromagnetic pen signals.
The remaining transmitting and receiving coils, except the 1 st transmitting coil and the 1 st receiving coil, re-form an antenna panel area in which the number p 'of transmitting coils is 18, the number q' of receiving coils is 18, and the numbers of transmitting coils and receiving coils are both even. Selecting a gated initial coil in the antenna panel area:
the initial transmit coil gated is: tx1And Tx9Or Tx18And Tx9
The initial receive coils that are gated are: ry1And Ry9Or Ry18And Ry9
Thus, the combination of the initially gated transmit and receive coils may be:
{Opentx(1),Opentx(9);Openry(1),Openry(9)};
{Opentx(1),Opentx(9);Openry(18),Openry(9)};
{Opentx(18),Opentx(9);Openry(1),Openry(9)};
{Opentx(18),Opentx(9);Openry(18),Openry(9)}。
any one of the above combinations is selected as the initial coil, and the detection region is located at the boundary of the antenna region.
In this embodiment, a combination of coils is selected: { Opentx (1), Opentx (9); openry (1), Openry (9) } as gated initial coils for scanning. At this time, the process of scanning the coil and the process of reforming the detection region are the same as those of the first and second embodiments, and detailed description thereof is omitted.
By adopting the scheme of the invention, the position of the electromagnetic pen can be quickly positioned, particularly when the electromagnetic pen moves quickly on the antenna board, the position of the electromagnetic pen can be quickly positioned, the phenomenon that a touch point is lost is avoided, and the positioning speed and the positioning precision of the electromagnetic pen are effectively improved.
Of course, in the described embodiment of the present invention, the gating initial coil does not necessarily include the boundary coil of the antenna area, but in the step of reforming the detection area, the method of using the boundary coil as the initial coil is simpler than the case where the initial detection area is located in the middle of the antenna area, and accordingly, the speed of detecting the electromagnetic pen signal is also greatly increased.