CapSense SmartSense Auto Calibration

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
user_2581831
Level 2
Level 2
10 sign-ins 5 questions asked First solution authored

Hi,

I've been trying to embed SmartSense Auto Calibration feature periodically to my project.  When MyAPI_Start(); (CapSense) function is called at the beginning of the program, SmartSense feature succesfully optimizes the widgets for optimal conditions and the first calibration results succesfully as long as the electrical conditions

do not vary much as the microcontroller keeps running. and touch widgets resulting succesfully according to my program.

But here's the problem that I've encountered.

But for a short time when AC main line that powers the card goes off and comes again, each touch widget does not result properly and the touch state of the widgets are set to be on when the power comes again. This is the first scenario that I've encountered when I was testing the card.

For the second time that I've arranged the same scenario (disabling ac main line and activating again for a short time (approximately 100msec)) The main functionality of the program keeps running successfully but , the touch state of the widgets never turned on. I think this is because, the smartsense feature calibrates all the widgets at the beginning of the program according to the electrical conditions ( in this scenario short time  power disabling -- when the power is disabled for a short time the microcontroller voltage (5V) does not fully discharge because of the capacitor which was paralled to the 5V line.) when it does not vary during the time keeps going.

I think this problem will be solved by embedding the SmartSense feature to the program periodically. and i think this  will prevent CapSense from being adversely affected from instanteneous varying of electrical conditions.

I've tried both CapSense_Start and CapSense_SsAutoTune() function by embedding to my program  but it didn't back any result to me. When I did this, CapSense_Start or CapSense_SsAutoTune() function called periodically on a timer (timer period -- 50msec). my program hangs on and  program resets itself automatically because of the watchdog timer. I think this process takes more than 1.6sec( watchdog timer period for my program) and the program resets itself.

I want to embed SmartSense feature to my program and this feature must be on process periodically when the program keeps runnning I think this will solve my problem and it will configure touch widgets periodically. for the instanteneous varying of electical conditions.

I want to have your  solutions or advises about this problem.

I'll be appreciated if you  consider my topic.

Have a nice day.

0 Likes
1 Solution

Hi user_2581831​,

As per CapSense performance requirement, the VDDA voltage should be allowed to vary greater than the specified amount in the below table:

pastedImage_0.png

Capsense operation is sensitive to voltage fluctuations and should be limited in the hardware itself.

Measuring VDDA and stopping the scan is a good idea. You  need to switch to manual tuning if you want to use the API GetVdda().

Did you try adding firmware filters such as IIR and median filter and check if it is helping in reducing the noise when there is noise condition?

Observations from the graph:

1. Is the waveform obtained when there is voltage fluctuations? There peak to peak noise seems to be around 30 but the difference counts is also around 35. This gives a Signal to Noise ratio (SNR) of around 1. We recommend to tune the sensors so that you get at least 50 counts of difference counts and the SNR it 5 :1. If the noise is 30 counts, the signal should be at least 150 counts.

2. The resolution of CSD seems to be very less. What is the finger capacitance parameter set in the component? We recommend you to tune finger capacitance such that you get a SNR of 5:1 even when there is voltage fluctuations. Check the SmartSense tuning guide in the CapSense design guide (Pg 49)

https://www.cypress.com/file/46081/download

3. How are these voltage fluctuations caused? Are you injecting any noise in the power lines (conducted/ radiated)? In such cases, you need to use the Multi Frequency Scan (MFS) feature of CapSense to tackle this. Note that SmartSense and MFS are mutually exclusive.

https://www.cypress.com/documentation/code-examples/ce227719-capsense-multi-frequency-scan

4. Adding firmware filters of suitable coefficient should help reducing this noise. A combination of firmware filters and high resolution should help in reducing the noise and SNR of 5 :1

Some points on manual tuning:

Most customers use Manual tuning for production designs. We are expected to tune the sensors based on the working conditions of the sensors. With Manual tuning, you will have strict control over parameters and allows you to give the best response time and power consumption.

Any environmental issues should be taken care in the firmware as discussed in the article Setting CapSense Parameters for Designs with Temperature, Humidity, and other Gradual Environmental ...

You need to monitor the raw counts and check if it is within the specified range. If due to temperature change, if raw counts exceeds predetermined limits , we need to recalibrate the sensor to 85 % again to ensure that we get the same sensitivity again.

Regards,

Bragadeesh

Regards,
Bragadeesh

View solution in original post

0 Likes
3 Replies
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi user_2581831​,

First we would like to understand the issue better. For this, would you be able to collect logs of rawcounts and baseline either using Tuner or some there communication lines when each of these situations.

For proper operation of CapSense, we do not recommend voltage fluctuation greater than 50 mV in the VDDA line. When the power goes out for 100 mS, can you measure VDDA as well monitor the rawcounts and share us the log.

Calling CapSense_Start() would help to recalibrate the sensors to the default levels. Therefore calling thing is sufficient only when you detect such a condition. We do not recommend calling CapSense_Start(). You could monitor the voltage of VDDA and the rawcounts. If the rawcounts is not within a specified range, you could recalibrate the sensors by calling CapSense_Start().

Would you be able to share the existing project to us? Under what condition are you calling CapSense_Start()?

Did you try using manual tuning for your design?

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes

Hi,

Thanks for replying my question.

1- I still couldn't figure out how to solve problem. The voltage fluctation on VDDA line effects CapSense negatively. When the fluctation happens, touch widgets are behavioring unusual. After this happens, when the VDDA voltage becomes stable again,  CapSense continues to operate properly. Only the time when voltage fluctation happens, CapSense doesn't work properly.

2- CapSense operates perfectly SmartSense(Full Auto Tune) mode. I didn't encounter any negative condition when VDDA voltage is stable during the touch sensing operation. But I didn't find any solution to monitor VDDA line when the SmartSense Full Auto Tune mode is active. But when I switched SmartSense mode to manual tuning or just hardware parameters only calculated by SmartSense, CapSense allows me to monitor VDDA voltage by CapSense_GetVdda() function. When I use this function, I can monitor VDDA voltage and also detect voltage fluctation on VDDA line. When the voltage fluctation is detected , I put the microcontroller to sleep mode and then the voltage becomes stable again, I wake the microcontroller from sleep mode and it continues to operate as usual again.

3-  But I don't want to set CapSense to operate on SmartSense(Hardware parameters only or manual tuning). Otherwise, I need to arrange threshold parameters (finger threshold, noise threshold,etc.) manually. Because when I did this, the threshold parameters are arranged for a specific environment. (environment -- the electiral conditions where that don't change instanteneously and negatively on different places) This time when the environment changed, I observed that CapSense operations in some rare cases doesn't work properly. I think this happens because of the threshold parameters which arranged based on a  different electrial line (different environment).

4- Is there any way to monitor VDDA line using differents approaches on software or hardware side externally ? I think that VDDA monitoring approach will solve my problem and I'm  also open any suggestions except that approach to fix that problem.

5- The microcontroller which is used is CY8C4124AZI-S433 and there are the grahps on SmartSense(Full Auto Tune Mode).I do share the graphs which includes raw and baseline counts of touch acitivity  -  I can share more outputs if it is needed further.

First graph views the count values is when no touch activity happens.

WhatsApp Image 2020-12-01 at 10.42.29 AM.jpeg

Second graph views the count values when any touch actives.

WhatsApp Image 2020-12-01 at 10.42.30 AM.jpeg

0 Likes

Hi user_2581831​,

As per CapSense performance requirement, the VDDA voltage should be allowed to vary greater than the specified amount in the below table:

pastedImage_0.png

Capsense operation is sensitive to voltage fluctuations and should be limited in the hardware itself.

Measuring VDDA and stopping the scan is a good idea. You  need to switch to manual tuning if you want to use the API GetVdda().

Did you try adding firmware filters such as IIR and median filter and check if it is helping in reducing the noise when there is noise condition?

Observations from the graph:

1. Is the waveform obtained when there is voltage fluctuations? There peak to peak noise seems to be around 30 but the difference counts is also around 35. This gives a Signal to Noise ratio (SNR) of around 1. We recommend to tune the sensors so that you get at least 50 counts of difference counts and the SNR it 5 :1. If the noise is 30 counts, the signal should be at least 150 counts.

2. The resolution of CSD seems to be very less. What is the finger capacitance parameter set in the component? We recommend you to tune finger capacitance such that you get a SNR of 5:1 even when there is voltage fluctuations. Check the SmartSense tuning guide in the CapSense design guide (Pg 49)

https://www.cypress.com/file/46081/download

3. How are these voltage fluctuations caused? Are you injecting any noise in the power lines (conducted/ radiated)? In such cases, you need to use the Multi Frequency Scan (MFS) feature of CapSense to tackle this. Note that SmartSense and MFS are mutually exclusive.

https://www.cypress.com/documentation/code-examples/ce227719-capsense-multi-frequency-scan

4. Adding firmware filters of suitable coefficient should help reducing this noise. A combination of firmware filters and high resolution should help in reducing the noise and SNR of 5 :1

Some points on manual tuning:

Most customers use Manual tuning for production designs. We are expected to tune the sensors based on the working conditions of the sensors. With Manual tuning, you will have strict control over parameters and allows you to give the best response time and power consumption.

Any environmental issues should be taken care in the firmware as discussed in the article Setting CapSense Parameters for Designs with Temperature, Humidity, and other Gradual Environmental ...

You need to monitor the raw counts and check if it is within the specified range. If due to temperature change, if raw counts exceeds predetermined limits , we need to recalibrate the sensor to 85 % again to ensure that we get the same sensitivity again.

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes