Background technology
At present the range of application of touch-screen is from the past ATM (automatic teller machine), minority's business markets such as industrial computer, expand to rapidly mobile phone, PDA (personal digital assistant), GPS (GPS), PMP (MP3, MP4 etc.), even the mass consumption electronic applications such as panel computer.Be used for touch-screen and have that touch control operation is simple, convenient, the advantage of hommization, so touch-screen is expected to become the best interface of human-computer interaction and is widely applied in portable set rapidly.
Because the detection principle of touch-screen is exactly to detect the variation of touch-screen electric capacity, namely detect under the touch condition under the capacitance and the state that not have touch poor between the capacitance, capacitance is called baseline under this just will be less than the state of touch.Baseline is closely-related with environment, and it is the pacing items that whole system can normally be moved, and can affect performance and the function of whole system.If therefore baseline is inaccurate, maybe can't upgrade in time, even upgrade mistake, can cause whole system to work, thereby cause deadlock.
Baseline upgrades the main dual mode realization of adopting at present, below will describe in detail to this dual mode.
Mode one, the baseline update algorithm of Cypress (being proposed by Cypress company)
As shown in Figure 1, for having the baseline update algorithm synoptic diagram of Cypress now.Wherein, 100 ' is the change curve of capacitance, and 200 ' is the change curve of baseline value, and X-axis is the time, and Y-axis is the capacitance size.
1) at t0 constantly, because difference surpasses FingerThreshold+Hysteresis (finger threshold value+off-set value), therefore is judged as the moment that touches beginning;
2) at t1 constantly, because therefore difference is judged as and touches the moment that finishes, from t0 to t1 time period baseline update mechanism frozen (baseline can not upgrade) less than FingerThreshold-Hysteresis (finger threshold value-off-set value);
3) at t2 constantly, the original count fast reducing, and also negative difference has surpassed NegativeNoiseThreshold (negative noise threshold).For example, in touch-screen work engineering, on screen, add water, this situation will occur.At this constantly, the baseline update mechanism is frozen, and activates an inner time-out count device.When the difference signal of continuous 6 samples was lower than NegativeNoiseThreshold (negative noise threshold), to baseline renewals that reset, this action occurred in moment t3;
4) at t4 constantly, water is dried on the screen, and the electric capacity instantaneous value increases, and difference also can surpass FingerThreshold+Hysteresis constantly at this, and will false judgment be finger touch this moment, thereby screen can't be worked, and causes deadlock.
Therefore, as can be seen from the above description, the defective of the baseline update algorithm of Cypress is can not waterproof, namely there is being water to be poured on that base line can descend on the touch-screen, baseline can't be replied after water is dried, thereby causes the touch-screen cisco unity malfunction, the deadlock state namely occurred.
Mode two, the baseline update algorithm of Quantum
The method that the baseline update algorithm of Quantum adopts is the timing reset baseline, namely at set intervals just current instantaneous value as baseline (the electrification reset baseline initial value that is equivalent to Cypress), it only comprises all the instantaneous value information in a period of time.The algorithm of Quantum and cypress have a lot of something in common, and the below does some introductions to quantum baseline update algorithm, as shown in Figure 2, are existing Quantum baseline update algorithm synoptic diagram.As can be seen from the figure, the algorithm of Quantum constantly can be at that time instantaneous value as baseline these 5 of t0, t1, t2, t3, t4, t5.The defective of this algorithm is: be carved into t2 during t1 in upper figure in constantly this time period, because baseline value increases, cause difference to diminish, so that the former situation that should be judged as touch has become the judgement of no touch.
Embodiment
The below describes embodiments of the invention in detail, and the example of described embodiment is shown in the drawings, and wherein identical or similar label represents identical or similar element or the element with identical or similar functions from start to finish.Be exemplary below by the embodiment that is described with reference to the drawings, only be used for explaining the present invention, and can not be interpreted as limitation of the present invention.
In order clearer understanding to be arranged to baseline update method and the updating device of the embodiment of the invention, below will simply introduce the update condition of baseline and baseline.
Because baseline representative ring environment information, the capacitance information (environmental information) that detects for the first time during therefore usually start is as the initial value of baseline.Because the environmental evolution time is much bigger with respect to the transformation period that touches, but environment is more much smaller on the impact of electric capacity than touching on the impact of electric capacity, therefore also can understand like this: environmental change is a slow and less process of amplitude, and touch is a quick and larger process of amplitude.
To sum up, since baseline is the parameter of reflection environment, therefore touches and would not exert an influence to baseline, the impact that therefore touches should be by filtering.Usually can adopt the principle of similar low-pass filter: each time difference is added up, when accumulation result adds 1 and accumulation result also clear 0 greater than a certain value base line.The result who causes like this is exactly no matter difference has much, baseline adds 1 most, the very short touch process of one-period is exactly at most to increase a very little amount on the impact of baseline so, and environmental evolution is a very long process, so baseline can be increased to the value corresponding with environment by little by little adding up.
Because external environment is all changing all the time, capacitance also can and then change, but they have the scope of a variation, it can be referred to as NoiseThreshold (noise threshold).According to this rule, again above process is optimized: because the capacitance after touching is certainly greater than NoiseThreshold, so the capacitance greater than NoiseThreshold does not add up to it, only the capacitance less than NoiseThreshold just adds up.Such result just can touch the complete filtering of the impact of baseline, and baseline only changes with environmental evolution, but the environmental evolution baseline also can't detect when touching generation.Similarly, if capacitance is reduced, then accumulated value can be for negative, and when accumulation result during less than some negative values, baseline subtracts 1.As shown in Figure 3, the schematic diagram for according to accumulated value baseline being upgraded.Particularly, at first current transient data (raw data) is deducted base-line data (baseline) and obtain difference data (differ_data), then judge that whether difference is less than NoiseThreshold, add up less than then putting in the difference bucket (being totalizer), otherwise just abandon.When the data accumulation in the difference bucket during to a certain amount of (for example reaching BaselineRefresh), baseline just adds 1 and clear 0 (being totalizer clear 0) of difference bucket.Here it should be noted that still after this difference is always greater than NoiseThreshold if accumulated value is not greater than BaselineRefresh, then the difference bucket can be by clear 0.
Because environmental evolution is not necessarily got caught up in the variation of baseline, touching so change amount and environment that electric capacity is caused will can affect to system to the change amount stack that electric capacity causes, so not necessarily touch greater than NoiseThreshold, also defined the FingerThreshold (finger threshold value) of another one greater than the value of NoiseThreshold at this, FingerThreshold has determined no touch.In addition because when touching, electric capacity is fixed value not necessarily also, and it also has fluctuation, has therefore also defined another one value Hysteresis (off-set value), and it has determined a scope, and fluctuation can not affect to touch and judge in this scope.Its principle is to be judged as touch from no touch, and then difference must be greater than FingerThreshold+Hysteresis, and still if from there being touch to be judged as no touch, then difference must be less than FingerThreshold-Hysteresis.Therefore can find out no matter no touch is arranged, difference fluctuates in the 2Hystersis interval can not affect touch condition.In addition, in order to prevent burr, also defined another one parameter S TTH (duration).Because touch can continue for some time, just think that effective touch is arranged so only have when difference continues STTH time during greater than FingerThreshold+Hysteresis.Because the time that touches to next time from touch disappearing is longer, disappear so only have when difference continues just to think to touch during less than FingerThreshold-Hysteresis for 6 times.
Although above slowly news more to the decision condition that touches and baseline, but in actual use, the situation that baseline also may exist extreme value to recover, be that capacitance significantly changes suddenly, if baseline slowly recovers according to the mode of aforementioned ± 1, then must cause the value of baseline inaccurate, thereby may cause deadlock.For example, difference might be for negative, and less than-NoiseThreshold, at this moment can not be used as simple noise to it has judged, be very large value because hand touches the initial value that causes baseline when this situation generally is start, the value (current environment value) that system detected after hand was decontroled a moment later is much smaller than the situation of baseline value.Reflect this situation so also defined another one value NegativeNoiseThreshold (negative noise threshold) at this, if difference is less than NegativeNoiseThreshold then think that this situation occurs, then baseline is resetted, namely current environment information is assigned to baseline, makes baseline can catch up with rapidly environmental evolution.Because the speed that baseline upgrades is slower, so can continue a very long time after this situation occurs, in order to prevent burr, it has been generally acknowledged that when difference to represent that this situation occurs during continuously less than the NegativeNoiseThreshold of 6 times (the first duration), and giving baseline to the sampled value of current environment information.It should be noted that NegativeNoiseThreshold can that is to say that at this time baseline can upgrade greater than-NoiseThreshold, but a moment later or can reset.
Followingly analyze various situations according to an example, as shown in Figure 4, be baseline update mode synoptic diagram.
1) at moment t0, current transient data (this moment be the initial capacitance value) is close to datum level, and owing to humidity or temperature variation begin slow decreasing.Because original count does not surpass NegativeNoiseThreshold between continuous 2 conversions, baseline can upgrade by following the trail of the original count minimum value, and keeps the low numerical value of original count signal;
2) at moment t1, current transient data (current capacitance) fast reducing, and also negative difference has surpassed NegativeNoiseThreshold (negative noise threshold).Finger be placed on the touch-screen in equipment energising, when then finger is removed over time, just this situation might appear.At this constantly, the baseline update mechanism is frozen, and activates an inner time-out count device.Being lower than NegativeNoiseThreshold (negative noise threshold) base line at the difference signal of continuous 6 samples (the first duration) resets.This action occurs in constantly t2.
3) at moment t3, the 2nd larger negative difference signal peaks occurs, for instance, this spike may be to be caused by certain static discharge (ESD) event.Because the duration of this spike in sample counting less than 6 samples (the first duration), do not reset so continue the maintenance baseline, and this spiking filtering disposed.The falseness that has so just prevented that false baseline reset operation occurs and caused touches and detects.
4) touch-screen is touched at moment t4.If difference signal has surpassed the number of times of FingerThreshold+Hysteresis and surpassed STTH sample, the state of this touch-screen is set to out.This action occurs in constantly t5.
5) be reduced to the FingerThreshold-Hysteresis of t7 constantly when following at difference signal, the touch-screen state turn to off status at once.The in short-term positive spike of constantly t9 appearance is filtered by debounce counter, because the duration of this spike in sample unit be not above 6.
6) original count slowly upwards drift between moment t7 to t10.When difference signal was lower than noise threshold, baseline adopted the bucket algorithm to upgrade, and this difference signal is directly proportional with drift rate.Adopt the BaselineRefresh parameter can control the baseline renewal speed.Lower parameter values provides faster baseline renewal speed.
As shown in Figure 5, be the baseline update method process flow diagram of the embodiment of the invention.The method may further comprise the steps:
Step S501, whether the present frame that detects touch-screen is the first frame capacitance.If be not the first frame capacitance, then go to step S503.
Step S502, if the first frame capacitance, then the first frame capacitance according to touch-screen arranges baseline, is about to the first frame capacitance and is assigned to baseline.Then go to step S512, receive the next frame capacitance.
Step S503, if not the first frame capacitance, then with its current capacitance as touch-screen, and calculate difference between current capacitance and the baseline, judge that further whether difference between current capacitance and the described baseline is less than NegativeNoiseThreshold (negative noise threshold).In one embodiment of the invention, the scope of NegativeNoiseThreshold (negative noise threshold) is-30 to-50, wherein is preferably-40.Simultaneously, if judge that difference between current capacitance and the baseline is less than NegativeNoiseThreshold (negative noise threshold), then start the first timer and carry out timing, and further judge between current capacitance and the baseline difference whether within very first time scope all less than negative noise threshold.In one embodiment of the invention, very first time scope is 5-8 sample time, is preferably 6 sample times.If not within very first time scope all less than negative noise threshold, then go to step S505.
Step S504, if within very first time scope all less than negative noise threshold, then upgrade baseline to carry out the extreme value restore funcitons of baseline according to current capacitance, be about to current capacitance and be assigned to baseline, so that baseline can be caught up with the variation of current capacitance in time.Then go to step S512, receive the next frame capacitance.
Step S505 judges according to the difference between the baseline after current capacitance and the renewal whether touch-screen is touched.In an embodiment of the present invention, describe for for every frame capacitance for the renewal of baseline, therefore, for clarity, be described as an example of a frame example in this embodiment, but the renewal that is similar to step S504 for baseline is only carried out once, and this frame that is updated in of baseline carries out before in this embodiment, therefore adopts baseline and current capacitance after upgrading to compare at this.Be the baseline after in step S504, upgrading.Certainly in other embodiments of the invention, if for example the difference number of times that surpassed FingerThreshold+Hysteresis has surpassed STTH sample, think that then touch-screen is touched.If judge that touch-screen is not touched, then go to step S508.
Step S506, if judge that touch-screen is touched, then close baseline the extreme value restore funcitons so that current capacitance and upgrade after baseline between difference no longer upgrade baseline during again less than negative noise threshold, even difference afterwards namely is less than negative noise threshold, and satisfy the requirement of very first time scope, capacitance can be assigned to baseline yet, thereby reach waterproof effect.
In one embodiment of the invention, owing in testing process, also need baseline carried out ± 1 slow renewal, namely when current capacitance is between positive noise threshold and negative noise threshold, the difference of current capacitance and baseline added in the totalizer adds up, thus when totalizer reaches certain value with baseline ± 1.In an embodiment of the present invention, when closing the extreme value restore funcitons of baseline, also with the totalizer zero clearing.Because environment is to be in the variation always, be not only baseline value ± 1 just not to have been dealt with baseline value afterwards at this, therefore, judge for the next time correct state to baseline value, then need the zero clearing of limit totalizer, in order to use next time.
In one embodiment of the invention, the extreme value restore funcitons of closing baseline can be accomplished in several ways, for example, can close above-mentioned the first timer, perhaps, to bear noise threshold and change minimal value into, for example it is set to-400, perhaps changes very first time scope into maximum value, for example 100 sample times etc., so-called its purpose of maximum value is exactly certain some condition of extreme value restore funcitons can't be reached get final product, thereby reaches the purpose of closing.Certainly those skilled in the art also can propose according to above-mentioned thought other the mode of closing, and these all should be included within protection scope of the present invention.
Step S507, the coordinate of the difference calculating touch point according to current capacitance and between the baseline after upgrading.Then go to step S512, receive the next frame capacitance.
Step S508 judges that the difference of current capacitance and baseline is whether between positive noise threshold and negative noise threshold.If between positive noise threshold and negative noise threshold, then do not go to step S512, receive the next frame capacitance.
Step S509 is if the difference of judging current capacitance and baseline between positive noise threshold and negative noise threshold, then adds up in the difference adding totalizer with current capacitance and baseline.And execution in step S510.
Step S510 judges that whether the absolute value of the accumulated value in the totalizer is greater than upgrading threshold value.If the absolute value of the accumulated value in the judgement totalizer is not more than the renewal threshold value, then go to step S512, receive the next frame capacitance.
Step S511, until the accumulated value in the totalizer is when upgrading threshold value, then with baseline+1, perhaps until the accumulated value in the totalizer during less than negative renewal threshold value, then with baseline-1, and simultaneously with the totalizer zero clearing.Go to step S512, receive the next frame capacitance.
Step S512 receives the next frame capacitance.
In one embodiment of the invention, also comprise: the capacitance that receives next frame; When the capacitance of described next frame is between positive noise threshold and negative noise threshold, the difference of the capacitance of next frame and baseline added in the totalizer add up, until the absolute value of the accumulated value in the totalizer is when upgrading threshold value, then with baseline ± 1, and simultaneously with described totalizer zero clearing.
As shown in Figure 6, the baseline for the embodiment of the invention upgrades synoptic diagram.
1) at moment t0, original count (current capacitance) fast reducing, and also negative difference has surpassed NegativeNoiseThreshold (negative noise threshold).Finger be placed on the touch-screen in equipment energising, when then finger is removed over time, just this situation might appear.At this constantly, the baseline update mechanism is frozen, and activates an inner time-out count device.When the difference signal of continuous 6 samples (very first time scope) was lower than NegativeNoiseThreshold (negative noise threshold), baseline resetted, and this action occurs in constantly t1.
2) touch-screen is touched at moment t2.If difference signal has surpassed the number of times of FingerThreshold+Hysteresis and has surpassed STTH sample, and the Rule of judgment of this back is closed, so that occur again can't carrying out the operation same with previous step when negative difference surpasses negative noise threshold next time.The state of this touch-screen is set to out.This action occurs in constantly t3.
3) at moment t4, have water to flow on the touch-screen, caused instantaneous value to descend rapidly, but owing to closed 1 at moment t2) in again assignment code, the extreme value restore funcitons that is about to baseline is closed, and therefore baseline can't moment decline as in the first step herein.
4) moment t5, water is wiped, but owing to the material reason, still can allow instantaneous value can't directly get back to constantly t4 value before, causes value added beginning of burden to be added up, when arriving t6 moment accumulated value greater than setting, so that baseline-1.
As shown in Figure 7, be the contactor control device structural drawing of the embodiment of the invention.This contactor control device comprises touch-screen 100, touch screen controller 200 and host computer 300.Wherein, touch-screen 100 has detection part to detect the capacitance of touch-screen 100.Touch screen controller 200 links to each other with the detection part of touch-screen 100, and touch screen controller 200 comprises that further baseline arranges module 210, the first timer 220, baseline update module 230, touches detection module 240 and control module 250.Wherein, baseline arranges module 210 and according to the first frame capacitance that the detection part of touch-screen 100 detects baseline is set.The first timer 220 links to each other with the detection part that baseline arranges module 210 and touch-screen 100, and the difference of the first timer 220 between current capacitance and baseline carried out timing during less than negative noise threshold.Baseline update module 230 links to each other with the detection part that the first timer 220, baseline arrange module 210 and touch-screen 100 respectively, the current capacitance that baseline update module 230 detects at detection module and the difference between the baseline during all less than negative noise threshold, are upgraded baseline to carry out the extreme value restore funcitons of baseline according to current capacitance within very first time scope.Touch that detection module 240 arranges module 210 with baseline respectively, baseline update module 230 links to each other with detection part, the difference that touches between the baseline of detection module 240 after according to current capacitance and renewal judges whether touch-screen is touched.Control module 250 links to each other with touch detection module 240 with baseline update module 230 respectively, control module 250 detects 240 to touch-screen 100 is touched after touching detection module, control baseline update module 230 close baseline the extreme value restore funcitons so that current capacitance and upgrade after baseline between difference again no longer upgrade baseline when bearing noise threshold.
In one embodiment of the invention, host computer 300 links to each other with touch screen controller 200, detect after touch-screen 100 is touched touching detection module 240, touch detection module 240 with current capacitance and the baseline after upgrading sends to host computer 300, host computer 300 according to current capacitance and the difference between the baseline after upgrading calculate the coordinate of touch point.
In one embodiment of the invention, control module 250 is by closing the first timer 220, and perhaps control module 250 changes negative noise threshold or the very first time scope of storage in the baseline update module 230 into extreme value restore funcitons that maximum value is closed baseline.
In one embodiment of the invention, touch screen controller 200 also comprises totalizer 260.When the difference of current capacitance and baseline is between positive noise threshold and negative noise threshold, add up in the difference adding totalizer 260 with current capacitance and baseline, control module 250 links to each other with totalizer 260, control module 250 is when closing the extreme value restore funcitons of baseline, with totalizer 260 zero clearings.
Can be so that touch-screen be suitable for various working environment by embodiments of the invention, and can not affect the operating rate of touch-screen, and can reach certain waterproof effect, thereby so that touch-screen can work.In addition, the embodiment of the invention is avoided adopting at set intervals and just current capacitance is carried out the baseline renewal as the mode of baseline, has therefore solved the problem that can occur losing efficacy when finger touches in a place for a long time.
In the description of this instructions, the description of reference term " embodiment ", " some embodiment ", " example ", " concrete example " or " some examples " etc. means to be contained at least one embodiment of the present invention or the example in conjunction with specific features, structure, material or the characteristics of this embodiment or example description.In this manual, the schematic statement of above-mentioned term not necessarily referred to identical embodiment or example.And the specific features of description, structure, material or characteristics can be with suitable mode combinations in any one or more embodiment or example.
Although illustrated and described embodiments of the invention, for the ordinary skill in the art, be appreciated that without departing from the principles and spirit of the present invention and can carry out multiple variation, modification, replacement and modification to these embodiment that scope of the present invention is by claims and be equal to and limit.