A control method and system for a capacitive touch screen
By using dynamic threshold adjustment and alternating multi-frequency detection, combined with normalization processing and the center of gravity method, the detection accuracy and anti-interference issues of capacitive touch screens in extreme environments are solved, achieving efficient and accurate touch point positioning and multi-point separation, thus improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SICHUAN RUIYANG INTELLIGENT TECHNOLOGY CO LTD
- Filing Date
- 2025-08-14
- Publication Date
- 2026-05-26
AI Technical Summary
Existing capacitive touchscreens are prone to affecting detection accuracy in extreme environments, have limited anti-interference capabilities, and struggle to balance detection efficiency and accuracy. Furthermore, they are inadequate in handling complex scenarios, leading to problems such as decreased touch sensitivity, false triggering, and coordinate offset.
By employing dynamic threshold adjustment and multi-frequency alternating detection methods, combined with normalization processing, peak extraction, and centroid method, the baseline threshold is updated through real-time acquisition of environmental data, electrostatic interference signals are eliminated, and capacitance is rapidly detected under the mechanism of X-axis line-by-line scanning and Y-axis synchronous sensing, thus achieving accurate positioning and multi-point separation of touch points.
It maintains stable touch detection performance in extreme environments, reduces the impact of electromagnetic interference, improves detection efficiency and accuracy, reduces false positives and coordinate offsets, and meets the real-time tracking requirements of high-speed touch trajectories.
Smart Images

Figure CN121029027B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of touch screen control technology, and particularly relates to a control method and system for a capacitive touch screen. Background Technology
[0002] With the rapid development of consumer electronics, smart devices, and industrial control, capacitive touchscreens have become a core component of human-computer interaction due to their advantages such as ease of operation, rapid response, and long lifespan. Their basic working principle utilizes the capacitive coupling effect between the human body as a conductor and the screen electrodes. Touch actions are recognized by detecting changes in capacitance between the electrodes, thereby achieving coordinate positioning. However, existing technologies still have the following technical challenges in practical applications:
[0003] First, poor environmental adaptability:
[0004] The detection accuracy of capacitive touchscreens is easily affected by environmental factors such as temperature and humidity. When the ambient temperature fluctuates by more than 5°C or the humidity change rate is greater than 10%, the parasitic capacitance between the electrodes will drift significantly, causing the reference threshold to fail and resulting in decreased touch sensitivity or false triggering. Traditional fixed threshold algorithms are difficult to dynamically track environmental changes and lack reliability in extreme environments (such as temperature ranges of -20°C to 70°C and humidity ranges of 20% RH to 90% RH).
[0005] Second, its anti-interference capability is limited.
[0006] In industrial environments, electromagnetic interference from high-frequency noise generated by motors and frequency converters, as well as electrostatic discharge (ESD), can interfere with the X-axis excitation signal and the Y-axis sensing signal, causing abnormal fluctuations in capacitance detection values. Existing single-frequency detection schemes have weak suppression capabilities against interference signals at specific frequencies, and are prone to coordinate jumps or touch loss under continuous interference.
[0007] Third, it is difficult to balance detection efficiency and accuracy:
[0008] To achieve full-screen scanning, traditional methods typically employ a line-by-line excitation on the X-axis and point-by-point reception on the Y-axis. This results in a long scanning cycle, usually ≥50ms, which is insufficient to meet the real-time tracking requirements of high-speed writing and swiping touch trajectories. Furthermore, due to uneven electrode distribution at the edges, the capacitance change signal is weak, making coordinate shifts prone to occur, with deviations reaching 3–5mm.
[0009] Fourth, insufficient handling of complex scenarios.
[0010] For scenarios such as wet-hand touch and multi-touch separation, existing algorithms lack effective adaptive adjustment mechanisms. When touching with wet hands, the large-area slight capacitance change formed by the water film is easily misjudged as a valid touch; when the distance between multi-touch points is small (<5mm), the capacitance change areas of adjacent touch points overlap, which can easily lead to coordinate fusion or misjudgment.
[0011] Therefore, there is an urgent need for a capacitive touch screen control method and system that can dynamically adapt to environmental changes, has strong anti-interference capabilities, balance detection efficiency and accuracy, and handle complex touch scenarios, so as to improve the reliability and user experience of touch screens in various application scenarios. Summary of the Invention
[0012] The purpose of this invention is to provide a control method and system for a capacitive touch screen, which can dynamically adapt to environmental changes, has strong anti-interference ability, balance detection efficiency and accuracy, and handle complex touch scenarios, thereby improving the reliability and user experience of the touch screen in various application scenarios.
[0013] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0014] In a first aspect, a method for controlling a capacitive touchscreen is provided, comprising the following steps;
[0015] S1: Initialize the capacitive touch screen, set the working mode of the driver IC, and transmit the setting value of the configuration register to the driver IC through I2C communication. The driver IC is used to detect capacitive touch.
[0016] S2: When the capacitive touch screen is working, the X-axis electrode emits an AC signal, the Y-axis electrode senses the AC signal, and the charging time when the AC signal passes through the capacitor is detected to determine the capacitance.
[0017] S3: When a finger touches the capacitive touch screen, it affects the coupling between two electrodes near the touch point, changes the capacitance between the two electrodes, and detects the change in the capacitance of the capacitor, that is, it is known that there is a touch action at the capacitor.
[0018] S4: The first X-axis electrode sends an excitation signal, and all Y-axis electrodes receive the signal simultaneously. The magnitude of the mutual capacitance at the intersection of each Y-axis and the first X-axis is detected by detecting the charging time. Each X-axis sends an excitation signal in sequence.
[0019] S5: Repeat step S4 to obtain the capacitance values of the entire two-dimensional plane of the touch screen. Based on the obtained two-dimensional data table of touch screen capacitance changes, calculate the coordinates of each touch point.
[0020] It also includes a dynamic threshold adjustment process, as detailed below:
[0021] S6: Real-time acquisition of environmental capacitance drift data, updating the reference capacitance threshold every specified time interval. When the rate of change of environmental humidity exceeds the humidity rate of change threshold or the rate of change of temperature exceeds the temperature rate of change threshold, the threshold calibration acceleration mode is triggered.
[0022] Preferably, it also includes a multi-frequency alternating calibration process:
[0023] S7: It cycles through three frequency bands of 30kHz, 60kHz and 120kHz to detect frequencies, eliminates electrostatic interference signals by comparing data between frequency bands, and automatically starts high-frequency filtering mode when three consecutive abnormal signals are detected.
[0024] Preferably, the dynamic threshold adjustment process in step S6 is as follows:
[0025] S61: After the capacitive touch screen is started, the driver IC automatically performs initial calibration. In the no-touch state, it continuously collects 100 sets of reference capacitance data. After removing the maximum and minimum values, it takes the average value to generate the initial reference capacitance threshold C0 and stores it in a dedicated register.
[0026] S62: Synchronously acquire initial environmental data: Record the current temperature T0 and humidity H0 through temperature and humidity sensors, use them as the reference values for judging subsequent environmental changes, and store them in the MCU's Flash memory;
[0027] S63: Sample the background capacitance of the non-touch area of the touch screen once every specified time interval, and calculate the capacitance drift ΔC through the sliding window algorithm. The formula is: ΔC = current sample value - previous cycle reference threshold. The collected data is stored in the FIFO buffer in real time.
[0028] S64: The temperature and humidity sensor outputs measured values at specified intervals, namely temperature T1 and humidity H1. The MCU reads these values via the I2C interface and calculates the environmental changes.
[0029] Temperature change rate: ΔT=|T1-T0| / T0×100%;
[0030] Humidity change rate: ΔH=|H1-H0| / H0×100%;
[0031] When ΔT does not exceed the temperature change rate threshold and ΔH does not exceed the humidity change rate threshold, the normal mode is triggered:
[0032] Extract the most recent 5 sets of ΔC data from the FIFO buffer and calculate the average drift ΔC. avg ;
[0033] New benchmark threshold T new = Previous period baseline threshold + ΔC avg × Correction factor, the default correction factor is 0.8;
[0034] The updated data is written to the register, and T0 and H0 are updated synchronously to the current environment values;
[0035] When ΔT exceeds the temperature change rate threshold or ΔH exceeds the humidity change rate threshold, enter threshold calibration acceleration mode:
[0036] High-frequency sampling is enabled: the sampling interval for capacitance drift data is shortened to 5ms;
[0037] The correction factor was adjusted to 1.2 to improve the response speed to sudden environmental changes;
[0038] The threshold is updated every specified time interval, calculated using the following formula:
[0039] T new = Previous period baseline threshold + (ΔC) avg +Environmental compensation value) × 1.2;
[0040] The environmental compensation value is obtained by querying the built-in lookup table based on ΔT and ΔH.
[0041] The threshold calibration acceleration mode continues until three consecutive cycles meet the condition that ΔT does not exceed the temperature change rate threshold and ΔH does not exceed the humidity change rate threshold, at which point it automatically switches back to normal mode.
[0042] Preferably, the specific process of step S2 is as follows:
[0043] S21: When the capacitive touch screen is working, the signal generator inside the driver IC generates an AC signal of the corresponding frequency according to the working mode;
[0044] S22: The generated AC signal is output through the designated channel pin of the driver IC. After the driving capability is enhanced by the buffer, it is transmitted to the X-axis ITO electrode matrix. Each X-axis electrode is activated in sequence. According to the scanning order of the first X-axis → all X-axis, it is ensured that only one X-axis electrode emits an excitation signal at any given time.
[0045] S23: When the X-axis electrode emits an AC signal, the mutual capacitance formed at the intersection of the X-axis and Y-axis electrodes will transmit the signal through electric field coupling. The Y-axis electrode senses the AC signal, and the intensity of the sensed signal is proportional to the capacitance of the mutual capacitance. The sensed signal output by the Y-axis electrode is preprocessed.
[0046] S24: The pre-processed sensing signal enters the capacitance detection unit, which includes a reference capacitor, an analog switch, and a comparator. When the analog switch is closed, the sensing signal charges the detection capacitor, forming a charging circuit. The comparator monitors the voltage across the detection capacitor in real time. When the voltage reaches the reference voltage, the comparator output level flips, triggering the MCU's timer to capture an interrupt. The timer records the time interval from the start of charging to the level flip, i.e., the charging time t, and then deduces the capacitance C of the detection capacitor.
[0047] Preferably, the specific process of step S3 is as follows:
[0048] S31: When a finger touches the capacitive touchscreen, the human body, as a conductor, forms a new coupling path with the X-axis and Y-axis electrodes near the touch point. At this time, the original mutual capacitance C between the X-axis and Y-axis electrodes... h A human body-electrode coupling capacitor C is connected in parallel. f This causes the total capacitance to become C. total =C h +C f ;
[0049] S32: Following the X-axis line-by-line scanning and Y-axis synchronous sensing mechanism, the capacitance at each XY-axis intersection point is sampled in real time. When a touch occurs, the sampled value corresponding to the touch point, i.e., the charging time t, changes: due to C total Increasing the voltage lengthens the time required to charge to the reference voltage.
[0050] S33: The driver IC will convert the currently sampled capacitance C current The point is compared with the reference capacitance threshold C0, and the difference ΔC is calculated. When ΔC exceeds the preset touch detection threshold, the point is marked as a suspected touch point.
[0051] S34: Perform secondary sampling on 8 adjacent intersections around the suspected touch point. If at least 3 of these points simultaneously show ΔC exceeding the threshold, then it is confirmed that there is a touch action in the area.
[0052] Preferably, the specific process of step S4 is as follows:
[0053] S41: For the first X-axis electrode X1, the driver IC connects the corresponding drive channel of X1 through the internal analog switch matrix, and at the same time disconnects the drive signals of other X-axis electrodes to avoid crosstalk. The excitation signal is amplified and then input to the X1 electrode. The signal duration is the single-axis scan cycle.
[0054] S42: The sensing channels of all Y-axis electrodes are turned on at the same time. The M sensing signals are transmitted to the same detection circuit in a time-division manner through a multiplexer. The sensing signals are first filtered out by a bandpass filter to remove noise, and then the envelope of the AC signal is extracted by a peak detector and converted into a DC voltage signal.
[0055] S43: The mutual capacitance corresponding to each Y-axis signal enters the charging detection unit. The charging timer is triggered on the rising edge of the excitation signal. When the voltage across the capacitor reaches the reference voltage, the comparator outputs a trigger signal. The MCU's timer records the charging time and calculates the value of each mutual capacitance.
[0056] S44: After the first X-axis scan is completed, the driver IC automatically closes the X1 drive channel and opens the second X-axis X2 drive channel after a specified delay. The above excitation and detection process is repeated. Each time the switch is completed, the channel selection signal of the Y-axis sensing circuit is updated synchronously. After each X-axis scan is completed, the calculated M mutual capacitance values are stored in the SRAM buffer and a timestamp and checksum are added.
[0057] Preferably, the specific process of calculating the coordinates of each touch point in step S5 based on the obtained two-dimensional data table of touch screen capacitance changes is as follows:
[0058] S51: Read N×M mutual capacitance values from the SRAM buffer, subtract the dynamic reference threshold matrix, and obtain the capacitance change matrix ΔC(i,j), where i is the X-axis index 1 to N, and j is the Y-axis index, with values 1 to M.
[0059] Normalize ΔC(i,j): ΔC norm (i,j)=ΔC(i,j) / ΔC max , where ΔC max The maximum change in the matrix maps the data range to the [0,1] interval, eliminating the influence of different touch intensities;
[0060] S52: Set touch detection threshold T touch traverse ΔC norm (i, j), and all ΔC norm (i, j) ≥ T touch The points are marked as valid touch points, forming a set of touch areas S. If S is empty, it is determined that there is no touch; if S contains ≥5 points, then step S53 is executed.
[0061] S53: Finding local peak points in set S: For point (i, j), if its ΔC norm (i, j) is greater than ΔC of the four adjacent points (up, down, left, and right). norm If the value is positive, it is marked as peak point P(k), where k is the peak index, ranging from 1 to K, and K is the total number of peaks. The coordinates of each peak point are recorded. k j k and the corresponding normalized value ΔC norm (k);
[0062] S54: Single-point touch coordinate calculation:
[0063] When K=1, the centroid method is used to calculate the accurate coordinates:
[0064] X-axis coordinate: X=(Σ(i×ΔC) norm (i,j)) / ΣΔC norm (i, j))×Xres ;
[0065] Y-axis coordinate: Y=(Σ(j×ΔC) norm (i,j)) / ΣΔC norm (i, j))×Y res ;
[0066] Where (i, j) are all points in set S, X res The physical resolution is in the X-axis direction, and the Y-axis direction is... res The physical resolution is in the Y-axis direction;
[0067] Multi-touch coordinate separation:
[0068] When K≥2, the region separation algorithm is activated:
[0069] Calculate the Euclidean distance between each peak point P(k). If the distance is ≥ D... min If so, it is determined to be an independent touch point;
[0070] For each peak point, a region of radius R is defined centered on it. The centroid coordinates of all points within this region are calculated and used as the final coordinates of the touch point. If the peak point spacing... <D min Multiple peak values identified as belonging to the same touch area are merged into a single point for processing.
[0071] Secondly, a control system for a capacitive touchscreen is provided, for implementing the aforementioned control method for a capacitive touchscreen, comprising:
[0072] The capacitive touch screen body includes X-axis electrodes and Y-axis electrodes arranged in a matrix, and mutual capacitance is formed at the intersection of the X-axis electrodes and the Y-axis electrodes.
[0073] A driver IC, connected to the X-axis and Y-axis electrodes, is used to detect capacitive touch, and the driver IC is configured with a configuration register;
[0074] The MCU control module is connected to the driver IC via I2C communication. It is used to initialize the capacitive touch screen, set the working mode of the driver IC, and transmit the set value of the configuration register to the driver IC.
[0075] The signal generation module, connected to the driver IC, is used to control the X-axis electrode to emit an AC signal when the capacitive touch screen is working.
[0076] The signal sensing and detection module, which is connected to the Y-axis electrode and the drive IC, is used to enable the Y-axis electrode to sense AC signals and detect the charging time when the AC signal passes through the capacitor to determine the capacitance.
[0077] The touch action judgment module is connected to the signal sensing and detection module and is used to determine that there is a touch action at the capacitor when a finger touches the capacitive touch screen, based on the change in capacitance between the electrodes near the touch point.
[0078] The scanning control module is connected to the driving IC, the X-axis electrode, and the Y-axis electrode. It is used to control the electrode of the first X-axis to emit an excitation signal so that all Y-axis electrodes receive the signal simultaneously. It detects the magnitude of the mutual capacitance of each Y-axis intersecting with the first X-axis by detecting the charging time, and controls each X-axis to emit an excitation signal in sequence.
[0079] The coordinate calculation module, connected to the scanning control module, is used to calculate the coordinates of each touch point based on the two-dimensional data table of the touch screen capacitance changes after obtaining the capacitance values of all the two-dimensional planes of the entire touch screen during the repeated scanning control module's operation.
[0080] The beneficial effects of this invention include:
[0081] The capacitive touchscreen control method and system provided by this invention firstly acquires environmental capacitance drift data in real time and updates the reference capacitance threshold through a dynamic threshold adjustment process. When the rate of change in ambient humidity or temperature exceeds the threshold, a threshold calibration acceleration mode is automatically triggered, effectively solving the problem of decreased touch sensitivity or false triggering that easily occurs in traditional fixed threshold algorithms when the environment changes drastically. Even within a temperature range of -20℃ to 70℃ and a humidity range of 20% RH to 90% RH, stable touch detection performance is maintained, ensuring reliable operation of the device in extreme environments.
[0082] Secondly, a multi-frequency alternating detection process is adopted, which cycles through the detection frequencies of 30kHz, 60kHz, and 120kHz. By comparing data between frequency bands, electrostatic interference signals can be effectively eliminated. When three consecutive abnormal signals are detected, the high-frequency filtering mode is automatically activated, which greatly reduces the impact of electromagnetic interference and electrostatic discharge on the detection results, reduces the occurrence of coordinate jumps or touch loss, and improves the anti-interference capability of the equipment in complex electromagnetic environments.
[0083] Furthermore, when the first X-axis electrode emits an excitation signal, all Y-axis electrodes simultaneously receive the signal, and each X-axis emits an excitation signal sequentially. Combined with the method of obtaining the mutual capacitance by detecting the charging time, rapid detection of all capacitances on the two-dimensional plane of the touchscreen is achieved. Simultaneously, in calculating the touch point coordinates, normalization processing, noise filtering, peak extraction, and the centroid method are employed. This not only achieves sub-pixel-level coordinate accuracy but also, through a reasonable scan cycle design, balances detection efficiency, meeting the real-time tracking requirements of high-speed touch trajectories.
[0084] Finally, considering the capacitance change characteristics during finger touch, a secondary sampling and confirmation mechanism for adjacent intersections around suspected touch points improves the accuracy of touch action judgment. For multi-touch scenarios, an area separation algorithm can distinguish independent touch points; for edge touch, edge compensation coefficients are used for correction, effectively improving processing capabilities in complex touch scenarios and reducing misjudgments and coordinate offsets. Attached Figure Description
[0085] Figure 1 This is a flowchart illustrating the control method of the capacitive touch screen of the present invention.
[0086] Figure 2 This is a schematic diagram illustrating the process of obtaining a touch action according to the present invention.
[0087] Figure 3 This is a schematic diagram of the capacitance detection circuit of the present invention. Detailed Implementation
[0088] The following is in conjunction with the appendix Figures 1-3 The present invention will be further described in detail below:
[0089] Example 1
[0090] See appendix Figure 1 As shown, a control method for a capacitive touch screen is characterized by comprising the following steps;
[0091] S1: Initialize the capacitive touch screen, set the working mode of the driver IC, and transmit the setting value of the configuration register to the driver IC through I2C communication. The driver IC is used to detect capacitive touch.
[0092] S2: When the capacitive touch screen is working, the X-axis electrode emits an AC signal, the Y-axis electrode senses the AC signal, and the charging time when the AC signal passes through the capacitor is detected to determine the capacitance.
[0093] S3: When a finger touches the capacitive touch screen, it affects the coupling between two electrodes near the touch point, changes the capacitance between the two electrodes, and detects the change in the capacitance of the capacitor, that is, it is known that there is a touch action at the capacitor.
[0094] S4: The first X-axis electrode sends an excitation signal, and all Y-axis electrodes receive the signal simultaneously. The magnitude of the mutual capacitance at the intersection of each Y-axis and the first X-axis is detected by detecting the charging time. Each X-axis sends an excitation signal in sequence.
[0095] S5: Repeat step S4 to obtain the capacitance values of the entire two-dimensional plane of the touch screen. Based on the obtained two-dimensional data table of touch screen capacitance changes, calculate the coordinates of each touch point.
[0096] In another embodiment of this example, a dynamic threshold adjustment process and a multi-frequency alternating calibration process are also included:
[0097] S6: Real-time acquisition of environmental capacitance drift data, updating the reference capacitance threshold every specified time interval. When the rate of change of environmental humidity exceeds the humidity rate of change threshold or the rate of change of temperature exceeds the temperature rate of change threshold, the threshold calibration acceleration mode is triggered, and the calibration cycle is shortened to 10ms.
[0098] S7: It cycles through three frequency bands of 30kHz, 60kHz and 120kHz to detect frequencies, eliminates electrostatic interference signals by comparing data between frequency bands, and automatically starts high-frequency filtering mode when three consecutive abnormal signals are detected.
[0099] The dynamic threshold adjustment process in step S6 is as follows:
[0100] S61: After the capacitive touch screen is started, the driver IC automatically performs initial calibration, continuously collecting 100 sets of reference capacitance data (sampling interval 10ms) in a non-touch state, and generating the initial reference capacitance threshold C0 by removing the maximum and minimum values and taking the average value, and storing it in a dedicated register.
[0101] S62: Synchronously acquire initial environmental data: Record the current temperature T0 and humidity H0 through temperature and humidity sensors, use them as the reference values for judging subsequent environmental changes, and store them in the MCU's Flash memory;
[0102] S63: The background capacitance of the non-touch area of the touch screen is sampled every 10ms. The capacitance drift (ΔC) is calculated by the sliding window algorithm (window size is 5 sets of data). The formula is: ΔC = current sample value - previous cycle reference threshold. The collected data is stored in the FIFO buffer (depth 32 bytes) in real time.
[0103] S64: The temperature and humidity sensor outputs measurement values every 50ms, namely temperature T1 and humidity H1. The MCU reads these values via the I2C interface and calculates the environmental changes.
[0104] Temperature change rate: ΔT=|T1-T0| / T0×100%;
[0105] Humidity change rate: ΔH=|H1-H0| / H0×100%;
[0106] When ΔT does not exceed the temperature change rate threshold and ΔH does not exceed the humidity change rate threshold, the normal mode is triggered:
[0107] Extract the most recent 5 sets of ΔC data from the FIFO buffer and calculate the average drift (ΔC). avg );
[0108] New benchmark threshold T new = Previous period baseline threshold + ΔC avg × Correction factor, the default correction factor is 0.8;
[0109] The updated data is written to the register, and T0 and H0 are updated synchronously to the current environment values;
[0110] When ΔT exceeds the temperature change rate threshold or ΔH exceeds the humidity change rate threshold, enter threshold calibration acceleration mode:
[0111] High-frequency sampling is enabled: the sampling interval for capacitor drift data is shortened to 5ms, and the FIFO buffer depth is expanded to 64 bytes;
[0112] The correction factor was adjusted to 1.2 to improve the response speed to sudden environmental changes;
[0113] The threshold is updated every 10ms, calculated using the following formula:
[0114] T new = Previous period baseline threshold + (ΔC) avg +Environmental compensation value) × 1.2;
[0115] The environmental compensation value is obtained by querying the built-in lookup table based on ΔT and ΔH.
[0116] The threshold calibration acceleration mode continues until three consecutive cycles meet the condition that ΔT does not exceed the temperature change rate threshold and ΔH does not exceed the humidity change rate threshold, at which point it automatically switches back to normal mode.
[0117] Example 2
[0118] Based on Example 1, the specific process of step S2 is as follows:
[0119] S21: When the capacitive touchscreen is working, the signal generator inside the driver IC generates an AC signal of the corresponding frequency according to the working mode. The initial frequency is selected from 30kHz, 60kHz, and 120kHz by default, corresponding to the multi-frequency detection scheme. The signal amplitude is adjustable from 0.5V to 3V to adapt to different electrode structures.
[0120] S22: The generated AC signal is output through the designated channel pin of the driver IC. After the driving capability is enhanced by the buffer, it is transmitted to the X-axis ITO electrode matrix. Each X-axis electrode is activated in sequence. According to the scanning order of the first X-axis → all X-axis, it is ensured that only one X-axis electrode emits an excitation signal at any given time.
[0121] S23: When the X-axis electrode emits an AC signal, the mutual capacitance formed at the intersection of the X-axis and Y-axis electrodes will transmit the signal through electric field coupling. The Y-axis electrode senses the AC signal, and the intensity of the sensed signal is proportional to the capacitance of the mutual capacitance; the larger the capacitance, the more charge is coupled. The sensed signal output by the Y-axis electrode first passes through an RC filter network (10kΩ resistor + 100pF capacitor) to filter out high-frequency noise, and then is sent to an instrumentation amplifier for amplification to improve the signal-to-noise ratio and meet the input requirements of subsequent detection circuits.
[0122] S24: The pre-processed induced signal enters the capacitance detection unit, which includes a reference capacitor, an analog switch, and a comparator. When the analog switch is closed, the induced signal charges the detection capacitor (i.e., the mutual capacitance at the intersection of the X and Y axes), forming a charging circuit. The comparator monitors the voltage across the detection capacitor in real time. When the voltage reaches the reference voltage, the comparator output level flips, triggering a timer capture interrupt in the MCU. The timer records the time interval from the start of charging to the level flip, i.e., the charging time t.
[0123] Among them, see Figure 3 As shown, the capacitance detection unit realizes capacitance detection through a capacitance detection circuit, specifically including an analog switch K, a first resistor R1, a second resistor R2, a reference capacitor Cr, a detection capacitor Cp, a comparator COMP, an MCU, and a multiplexer MUX. The analog switch is connected to the first resistor and the second resistor respectively. The other end of the first resistor is connected to the reference capacitor and the first inverter respectively. The first inverter is connected to the comparator. The other end of the second resistor is connected to the second inverter, the multiplexer MUX, and the detection capacitor Cp respectively. The multiplexer MUX is connected to different electrodes respectively.
[0124] After the analog switch is closed, the input signal charges the detection capacitor Cp through the first resistor R2, forming a charging circuit. Then, it passes through the first resistor R1 and forms another circuit with the reference capacitor Cr, which is compared to the charging circuit. The first and second inverters invert the two signals, providing two comparable signals to the comparator COMP. The comparator COMP receives the processed signals from the two inverters and compares the voltage differences between the two circuits. When a finger touches the detection electrode, it changes the capacitance of the corresponding detection channel. For example, the finger acts as a conductor, causing a change in the electrode capacitance, which in turn changes the charging and discharging characteristics of that channel. This alters the difference in the comparator input signal, causing the comparator output level to flip, triggering a timer capture interrupt in the MCU. The timer records the time interval from the start of charging to the level flip, i.e., the charging time t.
[0125] According to the characteristics of the RC charging circuit, the time for the voltage across the capacitor to reach the reference voltage satisfies the formula:
[0126] t=-R·C×ln(1-V ref / V in )
[0127] Where R is the equivalent resistance of the charging circuit, which is a known fixed value, and V ref V is the reference voltage. in Given the input voltage of the AC signal, the capacitance C of the detection capacitor can be deduced by measuring the value of t.
[0128] After one X-axis electrode completes its signal output, the driver IC switches to the next X-axis electrode, repeating the signal generation, sensing, and charging time detection process. Once all X-axis electrodes have been scanned, the capacitance distribution data of the entire two-dimensional plane of the touchscreen can be obtained. The driver IC controls the timing of X-axis scanning and Y-axis sensing through an internal clock, ensuring that the signal output of each row of X-axis electrodes is strictly synchronized with the detection cycle of the Y-axis electrodes, avoiding signal interference between different rows.
[0129] Example 3
[0130] Based on Example 1 or Example 2, see Figure 2 As shown, the specific process of step S3 is as follows:
[0131] S31: When a finger touches a capacitive touchscreen, the human body, as a conductor, has an equivalent capacitance of approximately 100–300 pF. This creates a new coupling path with the X-axis and Y-axis electrodes near the touch point. At this time, the original mutual capacitance C between the X-axis and Y-axis electrodes is reduced. h A human body-electrode coupling capacitor C will be connected in parallel. f This causes the total capacitance to become C. total =C h +C f The increase in capacitance is typically 5% to 30%, depending on the touch pressure and contact area.
[0132] When not touched, the electric field between the X-axis and Y-axis electrodes is symmetrically distributed. After the finger touches the electrode, the electric field lines bend towards the finger, which strengthens the electric field intensity at the edge of the electrode and further increases the coupling capacitance of the cross area. This change is most significant in the center of the touch point and decreases gradually outwards, usually decreasing to 50% within a 5mm range.
[0133] S32: The system uses a progressive X-axis scanning and synchronous Y-axis sensing mechanism to sample the capacitance at each XY-axis intersection in real time. When a touch occurs, the sampled value corresponding to the touch point, i.e., the charging time t, will change significantly: due to C total Increase, according to the RC charging formula t=-R·C×ln(1-V) ref / V in The time required to charge to the reference voltage will be extended, typically by 10% to 50%.
[0134] S33: The driver IC will convert the currently sampled capacitance C current The capacitance value is compared with a reference capacitance threshold C0, which is updated in real time by a dynamic threshold adjustment mechanism. The difference ΔC = C is then calculated. current -C0. When ΔC exceeds the preset touch detection threshold, the point is marked as a suspected touch point.
[0135] S34: To avoid misjudgment, the eight adjacent intersections around the suspected touch point are sampled again. If at least three of these points simultaneously show ΔC exceeding the threshold, it is confirmed that there is a touch action in the area, and the spatial continuity of capacitance change is used to eliminate single-point interference.
[0136] Noise filtering: Perform consistency verification on the detection data of 3 consecutive frames with a 10ms interval between each frame. If all 3 frames are determined to be touch, a valid touch signal is output; if more than 1 frame is determined to be non-touch, it is considered as interference and the detection state is reset.
[0137] Preliminary coordinate localization: Based on the confirmed touch area, the point with the largest change in capacitance is extracted as the initial coordinates (X0, Y0) of the touch center, and the peak value ΔC at that point is recorded. max This provides a basis for subsequent accurate coordinate calculations.
[0138] Setting up special scene processing procedures:
[0139] Multi-touch differentiation: When two or more independent ΔC peak areas with a spacing of ≥5mm are detected, the multi-touch separation algorithm is activated, and multi-touch differentiation is achieved by calculating the centroid coordinates of each area.
[0140] Edge touch compensation: For touch points at the screen edge ≤10mm from the screen bezel, the uneven electrode distribution causes abnormal capacitance changes. The system will call the edge compensation coefficient (based on factory calibration data) to correct ΔC and ensure detection accuracy.
[0141] Wet hand touch adaptation: When a depth of ≥1cm is detected 2 When a large area of slight capacitance change, ΔC, is 30% to 70% of the touch detection threshold, it is determined to be a wet hand touch scenario. The touch detection threshold is automatically increased to 1.5 times the original touch detection threshold, and the sampling time is extended to 20ms to reduce false triggering caused by water film interference.
[0142] In this embodiment, the specific process of step S4 is as follows:
[0143] S41: For the first X-axis electrode (X1), the driver IC connects the drive channel corresponding to X1 through the internal analog switch matrix, while disconnecting the drive signals of other X-axis electrodes to avoid crosstalk. The excitation signal is amplified and then input to the X1 electrode. The signal duration is the single-axis scan period T. scan T scan = Total frame period / N, for example, when N = 10, T scan =1ms.
[0144] S42: The sensing channels of all Y-axis electrodes (Y1~YM) are turned on simultaneously. The M sensing signals are transmitted to the same detection circuit in a time-division manner through a multiplexer. The sampling time of each signal is ≥10μs. The sensing signal is first filtered by a bandpass filter with a center frequency of 60kHz to remove noise, and then the envelope of the AC signal is extracted by a peak detector and converted into a DC voltage signal. The DC voltage signal is proportional to the mutual capacitance.
[0145] S43: Mutual capacitance (C) corresponding to each Y-axis signal x1y1 C x1y2 …C x1yM The system enters the charging detection unit, triggering the charging timer on the rising edge of the excitation signal. When the voltage across the capacitor reaches the reference voltage (1V), the comparator outputs a trigger signal, and the MCU's timer records the charging time (t1~t). M The mutual capacitance values are calculated according to the formula C = k × t, where k is a circuit constant determined by the reference resistor and the power supply voltage.
[0146] S44: After the first X-axis scan is completed, the driver IC automatically closes the X1 drive channel. To avoid signal superposition, the second X-axis (X2) drive channel is opened after a delay of 200ns. The above excitation and detection process is repeated. Each time the switch is completed, the channel selection signal of the Y-axis sensing circuit is updated synchronously to ensure that it corresponds one-to-one with the cross capacitance formed by the current X-axis. After each X-axis scan is completed, the calculated M mutual capacitance values are stored in the SRAM buffer and a timestamp and checksum are added.
[0147] If the detection data of a certain X-axis fails to be verified, such as if the sampling deviation exceeds 5% for three consecutive times, the axis will be re-scanned to ensure data integrity.
[0148] When the scan data of the Nth X-axis (XN) is stored in the buffer, the driver IC sends an interrupt signal to the MCU, that is, pulls down the INT pin, indicating that a complete frame of capacitance matrix data acquisition is completed. At this time, the buffer stores N×M mutual capacitance values, which constitute the two-dimensional capacitance distribution data table of the entire touch screen.
[0149] Channel crosstalk suppression: A grounded shielding layer is set between the X-axis drive channel and the Y-axis sensing channel to reduce parasitic capacitance coupling; at the same time, differential signal transmission is adopted to improve the common-mode interference rejection ratio (CMRR) to over 80dB.
[0150] Multi-frequency scanning fusion: During each frame scan, the X1, X2...XN axes are alternately excited by 30kHz, 60kHz and 120kHz respectively. For example, X1 uses 30kHz, X2 uses 60kHz, X3 uses 120kHz, and X4 uses 30kHz in a loop. Fixed frequency interference is eliminated by comparing the capacitance values at different frequencies.
[0151] Dynamic scan rate adjustment: When a touch action is detected, i.e. the capacitance change in a certain area exceeds the threshold, the X-axis scan cycle corresponding to that area is automatically shortened by 50% to improve the tracking accuracy of the touch trajectory. When there is no touch, the normal scan rate is restored to reduce power consumption.
[0152] Example 4
[0153] Based on Embodiment 1, Embodiment 2, or Embodiment 3, the specific process of calculating the coordinates of each touch point in step S5 according to the obtained two-dimensional data table of touch screen capacitance changes is as follows:
[0154] S51: Read N×M mutual capacitance values from the SRAM buffer, subtract the dynamic reference threshold matrix, which is generated by the dynamic threshold adjustment mechanism, to obtain the capacitance change matrix ΔC(i,j), where i is the X-axis index, with values from 1 to N, and j is the Y-axis index, with values from 1 to M.
[0155] Normalize ΔC(i,j): ΔC norm (i,j)=ΔC(i,j) / ΔC max , where ΔC max The maximum change in the matrix is used to map the data range to the interval [0, 1], thus eliminating the influence of different touch intensities.
[0156] S52: Set touch detection threshold T touch The default value is 0.15, which can be dynamically adjusted according to the environment, traversing ΔC. norm (i, j), and all ΔC norm (i, j) ≥ T touch The points are marked as valid touch points, forming a set of touch areas S. If S is empty, it is determined that there is no touch; if S contains ≥5 points (to avoid single-point interference), then proceed to the coordinate calculation step S53.
[0157] S53: Finding local peak points in set S: For point (i, j), if its ΔC norm(i, j) is greater than ΔC of the four adjacent points (up, down, left, and right). norm If the value is positive, it is marked as peak point P(k), where k is the peak index, ranging from 1 to K, and K is the total number of peaks. The coordinates of each peak point are recorded. k j k and the corresponding normalized value ΔC norm (k).
[0158] S54: Single-point touch coordinate calculation:
[0159] When K=1, it is a single-point touch, and the accurate coordinates are calculated using the center of gravity method:
[0160] X-axis coordinate: X=(Σ(i×ΔC) norm (i,j)) / ΣΔC norm (i, j))×X res ;
[0161] Y-axis coordinate: Y=(Σ(j×ΔC) norm (i,j)) / ΣΔC norm (i, j))×Y res ;
[0162] Where (i, j) are all points in set S, X res The physical resolution is in the X-axis direction, and the Y-axis direction is... res The physical resolution in the Y-axis direction is used, and the calculation results are retained to one decimal place to achieve sub-pixel precision.
[0163] Multi-touch coordinate separation:
[0164] When K≥2, it is a multi-touch operation, and the region separation algorithm is activated:
[0165] Calculate the Euclidean distance between each peak point P(k). If the distance is ≥ D... min If so, it is determined to be an independent touch point;
[0166] For each peak point, a radius R is defined centered on it, and the radius R is determined according to ΔC. norm (k) Dynamic adjustment, typically for an area of 3-5 electrode units, calculates the centroid coordinates of all points within this area, and uses these coordinates as the final coordinates of the touch point. If the peak point spacing... <D min Multiple peak values identified as belonging to the same touch area are merged into a single point for processing.
[0167] Setting up coordinate verification and optimization process:
[0168] First, the coordinate validity is verified, including boundary verification and timing consistency verification.
[0169] Boundary check: Ensure that the calculated (X,Y) is within the physical range of the screen (0≤X≤X).max , 0≤Y≤Y max If the touch value is outside the specified range, it will be truncated and marked as an edge touch.
[0170] Timing consistency check: Compare the current coordinates with the coordinates of the previous frame (if they exist), and calculate the movement speed V = [(X... current -X prev )2+(Y current -Y prev )2] 1 / 2 / Δt, where Δt is the frame interval of 10ms. If V>V max V max The default speed is 100mm / ms, which is the upper limit for fast sliding. The weighted average correction result of the previous frame coordinates and the current coordinates is used, with a weight ratio of 7:3.
[0171] Edge touch compensation:
[0172] For touch points ≤10mm from the screen edge, the X or Y coordinates are corrected using the edge compensation coefficient matrix, which is obtained from factory calibration.
[0173] X coordinate correction value X compensated =X+K x (X), Y coordinate correction value Y compensated =Y+K y (Y);
[0174] Where K x (X), K y (Y) is the edge position function, ensuring that the coordinate deviation of edge touch is ≤1mm.
[0175] Special case handling:
[0176] Touch point merging and splitting:
[0177] When the distance between the two touch points is greater than D min Become less than D min If the touch condition is met, it is determined to be a touch merge, and the coordinates of the merged center of gravity are output; otherwise, it is determined to be a touch split, and two independent coordinates are output.
[0178] Sliding trajectory prediction:
[0179] For continuous touches (≥3 frames), a linear equation is fitted based on the coordinates of the previous 3 frames to predict the coordinates of the next frame. If the deviation between the actual coordinates and the predicted coordinates is ≤2mm, the predicted value is used to smooth the trajectory; if the deviation is >2mm, the actual calculated value is used.
[0180] A control system for a capacitive touchscreen, used to implement the control method for the capacitive touchscreen, includes: a capacitive touchscreen body, comprising X-axis electrodes and Y-axis electrodes arranged in a matrix, with mutual capacitance formed at the intersection of the X-axis and Y-axis electrodes; a driver IC, connected to the X-axis and Y-axis electrodes, for detecting capacitive touch, the driver IC being configured with a configuration register; an MCU control module, connected to the driver IC via I2C communication, for initializing the capacitive touchscreen, setting the operating mode of the driver IC, and transmitting the set values of the configuration register to the driver IC; a signal generation module, connected to the driver IC, for controlling the X-axis electrodes to emit AC signals when the capacitive touchscreen is operating, via the driver IC; and a signal sensing and detection module, connected to the Y-axis electrodes and the driver IC, for enabling the Y-axis electrodes to sense the AC signals and detecting the charging time when the AC signals pass through the capacitor to determine the capacitance.
[0181] A touch action judgment module, connected to the signal sensing and detection module, is used to detect a touch action at a capacitive touchscreen by analyzing the change in capacitance between electrodes near the touch point. A scanning control module, connected to the driver IC, X-axis electrodes, and Y-axis electrodes, controls the electrodes along the first X-axis to emit excitation signals, ensuring all Y-axis electrodes simultaneously receive signals. It detects the mutual capacitance at the intersections of each Y-axis and the first X-axis by detecting charging time and controls each X-axis to emit excitation signals sequentially. A coordinate calculation module, connected to the scanning control module, calculates the coordinates of each touch point based on a two-dimensional data table of touchscreen capacitance changes after obtaining the capacitance values of all elements on the entire two-dimensional plane of the touchscreen during the repeated scanning control module's operation.
[0182] In summary, the capacitive touchscreen control method and system provided by this invention collects environmental capacitance drift data in real time and updates the reference capacitance threshold through a dynamic threshold adjustment process. When the rate of change of environmental humidity or temperature exceeds the threshold, a threshold calibration acceleration mode is automatically triggered, effectively solving the problem of decreased touch sensitivity or false triggering that easily occurs in traditional fixed threshold algorithms when the environment changes drastically. A multi-frequency alternating detection process is adopted, cyclically switching the detection frequency across three frequency bands. Data comparison between frequency bands effectively eliminates electrostatic interference signals. When three consecutive abnormal signals are detected, a high-frequency filtering mode is automatically activated, significantly reducing the impact of electromagnetic interference and electrostatic discharge on the detection results and minimizing the occurrence of coordinate jumps or touch loss.
[0183] By controlling the excitation signal emitted by the first X-axis electrode, all Y-axis electrodes simultaneously receive the signal, and each X-axis emits an excitation signal sequentially. Combined with the method of obtaining the mutual capacitance by detecting the charging time, rapid detection of all capacitances on the two-dimensional plane of the touchscreen is achieved. Addressing the capacitance change characteristics during finger touch, a secondary sampling and confirmation mechanism of adjacent intersections around suspected touch points improves the accuracy of touch action judgment. For multi-touch scenarios, a region separation algorithm can distinguish independent touch points; for edge touch, edge compensation coefficients are used for correction, effectively improving processing capabilities in complex touch scenarios and reducing misjudgments and coordinate offsets.
Claims
1. A control method for a capacitive touchscreen, characterized in that, Includes the following steps; S1: Initialize the capacitive touch screen, set the working mode of the driver IC, and transmit the setting value of the configuration register to the driver IC through I2C communication. The driver IC is used to detect capacitive touch. S2: When the capacitive touch screen is working, the X-axis electrode emits an AC signal, the Y-axis electrode senses the AC signal, and the charging time when the AC signal passes through the capacitor is detected to determine the capacitance. S3: When a finger touches the capacitive touch screen, it affects the coupling between two electrodes near the touch point, changes the capacitance between the two electrodes, and detects the change in the capacitance of the capacitor, that is, it is known that there is a touch action at the capacitor. S4: The first X-axis electrode sends an excitation signal, and all Y-axis electrodes receive the signal simultaneously. The magnitude of the mutual capacitance at the intersection of each Y-axis and the first X-axis is detected by detecting the charging time. Each X-axis sends an excitation signal in sequence. S5: Repeat step S4 to obtain the capacitance values of the entire two-dimensional plane of the touch screen. Based on the obtained two-dimensional data table of touch screen capacitance changes, calculate the coordinates of each touch point. It also includes a dynamic threshold adjustment process, the specific process of which is as follows: S6: Real-time acquisition of environmental capacitance drift data, updating the reference capacitance threshold every specified time interval. When the rate of change of environmental humidity exceeds the humidity rate of change threshold or the rate of change of temperature exceeds the temperature rate of change threshold, the threshold calibration acceleration mode is triggered. S61: After the capacitive touch screen is started, the driver IC automatically performs initial calibration. In the no-touch state, it continuously collects 100 sets of reference capacitance data. After removing the maximum and minimum values, it takes the average value to generate the initial reference capacitance threshold C0 and stores it in a dedicated register. S 62: Synchronous acquisition of initial environmental data: The current temperature T0 and humidity H0 are recorded by temperature and humidity sensors and used as the reference values for subsequent environmental change judgments. The data is then stored in the MCU's Flash memory. S63: Sample the background capacitance of the non-touch area of the touch screen once every specified time interval, and calculate the capacitance drift ΔC through the sliding window algorithm. The formula is: ΔC = current sample value - previous cycle reference threshold. The collected data is stored in the FIFO buffer in real time. S64: The temperature and humidity sensor outputs measured values at specified intervals, namely temperature T1 and humidity H1. The MCU reads these values via the I2C interface and calculates the environmental changes. Temperature change rate: ΔT = |T1 - T0| / T0 × 100%; Humidity change rate: ΔH = |H1 - H0| / H0 × 100%; When ΔT does not exceed the temperature change rate threshold and ΔH does not exceed the humidity change rate threshold, the normal mode is triggered: Extract the most recent 5 sets of ΔC data from the FIFO buffer and calculate the average drift ΔC. avg ; New benchmark threshold T new =Previous period baseline threshold + ΔC avg × Correction factor, the default correction factor is 0.8; The updated data is written to the register, and T0 and H0 are updated synchronously to the current environment values; When ΔT exceeds the temperature change rate threshold or ΔH exceeds the humidity change rate threshold, enter threshold calibration acceleration mode: High-frequency sampling is enabled: the sampling interval for capacitance drift data is shortened to 5ms; The correction factor was adjusted to 1.2 to improve the response speed to sudden environmental changes; The threshold is updated every specified time interval, calculated using the following formula: T new =Previous period baseline threshold + (ΔC) avg +Environmental compensation value) × 1.2; The environmental compensation value is obtained by querying the built-in lookup table based on ΔT and ΔH. The threshold calibration acceleration mode continues until three consecutive cycles meet the condition that ΔT does not exceed the temperature change rate threshold and ΔH does not exceed the humidity change rate threshold, at which point it automatically switches back to normal mode.
2. The control method for a capacitive touchscreen according to claim 1, characterized in that, It also includes a multi-frequency alternating calibration process: S7: It cycles through three frequency bands of 30kHz, 60kHz and 120kHz to detect frequencies, eliminates electrostatic interference signals by comparing data between frequency bands, and automatically starts high-frequency filtering mode when three consecutive abnormal signals are detected.
3. The control method for a capacitive touchscreen according to claim 1, characterized in that, The specific process of step S2 is as follows: S21: When the capacitive touch screen is working, the signal generator inside the driver IC generates an AC signal of the corresponding frequency according to the working mode; S22: The generated AC signal is output through the designated channel pin of the driver IC. After the driving capability is enhanced by the buffer, it is transmitted to the X-axis ITO electrode matrix. Each X-axis electrode is activated in sequence. According to the scanning order of the first X-axis → all X-axis, it is ensured that only one X-axis electrode emits an excitation signal at any given time. S23: When the X-axis electrode emits an AC signal, the mutual capacitance formed at the intersection of the X-axis and Y-axis electrodes will transmit the signal through electric field coupling. The Y-axis electrode senses the AC signal, and the intensity of the sensed signal is proportional to the capacitance of the mutual capacitance. The sensed signal output by the Y-axis electrode is preprocessed. S24: The pre-processed induction signal enters the capacitance detection unit, which includes a reference capacitor, an analog switch, and a comparator. When the analog switch is closed, the induction signal charges the detection capacitor, forming a charging circuit. The comparator monitors the voltage across the detection capacitor in real time. When the voltage reaches the reference voltage, the comparator output level flips, triggering the MCU's timer to capture an interrupt. The timer records the time interval from the start of charging to the level flip, i.e., the charging time t, and then deduces the capacitance C of the detection capacitor.
4. The control method for a capacitive touchscreen according to claim 1, characterized in that, The specific process of step S3 is as follows: S31: When a finger touches the capacitive touchscreen, the human body, as a conductor, forms a new coupling path with the X-axis and Y-axis electrodes near the touch point. At this time, the original mutual capacitance C between the X-axis and Y-axis electrodes... h A human body-electrode coupling capacitor C is connected in parallel. f This causes the total capacitance to become C. total =C h +C f ; S32: Following the X-axis line-by-line scanning and Y-axis synchronous sensing mechanism, the capacitance at each XY-axis intersection point is sampled in real time. When a touch occurs, the sampled value corresponding to the touch point, i.e., the charging time t, changes: due to C total Increasing the voltage lengthens the time required to charge to the reference voltage. S33: The driver IC will input the currently sampled capacitance C. current The point is compared with the reference capacitance threshold C0, and the difference ΔC is calculated. When ΔC exceeds the preset touch detection threshold, the point is marked as a suspected touch point. S34: Perform secondary sampling on 8 adjacent intersections around the suspected touch point. If at least 3 of these points simultaneously show ΔC exceeding the threshold, then confirm that there is a touch action in the area where at least 3 points simultaneously show ΔC exceeding the threshold.
5. The control method for a capacitive touchscreen according to claim 1, characterized in that, The specific process of step S4 is as follows: S41: For the first X-axis electrode X1, the driver IC connects the corresponding drive channel of X1 through the internal analog switch matrix, and at the same time disconnects the drive signals of other X-axis electrodes to avoid crosstalk. The excitation signal is amplified and then input to the X1 electrode. The signal duration is the single-axis scan cycle. S42: The sensing channels of all Y-axis electrodes are turned on at the same time. The M sensing signals are transmitted to the same detection circuit in a time-division manner through a multiplexer. The sensing signals are first filtered out by a bandpass filter to remove noise, and then the envelope of the AC signal is extracted by a peak detector and converted into a DC voltage signal. S43: The mutual capacitance corresponding to each Y-axis signal enters the charging detection unit. The charging timer is triggered on the rising edge of the excitation signal. When the voltage across the capacitor reaches the reference voltage, the comparator outputs a trigger signal. The MCU's timer records the charging time and calculates the value of each mutual capacitance. S44: After the first X-axis scan is completed, the driver IC automatically closes the X1 drive channel and opens the second X-axis X2 drive channel after a specified delay. The above excitation and detection process is repeated. Each time the switch is completed, the channel selection signal of the Y-axis sensing circuit is updated synchronously. After each X-axis scan is completed, the calculated M mutual capacitance values are stored in the SRAM buffer and a timestamp and checksum are added.
6. The control method for a capacitive touch screen according to claim 5, characterized in that, The specific process of calculating the coordinates of each touch point in step S5 based on the obtained two-dimensional data table of touch screen capacitance changes is as follows: S51: Read N×M mutual capacitance values from the SRAM buffer, subtract the dynamic reference threshold matrix, and obtain the capacitance change matrix ΔC(i,j), where i is the X-axis index 1~N and j is the Y-axis index, with values 1~M. Normalize ΔC(i,j): ΔC norm (i, j) = ΔC(i, j) / ΔC max , where ΔC max The maximum change in the matrix is used to map the data range to the [0,1] interval, thus eliminating the influence of different touch intensities; S52: Set touch detection threshold T touch traverse ΔC norm (i, j), and all ΔC norm (i, j) ≥ T touch The points are marked as valid touch points, forming a set of touch areas S. If S is empty, it is determined that there is no touch; if S contains ≥5 points, then step S53 is executed. S53: Finding local peak points in set S: For point (i, j), if its ΔC norm (i, j) is greater than ΔC of the four adjacent points (up, down, left, and right). norm If the value is a peak point, it is marked as peak point P(k), where k is the peak index, ranging from 1 to K, and K is the total number of peaks. The coordinates of each peak point are recorded. k j k and the corresponding normalized value ΔC norm (k); S54: Single-point touch coordinate calculation: When K=1, the centroid method is used to calculate the accurate coordinates: X-axis coordinate: X=(Σ(i×ΔC) norm (i,j)) / ΣΔC norm (i, j))×X res ; Y-axis coordinate: Y=(Σ(j×ΔC) norm (i,j)) / ΣΔC norm (i, j))×Y res ; Where (i, j) are all points in set S, X res The physical resolution is in the X-axis direction, and the Y-axis direction is... res The physical resolution is in the Y-axis direction; Multi-touch coordinate separation: When K≥2, the region separation algorithm is activated: Calculate the Euclidean distance between each peak point P(k). If the distance is ≥ D... min If so, it is determined to be an independent touch point; For each peak point, define a region of radius R centered on it, and calculate the centroid coordinates of all points within this region. These coordinates will be used as the final coordinates of the touch point. If the distance between peak points is less than D... min Multiple peak values identified as belonging to the same touch area are merged into a single point for processing.
7. A control system for a capacitive touchscreen, used to implement the control method for a capacitive touchscreen according to any one of claims 1-6, characterized in that, include: The capacitive touch screen body includes X-axis electrodes and Y-axis electrodes arranged in a matrix, and mutual capacitance is formed at the intersection of the X-axis electrodes and the Y-axis electrodes. A driver IC, connected to the X-axis and Y-axis electrodes, is used to detect capacitive touch, and the driver IC is configured with a configuration register. The MCU control module is connected to the driver IC via I2C communication. It is used to initialize the capacitive touch screen, set the working mode of the driver IC, and transmit the set value of the configuration register to the driver IC. The signal generation module, connected to the driver IC, is used to control the X-axis electrode to emit an AC signal when the capacitive touch screen is working. The signal sensing and detection module, which is connected to the Y-axis electrode and the drive IC, is used to enable the Y-axis electrode to sense AC signals and detect the charging time when the AC signal passes through the capacitor to determine the capacitance. A touch action judgment module, connected to the signal sensing and detection module, is used to determine that there is a touch action at the capacitor when a finger touches the capacitive touch screen, based on the change in capacitance between the electrodes near the touch point; A scanning control module, connected to the driver IC, X-axis electrode, and Y-axis electrode, is used to control the electrode of the first X-axis to emit an excitation signal so that all Y-axis electrodes receive the signal simultaneously, detect the magnitude of each mutual capacitance where each Y-axis intersects with the first X-axis by detecting the charging time, and control each X-axis to emit an excitation signal sequentially; The coordinate calculation module, connected to the scanning control module, is used to calculate the coordinates of each touch point based on the two-dimensional data table of the touch screen capacitance changes after obtaining the capacitance values of all the two-dimensional planes of the entire touch screen during the repeated scanning control module's operation.