Touch sensors are a little less sensitive in the first 30s after wake from sleep

dave111
Posts: 45
Joined: Fri Mar 03, 2017 1:37 am

Touch sensors are a little less sensitive in the first 30s after wake from sleep

Postby dave111 » Fri Jun 29, 2018 3:01 pm

I only notice this behavior when I use my touch sensors with a 2mm plastic panel on top. Proper calibration is very important in this configuration. But with proper calibration, things are working fine. And they do so all the time. Except for in the first ~30 seconds after wake from sleep. During these ~30 seconds my sensors appear a tiny little less sensitive than they usually are. As a result, during this time period my touch sensors do not work reliably with a 2mm panel on top. Then after about 30 seconds and without me doing anything (in code or otherwise), full sensitivity is coming back. And I am again able to use all sensors. This behavior always occurs directly after wake from sleep. Something definitely is going on in the background.

Please note that I do NOT experience this issue when I use a thinner panel (say, one with 1mm thickness) - or if I use no panel at all. I am sure the dip in sensitivity is still there, but when using a thinner panel, touch events do still register.

In short: I would like to be able to use a 2mm panel on top of my sensors and I am usually able to do so. Only in the first 30s after wake from sleep a dip in sensitivity is becoming noticeable and it is a little bothersome. I then have to wait up to 30s to be able to invoke the buttons.

What could be causing this behavior? Is there anything I can do about it?

mikemoy
Posts: 494
Joined: Fri Jan 12, 2018 9:10 pm

Re: Touch sensors are a little less sensitive in the first 30s after wake from sleep

Postby mikemoy » Sun Jul 01, 2018 9:45 pm

Does the same thing happen with when you first power it up?

ESP_Angus
Posts: 2278
Joined: Sun May 08, 2016 4:11 am

Re: Touch sensors are a little less sensitive in the first 30s after wake from sleep

Postby ESP_Angus » Mon Jul 02, 2018 12:56 am

Is software filtering enabled in the touch driver?

dave111
Posts: 45
Joined: Fri Mar 03, 2017 1:37 am

Re: Touch sensors are a little less sensitive in the first 30s after wake from sleep

Postby dave111 » Mon Jul 02, 2018 2:20 am

mikemoy wrote:Does the same thing happen with when you first power it up?
Definitely not. The delay I describe above only takes place after wake from sleep.

One other observation. When the device is in sleep mode, I usually wake it up by touching one of the sensors. It's really nice that this overall process is working so well. However, the sensors in sleep mode are already less sensitive than they were at runtime (after calibration). When I use a 2mm panel I often have to make a bit of "fat finger" towards a sensor in order to wake the device. Then it takes another ~30s before sensitivity is back to where it was before sleep.

So it looks like when going to sleep, the touch_pad_config data is being discarded (?) and some default settings are being used while in suspense mode? This would not be a totally perfect solution. It would be better to keep the touch_pad_config data unchanged. And it is not clear if this is somehow related to the 30s it takes for restored touch_pad_config data to take effect after wake-up.

dave111
Posts: 45
Joined: Fri Mar 03, 2017 1:37 am

Re: Touch sensors are a little less sensitive in the first 30s after wake from sleep

Postby dave111 » Mon Jul 02, 2018 2:20 am

ESP_Angus wrote:Is software filtering enabled in the touch driver?
No, not that I am aware of.

dave111
Posts: 45
Joined: Fri Mar 03, 2017 1:37 am

Re: Touch sensors are a little less sensitive in the first 30s after wake from sleep

Postby dave111 » Mon Jul 02, 2018 2:25 am

> and some default settings are being used while in suspense mode?

I mean while in *suspend mode. Haha.

ESP_Alfred
Posts: 2
Joined: Tue Jul 03, 2018 12:42 pm

Re: Touch sensors are a little less sensitive in the first 30s after wake from sleep

Postby ESP_Alfred » Tue Jul 03, 2018 1:03 pm

I have test your case, the result seems normal. Please check the picture. The change of the touch is the same, within 60 seconds of sleep waking up.

- Please provide the version of idf you used.
- Please use only the sleep and touch function tests.
- or, Provide test code.
Attachments
图片1.png
图片1.png (64.84 KiB) Viewed 4408 times

dave111
Posts: 45
Joined: Fri Mar 03, 2017 1:37 am

Re: Touch sensors are a little less sensitive in the first 30s after wake from sleep

Postby dave111 » Sat Jul 07, 2018 4:02 pm

ESP_Alfred wrote:Please provide the version of idf you used.
I was using v3.0-rc1 from 2018 Feb 21. I have now upgraded to v3.0.1 and this appears to fix the "less sensitive in the first 30s after wake" issue. I am not seeing this behavior anymore. This is great.

However, while in deep sleep, sensitivity does still appear to be slightly lower than at runtime after calibration. With the 2mm panel on top, slightly touching a sensor will not (always) wake the device. However, once it is awake and the touch_pad_config() values have been restored from flash (aka RTC_DATA_ATTR), touching the sensors in the exact same way does trigger an event every time. It definitely feels more sensitive. Are you sure the sensors use the last touch_pad_config() data while in deep sleep? Because I definitely have to restore them post deep sleep.

And one other thing I noticed: I have also tried upgrading to v3.1-beta1. But here, if any sensor is touched at runtime, xEventGroupWaitBits() does always return 0x3FD (decimal 1021; could this be an error code?). In other words: no matter what sensor is being touched, all touch sensors will report back. I do not see this when I switch my unmodified code back to IDF v3.0.1.

dave111
Posts: 45
Joined: Fri Mar 03, 2017 1:37 am

Re: Touch sensors are a little less sensitive in the first 30s after wake from sleep

Postby dave111 » Tue Jul 10, 2018 2:07 pm

Can someone _please_ confirm that calibration data (set by the app via touch_pad_config() and touch_pad_set_thresh()) is not being used while in deep sleep? This would explain why touch sensor sensitivity is lower during deep sleep, especially with a 2mm panel covering the sensors.

If true, this would be a serious shortcoming. The benefits of sensor calibration would be lost, if the touch sensors act differently (less sensitive) when you depend on them to wake the device.

(I still stand by what I said about touch sensors in v3.1-beta1. But because my app is working with IDF v3.0-rc1, v3.0 and v3.0.1, the v3.1-beta1 issue is not really critical to me atm. Although I am very interested in the new BT modem sleep feature.)

Who is online

Users browsing this forum: No registered users and 61 guests