Electromagnetic touch handwriting device with automatic phase correction function
Technical Field
The present invention relates to an electromagnetic touch technology, and in particular, to an electromagnetic touch device with an automatic phase correction function.
Background
Because the Electromagnetic (EM) touch technology has the advantages of high precision, high response speed and the like, the EM touch technology can be widely used in handwriting application. According to the basic principle, electromagnetic touch can be currently divided into two types, hereinafter referred to as active electromagnetic touch and passive electromagnetic touch. The antenna array and the electromagnetic pen are arranged at the same point, and the difference is that a battery is arranged in the pen of the active electromagnetic touch control (active pen) technology, the pen actively transmits electromagnetic waves, the electromagnetic waves are received by the antenna board, and the position and the pressure value of the pen are calculated; the passive electromagnetic touch (passive pen) technology has no battery, firstly, the antenna board emits electromagnetic waves with fixed frequency, resonance is generated in the pen close to the antenna board, then, the antenna board stops emitting and turns to receiving, and the resonance waves in the pen can be induced back to the antenna board, and the antenna board receives and calculates the position and the pressure.
In the passive pen technology, since a resonant wave having substantially the same frequency as that of the antenna board needs to be generated in the pen, it is also called Electromagnetic Resonance (Electromagnetic Resonance) touch. The electromagnetic pen is mainly composed of an LC loop, and the natural resonant frequency of the electromagnetic pen is equal to the frequency f0 of electromagnetic waves. When the pen point is pressed down, the inductance value or the capacitance value in the loop can be changed, the resonant frequency of the LC loop can be slightly changed to f1, as long as the quality factor Q value of the LC loop, the frequency f0 of the electromagnetic wave and the change frequency f1 are properly selected, the f1 can be kept within the passband of the LC resonant circuit, the LC loop in the pen can still generate resonance with the electromagnetic wave emitted by the antenna plate, the antenna plate stops emitting the electromagnetic wave after resonance and turns to receive, the LC loop in the pen cannot immediately stop oscillating at the moment and reflects the electromagnetic wave back to the antenna plate, the antenna plate can detect the reflected wave, and the specific position of the pen is calculated according to the amplitude of the reflected wave induced in each coil. Further, referring to fig. 1, it can be seen that a frequency change in the vicinity of the electromagnetic wave frequency f0 results in a significant phase change of the resonant wave, and by detecting the magnitude of the phase change, information such as whether the pen tip is pressed, and the pressing pressure can be obtained. This principle is well known to those skilled in the art and can be further understood by reference to Pat. No. 4878553, position detecting apparatus, etc.
The antenna board emits an electromagnetic wave with an initial phase phi 0 and a frequency f0 at a fixed frequency, the electromagnetic wave is resonated by the pen and then reflects back, the frequency is basically the same or slightly changed, but the phase of the reflected wave can be changed into phi 1, and usually phi 1 is not equal to phi 0. In practical applications, the stylus tip may slightly expand and contract when pressed, resulting in a change in capacitance or inductance, thereby changing the natural resonant frequency of the pen and causing a change in phase of the reflected waves. The phase when The pen point approaches The touch panel infinitely before being pressed down is assumed to be phi ini, which is hereinafter referred to as an initial pressing phase, the currently detected phase is In a wide range from phi ini to phi ini +2 pi/3, i.e., -60 to +60 o (refer to Pat. No. 5134689, associated Input System and Input evaluation Used In The System), and The phase value is converted into a pressure order, for example, 1024 or 2048, so as to obtain a pressure sensing value.
In the prior art, the phase of the echo wave is generally detected by sending two square waves with a fixed pi/2 phase difference to a phase detection unit, refer to PAT 4878553 "Position detection apparatus" and CN1453741A "wireless and passive handwriting device for computer recording", etc. The two waves are multiplied by the echo wave, respectively, and the corresponding amplitude component and phase component are obtained by low-pass filtering or integration, etc., and the phase offset value is obtained by using an arctangent calculation. However, as can be seen from the above document, determining the initial phase value by the degree of pressing with the pen is difficult to achieve the desired accuracy, has many factors affecting the initial phase value, is difficult to determine, and has a complicated structure.
Disclosure of Invention
Therefore, the embodiment of the invention provides an electromagnetic touch device with an automatic phase correction function and an automatic phase correction method, so as to solve the problem of inaccurate detection caused by uncertain pen pressure in the process of determining an initial phase by adopting a resonant echo wave in the prior art.
In order to achieve the above object, the embodiments of the present invention provide the following technical solutions:
according to a first aspect of the embodiments of the present invention, an electromagnetic touch handwriting device includes: the device is used for performing core operation and transmitting an electromagnetic wave with fixed phase and a phase detection wave; the signal driving module: the phase detection wave is coupled with the microcontroller and used for amplifying the phase detection wave; a position induction coil: the signal driving module is coupled, responds to the phase detection wave and generates a return wave; a signal conditioning module: the first inductance coil is coupled between the signal driving module and a node coupled with the first inductance coil and used for processing the return wave; a signal integration module: the echo wave and the electromagnetic wave which are processed by the signal conditioning module are respectively integrated and the integrated digital signals are transmitted to the microcontroller; and gate: the two input pins of the AND gate are respectively connected with the signal conditioning module and the microcontroller, and the output pin of the AND gate is connected with the signal integrating module; and the microcontroller continuously changes the phase of the phase detection wave to obtain different integral values, and the phase value corresponding to the extreme value in the integral values is calculated to be the initial phase value.
Further, the signal conditioning module comprises an amplifier, a band-pass filter and a precise half-wave rectifier.
Further, the signal integration module comprises an integrator and an analog-to-digital converter.
According to a second aspect of an embodiment of the present invention, an automatic phase correction method includes the following steps of S1, inputting a correction command; s2, after receiving the phase correction command, the controller simultaneously transmits an electromagnetic wave and a phase detection wave with the same frequency and phase; s3, the return waves are processed through a coil loop, the phase of the phase detection waves is changed continuously, the phase detection waves are multiplied by the return waves respectively, and corresponding integral value arrays are obtained; s4, solving a phase value corresponding to an extreme value in the integral value array as an initial phase value; and S5, storing the adjusted initial phase value.
Further, the phase correction command is input, and the command is sent from the USB port through the computer to be implemented or is implemented through a key on the handwriting device.
Further, the phase detection wave with the phase gradually changed from 0 to pi is selected as the phase detection wave.
Further, the processing of the echo wave includes amplification processing, filtering processing, and half-wave rectification processing.
The embodiment of the invention has the following advantages: the phase detection square wave with the phase changed step by step is transmitted, the optimal position of the pen is determined according to the mutual inductor, a phase integral value array and an amplitude integral value array are obtained, the phase difference between the initial pressing phase and the phase detection square wave is judged according to the array, the phase of the electromagnetic wave and the phase of the phase detection square wave is correspondingly adjusted, the initial pressing phase value in firmware is automatically modified, the electromagnetic touch device is in the optimal handwriting state, the procedure of determining the initial pressing phase in the production process is simplified, and the initial phase detection error caused by the height position and the pressing degree of the pen is reduced because the electromagnetic wave and the phase detection wave are transmitted by the controller.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. It should be apparent that the drawings in the following description are merely exemplary, and that other embodiments can be derived from the drawings provided by those of ordinary skill in the art without inventive effort.
The structures, the proportions, the sizes, and the like shown in the specification are only used for matching with the contents disclosed in the specification, so that those skilled in the art can understand and read the present invention, and do not limit the conditions for implementing the present invention, so that the present invention has no technical essence, and any modifications of the structures, changes of the proportion relation, or adjustments of the sizes, should still fall within the scope of the technical contents disclosed in the present invention without affecting the efficacy and the achievable purpose of the present invention.
Fig. 1 is a schematic structural diagram of an electromagnetic touch device according to an embodiment of the present invention;
fig. 2 is a band-pass filter circuit of an electromagnetic touch device according to an embodiment of the present invention;
fig. 3 is a precise half-wave rectification circuit of an electromagnetic touch device according to an embodiment of the present invention;
fig. 4 is a waveform diagram of an electromagnetic touch device according to an embodiment of the present invention.
Detailed Description
The present invention is described in terms of particular embodiments, other advantages and features of the invention will become apparent to those skilled in the art from the following disclosure, and it is to be understood that the described embodiments are merely exemplary of the invention and that it is not intended to limit the invention to the particular embodiments disclosed. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
Example (b): an electromagnetic touch handwriting device, as shown in fig. 1-3, includes a microcontroller, a signal driving module, a position sensing coil, an and gate, a signal conditioning module, and a signal integrating module, where the microcontroller is configured to perform a core operation and transmit an electromagnetic wave and a phase detection wave with the same frequency and phase, and in this embodiment, the phase of the waveform generated by the microcontroller is digitally adjustable. Many microcontrollers in the industry today have this function, such as the common ARM CORTEX3 series of chips, operating at 72MHz dominant frequency. A 690KHz square wave can be emitted with an adjustable phase, with an adjustable number PL of 104 (for 2 pi phases). If the frequency of the transmitting square wave is reduced, for example, by 300K, the adjustable phase level PL is 240 levels, and the corresponding phase calibration precision is 360/240 =1.5 °.
In this embodiment, the signal driving module is configured as an amplifier for amplifying the phase detection wave.
The position sensing coil is coupled to the signal driving module and responds to the phase detection wave to generate a return wave.
The signal conditioning module is coupled between the signal driving module and a node coupled with the first inductance coil and used for processing the echo wave and the phase detection wave. The signal conditioning module comprises an amplifier, a band-pass filter and a precise half-wave rectifier, wherein the retro-reflected waves amplify signals through the amplifier, then pass through the band-pass filter to filter interference signals, and are rectified into direct-current signals through the rectifier. The signal integration module comprises an integrator and an analog-digital converter, and the rectified direct current signal is converted into a digital signal through the integrator and the analog-digital converter and then sent to the microcontroller for processing. The phase detection wave directly passes through the integrator and the digital-to-analog converter and then is sent to the microcontroller for processing. In this embodiment, precise half-wave rectification is preferred to rectify the echo signal, and full-wave rectification may also be employed, but the complexity of the circuit is slightly higher. And the AND gate is coupled with the signal conditioning module, the microcontroller and the signal integration module, wherein two input pins of the AND gate are respectively connected with the signal conditioning module and the microcontroller, and an output pin of the AND gate is connected with the signal integration module.
The conventional method is that mutual inductance is generated when an induction array in an antenna board is close to an inductance coil in a pen, namely, an equivalent inductance is added in an LC loop in the pen, phase detection is to detect the initial phase of the pen, and the initial phase value is stored in FLASH to be used as an initial phase value of the antenna induction array, so that when a standard pen is close to the same distance, the same initial phase value is obtained. Because the inductance L and the capacitance C of the standard pen and the mutual inductance Lma of the pen and the antenna array are fixed values, and the pen emits the wave W0 with the fixed resonant frequency f0, the MCU can directly emit the wave with the fixed frequency f0 to replace the electromagnetic wave in the pen, and the integration window is changed to obtain an initial phase value. Thus, both the electromagnetic wave and the phase detection wave are transmitted by the microcontroller. The microcontroller utilizes the electromagnetic waves emitted by the microcontroller to directly pass through the coil loop for signal processing, after the electromagnetic waves pass through the signal processing circuit, the electromagnetic waves are multiplied by the phase detection square waves, the phases of the phase detection square waves are sequentially changed to obtain integral values, and then the phases of the electromagnetic waves are obtained according to the integral values.
The phase correction method comprises the following steps:
s1, inputting a correction command;
s2, after receiving the phase correction command, the controller simultaneously transmits an electromagnetic wave with a fixed phase and a phase detection wave with a gradually changed phase;
s3, the return waves are processed through a coil loop, the phase of the phase detection waves is changed continuously, the phase detection waves are multiplied by the return waves respectively, and corresponding integral value arrays are obtained;
s4, solving a phase value corresponding to an extreme value in the integral value array as an initial phase value;
and S5, storing the adjusted initial phase value.
The phase correction method will be described in detail below with reference to the accompanying drawings.
At the initial time, the phases of the electromagnetic wave and the phase detection wave are the same, and if the phases are assumed to be 0, the electromagnetic wave is subjected to filtering, rectification and other processing, and then has a phase difference phi with the phase detection wave. As shown in fig. 4, where a denotes a transmission signal, B denotes a transmission signal that has been driven, C denotes a transmission signal that has been subjected to amplification rectification, D denotes a phase detection signal, E denotes a waveform obtained by multiplying D by C, and F denotes a graph integrating E, a denotes an electromagnetic wave, and D denotes a phase detection wave, the initial phases of which are the same. A phase difference phi exists between the electromagnetic wave C after amplification and rectification and the phase detection wave D. According to the phase calibration method of the present invention, the phase difference is automatically calculated. Before phase correction, because the phase difference between the phase of the phase detection wave and the electromagnetic wave cannot be predicted, the phase of the phase detection wave is continuously changed and integrated to obtain a plurality of integrated values, and then the integrated values are judged to obtain an extreme value of the integrated value V, wherein the extreme value is an initial phase value.
The initial phase of the detection wave has a phase difference with respect to the electromagnetic wave after the amplification and rectification, and the phase theta is (-pi, pi). The phase of the electromagnetic wave is fixed, the phase of the detection wave is continuously changed from the initial phase angle theta, as shown by E, up to theta + pi, and integrated, and the curve of the integrated value is shown by F.
The value theta is obtained according to the value distribution of the array.
The array of integrated values is represented as:
integral [ PL ], PL =0,1,2, \8230;, PL-1, represents the number of stages of adjustable phase where the number of stages of adjustable phase are equally spaced between (0, π).
The specific method for judging the phase comprises the following steps:
and (4) solving the extreme value positions, namely index numbers imin and imax corresponding to the minimum value and the maximum value in the array.
The C language code is given below, wherein
Theta is expressed by phase, pi is expressed by pai, imax is expressed by imax, imin is expressed by imin
After the value of θ is obtained, the phase of the electromagnetic wave and the phase of the phase detection wave can be adjusted based on the value so that the phase difference therebetween becomes fixed, and the initial phase value is saved in the memory.
The automatic phase correction method comprises the steps of transmitting a phase detection square wave with gradually changed phase, determining the optimal position of a pen according to a mutual inductor to obtain a phase integral value array and an amplitude integral value array, judging the phase difference between an initial pressing phase and the phase detection square wave according to the arrays, correspondingly adjusting the phase of an electromagnetic wave phase and the phase detection square wave, and automatically modifying the initial pressing phase value in firmware to enable the electromagnetic touch device to be in the optimal handwriting state, so that the procedure of determining the initial pressing phase in the production process is simplified.
Although the invention has been described in detail with respect to the general description and the specific embodiments, it will be apparent to those skilled in the art that modifications and improvements may be made based on the invention. Accordingly, such modifications and improvements are intended to be within the scope of the invention as claimed.