CN115951128A - Capacitance detection method and device, chip and electronic equipment - Google Patents

Capacitance detection method and device, chip and electronic equipment Download PDF

Info

Publication number
CN115951128A
CN115951128A CN202211582518.1A CN202211582518A CN115951128A CN 115951128 A CN115951128 A CN 115951128A CN 202211582518 A CN202211582518 A CN 202211582518A CN 115951128 A CN115951128 A CN 115951128A
Authority
CN
China
Prior art keywords
signal
value
detection
frame
detection signal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211582518.1A
Other languages
Chinese (zh)
Inventor
曾晓燕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huiding Technology Chengdu Co ltd
Original Assignee
Huiding Technology Chengdu Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huiding Technology Chengdu Co ltd filed Critical Huiding Technology Chengdu Co ltd
Priority to CN202211582518.1A priority Critical patent/CN115951128A/en
Publication of CN115951128A publication Critical patent/CN115951128A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application provides a method, a device, a chip and an electronic device for capacitance detection, which can eliminate the influence of the environment on the capacitance detection so as to improve the accuracy of the capacitance detection. The method comprises the following steps: acquiring a signal value of a detection signal output by a detection electrode; determining the compensation amount of the detection signal of the Nth frame according to the deviation of the signal value of the detection signal of the M frames before the detection signal of the Nth frame relative to a reference value, wherein N is a positive integer, and M is a positive integer smaller than N; and calibrating the signal value of the detection signal of the Nth frame according to the compensation amount to obtain the calibration value of the detection signal of the Nth frame.

Description

Capacitance detection method and device, chip and electronic equipment
Technical Field
The embodiment of the application relates to the field of capacitance detection, and more particularly, to a method, an apparatus, a chip and an electronic device for capacitance detection.
Background
The capacitance detection device is usually disposed in an electronic device such as an earphone or a mobile phone, and includes a detection electrode and a related processing circuit to detect whether a human body approaches or leaves the detection electrode, so that the electronic device can perform corresponding operations. However, the change in the ambient temperature affects the result of the capacitance detection, thereby causing erroneous judgment of the state in which the conductor is close to or away from the detection electrode. Therefore, how to eliminate the influence of the environment on the capacitance detection to improve the accuracy of the capacitance detection becomes a problem to be solved.
Disclosure of Invention
The embodiment of the application provides a method, a device, a chip and an electronic device for capacitance detection, which can eliminate the influence of the environment on the capacitance detection so as to improve the accuracy of the capacitance detection.
In a first aspect, a method for capacitive detection is provided, the method comprising: acquiring a signal value of a detection signal output by a detection electrode; determining the compensation amount of the detection signal of the Nth frame according to the deviation of the signal value of the detection signal of the M frames before the detection signal of the Nth frame relative to a reference value, wherein N is a positive integer, and M is a positive integer smaller than N; and calibrating the signal value of the detection signal of the Nth frame according to the compensation amount to obtain the calibration value of the detection signal of the Nth frame.
In one implementation, when the M-frame detection signals satisfy a predetermined condition, the reference values of the M-frame detection signals are equal; and when the M frame detection signals do not meet the preset condition, the reference value of the (i + 1) th frame detection signal in the M frame detection signals is equal to the calibration value of the ith frame detection signal in the M frame detection signals, and i ranges from 1 to M-1.
In one implementation, the reference value of the 1 st frame detection signal in the M frame detection signals is equal to the signal value of the 1 st frame detection signal.
In one implementation, the predetermined condition includes: and the difference value between the signal value of each frame of detection signal in the M frames of detection signals and the signal value of the detection signal of the previous P frames at intervals is smaller than a first threshold value, wherein P is a positive integer smaller than N.
In one implementation, the compensation amount is an average value of differences between signal values of the M frame detection signals and a reference value.
In one implementation, the calibrating the signal value of the nth frame detection signal according to the compensation amount includes: and calibrating the signal values from the detection signal of the Nth frame to the detection signal of the (N + M-1) th frame according to the compensation amount.
In one implementation, the apparatus further includes a reference electrode, and the acquiring a signal value of a detection signal output by the detection electrode includes: acquiring an original value of the detection signal and an original value of a reference signal output by the reference electrode; and according to the original value of the reference signal, canceling a part caused by environmental change in the original value of the detection signal to obtain a signal value of the detection signal.
In one implementation, the signal value of the nth frame detection signal is a difference between an original value of the nth frame detection signal and a variation of the nth frame reference signal, the variation of the nth frame reference signal is K times a difference between the original value of the nth frame reference signal and the original value of the 1 st frame reference signal, and K is a preset coefficient.
In one implementation, the original value of the nth frame reference signal is obtained by filtering the original value of the P frame reference signal before the nth frame reference signal.
In one implementation, the method further comprises: when the difference value between the calibration value of the detection signal of the Nth frame and the base value thereof is larger than a second threshold value, determining that an event that a conductor approaches or leaves occurs on the detection electrode, wherein the base value is the signal value of the detection signal when no conductor approaches or contacts the detection electrode; and when the difference value between the calibration value of the detection signal of the Nth frame and the base value thereof is smaller than a second threshold value, determining that the event that the conductor approaches or leaves does not occur on the detection electrode.
In a second aspect, there is provided an apparatus for capacitive detection, the apparatus comprising: the signal acquisition unit is used for acquiring a signal value of a detection signal output by the detection electrode; the processing unit is used for determining the compensation amount of the detection signal of the Nth frame according to the deviation of the signal value of the detection signal of the M frames before the detection signal of the Nth frame relative to a reference value, wherein N is a positive integer, and M is a positive integer smaller than N; the processing unit is further configured to calibrate a signal value of the nth frame detection signal according to the compensation amount, so as to obtain a calibration value of the nth frame detection signal.
In one implementation, when the M-frame detection signals satisfy a predetermined condition, the reference values of the M-frame detection signals are equal; and when the M frame detection signals do not meet the preset condition, the reference value of the (i + 1) th frame detection signal in the M frame detection signals is equal to the calibration value of the ith frame detection signal in the M frame detection signals, and i ranges from 1 to M-1.
In one implementation, the reference value of the 1 st frame detection signal in the M frame detection signals is equal to the signal value of the 1 st frame detection signal.
In one implementation, the predetermined condition includes: and the difference value between the signal value of each frame of detection signal in the M frames of detection signals and the signal value of the detection signal of the previous P frames at intervals is smaller than a first threshold value, wherein P is a positive integer smaller than N.
In one implementation, the compensation amount is an average value of differences between signal values of the M frame detection signals and a reference value.
In one implementation, the processing unit is specifically configured to: and calibrating the signal values from the detection signal of the Nth frame to the detection signal of the (N + M-1) th frame according to the compensation amount.
In one implementation, the signal acquisition unit is specifically configured to: acquiring an original value of the detection signal and an original value of a reference signal output by a reference electrode; the processing unit is further configured to cancel a portion of the original value of the detection signal caused by the environmental change according to the original value of the reference signal, so as to obtain a signal value of the detection signal.
In one implementation, the signal value of the nth frame detection signal is a difference between an original value of the nth frame detection signal and a variation of the nth frame reference signal, the variation of the nth frame reference signal is K times a difference between the original value of the nth frame reference signal and the 1 st frame reference signal, and K is a preset coefficient.
In one implementation, the original value of the nth frame reference signal is obtained by filtering the original value of the P previous frame reference signal.
In one implementation, the processing unit is further configured to: when the difference value between the calibration value of the detection signal of the Nth frame and the base value thereof is larger than a second threshold value, determining that an event that a conductor approaches or leaves occurs on the detection electrode, wherein the base value is the signal value of the detection signal when no conductor approaches or contacts the detection electrode; and when the difference value between the calibration value of the detection signal of the Nth frame and the base value thereof is smaller than a second threshold value, determining that the event that the conductor approaches or leaves does not occur on the detection electrode.
In a third aspect, a chip for capacitance detection is provided, where the chip includes a processor and a memory, where the memory is configured to store instructions, and the processor is configured to execute the instructions to implement the method for capacitance detection in the first aspect or any implementation manner of the first aspect.
In a fourth aspect, an electronic device is provided, where the electronic device includes the apparatus for capacitance detection described in the second aspect or any implementation manner of the second aspect, or includes the chip for capacitance detection described in the third aspect.
Based on the technical scheme, the compensation amount of the detection signal of the Nth frame is determined through the deviation of the signal value of the detection signal of the M frames before the current detection signal of the Nth frame relative to the reference value, so that the signal value of the detection signal of the Nth frame is calibrated. The method is equivalent to calibrating the signal value of each frame of detection signal towards the direction of the reference value, so that the fluctuation of the detection signal is reduced, the signal value is smoother, and the misjudgment in the capacitance detection process is effectively avoided.
Drawings
Fig. 1 is a schematic configuration diagram of a capacitance detection device according to an embodiment of the present application.
Fig. 2 is a schematic diagram of the change law of the detection signal and the reference signal.
Fig. 3 is a schematic flow chart of a method of capacitance detection according to an embodiment of the present application.
FIG. 4 is a diagram showing the variation of the signal value of the detection signal and its P-point difference variation with the number of detection frames when an event occurs and the temperature changes.
Fig. 5 is a diagram showing the signal value of the detection signal and the P-point difference variation thereof with the number of detection frames when no event occurs and the temperature changes.
Fig. 6 is a diagram illustrating signal values of a detection signal and a reference signal according to an embodiment of the present application as a function of the number of detection frames.
Fig. 7 is a schematic diagram of signal values and calibration values of the detection signal.
Fig. 8 is a schematic block diagram of an apparatus for capacitance detection according to an embodiment of the present application.
Detailed Description
The technical solution in the present application will be described below with reference to the accompanying drawings.
Fig. 1 is a schematic structural diagram showing a capacitance detection device according to an embodiment of the present application. As shown in fig. 1, the apparatus 200 for capacitance detection includes a detection electrode 210, an Analog Front End (AFE) circuit 220 connected to the detection electrode 210, and a processing unit 230, wherein the AFE circuit 220 includes an Amplifier (AMP) 221 and an Analog-to-Digital Converter (ADC) 222. A capacitance Cs is formed between the detection electrode 210 and ground. When a conductor approaches or leaves the detection electrode 210, the capacitance Cs changes, the AMP 221 converts the capacitance signal into a voltage signal, and the ADC 222 performs analog-to-digital conversion on the voltage signal and sends the voltage signal to the processing unit 230 for corresponding data processing. Thus, whether an event that a conductor approaches or leaves can be judged according to the change of the capacitance Cs, so that corresponding operation can be performed, for example, when the device 200 is applied to an earphone, wearing and falling of the earphone can be conveniently detected; for another example, when the apparatus 200 is applied to a mobile phone, it can be determined whether a human body approaches in a Specific Absorption Rate (SAR) detection scenario of the mobile phone, so as to adjust the antenna transmission power.
Optionally, the apparatus 200 may further include a reference electrode 240, and an AFE circuit 250 connected to the reference electrode 240, wherein the AFE circuit 250 includes an AMP 251 and an ADC 252. A capacitance Cr is formed between the reference electrode 240 and ground. The capacitance Cr is only used to reflect the influence of the environmental change on the capacitance detection, and since the detection electrode 210 and the reference electrode 240 are in the same environment and are affected by the same environment, the reference signal generated on the reference electrode 240 can be used to cancel the part of the detection signal generated on the detection electrode 210 caused by the environmental change.
Since the temperature change in the general environment has the largest influence on the detection result, the following describes the process of capacitance detection by taking the influence of temperature as an example.
For example, as shown in fig. 2, when the detecting electrode 210 and the reference electrode 240 can be completely matched, the reference signal can completely reflect the temperature influence in the detecting signal, and the difference between the detecting signal and the reference signal can eliminate the temperature-influenced portion in the detecting signal, so as to obtain:
RawDataNew=RawData-RefData (1);
where RawData is the original value of the detection signal, for example, the signal value output by the AFE circuit 220 connected to the detection electrode 210; refData is the original value of the reference signal, for example, the signal value output by the AFE circuit 250 connected to the reference electrode 240; rawDataNew obtained after eliminating a portion of the original value of the detection signal caused by a temperature change using the reference signal is referred to as a signal value of the detection signal. Based on the signal value of the detection signal, it can be determined whether the conductor is currently close.
Due to the structural design, the capacitance of the detection electrode 210 and the reference electrode 240 are deviated, and the like, the detection electrode 210 and the reference electrode 240 cannot be completely matched, and for this reason, the influence of the mismatch between the detection electrode 210 and the reference electrode 240 on the detection result can be reduced by the coefficient K. In this case, the signal value of the detection signal may be, for example:
RawDataNew(N)=RawData(N)-K*[RefData(N)-RefData(1)] (2);
where N is the number of detected frames, refData (1) is the original value of the reference signal of the 1 st frame, for example, the initial value of the reference signal when the device 200 is powered on, refData (N) is the original value of the reference signal of the nth frame, rawData (N) is the original value of the detection signal of the nth frame, and RawDataNew (N) is the signal value of the detection signal of the nth frame after the temperature influence is eliminated by the reference signal.
Alternatively, the test may be performed in a maximum temperature difference environment, and the variation amount of the original value of the detection signal and the variation amount of the original value of the reference signal are obtained, such that K is equal to a ratio between the variation amount of the original value of the detection signal and the variation amount of the original value of the reference signal. For example, in a scenario where the temperature rapidly rises and the temperature rapidly falls, a test is performed respectively to obtain two K values, and a corresponding K value when the difference between the detection signal variation and the reference signal variation is larger is selected as a subsequently used K value, that is, the larger of the two K values is selected when the K value is larger than 1, and the smaller of the two K values is selected when the K value is smaller than 1.
In formula (2), refData (N) -RefData (1) reflects the signal variation caused by the temperature difference between the N-th frame reference signal and the 1 st frame reference signal, and since the law of the temperature variation of the detection signal and the reference signal is consistent, theoretically, the signal variation caused by the temperature variation in the detection signal should be equal to RefData (N) -RefData (1), but actually, considering that the detection electrode 210 and the reference electrode 240 cannot be completely matched, the RefData (N) -RefData (1) is adjusted by using the coefficient K, and then the original value of the detection signal is different from the adjusted signal variation, thereby roughly eliminating the temperature influence on the detection signal.
If the matching between the detection electrode 210 and the reference electrode 240 is poor, the coefficient K cannot effectively eliminate the influence of the mismatch between the detection electrode 210 and the reference electrode 240 on the detection result in a scene with a drastic temperature change, such as a scene of a cyclic temperature rise and fall test, a scene of sudden change of temperature difference between the inside and the outside, and a scene of a large temperature change of the power amplification device in a mobile phone application. For example, if K is set to be small, it may be misjudged that an event with a conductor close to it occurs due to noise; k if set larger, it may be determined that the conductor is far away when an event occurs in which there is a conductor present close. Such misjudgment may bring about a great influence In a specific application, for example, an In Ear Detection function (IED) of the headset may misjudge as wearing or dropping, and misjudgment In an SAR Detection scene of a mobile phone may cause misadjustment of antenna transmission power, thereby affecting the whole function.
Therefore, the embodiment of the application provides a capacitance detection scheme, and aims to solve the problem of how to eliminate the influence of the environment on capacitance detection so as to improve the accuracy of capacitance detection. The compensation amount is calculated in real time by using the change trend of the detection signal, so that the detection signal is calibrated, and the accuracy of capacitance detection is effectively improved.
The apparatus 200 shown in fig. 1 is an example of self-capacitance detection, and the capacitance detection scheme according to the embodiment of the present application may be applied to various scenarios and applications based on capacitance detection, such as self-capacitance detection and mutual capacitance detection.
Fig. 3 shows a method 100 for capacitance detection according to an embodiment of the present application, where the method 100 may be performed by the apparatus 200 for capacitance detection shown in fig. 1, the apparatus 200 includes a detection electrode 210, and the method 100 is used for detecting whether an event that a conductor approaches or leaves the detection electrode 210 occurs. As shown in fig. 3, the method 100 includes some or all of the following steps.
In step 110, a signal value of the detection signal output from the detection electrode 210 is acquired.
In step 120, a compensation amount of the nth frame detection signal is determined according to a deviation of a signal value of an M frame detection signal before the nth frame detection signal with respect to a reference value, where N is a positive integer and M is a positive integer less than N.
In step 130, the signal value of the nth frame detection signal is calibrated according to the compensation amount, so as to obtain a calibration value of the nth frame detection signal.
It can be seen that, the compensation amount of the nth frame detection signal is determined by the deviation of the signal value of the M frame detection signal before the current nth frame detection signal with respect to the reference value, so as to calibrate the signal value of the nth frame detection signal. This is equivalent to calibrating the signal value of each frame of detection signal towards the direction of the reference value, reduces the fluctuation of the detection signal, makes the signal value thereof smoother, and effectively avoids the misjudgment in the capacitance detection process.
Further, optionally, the method 100 further comprises: determining that an event of approaching or departing of a conductor occurs on the detection electrode 210 when a difference between the calibration value of the nth frame detection signal and the base value thereof is greater than a second threshold value TH 2; when the difference between the calibration value of the nth frame detection signal and the base value thereof is less than the second threshold value TH2, it is determined that no event of approaching or departing of a conductor occurs on the detection electrode 210. Here, the base value (base value) is a signal value of a detection signal output from the detection electrode 210 when no conductor is close to or in contact with the detection electrode 210. Alternatively, the base value is a signal value of the detection signal after the conductor is away from the detection electrode 210.
It is to be understood that, before the capacitance detection is performed, a signal value of the detection signal output from the detection electrode 210 when no conductor is close to or in contact with the detection electrode 210 may be acquired in advance as the base value. Therefore, when capacitance is detected subsequently, whether an event that the conductor approaches or leaves can be determined according to the magnitude relationship between the calibration value of the detection signal and the difference between the reference value and the second threshold TH 2.
The compensation amount of the N-th frame detection signal is determined by a deviation of a signal value of the M-frame detection signal before the N-th frame detection signal from a reference value, for example, in one implementation, the compensation amount is an average value of differences between the signal value of each frame detection signal in the M-frame detection signal and the reference value. That is to say that the first and second electrodes,
Figure BDA0003991917380000071
wherein, delta s And (N) is the compensation quantity of the detection signal of the Nth frame, tempBase (N-i) is the reference value of the detection signal of the Nth-i frame, rawDataNew (N-i) is the signal value of the detection signal of the Nth-i frame, and M is a preset positive integer smaller than N.
In obtaining delta s After (N), can be based on δ s (N) calibrating a signal value RawDataNew (N) of the detection signal of the Nth frame, and obtaining a calibration value of the detection signal of the Nth frame as follows:
Raw(N)=RawDataNew(N)-δ s (N) (4);
where Raw (N) is the calibration value of the Nth frame detection signal, rawDataNew (N) is the signal value of the Nth frame detection signal, and δ s (N) is the compensation amount of the detection signal of the Nth frame.
Optionally, in step 130, calibrating the signal value of the nth frame detection signal according to the compensation amount includes: and calibrating the signal values of the detection signals of the Nth frame to the detection signals of the (N + M-1) th frame according to the compensation amount. That is, the compensation amount may be updated every M frames, that is, an average of the amounts of change of the detection signals of the previous M frames is taken as the compensation amount of the detection signal of the next M frames.
Hereinafter, this compensation method is also referred to as minimum deviation compensation.
The reference value TempBase described above follows only a change in signal value caused by an event in which a conductor approaches or moves away from the detection electrode 210, and does not follow a change in signal value caused by a temperature. That is, in the process of capacitance detection, if a change in the detected signal value is likely to be caused by an event of the conductor approaching or separating, the reference value follows the change with the number of detection frames; the reference value remains unchanged if the change in the detected signal value is likely to be caused only by a change in temperature.
In the embodiment of the application, whether the change of the current signal value is caused by an event that the conductor is close to or far away from or caused by the temperature change can be judged by setting a preset condition. For example, when the M-frame detection signals satisfy a predetermined condition, the reference values of the M-frame detection signals are equal; and when the M frame detection signals do not meet the preset condition, the reference value of the (i + 1) th frame detection signal in the M frame detection signals is equal to the calibration value of the ith frame detection signal in the M frame detection signals, and i ranges from 1 to M-1. The reference value of the 1 st frame detection signal in the M frame detection signals may be, for example, equal to the signal value of the 1 st frame detection signal, and the compensation amount of the 1 st frame detection signal is default to 0, so that the calibration value of the 1 st frame detection signal is also the signal value thereof.
The change of the signal value of the detection signal caused by the temperature change is generally slow and smooth, and the signal value of the detection signal is characterized by a step change when an event that the conductor is close to or far away from occurs, so that whether the current change of the signal value is caused by the event occurrence or the temperature change can be preliminarily identified in a differential mode.
For example, the predetermined condition may be that a difference between a signal value of each frame detection signal and a detection signal of an interval P frame before the nth frame detection signal is smaller than a first threshold TH1, where P is a positive integer smaller than N. In the embodiment of the application, the values of P and M can be independently selected; alternatively, P.gtoreq.M may also be selected, preferably.
Taking the ith frame detection signal in the M frame detection signals as an example, i varies from 1 to M, and the variation of the ith frame detection signal with respect to the signal value of the ith-P frame detection signal is:
DiffChange(i)=|RawDataNew(i)-RawDataNew(i-P)| (5);
here, rawDataNew (i) is a signal value of the i-th frame detection signal, and RawDataNew (i-P) is a signal value of the i-P-th frame detection signal. DiffChange (i) is a change amount of the i-th frame detection signal with respect to the signal value of the i-P-th frame detection signal, and is hereinafter also referred to as a P-point difference change amount.
The choice of the value of P is generally related to the rate of change of the ambient temperature. Considering the influence of noise in the environment and the slow occurrence of the event that the conductor approaches or leaves the detection electrode, setting P > 1 can effectively eliminate the influence of partial noise, and the differential variation can still be accurately acquired under the condition that the conductor approaches or leaves the detection electrode slowly. Hereinafter, the following description will be specifically made with reference to fig. 4 and 5.
Fig. 4 (a) shows a change in signal value of a detection signal with the number of detection frames in the case where an event of approaching or departing of a conductor occurs and the temperature changes; fig. 4 (b) shows the DiffChange with the number of detected frames when P =1 in this case; fig. 4 (c) shows the DiffChange with the number of detected frames when P =5 in this case. The smaller P, the more significantly DiffChange is affected by noise, for example, as shown by the dashed boxes in (b) and (c) of fig. 4, the larger the value of DiffChange is at P =5 shown in (c), and the smaller jitter, i.e., the smaller the numerical fluctuation of the ordinate, indicates that DiffChange is less affected by noise; while the DiffChange value shown in (b) is smaller for P =1 and the jitter is more pronounced, i.e. the numerical value of the ordinate fluctuates more, indicating that DiffChange is more affected by noise.
Fig. 5 (a) shows a change in signal value of a detection signal with the number of detection frames in the case where no event of approaching or separating of conductors occurs and temperature changes; fig. 5 (b) shows the DiffChange with the number of detected frames when P =1 in this case; fig. 5 (c) shows the DiffChange with the number of detected frames when P =5 in this case. As P is smaller, diffChange is more significantly affected by noise, and the effect of temperature on the detection signal in fig. 5 (a) causes the signal value to drop at point a, and DiffChange in the dotted frame in fig. 5 (c) can reflect this change, while DiffChange in the dotted frame in fig. 5 (b) cannot reflect this change well.
According to equation (5), if DiffChange (i) is greater than or equal to the first threshold TH1, it indicates that a change in the current signal value may be caused by an event in which the conductor is close to or far away from; if DiffChange (i) is less than the first threshold TH1, it indicates that a change in the current signal value may be caused only by a temperature change.
Then, when DiffChange (i) ≧ TH1, the reference value varies with the number of detected frames, and the reference value of the 1 st frame detected signal in the M frame detected signals may be the signal value of the 1 st frame detected signal when δ is defaulted s (i) =0, so the calibration value of the 1 st frame detection signal is the signal value thereof, and from the 2 nd frame detection signal, the reference value of each frame detection signal changes with the calibration value of the previous frame detection signal; when DiffChange (i) < TH1, the reference value of the M frame detection signals is kept unchanged, and the reference value of each frame detection signal in the M frame detection signals is equal to the reference value of the previous frame detection signal.
After obtaining the reference value of the detection signal of the M frames, the compensation amount δ of the detection signal of the N-th frame can be calculated based on the above formula (3) and formula (4) s (N) according to δ s And (N) calibrating the signal value of the detection signal of the Nth frame to obtain the calibration value of the detection signal of the Nth frame.
The method 100 for capacitive detection according to the embodiment of the present application can be applied to a scenario without the reference electrode 240, and can also be applied to a scenario with the reference electrode 240. In a scenario without the reference electrode 240, the signal value of the detection signal is an original value of the detection signal, for example, rawDataNew (N) = RawData (N); in a scenario with the reference electrode 240, the reference signal output by the reference electrode 240 is used to cancel a portion of the detection signal caused by environmental changes, and the signal value of the detection signal is obtained by using the reference signal to eliminate a portion of the original value of the detection signal affected by temperature, for example, rawDataNew (N) = RawData (N) -K [ RefData (N) -RefData (1) ].
For a scenario with the reference electrode 240, in one implementation, in step 110, acquiring a signal value of the detection signal output by the detection electrode 210 includes: acquiring an original value of the detection signal and an original value of the reference signal; and according to the original value of the reference signal, canceling a part of the original value of the detection signal caused by the environmental change to obtain the signal value of the detection signal.
For example, referring to the foregoing formula (2), the signal value of the nth frame detection signal is a difference between an original value of the nth frame detection signal and a variation of the nth frame reference signal, the variation of the nth frame reference signal is K times the difference between the original value of the nth frame reference signal and the 1 st frame reference signal, and K is a preset coefficient.
To eliminate noise, in one implementation, the original value of the nth frame reference signal is filtered from the original value of the P frame reference signal prior to the nth frame reference signal. For example, the original value of the P frame reference signal before the nth frame reference signal may be filtered, and the obtained original value of the nth frame reference signal is:
RefDataNew(N)=filter[RefData(N-1),…,RefData(N-P)] (6);
RefDataNew (N) is the original value of the N frame reference signal after filtering, and RefData (N-1) to RefData (N-P) are the original values of the P frame reference signal before the N frame reference signal.
Replacing RefData (N) in equation (2) with RefDataNew (N) can result in:
RawDataNew(N)=RawData(n)-K*[RefDataNew(N)-RefData(1)] (7);
RefData (1) is an initial value of a reference signal during power-on, refDataNew (N) is an original value of a filtered Nth frame reference signal, rawData (N) is an original value of an Nth frame detection signal, and RawDataNew (N) is a signal value of the Nth frame detection signal after temperature influence is eliminated by the reference signal.
According to the formula (6) and the formula (7), the variation of the reference signal can be converted into the detection signal, thereby eliminating the influence of the temperature on the detection signal. However, due to the foregoing matching, the coefficient K is not 1, but is set based on the difference between the detection electrode 210 and the reference electrode 240, but the coefficient K cannot completely eliminate the influence of the environment on the detection signal, and can only reduce the temperature drift of the detection signal to a certain extent. That is, only the detection signal can be preliminarily compensated using the reference signal.
In the embodiment of the present application, after the initial compensation, the minimum deviation compensation is performed on the detection signal in real time, that is, the compensation amount of the nth frame detection signal is determined according to the deviation of the signal value of the M frames of detection signals before the current nth frame detection signal with respect to the reference value, so as to calibrate the signal value of the nth frame detection signal. After the preliminary compensation and the minimum deviation compensation, the influence of the environment on the detection signal can be basically and completely eliminated.
The signal values of the detection signal and the reference signal vary with the number of detection frames as shown in fig. 6, where a curve D represents the original value of the reference signal, a curve E represents the original value of the detection signal, a curve F represents the reference value of the detection signal, and a curve Q represents the signal value of the detection signal after the preliminary compensation. Before the position B, the temperature influence degree of the detection electrode 210 and the reference electrode 240 is the same, so the curve Q is horizontal, and after the position B, the temperature influence degree of the detection electrode 210 and the reference electrode 240 is different, so the curve Q also fluctuates, i.e. the influence of the environment on the detection signal cannot be completely eliminated after the initial compensation. However, when the method 100 of the embodiment of the present application is adopted, the curve Q may be pulled to coincide with the curve F, that is, after the initial compensation and the minimum deviation compensation, the influence of the environment on the detection signal can be basically and completely eliminated. That is, after the initial compensation is performed by using the reference signal, the curve E is pulled to the position of the curve Q; and then, the variation of the detection signals of the previous M frames is used for calculating compensation quantity to carry out minimum deviation compensation, so that the curve Q can be pulled to the position of the curve F.
As shown in fig. 7, in the actual test, if the minimum deviation compensation is not performed, the signal value of the detection signal is a curve E, and after the minimum deviation compensation is performed, the signal value of the detection signal is a calibration value shown by a curve Q, and a curve F is a reference value of the detection signal, and it can be seen that the curve Q and the curve F substantially overlap each other. It can be seen that the method 100 can effectively reduce the influence of environmental changes on the detection signal, so that the signal value of the calibrated detection signal tends to be stable and does not fluctuate under the influence of temperature.
In the embodiment of the application, after the detection signal of the current frame is preliminarily compensated by using the reference signal, whether the change of the current signal value is caused by an event or a temperature is judged according to the P point difference change amount, and a proper reference value is selected based on the P point difference change amount, so that the signal value of the detection signal of the current frame is calibrated according to the change amount between the signal value and the reference value of the previous M frame detection signal, the environmental change is more accurately eliminated, the effective signal is reserved, the influence of the environmental change on the detection signal is optimized, and the accuracy of capacitance detection is effectively improved.
Fig. 8 shows a schematic block diagram of an apparatus for capacitive detection of an embodiment of the present application. As shown in fig. 8, the apparatus 200 for capacitance detection includes a signal acquisition unit 201 and a processing unit 230. The signal acquisition unit 201 may include, for example, an AFE circuit 220 and an AFE circuit 250 shown in fig. 1, and the apparatus 200 may further include a detection electrode 210 connected to the signal acquisition unit 201, and further may further include a reference electrode 240 connected to the signal acquisition unit 201.
The signal acquisition unit 201 is used for acquiring a signal value of the detection signal output by the detection electrode 210.
The processing unit 230 is configured to determine a compensation amount of the nth frame detection signal according to a deviation of a signal value of an M frame detection signal before the nth frame detection signal with respect to a reference value, where N is a positive integer and M is a positive integer smaller than N; the processing unit 230 is further configured to calibrate the signal value of the nth frame detection signal according to the compensation amount, so as to obtain the calibration value of the nth frame detection signal.
In one implementation, when the M-frame detection signals satisfy a predetermined condition, the reference values of the M-frame detection signals are equal; and when the M frame detection signals do not meet the preset condition, the reference value of the (i + 1) th frame detection signal in the M frame detection signals is equal to the calibration value of the ith frame detection signal in the M frame detection signals, and i ranges from 1 to M-1.
In one implementation, the reference value of the 1 st frame detection signal in the M frame detection signals is equal to the signal value of the 1 st frame detection signal.
In one implementation, the predetermined condition includes: the difference value between the signal value of each frame detection signal in the M frames detection signals and the signal value of the detection signal of the previous P frames at intervals is smaller than a first threshold value, wherein P is a positive integer smaller than N.
In one implementation, the compensation amount is an average value of differences between signal values of the M frame detection signals and a reference value.
In one implementation, the processing unit 230 is specifically configured to: and calibrating the signal values of the detection signals of the Nth frame to the detection signals of the (N + M-1) th frame according to the compensation amount.
In one implementation, the signal acquisition unit 201 is specifically configured to: acquiring an original value of the detection signal and an original value of the reference signal output by the reference electrode 240; the processing unit 230 is further configured to cancel a portion of the original value of the detection signal caused by the environmental change according to the original value of the reference signal, so as to obtain a signal value of the detection signal.
In one implementation, the signal value of the nth frame detection signal is a difference between an original value of the nth frame detection signal and a variation of the nth frame reference signal, the variation of the nth frame reference signal is K times a difference between the original value of the nth frame reference signal and the original value of the 1 st frame reference signal, and K is a preset coefficient.
In one implementation, the original value of the nth frame reference signal is obtained by filtering the original value of the P frame reference signal before the nth frame reference signal.
In one implementation, the processing unit 230 is further configured to: when the difference between the calibration value of the nth frame detection signal and the base value thereof is greater than the second threshold value, determining that an event of approaching or departing of a conductor occurs on the detection electrode 210; when the difference between the calibration value of the nth frame detection signal and the base value thereof, which is the signal value of the detection signal when no conductor approaches or contacts the detection electrode 210, is less than the second threshold value, it is determined that no conductor approaching or leaving event has occurred on the detection electrode 210.
It should be understood that specific details of the capacitive detection performed by the apparatus 200 can be found in the description of the method 100, and are not repeated herein for brevity.
The present application further provides a chip for capacitance detection, where the chip includes a processor and a memory, where the memory is used to store instructions, and the processor is used to execute the instructions to implement the method for capacitance detection described in any of the above embodiments.
The present application further provides an electronic device, which includes the apparatus for capacitance detection described in any of the above embodiments, or includes the chip for capacitance detection described in any of the above embodiments.
By way of example and not limitation, the electronic device in the embodiments of the present application may be a portable or mobile computing device such as a terminal device, a mobile phone, a tablet computer, a notebook computer, a desktop computer, a game device, an in-vehicle electronic device, or a wearable smart device, and other electronic devices such as an electronic database, an automobile, and an Automated Teller Machine (ATM). This wearable smart machine includes that the function is complete, the size is big, can not rely on the smart mobile phone to realize complete or partial functional equipment, for example smart watch or smart glasses etc to and include only be concentrated on a certain kind of application function and need with other equipment like the equipment that the smart mobile phone cooperation was used, for example all kinds of intelligent bracelet, intelligent ornament etc. that carry out the physical sign monitoring.
It should be noted that, without conflict, the embodiments and/or technical features in the embodiments described in the present application may be arbitrarily combined with each other, and the technical solutions obtained after the combination also fall within the protection scope of the present application.
The system, apparatus and method disclosed in the embodiments of the present application can be implemented in other ways. For example, some features of the method embodiments described above may be omitted or not performed. The above-described device embodiments are merely illustrative, the division of the unit is only one logical functional division, and there may be other divisions when the actual implementation is performed, and a plurality of units or components may be combined or may be integrated into another system. In addition, the coupling between the units or the coupling between the components may be direct coupling or indirect coupling, and the coupling includes electrical, mechanical, or other forms of connection.
It can be clearly understood by those skilled in the art that, for convenience and simplicity of description, the specific working process and the generated technical effect of the apparatus and the device described above may refer to the corresponding process and technical effect in the foregoing method embodiments, and are not described herein again.
It should be understood that the specific examples in the embodiments of the present application are for the purpose of promoting a better understanding of the embodiments of the present application, and are not intended to limit the scope of the embodiments of the present application, and that various modifications and variations can be made by those skilled in the art based on the above embodiments and fall within the scope of the present application.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (20)

1. A method of capacitive sensing applied to a device for capacitive sensing, the device including a sensing electrode for sensing the approach or departure of a conductor, the method comprising:
acquiring a signal value of a detection signal output by the detection electrode;
determining the compensation amount of the detection signal of the Nth frame according to the deviation of the signal value of the detection signal of the M frames before the detection signal of the Nth frame relative to a reference value, wherein N is a positive integer, and M is a positive integer smaller than N;
and calibrating the signal value of the detection signal of the Nth frame according to the compensation amount to obtain the calibration value of the detection signal of the Nth frame.
2. The method of claim 1,
when the M frame detection signals meet the preset condition, the reference values of the M frame detection signals are equal;
and when the M frame detection signals do not meet the preset condition, the reference value of the (i + 1) th frame detection signal in the M frame detection signals is equal to the calibration value of the ith frame detection signal in the M frame detection signals, and i ranges from 1 to M-1.
3. The method according to claim 2, wherein the reference value of the 1 st frame detection signal of the M frame detection signals is equal to the signal value of the 1 st frame detection signal.
4. A method according to claim 2 or 3, characterized in that the predetermined conditions comprise:
and the difference value between the signal value of each frame of detection signal in the M frames of detection signals and the signal value of the detection signal of the previous P frames at intervals is smaller than a first threshold value, wherein P is a positive integer smaller than N.
5. The method according to any one of claims 1 to 4, wherein the compensation amount is an average value of differences between signal values of the respective frame detection signals and a reference value in the M frame detection signals.
6. The method according to any one of claims 1 to 5, wherein the calibrating the signal value of the detection signal of the Nth frame according to the compensation amount comprises:
and calibrating the signal values from the detection signal of the Nth frame to the detection signal of the (N + M-1) th frame according to the compensation amount.
7. The method of any one of claims 1 to 6, wherein the apparatus further comprises a reference electrode, and the acquiring signal values of the detection signals output by the detection electrodes comprises:
acquiring an original value of the detection signal and an original value of a reference signal output by the reference electrode;
and according to the original value of the reference signal, canceling a part caused by environmental change in the original value of the detection signal to obtain a signal value of the detection signal.
8. The method of claim 7, wherein the signal value of the nth frame detection signal is a difference between an original value of the nth frame detection signal and a variation of the nth frame reference signal, the variation of the nth frame reference signal is K times the difference between the original value of the nth frame reference signal and the original value of the 1 st frame reference signal, and K is a preset coefficient.
9. The method of claim 8, wherein the original value of the N frame reference signal is obtained after filtering the original value of the P frame reference signal before the N frame reference signal.
10. The method according to any one of claims 1 to 9, further comprising:
when the difference value between the calibration value of the detection signal of the Nth frame and the base value thereof is larger than a second threshold value, determining that an event that a conductor approaches or leaves occurs on the detection electrode, wherein the base value is the signal value of the detection signal when no conductor approaches or contacts the detection electrode;
and when the difference value between the calibration value of the detection signal of the Nth frame and the basic value thereof is smaller than the second threshold value, determining that the approaching or departing event of the conductor does not occur on the detection electrode.
11. An apparatus for capacitive sensing, the apparatus comprising:
the signal acquisition unit is used for acquiring a signal value of a detection signal output by the detection electrode;
the processing unit is used for determining the compensation amount of the detection signal of the Nth frame according to the deviation of the signal value of the detection signal of the M frames before the detection signal of the Nth frame relative to a reference value, wherein N is a positive integer, and M is a positive integer smaller than N;
the processing unit is further configured to calibrate a signal value of the nth frame detection signal according to the compensation amount, so as to obtain a calibration value of the nth frame detection signal.
12. The apparatus of claim 11,
when the M frame detection signals meet the preset condition, the reference values of the M frame detection signals are equal;
and when the M frame detection signals do not meet the preset condition, the reference value of the (i + 1) th frame detection signal in the M frame detection signals is equal to the calibration value of the ith frame detection signal in the M frame detection signals, and i ranges from 1 to M-1.
13. The apparatus of claim 12, wherein the reference value of the 1 st frame detection signal of the M frame detection signals is equal to the signal value of the 1 st frame detection signal.
14. The apparatus according to claim 12 or 13, wherein the predetermined condition comprises:
and the difference value between the signal value of each frame of detection signal in the M frames of detection signals and the signal value of the detection signal of the previous P frames at intervals is smaller than a first threshold value, wherein P is a positive integer smaller than N.
15. The apparatus according to any one of claims 11 to 14, wherein the compensation amount is an average value of differences between signal values of the respective frame detection signals and a reference value in the M frame detection signals.
16. The device according to any one of claims 11 to 15, characterized in that the signal acquisition unit is specifically configured to:
acquiring an original value of the detection signal and an original value of a reference signal output by a reference electrode;
the processing unit is further configured to cancel a portion of the original value of the detection signal caused by the environmental change according to the original value of the reference signal, so as to obtain a signal value of the detection signal.
17. The apparatus of claim 16, wherein the signal value of the nth frame detection signal is a difference between an original value of the nth frame detection signal and a variation of an nth frame reference signal, the variation of the nth frame reference signal is K times a difference between the original value of the nth frame reference signal and a 1 st frame reference signal, and K is a preset coefficient.
18. The apparatus according to any one of claims 11 to 17, wherein the processing unit is further configured to:
when the difference value between the calibration value of the detection signal of the Nth frame and the base value thereof is larger than a second threshold value, determining that an event that a conductor approaches or leaves occurs on the detection electrode, wherein the base value is the signal value of the detection signal when no conductor approaches or contacts the detection electrode;
and when the difference value between the calibration value of the detection signal of the Nth frame and the base value thereof is smaller than the second threshold value, determining that the event that the conductor approaches or leaves does not occur on the detection electrode.
19. A chip for capacitance detection, the chip comprising a processor and a memory, the memory being configured to store instructions, and the processor being configured to execute the instructions to implement the method for capacitance detection according to any one of claims 1 to 10.
20. An electronic device, characterized in that it comprises a device for capacitive detection according to any one of the preceding claims 11 to 18, or a chip for capacitive detection according to claim 19.
CN202211582518.1A 2022-12-09 2022-12-09 Capacitance detection method and device, chip and electronic equipment Pending CN115951128A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211582518.1A CN115951128A (en) 2022-12-09 2022-12-09 Capacitance detection method and device, chip and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211582518.1A CN115951128A (en) 2022-12-09 2022-12-09 Capacitance detection method and device, chip and electronic equipment

Publications (1)

Publication Number Publication Date
CN115951128A true CN115951128A (en) 2023-04-11

Family

ID=87296041

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211582518.1A Pending CN115951128A (en) 2022-12-09 2022-12-09 Capacitance detection method and device, chip and electronic equipment

Country Status (1)

Country Link
CN (1) CN115951128A (en)

Similar Documents

Publication Publication Date Title
US9495038B2 (en) Detection of a conductive object during an initialization process of a touch-sensing device
US10103541B2 (en) Wearable device and electrostatic discharge protection circuit of the same
SE1351489A1 (en) Fingerprint detection system and method
CN111947691B (en) Grip sensing method and apparatus
US10366266B2 (en) Fingerprint sensing device, electronic device and calibration method for fingerprint sensor
EP4072157B1 (en) Method for determining capacitance reference, apparatus for determining capacitance reference, and device
CN108958565B (en) Coordinate calculation method for multi-point capacitive touch, touch device and mobile terminal
CN114791301A (en) Apparatus and method for detecting change in operating environment of electronic device
US7543503B2 (en) Deformation detection sensor with temperature correction
CN112533102B (en) Method for determining capacitance reference, and device and equipment for determining capacitance reference
CN115951128A (en) Capacitance detection method and device, chip and electronic equipment
US20190204373A1 (en) Electrostatic detecting device
US20230325034A1 (en) Proximity sensor and proximity sensing method
US9692438B2 (en) Signal processing, amplification module, an analog to digital converter module
CN115639410A (en) Capacitance detection method and capacitance detection device
CN110186560B (en) Ultraviolet numerical value correction method and system
US20210285773A1 (en) User context and activity detection device and method
CN115218930A (en) Multi-channel capacitive sensor device
US20210194481A1 (en) Dynamic capacitive sensing
CN115562924B (en) Method for detecting folding angle of folding screen, touch chip and electronic device
CN114554382B (en) In-ear detection method and device, wireless earphone and storage medium
US20230118148A1 (en) Differential capacitive sensing based wear detection
CN110971742A (en) Antenna switching method, device, terminal and computer readable storage medium
EP4270790A1 (en) Capacitive sensor device with drift compensation
US20170255329A1 (en) Touch detection method of a touch detection device for obtaining a calibrated variation for determining whether a touch event has been triggered

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination