Capacitance detection method, apparatus, chip and electronic device
By calibrating the capacitance detection signal value, combining it with a reference signal to offset environmental changes, and using minimum deviation compensation to eliminate the influence of temperature, the problem of misjudgment in capacitance detection is solved, achieving higher detection accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GOODIX TECH (CHENGDU) CO LTD
- Filing Date
- 2022-12-09
- Publication Date
- 2026-06-12
Smart Images

Figure CN115951128B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of capacitance detection, and more specifically, to a method, apparatus, chip, and electronic device for capacitance detection. Background Technology
[0002] Capacitance detection devices are commonly found in electronic devices such as headphones and mobile phones. They include detection electrodes and related processing circuitry to detect whether a human body is near or away from the electrodes, allowing the electronic device to perform corresponding operations. However, changes in ambient temperature can affect the capacitance detection results, leading to misjudgments of the conductor's proximity to or distance from the detection electrodes. Therefore, eliminating the influence of the environment on capacitance detection to improve its accuracy is a problem that needs to be solved. Summary of the Invention
[0003] This application provides a method, apparatus, chip, and electronic device for capacitance detection, which can eliminate the influence of the environment on capacitance detection and improve the accuracy of capacitance detection.
[0004] In a first aspect, a method for capacitance detection is provided, the method comprising: acquiring the signal value of a detection signal output by a detection electrode; determining a compensation amount for the Nth frame detection signal based on the deviation of the signal values of M previous frames of detection signals relative to a reference value, wherein N is a positive integer and M is a positive integer less than N; calibrating the signal value of the Nth frame detection signal according to the compensation amount to obtain a calibration value for the Nth frame detection signal.
[0005] In one implementation, when the M-frame detection signals meet a predetermined condition, the reference values of the M-frame detection signals are equal; when the M-frame detection signals do not meet the predetermined 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 i-th frame detection signal in the M-frame detection signals, where i ranges from 1 to M-1.
[0006] In one implementation, the reference value of the first frame detection signal in the M-frame detection signal is equal to the signal value of the first frame detection signal.
[0007] In one implementation, the predetermined condition includes: the difference between the signal value of each frame detection signal in the M-frame detection signal and the detection signal of the previous P-frame interval is less than a first threshold, where P is a positive integer less than N.
[0008] In one implementation, the compensation amount is the average of the differences between the signal values of each frame detection signal in the M-frame detection signal and the reference value.
[0009] In one implementation, calibrating the signal value of the Nth frame detection signal according to the compensation amount includes: calibrating the signal values of the Nth frame detection signal to the N+M-1th frame detection signals according to the compensation amount.
[0010] In one implementation, the device further includes a reference electrode, and the step of acquiring the signal value of the detection signal output by the detection electrode includes: acquiring the original value of the detection signal and the original value of the reference signal output by the reference electrode; and, based on the original value of the reference signal, canceling out the portion of the original value of the detection signal caused by environmental changes to obtain the signal value of the detection signal.
[0011] In one implementation, the signal value of the Nth frame detection signal is the difference between the original value of the Nth frame detection signal and the change in the Nth frame reference signal, and the change in 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 1st frame reference signal, where K is a preset coefficient.
[0012] In one implementation, the original value of the Nth frame reference signal is obtained by filtering the original values of the previous P frame reference signals.
[0013] In one implementation, the method further includes: when the difference between the calibration value of the Nth frame detection signal and its base value is greater than a second threshold, determining that an event of a conductor approaching or leaving the detection electrode has occurred, 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 between the calibration value of the Nth frame detection signal and its base value is less than the second threshold, determining that no event of a conductor approaching or leaving the detection electrode has occurred.
[0014] Secondly, a capacitance detection apparatus is provided, the apparatus comprising: a signal acquisition unit for acquiring the signal value of a detection signal output by a detection electrode; a processing unit for determining a compensation amount for the Nth frame detection signal based on the deviation of the signal values of the M frames of detection signals preceding the Nth frame detection signal from a reference value, wherein N is a positive integer and M is a positive integer less than N; the processing unit is further configured to calibrate the signal value of the Nth frame detection signal according to the compensation amount to obtain a calibration value for the Nth frame detection signal.
[0015] In one implementation, when the M-frame detection signals meet a predetermined condition, the reference values of the M-frame detection signals are equal; when the M-frame detection signals do not meet the predetermined 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 i-th frame detection signal in the M-frame detection signals, where i ranges from 1 to M-1.
[0016] In one implementation, the reference value of the first frame detection signal in the M-frame detection signal is equal to the signal value of the first frame detection signal.
[0017] In one implementation, the predetermined condition includes: the difference between the signal value of each frame detection signal in the M-frame detection signal and the detection signal of the previous P-frame interval is less than a first threshold, where P is a positive integer less than N.
[0018] In one implementation, the compensation amount is the average of the differences between the signal values of each frame detection signal in the M-frame detection signal and the reference value.
[0019] In one implementation, the processing unit is specifically used to: calibrate the signal values of the Nth frame detection signal to the N+M-1th frame detection signal according to the compensation amount.
[0020] In one implementation, the signal acquisition unit is specifically used to: acquire the original value of the detection signal and the original value of the reference signal output by the reference electrode; the processing unit is further used to: based on the original value of the reference signal, cancel out the portion of the original value of the detection signal caused by environmental changes, to obtain the signal value of the detection signal.
[0021] In one implementation, the signal value of the Nth frame detection signal is the difference between the original value of the Nth frame detection signal and the change in the Nth frame reference signal, and the change in 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 1st frame reference signal, where K is a preset coefficient.
[0022] In one implementation, the original value of the Nth frame reference signal is obtained by filtering the original values of the previous P frame reference signals.
[0023] In one implementation, the processing unit is further configured to: determine that an event of a conductor approaching or leaving the detection electrode has occurred when the difference between the calibration value of the Nth frame detection signal and its base value is greater than a second threshold, wherein the base value is the signal value of the detection signal when no conductor approaches or contacts the detection electrode; and determine that no event of a conductor approaching or leaving the detection electrode has occurred when the difference between the calibration value of the Nth frame detection signal and its base value is less than the second threshold.
[0024] Thirdly, a capacitance detection chip is provided, the chip including a processor and a memory, the memory for storing instructions, and the processor for executing the instructions to implement the capacitance detection method described in the first aspect or any implementation thereof.
[0025] Fourthly, an electronic device is provided, the electronic device comprising the capacitance detection apparatus described in the second aspect or any implementation thereof, or comprising the capacitance detection chip described in the third aspect.
[0026] Based on the above technical solution, the compensation amount for the Nth frame detection signal is determined by the deviation of the signal values of the M previous frames of detection signals relative to the reference value, thereby calibrating 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 reference value, reducing fluctuations in the detection signal, making its signal value smoother, and effectively avoiding misjudgments during capacitance detection. Attached Figure Description
[0027] Figure 1 This is a schematic structural diagram of a capacitance detection device according to an embodiment of this application.
[0028] Figure 2 It is a schematic diagram showing the changing patterns of the detection signal and the reference signal.
[0029] Figure 3 This is a schematic flowchart of a capacitance detection method according to an embodiment of this application.
[0030] Figure 4 This is a schematic diagram showing the change in the signal value of the detection signal and the change in the differential at point P as a function of the number of detection frames when an event occurs and the temperature changes.
[0031] Figure 5 This is a schematic diagram showing the change in the signal value of the detection signal and the change in the differential at point P as a function of the number of detection frames when no event occurs and the temperature changes.
[0032] Figure 6 This is a schematic diagram illustrating how the signal values of the detection signal and the reference signal change with the number of detection frames in an embodiment of this application.
[0033] Figure 7 This is a schematic diagram of the signal value and calibration value of the detected signal.
[0034] Figure 8 This is a schematic block diagram of a capacitance detection device according to an embodiment of this application. Detailed Implementation
[0035] The technical solutions in this application will now be described with reference to the accompanying drawings.
[0036] Figure 1 A schematic structural diagram of a capacitance detection apparatus according to an embodiment of this application is shown. Figure 1As shown, the capacitance detection device 200 includes a detection electrode 210, an analog front end (AFE) circuit 220 connected to the detection electrode 210, and a processing unit 230. 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 moves away from the detection electrode 210, the capacitance Cs changes. The AMP 221 converts this capacitance signal into a voltage signal, which is then converted from analog to digital by the ADC 222 and sent to the processing unit 230 for corresponding data processing. Thus, the change in capacitance Cs can be used to determine whether a conductor has approached or moved away, thereby performing corresponding operations. For example, when the device 200 is applied to headphones, it can conveniently detect whether headphones are being worn or removed; or, for example, when the device 200 is applied to a mobile phone, in a specific absorption rate (SAR) detection scenario, it can determine whether a human body is approaching and adjust the antenna transmission power accordingly.
[0037] Optionally, the device 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 capacitor Cr is formed between the reference electrode 240 and ground. The capacitor Cr is only used to reflect the effect of environmental changes on capacitance detection. Since the detection electrode 210 and the reference electrode 240 are in the same environment, they are equally affected by the environment. The reference signal generated on the reference electrode 240 can be used to cancel out the portion of the detection signal generated on the detection electrode 210 caused by environmental changes.
[0038] Since temperature changes in the environment usually have the greatest impact on the detection results, the following description of the capacitance detection process will take the influence of temperature as an example.
[0039] For example, such as Figure 2 As shown, when the detection electrode 210 and the reference electrode 240 are perfectly matched, the reference signal can fully reflect the temperature influence in the detection signal. By subtracting the detection signal from the reference signal, the temperature-affected portion of the detection signal can be eliminated, resulting in:
[0040] RawDataNew=RawData-RefData (1);
[0041] Wherein, RawData is the original value of the detection signal, such as the signal value output by the AFE circuit 220 connected to the detection electrode 210; RefData is the original value of the reference signal, such as the signal value output by the AFE circuit 250 connected to the reference electrode 240; the RawDataNew obtained after eliminating the portion caused by temperature changes in the original value of the detection signal using the reference signal is called the signal value of the detection signal. Based on the signal value of the detection signal, it can be determined whether a conductor is currently nearby.
[0042] Due to structural design differences and inherent capacitance variations between the detection electrode 210 and the reference electrode 240, they cannot be perfectly matched. Therefore, a coefficient K can be used to reduce the impact of this mismatch on the detection results. In this case, the signal value of the detection signal can be, for example,:
[0043] RawDataNew(N)=RawData(N)-K*[RefData(N)-RefData(1)] (2);
[0044] Where N is the number of detection frames, RefData(1) is the original value of the reference signal of the first frame, such as 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 eliminating the temperature effect using the reference signal.
[0045] Optionally, testing can be conducted under conditions of maximum temperature difference to obtain the change in the original value of the detected signal and the change in the original value of the reference signal. Thus, K is equal to the ratio between the change in the original value of the detected signal and the change in the original value of the reference signal. For example, tests can be conducted in scenarios of rapid temperature rise and rapid temperature fall to obtain two K values. The K value corresponding to the greater difference between the change in the detected signal and the change in the reference signal is selected as the K value used subsequently. That is, when the K value is greater than 1, the larger of the two K values is used; when the K value is less than 1, the smaller of the two K values is used.
[0046] In formula (2), RefData(N)-RefData(1) reflects the signal change caused by the different temperatures when acquiring the Nth frame reference signal and the 1st frame reference signal. Since the detection signal and the reference signal change with temperature are consistent, theoretically, the signal change caused by temperature change in the detection signal should also be equal to RefData(N)-RefData(1). However, considering that the detection electrode 210 and the reference electrode 240 cannot be perfectly matched, the coefficient K is used to adjust RefData(N)-RefData(1). Then, the difference between the original value of the detection signal and the adjusted signal change is calculated to roughly eliminate the influence of temperature on the detection signal.
[0047] If the matching between the detection electrode 210 and the reference electrode 240 is poor, then in scenarios with drastic temperature changes, such as cyclic heating and cooling tests, sudden changes in indoor and outdoor temperature differences, or large temperature variations in power amplifier devices in mobile phone applications, the coefficient K cannot effectively eliminate the impact of the mismatch between the detection electrode 210 and the reference electrode 240 on the detection results. For example, if K is set too small, it may be misjudged as an event of a conductor approaching due to noise; if K is set too large, it may be judged as a conductor moving away when an event of a conductor approaching occurs. Such misjudgments can have a significant impact in certain applications. For example, in the in-ear detection (IED) function of headphones, it may be misjudged as being worn or removed; in the SAR detection scenario of mobile phones, misjudgments may cause incorrect adjustments to the antenna transmission power, thus affecting the overall function of the device.
[0048] Therefore, this application provides a capacitance detection scheme aimed at solving the problem of how to eliminate the influence of the environment on capacitance detection to improve its accuracy. By utilizing the changing trend of the detection signal itself to calculate a compensation amount in real time, the detection signal is calibrated, effectively improving the accuracy of capacitance detection.
[0049] Figure 1 The device 200 shown is based on the detection of self-capacitance. The capacitance detection scheme of this application embodiment can be applied to various capacitance detection-based scenarios and applications such as self-capacitance detection and mutual capacitance detection.
[0050] Figure 3 This application illustrates a capacitance detection method 100 according to an embodiment of the present application. Method 100 can be performed by... Figure 1 The capacitance detection device 200 shown is executed, and the device 200 includes a detection electrode 210. Method 100 is used to detect whether an event occurs where a conductor approaches or leaves the detection electrode 210. Figure 3 As shown, method 100 includes some or all of the following steps.
[0051] In step 110, the signal value of the detection signal output by the detection electrode 210 is acquired.
[0052] In step 120, the compensation amount of the Nth frame detection signal is determined based on the deviation of the signal values of the M frames of detection signals preceding the Nth frame detection signal from the reference value, where N is a positive integer and M is a positive integer less than N.
[0053] In step 130, the signal value of the Nth frame detection signal is calibrated according to the compensation amount to obtain the calibration value of the Nth frame detection signal.
[0054] As can be seen, the compensation amount for the Nth frame detection signal is determined by the deviation of the signal values of the M previous frames relative to the reference value, thus calibrating the signal value of the Nth frame detection signal. This is equivalent to calibrating the signal value of each frame detection signal towards the reference value, reducing the fluctuation of the detection signal, making its signal value smoother, and effectively avoiding misjudgment in the capacitance detection process.
[0055] Further, optionally, method 100 further includes: determining that an event of conductor approaching or leaving the detection electrode 210 has occurred when the difference between the calibration value of the detection signal in the Nth frame and its base value is greater than a second threshold TH2; and determining that no event of conductor approaching or leaving the detection electrode 210 has occurred when the difference between the calibration value of the detection signal in the Nth frame and its base value is less than the second threshold TH2. The base value is the signal value of the detection signal output by the detection electrode 210 when no conductor approaches or contacts the detection electrode 210. Alternatively, the base value is the signal value of the detection signal after the conductor moves away from the detection electrode 210.
[0056] It is understandable that before performing capacitance detection, the signal value of the detection signal output by the detection electrode 210 when no conductor approaches or contacts the detection electrode 210 can be obtained in advance as the baseline value. Therefore, during subsequent capacitance detection, the relationship between the difference between the calibration value of the detection signal and the baseline value and the second threshold TH2 can be used to determine whether an event of conductor approaching or leaving has occurred.
[0057] The compensation amount for the Nth frame detection signal is determined by the deviation of the signal values of the preceding M frames of detection signals relative to a reference value. For example, in one implementation, this compensation amount is the average of the differences between the signal values of each frame of detection signal in the M frames and the reference value. That is,
[0058]
[0059] Where, δ s(N) is the compensation amount of the detection signal in the Nth frame, TempBase(Ni) is the reference value of the detection signal in the Nith frame, RawDataNew(Ni) is the signal value of the detection signal in the Nith frame, and M is a preset positive integer less than N.
[0060] In obtaining δ s After (N), we can determine based on δ s (N) The signal value RawDataNew(N) of the Nth frame detection signal is calibrated to obtain the calibration value of the Nth frame detection signal:
[0061] Raw(N) = RawDataNew(N) - δ s (N) (4);
[0062] Where Raw(N) is the calibration value of the detection signal in the Nth frame, RawDataNew(N) is the signal value of the detection signal in the Nth frame, and δ s (N) represents the compensation amount for the detection signal in the Nth frame.
[0063] Optionally, in step 130, the signal value of the detection signal in the Nth frame is calibrated according to the compensation amount, including: calibrating the signal values of the detection signal from the Nth frame to the (N+M-1)th frame according to the compensation amount. That is, the compensation amount can be updated every M frames, i.e., the average of the changes in the detection signals of the previous M frames is used as the compensation amount for the detection signals of the next M frames.
[0064] This compensation method will also be referred to as minimum deviation compensation.
[0065] The aforementioned reference value TempBase only tracks changes in signal value caused by events such as the conductor moving closer to or further away from the detection electrode 210, and does not track changes in signal value caused by temperature. In other words, during capacitance detection, if the change in the detected signal value may be caused by events such as the conductor moving closer to or further away, this reference value changes with the number of detection frames; if the change in the detected signal value may be caused only by temperature changes, this reference value remains unchanged.
[0066] In this embodiment, predetermined conditions can be set to determine whether the change in the current signal value is caused by an event of the conductor moving closer or further away, or by a temperature change. For example, when the M-frame detection signals meet the predetermined conditions, the reference values of the M-frame detection signals are equal; when the M-frame detection signals do not meet the predetermined conditions, 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 i-th frame detection signal in the M-frame detection signals, where i ranges from 1 to M-1. The reference value of the first frame detection signal in the M-frame detection signals can, for example, be equal to the signal value of the first frame detection signal. In this case, the compensation amount of the first frame detection signal is assumed to be 0, so the calibration value of the first frame detection signal is also its signal value.
[0067] The changes in the detection signal value caused by temperature changes are usually slow and steady. However, when an event occurs where the conductor moves closer to or further away from the detection signal, the signal value will show a step change. Therefore, differential methods can be used to initially identify whether the change in the current signal value is caused by an event or by a temperature change.
[0068] For example, the predetermined condition could be that the difference between the signal value of each detection signal in the M frames preceding the Nth frame and the signal value of the detection signal at interval P frames prior to it is less than a first threshold TH1, where P is a positive integer less than N. In the embodiments of this application, the values of P and M can be selected independently; or, preferably, P ≥ M can also be selected.
[0069] Taking the i-th frame detection signal in the M-frame detection signal as an example, where i ranges from 1 to M, the change in signal value of the i-th frame detection signal relative to the iP-th frame detection signal is:
[0070] DiffChange(i)=|RawDataNew(i)-RawDataNew(iP)| (5);
[0071] Where RawDataNew(i) is the signal value of the detection signal in the i-th frame, and RawDataNew(iP) is the signal value of the detection signal in the iP-th frame. DiffChange(i) is the change in the signal value of the detection signal in the i-th frame relative to the detection signal in the iP-th frame, also referred to below as the P-point differential change.
[0072] The choice of the P-value is usually related to the rate of change of ambient temperature. Considering the influence of ambient noise and the relatively slow occurrence of the conductor moving closer to or away from the detection electrode, setting P > 1 can effectively eliminate some of the noise's influence and still accurately obtain the differential change even when the conductor moves closer to or away from the detection electrode relatively slowly. The following, combined with... Figure 4 and Figure 5 Please provide a detailed explanation.
[0073] Figure 4 (a) shows the change in the signal value of the detection signal with the number of detection frames when an event occurs where a conductor approaches or moves away and the temperature changes; Figure 4 (b) shows the change of DiffChange with the number of detected frames when P=1 in this case; Figure 4 (c) shows the change of DiffChange with the number of detected frames when P=5. The smaller P is, the more significantly DiffChange is affected by noise, for example, ... Figure 4 As shown in the dashed boxes in (b) and (c), in (c), when P=5, the value of DiffChange is larger and the jitter is smaller, that is, the value of the vertical axis fluctuates less, indicating that DiffChange is less affected by noise; while in (b), when P=1, the value of DiffChange is smaller and the jitter is more obvious, that is, the value of the vertical axis fluctuates more, indicating that DiffChange is more affected by noise.
[0074] Figure 5 (a) shows the change in the signal value of the detection signal with the number of detection frames in the case where no event of the conductor approaching or moving away occurs and the temperature changes; Figure 5 (b) shows the change of DiffChange with the number of detected frames when P=1 in this case; Figure 5 (c) shows the change of DiffChange with the number of detected frames when P=5. The smaller P is, the more significantly DiffChange is affected by noise. Figure 5 In (a), the effect of temperature on the detection signal causes the signal value to decrease at point A. Figure 5 The DiffChange within the dashed box in (c) also reflects this change, and Figure 5 In (b), the DiffChange within the dashed box does not accurately reflect this change.
[0075] According to formula (5), if DiffChange(i) is greater than or equal to the first threshold TH1, it indicates that the change in the current signal value may be caused by an event of the conductor moving closer or further away; if DiffChange(i) is less than the first threshold TH1, it indicates that the change in the current signal value may be caused only by a temperature change.
[0076] Therefore, when DiffChange(i)≥TH1, this reference value changes with the number of detected frames. The reference value of the first detected signal in the M-frame detection signal can be the signal value of the first detected signal. In this case, the default δ s(i) = 0, so the calibration value of the first frame detection signal is its signal value. From the second frame detection signal onwards, 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 signal remains unchanged. The reference value of each frame detection signal in the M frame detection signal is equal to the reference value of the previous frame detection signal.
[0077] After obtaining the reference value of the M-frame detection signal, the compensation amount δ of the N-frame detection signal can be calculated based on the aforementioned formulas (3) and (4). s (N), according to δ s (N) The signal value of the detection signal of the Nth frame is calibrated to obtain the calibration value of the detection signal of the Nth frame.
[0078] The capacitance detection method 100 of this application embodiment can be applied to scenarios without a reference electrode 240 or with a reference electrode 240. It should be noted that in the scenario without a reference electrode 240, the signal value of the aforementioned detection signal is the original value of the detection signal, for example, RawDataNew(N) = RawData(N); in the scenario with a reference electrode 240, the reference signal output by the reference electrode 240 is used to cancel the part of the detection signal caused by environmental changes, and the signal value of the aforementioned detection signal is obtained by using the reference signal to eliminate the part of the original value of the detection signal affected by temperature, for example, RawDataNew(N) = RawData(N) - K*[RefData(N) - RefData(1)].
[0079] In a scenario with a reference electrode 240, in one implementation, in step 110, obtaining the signal value of the detection signal output by the detection electrode 210 includes: obtaining the original value of the detection signal and the original value of the reference signal; and, based on the original value of the reference signal, canceling out the portion of the original value of the detection signal caused by environmental changes to obtain the signal value of the detection signal.
[0080] For example, referring to the aforementioned formula (2), the signal value of the Nth frame detection signal is the difference between the original value of the Nth frame detection signal and the change of the Nth frame reference signal. The change 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 1st frame reference signal, where K is a preset coefficient.
[0081] To eliminate noise, in one implementation, the original value of the Nth frame reference signal is obtained by filtering the original values of the preceding P frame reference signals. For example, the original values of the P frame reference signals preceding the Nth frame reference signal can be filtered to obtain the original value of the Nth frame reference signal:
[0082] RefDataNew(N)=filter[RefData(N-1),…,RefData(NP)] (6);
[0083] Wherein, RefDataNew(N) is the original value of the Nth frame reference signal after filtering, and RefData(N-1) to RefData(NP) are the original values of the P frame reference signals preceding the Nth frame reference signal, respectively.
[0084] Replacing RefData(N) with RefDataNew(N) in formula (2) yields:
[0085] RawDataNew(N)=RawData(n)-K*[RefDataNew(N)-RefData(1)] (7);
[0086] Where RefData(1) is the initial value of the reference signal when powered on, RefDataNew(N) is the original value of the reference signal in the Nth frame after filtering, RawData(N) is the original value of the detection signal in the Nth frame, and RawDataNew(N) is the signal value of the detection signal in the Nth frame after eliminating the temperature effect using the reference signal.
[0087] According to formulas (6) and (7), the change in the reference signal can be converted into the detection signal, thereby eliminating the influence of temperature on the detection signal. However, due to the aforementioned matching reasons, the coefficient K is not 1, but is set based on the difference between the detection electrode 210 and the reference electrode 240. However, the coefficient K cannot completely eliminate the influence of the environment on the detection signal, but can only reduce the temperature drift of the detection signal to a certain extent. In other words, the reference signal can only be used to perform preliminary compensation for the detection signal.
[0088] In this embodiment, after preliminary compensation, 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 by the deviation of the signal value of the M frames of detection signals preceding the current Nth frame detection signal from the reference value, so as to calibrate the signal value of the Nth frame detection signal. After preliminary compensation and minimum deviation compensation, the influence of the environment on the detection signal can be basically completely eliminated.
[0089] like Figure 6The signal values of the detection signal and reference signal shown change with the number of detection frames. Curve D represents the original value of the reference signal, curve E represents the original value of the detection signal, curve F represents the baseline value of the detection signal, and curve Q represents the signal value of the detection signal after preliminary compensation. Before position B, the detection electrode 210 and the reference electrode 240 are affected by temperature to the same degree, so curve Q is horizontal. After position B, the degree of temperature influence on the detection electrode 210 and the reference electrode 240 differs, so curve Q also fluctuates. That is, the influence of the environment on the detection signal cannot be completely eliminated after preliminary compensation. However, when using the method 100 of this application embodiment, curve Q can be pulled to coincide with curve F. That is, after preliminary compensation and minimum deviation compensation, the influence of the environment on the detection signal can be basically completely eliminated. In other words, after preliminary compensation using the reference signal, curve E is pulled to the position of curve Q; then, by calculating the compensation amount using the change in the detection signal of the previous M frames for minimum deviation compensation, curve Q can be pulled to the position of curve F.
[0090] For example Figure 7 As shown, in actual testing, without minimum deviation compensation, the signal value of the detected signal is curve E. After minimum deviation compensation, the signal value of the detected signal is the calibration value shown by curve Q, and curve F is the reference value of the detected signal. It can be seen that curve Q and curve F basically coincide. Therefore, method 100 can effectively reduce the influence of environmental changes on the detected signal, making the signal value of the calibrated detected signal tend to be stable and unaffected by temperature fluctuations.
[0091] In this embodiment, after preliminary compensation of the detection signal of the current frame using a reference signal, the change in the current signal value is determined based on the differential change at point P to determine whether the change is caused by an event or by temperature. Based on this, a suitable reference value is selected. Thus, the signal value of the detection signal of the current frame is calibrated based on the change between the signal value of the detection signal of the previous M frames and the reference value. This more accurately eliminates environmental changes while retaining the effective signal, optimizes the impact of environmental changes on the detection signal, and effectively improves the accuracy of capacitance detection.
[0092] Figure 8 A schematic block diagram of a capacitance detection apparatus according to an embodiment of this application is shown. Figure 8 As shown, the capacitance detection device 200 includes a signal acquisition unit 201 and a processing unit 230. The signal acquisition unit 201 may include, for example, [missing information - likely related to a specific component or process]. Figure 1 The AFE circuits 220 and 250 shown in the diagram, the device 200 may also include a detection electrode 210 connected to the signal acquisition unit 201, and further may include a reference electrode 240 connected to the signal acquisition unit 201.
[0093] The signal acquisition unit 201 is used to acquire the signal value of the detection signal output by the detection electrode 210.
[0094] The processing unit 230 is used to determine the compensation amount of the Nth frame detection signal based on the deviation of the signal values of the M frames of detection signals preceding the Nth frame detection signal from the reference value, where N is a positive integer and M is a positive integer less than N; the processing unit 230 is also used to calibrate the signal value of the Nth frame detection signal according to the compensation amount to obtain the calibration value of the Nth frame detection signal.
[0095] In one implementation, when the M-frame detection signals meet predetermined conditions, the reference values of the M-frame detection signals are equal; when the M-frame detection signals do not meet predetermined conditions, 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 i-th frame detection signal in the M-frame detection signals, where i ranges from 1 to M-1.
[0096] In one implementation, the reference value of the first frame detection signal in the M-frame detection signal is equal to the signal value of the first frame detection signal.
[0097] In one implementation, the predetermined condition includes: the difference between the signal value of each detection signal in the M-frame detection signal and the detection signal of the previous P-frame interval is less than a first threshold, where P is a positive integer less than N.
[0098] In one implementation, the compensation amount is the average of the differences between the signal values of each frame detection signal in the M-frame detection signal and the reference value.
[0099] In one implementation, the processing unit 230 is specifically used to: calibrate the signal values of the detection signals from the Nth frame to the N+M-1th frame according to the compensation amount.
[0100] In one implementation, the signal acquisition unit 201 is specifically used to: acquire the original value of the detection signal and the original value of the reference signal output by the reference electrode 240; the processing unit 230 is further used to: based on the original value of the reference signal, cancel out the part of the original value of the detection signal caused by environmental changes, and obtain the signal value of the detection signal.
[0101] In one implementation, the signal value of the Nth frame detection signal is the difference between the original value of the Nth frame detection signal and the change in the Nth frame reference signal. The change in 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 1st frame reference signal, where K is a preset coefficient.
[0102] In one implementation, the original value of the Nth frame reference signal is obtained by filtering the original values of the previous P frame reference signals.
[0103] In one implementation, the processing unit 230 is further configured to: determine that an event of a conductor approaching or leaving the detection electrode 210 occurs when the difference between the calibration value of the Nth frame detection signal and its base value is greater than a second threshold; and determine that no event of a conductor approaching or leaving the detection electrode 210 occurs when the difference between the calibration value of the Nth frame detection signal and its base value is less than the second threshold, wherein the base value is the signal value of the detection signal when no conductor approaches or contacts the detection electrode 210.
[0104] It should be understood that the specific details of the capacitance detection performed by the device 200 can be found in the aforementioned description of method 100, and will not be repeated here for the sake of brevity.
[0105] This application also provides a capacitance detection chip, which includes a processor and a memory. The memory is used to store instructions, and the processor is used to execute the instructions to implement the capacitance detection method described in any of the above embodiments.
[0106] This application also provides an electronic device that includes the capacitance detection device described in any of the above embodiments, or includes the capacitance detection chip described in any of the above embodiments.
[0107] By way of example and not limitation, the electronic devices in this application can be portable or mobile computing devices such as terminal devices, mobile phones, tablets, laptops, desktop computers, gaming devices, in-vehicle electronic devices, or wearable smart devices, as well as other electronic devices such as electronic databases, automobiles, and automated teller machines (ATMs). The wearable smart devices include fully functional, large-sized devices that can achieve complete or partial functionality without relying on a smartphone, such as smartwatches or smart glasses, as well as devices that focus on only a specific type of application function and require cooperation with other devices such as smartphones, such as various smart bracelets and smart jewelry for vital sign monitoring.
[0108] It should be noted that, without conflict, the various embodiments and / or technical features described in this application can be arbitrarily combined with each other, and the resulting technical solutions should also fall within the protection scope of this application.
[0109] The systems, apparatuses, and methods disclosed in the embodiments of this application can be implemented in other ways. For example, some features of the method embodiments described above can be ignored or not performed. The apparatus embodiments described above are merely illustrative, and the division of units is only a logical functional division. In actual implementation, there may be other division methods, and multiple units or components may be combined or integrated into another system. In addition, the coupling between units or between components can be direct coupling or indirect coupling, including electrical, mechanical, or other forms of connection.
[0110] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process and technical effects of the above-described apparatus and equipment can be referred to the corresponding processes and technical effects in the foregoing method embodiments, and will not be repeated here.
[0111] It should be understood that the specific examples in the embodiments of this application are only for the purpose of helping those skilled in the art to better understand the embodiments of this application, and are not intended to limit the scope of the embodiments of this application. Those skilled in the art can make various improvements and modifications based on the above embodiments, and all such improvements or modifications fall within the protection scope of this application.
[0112] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for capacitance detection, characterized in that, An apparatus for capacitance detection, the apparatus including a detection electrode for detecting the approach or departure of a conductor, the method comprising: Obtain the signal value of the detection signal output by the detection electrode; The compensation amount of the Nth frame detection signal is determined based on the deviation of the signal values of the M frames of detection signals preceding the Nth frame detection signal from the reference value, where N is a positive integer and M is a positive integer less than N. Based on the compensation amount, the signal value of the Nth frame detection signal is calibrated to obtain the calibration value of the Nth frame detection signal; Wherein, when the M-frame detection signals meet predetermined conditions, the reference values of the M-frame detection signals are equal; When the M-frame detection signal does not meet the predetermined condition, the reference value of the (i+1)th frame detection signal in the M-frame detection signal is equal to the calibration value of the i-th frame detection signal in the M-frame detection signal, where i ranges from 1 to M-1.
2. The method according to claim 1, characterized in that, The reference value of the first frame detection signal in the M-frame detection signal is equal to the signal value of the first frame detection signal.
3. The method according to claim 1, characterized in that, The predetermined conditions include: The difference between the detection signal value of each frame in the M-frame detection signal and the detection signal value of the previous P-frame interval is less than a first threshold, where P is a positive integer less than N.
4. The method according to any one of claims 1 to 3, characterized in that, The compensation amount is the average of the differences between the signal values of each frame detection signal in the M-frame detection signal and the reference value.
5. The method according to any one of claims 1 to 3, characterized in that, The step of calibrating the signal value of the Nth frame detection signal according to the compensation amount includes: The signal values of the detection signals from the Nth frame to the N+M-1th frame are calibrated according to the compensation amount.
6. The method according to any one of claims 1 to 3, characterized in that, The device further includes a reference electrode, and acquires the signal value of the detection signal output by the detection electrode, including: Obtain the original value of the detection signal and the original value of the reference signal output by the reference electrode; Based on the original value of the reference signal, the portion of the original value of the detection signal caused by environmental changes is canceled out to obtain the signal value of the detection signal.
7. The method according to claim 6, characterized in that, The signal value of the Nth frame detection signal is the difference between the original value of the Nth frame detection signal and the change of the Nth frame reference signal. The change 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 1st frame reference signal, where K is a preset coefficient.
8. The method according to claim 7, characterized in that, The original value of the Nth frame reference signal is obtained by filtering the original values of the previous P frame reference signals.
9. The method according to any one of claims 1 to 3, characterized in that, The method further includes: When the difference between the calibration value of the Nth frame detection signal and its base value is greater than the second threshold, it is determined that an event of a conductor approaching or leaving the detection electrode has occurred. The base value is the signal value of the detection signal when no conductor approaches or contacts the detection electrode. When the difference between the calibration value of the Nth frame detection signal and its baseline value is less than the second threshold, it is determined that no event of a conductor approaching or leaving the detection electrode has occurred.
10. A capacitance detection device, characterized in that, The device includes: The signal acquisition unit is used to acquire the signal value of the detection signal output by the detection electrode; The processing unit is used to determine the compensation amount of the Nth frame detection signal based on the deviation of the signal values of the M frames of detection signals preceding the Nth frame detection signal from the reference value, where N is a positive integer and M is a positive integer less than N. The processing unit 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; Wherein, when the M-frame detection signals meet predetermined conditions, the reference values of the M-frame detection signals are equal; When the M-frame detection signal does not meet the predetermined condition, the reference value of the (i+1)th frame detection signal in the M-frame detection signal is equal to the calibration value of the i-th frame detection signal in the M-frame detection signal, where i ranges from 1 to M-1.
11. The apparatus according to claim 10, characterized in that, The reference value of the first frame detection signal in the M-frame detection signal is equal to the signal value of the first frame detection signal.
12. The apparatus according to claim 10, characterized in that, The predetermined conditions include: The difference between the detection signal value of each frame in the M-frame detection signal and the detection signal value of the previous P-frame interval is less than a first threshold, where P is a positive integer less than N.
13. The apparatus according to any one of claims 10 to 12, characterized in that, The compensation amount is the average of the differences between the signal values of each frame detection signal in the M-frame detection signal and the reference value.
14. The apparatus according to any one of claims 10 to 12, characterized in that, The signal acquisition unit is specifically used for: Obtain the original value of the detection signal and the original value of the reference signal output by the reference electrode; The processing unit is further configured to, based on the original value of the reference signal, cancel out the portion of the original value of the detection signal caused by environmental changes, thereby obtaining the signal value of the detection signal.
15. The apparatus according to claim 14, characterized in that, The signal value of the Nth frame detection signal is the difference between the original value of the Nth frame detection signal and the change of the Nth frame reference signal. The change 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 1st frame reference signal, where K is a preset coefficient.
16. The apparatus according to any one of claims 10 to 12, characterized in that, The processing unit is also used for: When the difference between the calibration value of the Nth frame detection signal and its base value is greater than the second threshold, it is determined that an event of a conductor approaching or leaving the detection electrode has occurred. The base value is the signal value of the detection signal when no conductor approaches or contacts the detection electrode. When the difference between the calibration value of the Nth frame detection signal and its baseline value is less than the second threshold, it is determined that no event of a conductor approaching or leaving the detection electrode has occurred.
17. A capacitance detection chip, characterized in that, The chip includes a processor and a memory, the memory being used to store instructions, and the processor being used to execute the instructions to implement the capacitance detection method according to any one of claims 1 to 9.
18. An electronic device, characterized in that, The electronic device includes a capacitance detection apparatus according to any one of claims 10 to 16, or includes a capacitance detection chip according to claim 17.