Full-wave and digital filtering denoising method and circuit for capacitive grating
[ field of technology ]
The invention relates to the field of electronic circuits, in particular to a full-wave and digital filtering denoising method and circuit for capacitive grids.
[ background Art ]
The internal of the holding grid comprises a movable grid and a static grid, the movable grid is provided with a plurality of transmitting electrodes and a receiving electrode, and the static grid is provided with a plurality of reflecting electrodes and shielding electrodes which are mutually insulated. An electric field exists between the transmitting electrode and the reflecting electrode, and between the reflecting electrode and the receiving electrode. The resulting output signal at the receiving electrode varies with the position between the transmitting electrode and the reflecting electrode due to capacitive coupling and charge transfer effects of the reflecting electrode.
The excitation signal generator outside the capacitive gate can generate two groups of digital signals (4 in each group) with 90-degree phase difference, and the 8 digital signals are subjected to D/A conversion to form a driving signal of the capacitive gate. The capacitive grating outputs two paths of analog signals sine and cosine with the phase difference of 90 degrees, the two paths of signals are converted into digital output signals sine and cosine after multistage amplification, filtering, A/D conversion and demodulation, and the two digital signals can be used for calculating the angle value at the current moment by a CORDIC algorithm. Such that a change in the position of the capacitive grating translates into a change in the angular value.
In actual operation, the reliability of the capacitive grid is affected by a number of adverse factors, including electrolyte, gap between the movable grid and the static grid, external environment (temperature, humidity, pressure, etc.), electromagnetic interference, etc. These adverse factors can form noise on the output signal of the capacitive grating, and these noise, when superimposed on the signals sine and cosine, can affect the accuracy and precision of the angle values.
Aiming at the defects that the capacitive grid is easy to be interfered by the outside and has low working reliability, special measures are usually required to resist the interference, and corresponding mechanical and electric circuit improvements are adopted, such as electromagnetic, signal and power isolation are adopted to improve the working reliability. Although the measures improve the reliability of the capacitive grating to a certain extent, the original noise is not eliminated fundamentally, and the capacitive grating can become a new noise source.
When the device is used in different working environments, the noise of the capacitive grid signal output is changed, which may cause the original anti-interference measures to be disabled.
[ invention ]
The invention provides a full-wave and digital filtering denoising method and circuit for a capacitive grating, which are used for solving the problems that the prior art does not fundamentally eliminate the original noise and possibly becomes a new noise source.
The full-wave and digital filtering denoising method for the capacitive grating comprises the following steps of: full wave denoising: respectively denoising an output sine signal and a cosine signal of the capacitance grid through multistage full waves, and outputting the signals; and (3) digital filtering denoising: respectively denoising an output sine signal and a cosine signal of the capacitive grating through multistage digital filtering, and outputting the signals; switching the denoising mode: the output of the above-described full wave denoising step or the output of the digital filter denoising step is selected.
The full-wave denoising step comprises the following steps: full-wave denoising is carried out on the sine signal output by the capacitance grid: the full wave denoising is divided into m stages, and a certain number of numerical values are stored in each stage; the value in the first stage comes from the sine signal output by the capacitive grid, the input of the next stage is the sum of all the values stored in the previous stage, and the sum of all the values stored in the last stage is used as the output sine_out1 of the full-wave denoising; full-wave denoising is carried out on the cosine signal output by the capacitance grid: the full wave denoising is divided into m stages, and a certain number of numerical values are stored in each stage; the value in the first stage comes from the cosine signal output by the capacitive grid, the input of the latter stage is the sum of all the values stored in the former stage, and the sum of all the values stored in the last stage is taken as the output cosine_out1 of the full-wave denoising.
The digital filtering denoising step comprises the following steps: digital filtering denoising is carried out on the sine signal output by the capacitance grid: the digital filtering denoising is divided into t stages, and a certain number of numerical values are stored in each stage; the value in the first stage comes from the sine signal output by the capacitive grid, the input of the next stage is the sum of all the values stored in the previous stage, and the sum of all the values stored in the last stage is used as the output sine_out2 of digital filtering denoising; digital filtering denoising is carried out on the cosine signal output by the capacitance grid: the digital filtering denoising is divided into t stages, and a certain number of numerical values are stored in each stage; the value in the first stage comes from the sine signal output by the capacitive gate, the input of the latter stage is the sum of all the values stored in the former stage, and the sum of all the values stored in the last stage is taken as the output sine_out2 of digital filtering denoising.
The step of switching the denoising mode further comprises the following steps: calculating the angle value at the current moment: and calculating the output of the selected full-wave denoising step or the output of the digital filtering denoising step through a CORDIC algorithm to obtain the angle value at the current moment.
The full-wave and digital filtering denoising circuit for capacitive grating of the present invention comprises: the full-wave denoising module is used for denoising the output sine signal and the cosine signal of the capacitive grating through multiple stages of full waves respectively and outputting the signals; the digital filtering denoising module is used for denoising the output sine signal and the cosine signal of the capacitive grating through multistage digital filtering respectively and outputting the signals; and the denoising mode switching module is used for selecting the output of the full-wave denoising module or the output of the digital filtering denoising module.
Wherein, the full wave denoising module comprises: the sub-module is used for carrying out full-wave denoising on the sine signal output by the capacitive grating, wherein the full-wave denoising is divided into m stages, and a certain number of numerical values are stored in each stage; the value in the first stage comes from the sine signal output by the capacitive grid, the input of the latter stage is the sum of all the values stored in the former stage, the sum of all the values stored in the last stage is used as the output sine_out1 of the full-wave denoising, and the summation process is realized by an adder; the submodule is used for carrying out full-wave denoising on the cosine signal output by the capacitance grid, wherein the full-wave denoising is divided into m stages, and a certain number of numerical values are stored in each stage; the value in the first stage comes from a sine signal output by the capacitive grid, the input of the latter stage is the sum of all values stored in the former stage, the sum of all values stored in the last stage is taken as the output sine_out1 of the full-wave denoising, and the summation process is realized through an adder.
The digital filtering denoising module comprises: the sub-module is used for carrying out digital filtering denoising on the sine signal output by the capacitance grid, wherein the digital filtering denoising is divided into t stages, and a certain number of numerical values are stored in each stage; the numerical value in the first stage is from a sine signal output by the capacitive grating, the input of the latter stage is the sum of all numerical values stored in the former stage, the sum of all numerical values stored in the last stage is used as output sine_out2 for digital filtering denoising, and the summation process is realized through an adder; the submodule is used for carrying out digital filtering denoising on the cosine signal output by the capacitance grid, wherein the digital filtering denoising is divided into t stages, and a certain number of numerical values are stored in each stage; the value in the first stage comes from the sine signal output by the capacitive grid, the input of the latter stage is the sum of all the values stored in the former stage, the sum of all the values stored in the last stage is used as the output sine_out2 of digital filtering denoising, and the summation process is realized through an adder.
Wherein, still include: the module for calculating the angle value at the current moment is used for calculating the output of the full-wave denoising module or the output of the digital filtering denoising module selected by the denoising mode switching module through a CORDIC algorithm to obtain the angle value at the current moment.
The full-wave and digital filtering denoising method and circuit for capacitive grating of the present invention describe two denoising methods for capacitive grating output signals sine and cosine, namely full-wave and digital filtering. Noise in the grid-containing output signals sine and cosine can be removed, the capacity of resisting external environment interference of the system is improved, and the processed sine and cosine signals can be used for CORDIC (Coordinate Rotation Digital Computer) algorithm to calculate the angle value at the current moment. The system has the parameter configurable function in the implementation, so that the system can adapt to different external environments. The invention realizes the denoising treatment of the grid output signals sine and cosine on the basis of adopting the original anti-interference, the two denoising methods are not influenced by the grid working environment, the treated sine and cosine signals can be better used by the CORDIC algorithm, and the accuracy and precision of the angle values are improved.
[ description of the drawings ]
FIG. 1 is a flow chart of method steps of embodiment 1 of the present invention;
FIG. 2 is a schematic diagram of full-wave denoising of a sine signal output from a capacitor grid in embodiment 1 of the present invention;
fig. 3 is a schematic circuit diagram of embodiment 2 of the present invention;
fig. 4 is a schematic structural diagram of a full-wave denoising sub-module for a sine signal output by a capacitor grid in embodiment 2 of the present invention.
[ detailed description ] of the invention
Embodiment 1, the full-wave and digital filtering denoising method for capacitive grating of the present embodiment, as shown in fig. 1, comprises the following main steps:
s11, full-wave denoising: and respectively denoising the output sine signal and the cosine signal of the capacitance grid through multistage full wave, and outputting the signals.
In a specific implementation, full-wave denoising is performed on a sine signal output by a capacitive grating, as shown in fig. 2, the full-wave denoising can be divided into m stages, a certain number of numerical values are stored in each stage, and the structures of the stages are similar. The value in the first stage comes from the sine signal output by the capacitive gate, the input of the next stage is the sum of all the values stored in the previous stage, and the sum of all the values stored in the last stage is taken as the output sine_out1 of the full-wave denoising. The number of the full-wave denoising stages m and the number of the numerical values of each stage can be configured through parameters so as to adapt to different working environments.
Similarly, in the concrete implementation, full-wave denoising is performed on the cosine signal output by the capacitor grid, the full-wave denoising can be divided into m stages, a certain number of numerical values are stored in each stage, and the structures of the stages are similar. The value in the first stage comes from the cosine signal output by the capacitive grid, the input of the latter stage is the sum of all the values stored in the former stage, and the sum of all the values stored in the last stage is taken as the output cosine_out1 of the full-wave denoising. The number of the full-wave denoising stages m and the number of the numerical values of each stage can be configured through parameters so as to adapt to different working environments.
S12, digital filtering denoising: and respectively denoising the output sine signal and the cosine signal of the capacitive grating through multistage digital filtering, and outputting the signals.
Similarly to the description in S11, the digital filtering denoising is performed on the sine signal output by the capacitor grid, and the digital filtering denoising can be divided into t stages, wherein a certain number of numerical values are stored in each stage, and the structures of the stages are similar. The value in the first stage comes from the sine signal output by the capacitance grid, the input of the next stage is the sum of all the values stored in the previous stage, and the sum of all the values stored in the next stage is taken as the output sine_out2 of digital filtering denoising. The number of stages t of digital filtering denoising and the number of numerical values of each stage can be configured through parameters so as to adapt to different working environments.
Similarly, in the specific implementation, digital filtering denoising is performed on the cosine signal output by the capacitor grid, the digital filtering denoising can be divided into t stages, a certain number of numerical values are stored in each stage, and the structures of the stages are similar. The value in the first stage comes from the sine signal output by the capacitive gate, the input of the latter stage is the sum of all the values stored in the former stage, and the sum of all the values stored in the last stage is taken as the output sine_out2 of digital filtering denoising. The number of stages t of digital filtering denoising and the number of numerical values of each stage can be configured through parameters so as to adapt to different working environments.
S13, switching a denoising mode: the output of the above-described full wave denoising step or the output of the digital filter denoising step is selected.
In a specific implementation, an appropriate denoising method may be selected for use as needed.
S14, calculating the angle value at the current moment: the method is a preferred step, and the angle value at the current moment is obtained by calculating the output of the selected full-wave denoising step or the output of the digital filtering denoising step through a CORDIC algorithm.
Embodiment 2, the full-wave and digital filtering denoising circuit for capacitive grating of the present embodiment, as shown in fig. 3, includes:
the full-wave denoising module 21 is configured to denoise and output the sine signal and the cosine signal of the capacitive grid through multiple stages of full-wave denoising respectively. The full-wave denoising module 21 further includes: the sub-module 211 for performing full-wave denoising on the sine signal output by the capacitor grid is shown in fig. 4, where the full-wave denoising is divided into m stages, and a certain number of numerical values are stored in each stage, and each stage has a similar structure. The value in the first stage comes from the sine signal output by the capacitive grating, the input of the subsequent stage is the sum of all the values stored in the previous stage, the sum of all the values stored in the final stage is used as the output sine_out1 of the full-wave denoising, the summation process is realized through an adder 2111, and the structures of a plurality of subsequent sub-modules are similar to those described above and are not repeated. The sub-module 212 performs full-wave denoising on the cosine signal output by the capacitor grid, where the full-wave denoising is divided into m stages, and a certain number of numerical values are stored in each stage, and each stage has a similar structure. The value in the first stage comes from a sine signal output by the capacitive grid, the input of the latter stage is the sum of all values stored in the former stage, the sum of all values stored in the last stage is taken as the output sine_out1 of the full-wave denoising, and the summation process is realized through an adder.
The digital filtering denoising module 22 is configured to denoise the output sine signal and the cosine signal of the capacitive grating through multi-stage digital filtering, and output the denoised signals. The digital filtering denoising module 22 further includes: and a sub-module 221 for carrying out digital filtering denoising on the sine signal output by the capacitance grid, wherein the digital filtering denoising is divided into t stages, a certain number of numerical values are stored in each stage, and the structures of the stages are similar. The value in the first stage comes from the sine signal output by the capacitive grid, the input of the latter stage is the sum of all the values stored in the former stage, the sum of all the values stored in the last stage is used as the output sine_out2 of digital filtering denoising, and the summation process is realized through an adder. And a submodule 222 for carrying out digital filtering denoising on the cosine signal output by the capacitance grid, wherein the digital filtering denoising is divided into t stages, a certain number of numerical values are stored in each stage, and the structures of the stages are similar. The value in the first stage comes from the sine signal output by the capacitive grid, the input of the latter stage is the sum of all the values stored in the former stage, the sum of all the values stored in the last stage is used as the output sine_out2 of digital filtering denoising, and the summation process is realized through an adder.
The denoising mode switching module 23 is configured to select an output of the full-wave denoising module or an output of the digital filtering denoising module.
The current time angle value calculating module 24 is a preferred module, and is configured to calculate, through a CORDIC algorithm, an output of the full-wave denoising module or an output of the digital filtering denoising module selected by the denoising mode switching module, to obtain a current time angle value.
The description and applications of the present invention herein are illustrative and exemplary only and are not intended to limit the scope of the invention to the embodiments described above. Variations and modifications of the embodiments disclosed herein are fully possible and various alternatives and equivalents of the embodiments are known to those skilled in the art. It will also be apparent to those of skill in the art that the invention may be embodied in other forms, structures, arrangements, proportions, and with other components, materials, and parts, without departing from the spirit or essential characteristics thereof, and that other variations and modifications may be made in the embodiments disclosed herein without departing from the scope or spirit of the invention.