Guide to Tuning Touch Sensors

 Objective

This page explains the step-by-step procedure to tune the touch sensors. The following figure represents the steps involved in tuning the touch sensors. The steps must be followed in sequence.

TuningSteps.png

 Procedure

Preparation

1.1

Front Panel

  • Front panel should securely adhere to the sensor Printed Circuit Board (PCB).
  • There should not be any air-gap:
    • Air-gaps cause unit-to-unit variation.
    • Reduce sensitivity significantly.
    • Cause unpredictable touch behavior.
  • The assembly should be representative of the final product assembly. If not, retune may be required for production.

1.2

External Resistor

Refer to the following table for which initial series resistor configuration should be used for tuning. If you don’t know the Targeted Noise Immunity, select the resistor based on the power supply.

This resistor value may need to be changed during noise tuning (Step 4).

Self-capacitance Self-capacitance + Shield Mutual capacitance
Target Noise Immunity (conducted immunity)
High (10 V) 100 K 50 K 1 K (100 K internal)
Medium (3 V) 50 K 10 K 1 K (50 K internal)
Low (1 V) 1 K 1 K 1 K (0 internal)
Power Supply
Battery Operated 1 K 1 K 1 K (0 internal)
Mains power supply 10 K 5 K 1 K (10 K internal)

1.3

Power Supply

  • The initial touch tuning, such as charge time, sensitivity, etc., requires a stable power supply.
  • Use a bench supply to power the MCU until basic tuning is completed.

1.4

Project Generation

  • For tuning the touch sensor, it would be good to have a project with just the touch application and debugging data available on the Data Visualizer.
  • Go to START and generate a touch ONLY project.
    • Configure the touch pins.
    • Configure the debug pins.
    • Enable Sensor Charge Time auto-tune option.
    • Enable Frequency Hop auto-tune option (if Target Noise Immunity is medium or high).
    • Keep the other parameters to default values.
  • Download a copy of the project with the Sensor Charge Time auto-tune option disabled.

Charge-time Tuning

2.1

Monitoring CSD/Prescaler

  • It is required that you ensure each sensor is fully charged during each measurement to get correct results.
  • Most Peripheral Touch Controller (PTC) devices have a configurable “Charge Share Delay (CSD)” to adjust the charge time during each measurement. Increasing the CSD increases charge time.
  • Some PTC devices do not have CSD option. For such devices, the PTC Prescaler can be used to increase the charge time. Increasing the Prescaler increases charge time.
  1. Build and program the HEX file.
  2. Using the Data Visualizer, monitor the auto-tuned value (Prescaler or CSD).
  3. Power-off and power-on a couple of times to ensure that the same Prescaler/CSD values are obtained.

Result: Note the auto-tuned Prescaler/CSD values.

2.2

CSD/Prescaler Configuration in Project

Now the auto-tuned value is available. Configure the auto-tuned values into the non-auto-tuned project. This is done to save memory.
Steps to configure the CSD/Prescaler in the project:

  1. Open the project with the auto-tune charge option disabled.
  2. Configure the Prescaler/CSD which we noted in the previous step. To take tolerance into account, use higher values than the auto-tuned values.
    • In the case of CSD, use a 20% higher value. Example: If auto-tune CSD value is 10, then use 12.
    • In the case of the Prescaler, use one higher Prescaler value. Example: If the auto-tune Prescaler is PRSC_DIV_SEL_1, then use PRSC_DIV_SEL_2.
  3. Program the project and monitor the touch parameters in Data Visualizer.

2.3

Steps to Manually Tune CSD/Prescaler (optional):

  1. Observe the touch delta (let us assume this delta value as X).
  2. Increase the CSD by one step and observe the touch delta (let us assume this delta as Y).
  3. If the difference between Y and X is more than 10% of X, go to step 2.
  4. If the difference in delta value is not more than 10%, then reduce the CSD setting by one step and use it for touch acquisition.

For example, assume the following:

  1. With CSD = 3, the touch delta is 20 counts.
  2. With CSD = 5, the touch delta increased to 25 counts.
  3. With CSD = 6, the touch delta increased to 26 counts.

In this example, increasing the CSD to 6 only provides a marginal improvement in touch delta compared to CSD = 5. So, it is better to use CSD = 5. To take tolerance into account, use higher values than the values resulting from the manual tune.

  • In the case of CSD, use a 20% higher value. Example: If auto-tune CSD value is 10, then use 12.
  • In the case of the Prescaler, use one higher Prescaler value. Example: If the auto-tune Prescaler is PRSC_DIV_SEL_1, then use PRSC_DIV_SEL_2.
  • If CSD is not available, use the Prescaler.

Sample Configuration in touch.h file with CSD shown in red: If CSD is not available, this field will be blank.

#define NODE_0_PARAMS
{
X(1), Y(3), 5, NODE_RSEL_PRSC(RSEL_VAL_0, PRSC_DIV_SEL_1), NODE_GAIN(GAIN_1, GAIN_1), FILTER_LEVEL_16
}

Sample Configuration in touch.h file with Prescaler shown in red:
#define NODE_0_PARAMS
{
X(1), Y(3), 0, NODE_RSEL_PRSC(RSEL_VAL_0, PRSC_DIV_SEL_1), NODE_GAIN(GAIN_1, GAIN_1), FILTER_LEVEL_16
}

Sensitivity Tuning

3.1

Overview

The purpose of this step is to optimize sensitivity for a light finger touch, as shown in the following image:

Sensitivity.png

3.1.1

Battery Operated Systems

If the system is battery operated, you might notice a reduction in sensitivity compared to that of a bench supply powered system.

In this condition, you may need to tune the sensitivity with isolated ground circuitry (like optocouplers).

3.1.2

Sensitivity Tuning with Gain

  • We recommended starting with an analog gain of 1 for best noise performance. Do not change if adequate sensitivity is achieved. Increasing analog gain reduces noise margin.
  • There is no advantage to having delta values higher than 50 counts. Consider reducing the gain to keep it under 50 counts.

Sample Configuration in touch.h file with Digital Gain shown in red:
#define NODE_0_PARAMS
{
X(1), Y(3), 0, NODE_RSEL_PRSC(RSEL_VAL_0, PRSC_DIV_SEL_1), NODE_GAIN(GAIN_1, GAIN_1), FILTER_LEVEL_16
}

Steps to tune the gain settings:

  1. Keep the analog gain and digital gain as GAIN_1.
  2. Observe the touch delta by gently touching the sensors. If the touch delta is >30 then use these gain settings. If not, go to step 3.
  3. Increase the digital gain by 1 step and go to step 1.
    • Ensure that ratio FILTER_LEVEL/D_GAIN >= 8. For example, if D_GAIN = GAIN_4, then the filter level should be at least FILTER_LEVEL_32).
    • Maximum digital gain should be limited to GAIN_8. Using more than that will reduce the Signal-to-Noise Ratio (SNR).

3.1.3

Sensitivity Tuning with Threshold

Steps to tune threshold:

  1. Monitor the touch delta value for each sensor.
  2. Configure the threshold as 50~60% of the touch delta values.
  3. Ensure that for light finger touch, the sensor goes into detect.
  4. Adjust the sensitivity as required by performing a slight variation on the threshold.

Sample Configuration in touch.h file with Threshold shown in red:
#define KEY_0_PARAMS
{
20, HYST_25, NO_AKS_GROUP
}

3.1.4

Tuning Sensitivity for Slider/Wheel/Surface

Steps to tune threshold for Slider/Wheel/Surface:

  1. Monitor the touch delta value for each button on the slider/wheel/surface sensor.
  2. Configure the threshold as 50~60% of the touch delta values for each button.
  3. Ensure that for light finger touch, the sensor goes into detect.
  4. Adjust the sensitivity as required by performing a slight variation on the threshold.
  5. Move the finger throughout the sensor area and monitor the contact size on the Data Visualizer. Configure MIN_CONTACT value as 70% of the contact size observed on the Data Visualizer.
  6. Perform minor adjustments on MIN_CONTACT value and ensure that the position reported is smooth through the sensor.

Sample Configuration in touch.h file with MIN_CONTACT shown in red:
#define SCROLLER_0_PARAMS
{
SCROLLER_TYPE_SLIDER, 1, 3, SCR_RESOL_DEADBAND(RESOL_8_BIT, DB_10_PERCENT), 8, 20
}

Noise Tuning

4.1

Understanding the Type of Noise Present in the System

4.1.1

Power Supply Noise

  1. Connect the touch MCU to a bench power supply and monitor touch delta values for each button.
  2. Note the peak-to-peak noise for each button.
  3. Connect the touch MCU to the system power supply and monitor touch delta values for each button.
  4. Note the peak-to-peak noise for each button.
  5. If there is no difference between the peak-to-peak noise between step 2 and step 4, then the noise introduced by the system power supply is NOT significant or NONE.

4.1.2

Common-mode Noise

  1. Connect the touch board's ground to the bench power supply's ground.
  2. Note the peak-to-peak noise for each button.
  3. Disconnect the touch board ground from bench power supply ground.
  4. Note the peak-to-peak noise for each button.
  5. If there is no difference between the peak-to-peak noise between step 2 and step 4, then there is no common-mode noise present in the system.

Note: The noise is considered common-mode noise if the noise on touch sensors increases only when there is a finger touch.

4.2

Tuning the System for Common-mode Noise

Please note that tuning is an iterative process. Sometimes adjusting noise tuning parameters might involve returning the charge time-sensitivity etc.

Effectiveness of noise parameter on type of noise:
Power supply noise/differential noise: Filter Level, Frequency Hop.
Common-Mode noise: Filter Level, Series Resistor, Frequency Hop.

4.2.1

Increase the Filter Level

Increasing the filter level reduces noise and vice-versa. Filter level can be increased to a maximum FILTER_LEVEL_64.
Sample Configuration in touch.h file with Filter Level shown in red:
#define NODE_0_PARAMS
{
X(1), Y(3), 0, NODE_RSEL_PRSC(RSEL_VAL_0, PRSC_DIV_SEL_1), NODE_GAIN(GAIN_1, GAIN_1), FILTER_LEVEL_16
}

4.2.2

Enable Frequency Hop Auto-Tune

  1. Ensure that the project is generated with the Frequency Hop auto-tune option.
  2. Enable the Frequency Hop Auto-tune option.
    • #define DEF_FREQ_AUTOTUNE_ENABLE 1
  3. Find the lowest threshold used among all buttons. Configure the FREQ_AUTOTUNE_MAX_VARIANCE parameter to 75% of the lowest threshold. For example, if the lowest threshold is 40, then configure FREQ_AUTOTUNE_MAX_VARIANCE as 30.
  4. With this configuration, check whether the noise decreases.
  • The frequency auto-tune module replaces the noisy frequency with a new frequency. The amount of allowed noise is defined by FREQ_AUTOTUNE_MAX_VARIANCE. Using too low of a value would result in replacing a good frequency with a bad one.
  • Since the FREQ_AUTOTUNE_MAX_VARIANCE is common for all the sensors, it is better to tune the sensor’s threshold with little differences. If one button is tuned for a threshold of 20 and another button for a threshold of 50, then the Frequency Hop auto-tune may not work. In this case, reduce the gain of the button with a threshold of 50 by half and reduce the threshold to 25.

4.2.3

Increase the Series Resistor

Self-cap: External series resistor should be increased (internal does not reduce noise).
Mutual cap: Internal series resistor can be used.

  1. Increase the series resistor by 10 KΩ.
  2. Ensure that the charge time is enough by following steps mentioned in section 3.3.
  3. Ensure that the sensitivity is optimum.
  4. Check whether the noise is reduced. If not, go to step 1.

Increase the resistor up to:
Self-cap: 200 KΩ.
Mutual cap: 100 KΩ.

Sample Configuration in touch.h file with Series Resistor shown in red:
#define NODE_0_PARAMS
{
X(1), Y(3), 0, NODE_RSEL_PRSC(RSEL_VAL_0, PRSC_DIV_SEL_1), NODE_GAIN(GAIN_1, GAIN_1), FILTER_LEVEL_16
}

© 2019 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.