Guide to Tuning Touch Sensors for Atmel START QTouch® Library

Last modified by Microchip on 2023/11/09 08:55

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.

Image depicting the 4 stages of tuning a touch sensor

Figure 1

Procedure

Preparation
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.
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-capacitanceSelf-capacitance + ShieldMutual capacitance
Target Noise Immunity (conducted immunity)
High (10 V)100 K50 K1 K (100 K internal)
Medium (3 V)50 K10 K1 K (50 K internal)
Low (1 V)1 K1 K1 K (0 internal)
Power Supply
Battery Operated1 K1 K1 K (0 internal)
Mains power supply10 K5 K1 K (10 K internal)
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.
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.

Note: Auto-tune charge time option must be used only for the initial development. When the tuning is completed, and when the system is ready for testing, the auto-tune option must be disabled and manual feed values must be used.


Charge-time Tuning

Monitoring CSD/Prescaler

Note: For certain designs where parasitic charges are higher, auto-tune may not provide optimal results. Auto-tune CSD values may be too much (e.g., > 20). If such values are observed, assume that auto-tune has failed and proceed with manual tuning.

  • 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.

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

CSD/Prescaler Configuration in Project

Now the auto-tuned value is available. Configure the auto-tuned values into the non-auto-tuned project.
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.
Steps to Manually Tune CSD/Prescaler (optional):
  1. Keep a higher CSD value like 30 and obseve the touch delta.
  2. Observe the Delta with CSD values 25, 20, 15, 10, 5 and zero.
  3. From these values, find the CSD for which the delta is not significantly less comparing to the delta with CSD of 30.
  4. Use that CSD value.
  • If CSD is not available, use the Prescaler. Observe delta with PRSC_DIV_SEL_4 and reduce the prescaler to find the optimum prescaler value.

For example, assume the following:

  1. With CSD = 30, the touch delta is 40 counts.
  2. With CSD = 25,20,15, the touch delta is 40 counts.
  3. With CSD = 10, the touch delta is 30 counts.

In this example, the highest delta value of 40 is found with a CSD value of 15. Increasing CSD beyond 15 does not help to increase the delta. So, it is better to use CSD = 15.
It is possible to finetune CSD by comparing the delta with CSD 14, 13, 12, and 11.

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.

Sample Configuration in touch.h file with CSD set equal to 5: 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 set equal to PRSC_DIV_SEL_1:

#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

Overview

The purpose of this step is to optimize sensitivity for a light finger touch, as shown in Figure 2:

Image depicting the three sensitivity levels of a touch sensor, under-sensitive, over-sensitive and just right

Figure 2

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).

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 as GAIN_1:

#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).
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
}
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

Understanding the Type of Noise Present in the System

Steps 4.1 and 4.2 are for determining which type of noise is present to understand which parameters of noise tuning to focus on. 

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.
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.

Tuning the System for Common-mode Noise

Steps 4.3 - 4.5 cover adjusting the three parameters that are used to tune a system for noise: Filter Level, Frequency Hop auto-tune and increasing the Series Resistor.

The effectiveness of each of these parameters varies depending on the type of noise. For example: Increasing the series resistor has little to no effect on power supply noise so it can be skipped if you are tuning for that. A quick guide for noise tuning is given below:

  • Power supply noise/differential noise: Filter Level, Frequency Hop.
  • Common-Mode noise: Filter Level, Series Resistor, Frequency Hop.

Note: Tuning is an iterative process. Sometimes adjusting noise tuning parameters might involve returning the charge time-sensitivity etc.

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 set to FILTER_LEVEL_16:

#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
}
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.
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 internal Series Resistor controled by RSEL_VAL_0:

#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
}

Back to Top