Guide to Tuning Touch Sensors for Atmel START QTouch® Library
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.
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.
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) |
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.
Charge-time Tuning
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.
- Build and program the HEX file.
- Using the Data Visualizer, monitor the auto-tuned value (Prescaler or CSD).
- 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:
- Open the project with the auto-tune charge option disabled.
- 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.
- Program the project and monitor the touch parameters in Data Visualizer.
Steps to Manually Tune CSD/Prescaler (optional):
- Keep a higher CSD value like 30 and obseve the touch delta.
- Observe the Delta with CSD values 25, 20, 15, 10, 5 and zero.
- From these values, find the CSD for which the delta is not significantly less comparing to the delta with CSD of 30.
- 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:
- With CSD = 30, the touch delta is 40 counts.
- With CSD = 25,20,15, the touch delta is 40 counts.
- 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.
{
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:
{
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:
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:
{
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:
- Keep the analog gain and digital gain as GAIN_1.
- 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.
- 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:
- Monitor the touch delta value for each sensor.
- Configure the threshold as 50~60% of the touch delta values.
- Ensure that for light finger touch, the sensor goes into detect.
- Adjust the sensitivity as required by performing a slight variation on the threshold.
Sample Configuration in touch.h file with Threshold shown in red:
{
20, HYST_25, NO_AKS_GROUP
}
Tuning Sensitivity for Slider/Wheel/Surface
Steps to tune threshold for Slider/Wheel/Surface:
- Monitor the touch delta value for each button on the slider/wheel/surface sensor.
- Configure the threshold as 50~60% of the touch delta values for each button.
- Ensure that for light finger touch, the sensor goes into detect.
- Adjust the sensitivity as required by performing a slight variation on the threshold.
- 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.
- 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:
{
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
- Connect the touch MCU to a bench power supply and monitor touch delta values for each button.
- Note the peak-to-peak noise for each button.
- Connect the touch MCU to the system power supply and monitor touch delta values for each button.
- Note the peak-to-peak noise for each button.
- 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
- Connect the touch board's ground to the bench power supply's ground.
- Note the peak-to-peak noise for each button.
- Disconnect the touch board ground from bench power supply ground.
- Note the peak-to-peak noise for each button.
- 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.
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.
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:
{
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
- Ensure that the project is generated with the Frequency Hop auto-tune option.
- Enable the Frequency Hop Auto-tune option.
- #define DEF_FREQ_AUTOTUNE_ENABLE 1
- 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.
- With this configuration, check whether the noise decreases.
Increase the Series Resistor
- Increase the series resistor by 10 KΩ.
- Ensure that the charge time is enough by following steps mentioned in section 3.3.
- Ensure that the sensitivity is optimum.
- 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:
{
X(1), Y(3), 0, NODE_RSEL_PRSC(RSEL_VAL_0, PRSC_DIV_SEL_1),
NODE_GAIN(GAIN_1, GAIN_1), FILTER_LEVEL_16
}