Touch detection techniques for capacitive touch sense systems

A technique for recognizing and rejecting false activation events related to a capacitance sense interface includes measuring a capacitance value of a capacitance sensor within the capacitance sense interface to generate a measured capacitance value. The measured capacitance value is analyzed to determine a baseline capacitance value for the capacitance sensor. The baseline capacitance value may be updated based at least in part upon a weighted moving average of the measured capacitance value. The measured capacitance value may also be analyzed to determine whether the capacitance sensor was activated during a startup phase and to adjust the baseline capacitance value in response to determining that the capacitance sensor was activated during the startup phase.

TECHNICAL FIELD

This disclosure relates generally to capacitance sensing techniques, and in particular but not exclusively, relates to improved touch detection techniques for capacitance sense interfaces.

BACKGROUND INFORMATION

Capacitance sensors are used to implement a variety of useful functions including touch sensors (e.g., touch pad, touch dial, touch wheel, etc.), determining the presence of an object, accelerometers, and other functions.FIG. 1Aillustrates a conventional capacitance measurement circuit100including a relaxation oscillator, a reference clock, and a frequency comparator. The relaxation oscillator is coupled to drive a charging current (Ic) in a single direction onto a device under test (“DUT”) capacitor. As the charging current accumulates charge on the DUT capacitor, the voltage across the capacitor increases with time as a function of ICand its capacitance C. Equation 1 describes the relation between current, capacitance, voltage and time for a charging capacitor.
CdV=ICdt  (Equation 1)

The relaxation oscillator begins by charging the DUT capacitor from a ground potential or zero voltage and continues to accumulate charge on the DUT capacitor at a fixed charging current ICuntil the voltage across the DUT capacitor reaches a reference voltage (Vref). At Vref, the relaxation oscillator allows the accumulated charge to discharge or the DUT capacitor to “relax” back to the ground potential and then the process repeats itself. The relaxation oscillator outputs a relaxation oscillator clock signal (RO CLK) having a frequency (fRO) dependent upon capacitance C of the DUT capacitor, charging current IC, a discharge time td, and Vref, as described in equation 2 below.

If capacitance C of the DUT capacitor changes, then fROwill change proportionally according to equation 2. By comparing fROof RO CLK against the frequency (fREF) of a known reference clock signal (REF CLK), the change in capacitance ΔC can be measured. Accordingly, equations 3 and 4 below describe that a change in frequency between RO CLK and REF CLK is proportional to a change in capacitance of the DUT capacitor.
ΔC∝Δf, where  (Equation 3)
Δf=fRO−fREF(Equation 4)

The frequency comparator is coupled to receive RO CLK and REF CLK, compare their frequencies fROand fREF, respectively, and output a signal indicative of the difference Δf between these frequencies. By monitoring Δf one can determine whether the capacitance of the DUT capacitor has changed.

FIG. 1Billustrates another capacitance sensing technique using a charge transfer mechanism.FIG. 1Billustrates a conventional capacitance measurement circuit101including three switches105with control terminals φ0, φ1, and φ2, and summing capacitor110having a capacitance CSUM, and an analog to digital (“ADC”) converter115. Capacitance measurement circuit101may be used to sense changes in a DUT capacitor120having a changing capacitance CDUT.

During operation, capacitance measurement circuit101operates as follows to sense capacitance changes on DUT capacitor120. First, summing capacitor110is discharged to a ground potential by asserting control terminal φ0to open circuit switch SW0and by asserting control terminal φ1to close circuit switch SW1. Once discharged to ground, integrating capacitor110is disconnected from ground by asserting φ1to open switch SW1. Then, DUT capacitor120is charged to the supply voltage VS by asserting φ0to open circuit switch SW0and asserting φ2to close circuit switch SW2. Once DUT capacitor120charges to the supply voltage VS, the charge on DUT capacitor120is transferred onto summing capacitor110and distributed between the two capacitors. Charge transfer occurs by asserting φ1and φ2to open circuit switches SW1and SW2, respectively, and asserting φ0to close circuit switch SW0.

The above stages of charging DUT capacitor120and transferring the charge onto summing capacitor110are repeated a fixed number times causing the voltages of nodes N1and N2to ramp with time as illustrated in line graphs130and135, respectively. After a fixed number of consecutive charging stages and charge transferring stages, ADC converter115samples the final voltage on node N2. The capacitance CDUTis determined based on the output of ADC converter115and is proportional to the voltage at node N2after the final charge transfer stage.

Because the capacitance deviation of a capacitance sense switch due to a finger press is small compared to the underlying capacitance of the switch itself, the above two capacitance sensing techniques can be susceptible to external noise, interference, or other environmental factors. For example, parasitic capacitances may couple to the user interface, electromagnetic interference (“EMI”) may disrupt capacitance measurements and control signals, deviations in operating temperature can cause thermal expansions and dielectric variations that affect capacitance measurements, user error can result in malfunctions, and so forth. These environmental factors can often result in disruptive capacitance deviations that are larger than the capacitance changes induced by a finger interaction with the capacitance sense interface. Accordingly, a reliable capacitance sense interface and control system should account for some or all of these sources of noise.

DETAILED DESCRIPTION

FIG. 2illustrates a user finger205interacting with a capacitance sensor200, in accordance with an embodiment of the invention. In short, when a conductive object, such as user finger205, is moved into proximity with capacitance sensor200, its capacitance is increased above its baseline capacitance, resulting in a measurable capacitance change. By monitoring capacitance sensor200for deviations AC from its baseline capacitance, sensor activations can be determined and registered within software. Of course, a user interaction with capacitance sensor200is not limited to a finger. Other conductive objects may be used to interact with capacitance sensor200including, a stylus, a pen, or any other conductive object.

By grouping a plurality of capacitance sensors200into an array of capacitance sensors, such as a radial slider array, a linear slider array, a touch pad array, or the like, a variety of capacitance sense interfaces may be implemented. For example, capacitance sensor arrays may be used to implement user interfaces of a variety of products including: door switches, white goods (e.g., kitchen appliances), laptop computers, desktop computers, personal digital assistants (“PDAs”), portable music players (e.g., MP3 players), wireless telephones, cellular telephones, radios, or the like. Capacitance sensor arrays may also be used to implement position sensors.

FIG. 3Ais a functional block diagram illustrating a capacitance sensor circuit300, in accordance with an embodiment of the invention. The illustrated embodiment of capacitance sensor circuit300includes capacitance measurement circuitry305, an input/output (“I/O”) interface310, and a capacitance sense interface315. I/O interface310links capacitance sense interface315to capacitance measurement circuit305. In one embodiment, I/O interface310is a configurable analog interconnect between capacitance measurement circuitry305and capacitance sense interface315. For example, I/O interface310may be configured to sequentially scan multiple capacitance (“CAP”) sensors within capacitance sense interface315to time-share capacitance measurement circuitry305. Once connected to an individual CAP sensor within capacitance sense interface315, capacitance measurement circuitry305can measure its capacitance to determine whether its capacitance has deviated sufficiently from its baseline capacitance such that the activation event should be registered in software as a user activation (i.e., acknowledged in software such that an appropriate action or function is executed).

Capacitance measurement circuitry305may be implemented using a variety of different capacitance measurement circuits, such as capacitance measurement circuit100, capacitance measurement circuit101, or otherwise. During operation, capacitance measurement circuitry305may output a signal or value that is representative of the capacitance of a selected CAP sensor. In one embodiment, this value may include a count of a number of clock cycles from a gated reference clock that transpired during a single charge and discharge cycle of the selected CAP sensor. This value or count may subsequently be analyzed by software to determine whether the measured capacitance deviation should be registered (i.e., acknowledged) by software as a valid user activation event.

FIGS. 3B and 3Cillustrate examples of capacitance sense interface315, in accordance with an embodiment of the invention.FIG. 3Billustrates a radial slider interface320having twelve individual CAP sensors325.FIG. 3Cillustrates a linear slider interface330having seven CAP sensors325. It should be appreciated that radial slider interface320and linear slider interface330may include more or less CAP sensors than illustrated. Furthermore, radial slider interface320and linear slider interface330are only intended as example embodiments of capacitance sense interface315. Other configurations or arrays of CAP sensors may be implemented.

FIG. 4is a chart400illustrating a scanning technique for use with capacitance sensor circuit300to monitor capacitance sense interface315for user activations, in accordance with an embodiment of the invention. Chart400plots capacitance values for CAP sensors325versus time. The capacitance values plotted along the y-axis of chart400are values determined by capacitance measurement circuitry305that are representative of a measured capacitance of CAP sensors325. In one embodiment, the capacitance values are clock cycle counts gated by relaxation oscillator circuitry included within capacitance measurement circuitry305. In one embodiment, the capacitance values are the output of an analog-to-digital (“ADC”) converter (e.g., ADC115).

Each trace S0, S1, S2, S3, S4represents a measured capacitance value associated with a corresponding one of CAP sensors325(only five traces are illustrated so as not to clutter the drawing). Each CAP sensor325is sampled in sequence by capacitance measurement circuitry305one time during each scan cycle (e.g., scan cycles1,2,3,4, and5are illustrated). For example, CAP sensor325A (represented by trace S0) is sampled at times T0, T6, T8, T10, T12. . . , CAP sensor325B (represented by trace S1) is sampled at time T1, CAP sensor325C (represented by trace S2) is sampled at time T2, and so on. Traces S0to S4have been staggered vertically for clarity; however, if CAP sensors325are physically identical in size and orientation, traces S0to S4may in fact overlap with minor deviations due to localized variations in the capacitances of each CAP sensor325.

During operation, the baseline capacitance of CAP sensors325may drift due to a variety of environmental factors, such as temperature changes, dynamically changing parasitic capacitances, localized disturbances, electromagnetic interference (“EMI”), or otherwise. This drift is illustrated by the wandering traces S1to S4. Furthermore, chart400illustrates a user activation of CAP sensor325A sometime between the samplings of CAP sensor325A at time T6and time T8. In one embodiment, when the measured capacitance value of CAP sensor325A crosses the activation threshold, the user activation of CAP sensor325A is registered or acknowledged by software or hardware logic coupled to capacitance measurement circuitry305.

FIG. 5is a functional block diagram illustrating a system500for improved capacitive touch sensing, in accordance with an embodiment of the invention. The illustrated embodiment of system500includes capacitance sensor circuit300, touch sense logic505, application logic510, and I/O device515. The illustrated embodiment of touch sense logic505includes a startup logic component520, a baseline logic component525, a hysteresis logic component530, an electrostatic discharge (“ESD”) component535, and an interpolation logic component540.

During operation, capacitance measurement circuit305outputs a signal550being indicative of a capacitance or capacitance change of a selected one of CAP sensors325within capacitance sense interface315. In one embodiment, capacitance measurement circuit305includes a relaxation oscillator and signal550is representative of a frequency change Δf or a period change ΔP of the oscillator circuit. In one embodiment, signal550is the output of a gated clock signal that forms a counter. The number of gated clock cycles counted by the counter is then related to the capacitance on the selected CAP sensor325in a similar manner as the frequency change Δf or the period change ΔP is related to the capacitance on the selected CAP sensor325, discussed above.

Touch sense logic505may be implemented entirely in software or firmware (e.g., machine readable instructions), entirely in hardware (e.g., application specific integrated circuit, field programmable gate array, etc.), or some combination of both. Touch sense logic505analyzes signal550to compensate for various environmental factors (e.g., temperature drift), filter noise, reject false activation events (e.g., reject ESD events), interpolate higher resolution from capacitance sense interface315, and compensate for various other user interactions with the capacitance sense interface315. Touch sense logic505analyzes signal550to determine whether an actuations of CAP sensors325should be registered (acknowledged) as valid touch events or rejected (masked) as false touch events. While analyzing signal550, the touch sense logic may implement one or more of the techniques discussed below.

Application logic510represents various user applications that may receive input from capacitance sensor circuit300, use the input to manipulate application data, and generate output for I/O device515. I/O device515may represent any type of I/O device including a display, a network interface card, an audio port, various peripheral devices, and the like.

A) Baseline Drift Compensation Technique

FIG. 6is a chart600illustrating a baseline drift compensation technique for improved capacitive touch sense operation, in accordance with an embodiment of the invention. In general, capacitance sensor circuit300measures a change in capacitance from a deactivated state to an activated state of a selected CAP sensor325. In one embodiment, baseline logic525monitors the difference between the current value of signal550and a historical or baseline value. Thresholds for determining whether an activation event has in fact occurred are set related to these historical or baseline values. Measured capacitance values that pass over the activation threshold are considered to be touch events. Accordingly, it is important to accurately track the baseline capacitance values associated with CAP sensors325should they drift over time.

Background (or “parasitic”) capacitance may change slowly as a result of environmental factors (temperature drift, electrostatic charge build up, etc.). The activation threshold values should be adjusted to compensate for this background capacitance and other factors. This may be done by monitoring signal550in real-time, and updating the baseline capacitance value on a regular basis based on the actual capacitance values measured during each sampling cycle. In one embodiment, the baseline capacitance value for each CAP sensor325is tracked and updated using a weighted moving average. For example, the weighted moving average may apply a 0.25 weight to the presently measured capacitance value and a 0.75 weight to the historical baseline capacitance value. Of course, other weights may be applied. In one embodiment, infinite impulse response (“IIR”) filters are used to filter signal550in real-time and make computation of the weighted moving average efficient.

As illustrated inFIG. 6, when an activation is sensed, the baseline capacitance value is held steady so that the elevated values due to the user interaction do not skew the baseline capacitance value calculation. Accordingly, during activations the baseline update algorithm is disabled and the measured capacitance values masked so as to hold the baseline capacitance value steady until the CAP sensor is deactivated.

The rate at which the baseline capacitance values are updated can be set as part of the system design and even updated by users at a later date. The automatic update rate or interval may also be set by the user to compensate for expected environmental variance. In the event that environmental changes are too rapid, the automatic update rate can be adjusted at run-time to compensate. In one embodiment, the update interval may be set to every Nth sampling (e.g., N=5), where N can be any positive integer.

The baseline capacitance values for each CAP sensor325may be adjusted individually or as part of a sensor group (e.g., sensor groups340or350). Tracking and updating baseline capacitance values for each CAP sensor325allows different environmental effects to be compensated in each CAP sensor325independently. Alternatively, a group baseline capacitance value compensation enables variations to be averaged over a group of CAP sensors325. Accordingly, an embodiment of the invention enables convenient group compensation of baseline capacitance values and the update rate to be applied to a group of CAP sensors325. This may be useful for groups of CAP sensors325that are physically adjacent to each other in capacitance sense interface315.

B) Finger on Startup Detection Technique

FIG. 7is a chart700illustrating a finger on startup detection technique for improved capacitive touch sense operation, in accordance with an embodiment of the invention. In one embodiment, the baseline capacitance values discussed above are initialized upon booting or starting system500. If during the initialization procedures (e.g., time T0to T1inFIG. 7), one or more CAP sensors325are actuated by a user (e.g., the user has his finger on one or more CAP sense buttons), it may be necessary to detect this condition and quickly update the startup baseline capacitance values. After the user removes the activation (time T2inFIG. 7), the measured capacitance value of signal550will change to a negative value below the startup baseline capacitance value. Simply relying on the baseline logic525to slowly track down the startup baseline capacitance value using the weighted moving average can take too long, during which time user interaction with capacitance sense interface315will not be recognized. Accordingly this finger on startup condition should be quickly recognized and compensated.

In one embodiment, the finger on startup condition is determined by startup logic520, if the measured capacitance values of signal550cross a negative finger threshold below the startup baseline capacitance value and remains below it for a predetermined period of time (Tp). If this condition is found to be valid, then the startup baseline capacitance value is immediately updated by averaging the capacitance values measured after signal550dropped below the negative finger threshold. In one embodiment, the predetermined period of time Tp is a fixed number of sampling cycles (e.g., five sampling cycles).

C) Activation with Hysteresis Technique

FIG. 8is a chart800illustrating activation of CAP sensors325using hysteresis for improved capacitive touch sense operation, in accordance with an embodiment of the invention. Depending on the scan rate of a capacitance sense interface315, rapid repeat activation of the CAP sensors325may result in measured capacitance values that do not return all the way to the baseline capacitance value between activations. Unless compensated for, rapid repeat activations may not be detected.

To compensate for rapid repeat activations, hysteresis logic530may add hysteresis to the detection algorithm by applying two separate thresholds for determining when a selected CAP sensor325is activated and when the selected CAP sensor325is deactivated. As illustrated inFIG. 8, hysteresis logic530may add an activation threshold and a lower deactivation threshold. When a measured capacitance value cross the activation threshold, the corresponding CAP sensor325is registered as “activated.” When the measured capacitance value falls below the deactivation threshold, the corresponding CAP sensor325is deemed “deactivated.” In this manner, the measured capacitance value need not return all the way to the baseline capacitance value before an activation is deemed deactivated, nor does the measured capacitance value need to return to the baseline capacitance value to register a subsequent activation.

D) ESD Compensation Technique

FIG. 9Aillustrates typical measured profiles for a finger event and an ESD event on CAP sensors325, in accordance with an embodiment of the invention. As can be seen, the measured capacitance values rise and fall gradually as a user finger (or other conductive device) approaches and departs capacitance sense interface315. In contrast, an ESD event is typified by a rapid spike above the baseline capacitance value, followed by a rapid drop below the baseline capacitance value followed by a ringing or transients with rapidly declining envelope.

FIG. 9Bis a chart900illustrating an ESD compensation technique for rejecting ESD events, in accordance with an embodiment of the invention. The user interface environment has substantial opportunity for interruption from ESD events. In order to prevent false activation, signal550is evaluated by ESD logic535. The nature of ESD events is to inject large fast transients into the measured capacitance values, as illustrated inFIG. 9A. ESD logic535can reject these ESD events by quickly recognizing these transients and masking the false event for a period of time.

ESD logic535can recognize an ESD event by monitoring the slope between consecutive samplings of the measured capacitance values (e.g., calculating the derivative of traces S0to S4is real-time) and determining whether the measured capacitance values cross an ESD threshold below the baseline capacitance value. When the derivative value is significantly faster than typical of human activation, an activation may be rejected as an ESD event. In one embodiment, ESD logic535determines that an ESD event has occurred if: (1) the slope of the measured capacitance value turns positive and has a magnitude greater than a positive slope threshold (POS_SLOPE_TH), (2) the slope of the measured capacitance value then turns negative and has a magnitude greater than a negative slope threshold (NEG_SLOPE_TH), and (3) the measured capacitance value cross an ESD threshold (ESD_TH) below the baseline capacitance value. ESD logic535may apply a fourth requirement that conditions (1), (2), and (3) occur within a predetermined time threshold. If ESD logic535determines these conditions are valid, then the activation event is rejected as a false activation or ESD event and all activation on the particular CAP sensor325will be rejected or masked for a period of time.

E) Variable Resolution Via Interpolation

Some application logic510may require the use of a sliding switch, such as radial slider interface320or linear slider interface330. In many cases the resolution desired is much finer than is physically possible by simply using a greater number of smaller CAP sensors325. There may also be a desire for detecting greater resolution or granularity than there are physical CAP sensors in the physical array of CAP sensors. In one embodiment, interpolation logic540includes detection algorithms to assess the signal strength on each CAP sensor in the array and map the measured values onto a user selected number of CAP sensors (e.g., interpolation). Typical examples include mapping eight linearly spaced CAP sensors325onto a 0 to 100 scale, mapping twenty CAP sensors325onto a 0 to 256 scale, or mapping eight CAP sensors325onto six separate capacitance sense buttons. The calculations may be done with fractional fixed point for efficiency in a limited capability microcontroller.

FIG. 10is a flow chart illustrating a process1000for improved capacitive touch sensing using system500, in accordance with an embodiment of the invention. The order in which some or all of the process blocks appear in process1000below should not be deemed limiting. Rather, one of ordinary skill in the art having the benefit of the present disclosure will understand that some of the process blocks may be executed in a variety of orders or even in parallel.

In a process block1005, capacitance sensor circuit300commences measuring the capacitance values associated with CAP sensors325. In one embodiment, I/O interface310is configured to scan each CAP sensor325in sequence to time share capacitance measurement circuit305across all CAP sensors325. Accordingly, the measured capacitance values for all CAP sensors325may be obtained in process block1005before continuing on with the rest of process1000, or process1000may be executed in its entirety after obtaining a single measured capacitance value, before moving to the next CAP sensor325in the sequence.

In a decision block1010, touch sense logic505determines whether system500was started with a user finger on capacitance sense interface315. If so, then the baseline capacitance values for CAP sensors325are recalculated in process block1015. In a process block1020, touch sense logic505tracks the baseline capacitance value(s) of CAP sensors325in capacitance sense interface315. If the baseline capacitance values drift, then a weighted moving average may be applied to update the baseline average and track the baseline drift. In a process block1025, hysteresis is applied to signal550to determine whether any of CAP sensors325have been activated or deactivated (decision block1030). Finally, in a process block1035, touch sense logic505evaluates signal505to determine whether the activation should be acknowledged or registered as a valid user activation or rejected as a false activation. Rejecting the activation as a false activation may include identifying noise (e.g., ESD events) in signal505and compensating (e.g., reject ESD events).

FIG. 6illustrates a demonstrative integrated circuit (“IC”)1100implemented using an embodiment of system500. IC1100illustrates a Programmable System on a Chip (PSoC⊥) microcontroller by Cypress Semiconductor Corporation. The illustrated embodiment of IC1100includes programmable input/output (“I/O”) ports1102, at least a portion of which correspond to I/O interface310. I/O ports1102are coupled to Programmable Interconnect and Logic (“PIL”)1104which acts as an interconnect between I/O ports1102and a digital block array1106. Digital block array1106may be configured to implement a variety of digital logic circuits (e.g., DAC, digital filters, digital control systems, etc.) using configurable user modules (“UMs”). Digital block array1106is further coupled to a system bus1112.

Static Random Access Memory (“SRAM”)1110and processor1111are also coupled to system bus1112. Processor1111is coupled to non-volatile storage (“NVS”)1116which may be used to store firmware (e.g., touch sense logic540).

An analog block array1118is coupled to system bus1112. Analog block array1118also may be configured to implement a variety of analog circuits (e.g., ADC, analog filters, comparators, current sources, etc.) using configurable UMs. Analog block array1118is also coupled to an analog I/O unit1124which is coupled to I/O ports1102. In one embodiment, I/O interface310is included within analog I/O1124. Various subcomponents of capacitance measurement circuit305may be implemented with various UMs of digital clock array1106and/or analog block array1118or the subcomponents may be stand alone components.

System500may be incorporated into IC1100, as well as, various other integrated circuits. Descriptions of system500may be generated and compiled for incorporation into other integrated circuits. For example, behavioral level code describing system500, or portions thereof, may be generated using a hardware descriptive language, such as VHDL or Verilog, and stored to a machine-readable storage medium. Furthermore, the behavioral level code can be compiled into register transfer level (“RTL”) code, a netlist, or even a circuit layout and stored to a machine-readable storage medium. The behavioral level code, the RTL code, the netlist, and the circuit layout all represent various levels of abstraction to describe system500.