CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Noise handling algorithm in 8 wire touch screen

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
hanhao



Joined: 21 Mar 2007
Posts: 24

View user's profile Send private message

Noise handling algorithm in 8 wire touch screen
PostPosted: Wed Apr 25, 2007 6:46 pm     Reply with quote

Noise handling algorithm in 8 wire touch screen
here's how a touch screen work http://focus.ti.com/lit/an/slaa298/slaa298.pdf


Problem:
when the touch pen is stationary on a point and reading ADC values from a touch screen using the micro controller, the ADC values are never the same
eg, 1st reading might be 500, 2nd reading is 510, 3rd is 505. This causes the the cursor to drift about the touch point, not something nice for the user . caps are already in place. it's a standard schematic so hardware shouldnt be a problem.

Proposed solution:
Now what i did was to create a boundary circle around the point, effectively locking all other bad readings into the circle.




but the problem is that
- for slow moving touch pen speed movements, due to this boundary circle, the cursor jumps from 1 circle to another. very ugly and it disallows slow movement.
- the size of the boundary circle has to be expanded when the touch screen wears out because of more noise

does anyone have a better solution?
thanks in advance
- hanhao
hanhao



Joined: 21 Mar 2007
Posts: 24

View user's profile Send private message

Re: Noise handling algorithm in 8 wire touch screen
PostPosted: Wed Apr 25, 2007 7:50 pm     Reply with quote

<double post>

Last edited by hanhao on Wed Apr 25, 2007 10:27 pm; edited 1 time in total
newguy



Joined: 24 Jun 2004
Posts: 1903

View user's profile Send private message

PostPosted: Wed Apr 25, 2007 8:22 pm     Reply with quote

What (if any) hardware filtering/conditioning is in place? If there is a hardware lowpass filter in place, what is the cutoff frequency? My gut instinct would be that lowering the cutoff frequency on this filter would stabilize the touch screen reading. A rough guess would be to shoot for a time constant (tau) = RC of about 70 milliseconds or so. That would still allow for near instantaneous reaction for the user (luckily humans aren't terribly swift). Laughing
hanhao



Joined: 21 Mar 2007
Posts: 24

View user's profile Send private message

PostPosted: Wed Apr 25, 2007 9:13 pm     Reply with quote

newguy wrote:
What (if any) hardware filtering/conditioning is in place? If there is a hardware lowpass filter in place, what is the cutoff frequency? My gut instinct would be that lowering the cutoff frequency on this filter would stabilize the touch screen reading. A rough guess would be to shoot for a time constant (tau) = RC of about 70 milliseconds or so. That would still allow for near instantaneous reaction for the user (luckily humans aren't terribly swift). Laughing


doubt i will be adding anymore hardware to handle the noise other than the caps because this is a standard schematic i m using from another nice working one
newguy



Joined: 24 Jun 2004
Posts: 1903

View user's profile Send private message

PostPosted: Wed Apr 25, 2007 9:26 pm     Reply with quote

The TI chip that you're using....do you have power supply decoupling capacitors to ground very near each Vdd pin? Is there supposed to be capacitors to ground on the touch screen sense lines? Is this a mock-up/prototype, or do you have everything mounted on a PCB? If so, does the PCB have a ground plane (internal or external or both)? Does your power suppy (Vdd rail) have sufficient capacitance attached to it?
hanhao



Joined: 21 Mar 2007
Posts: 24

View user's profile Send private message

PostPosted: Wed Apr 25, 2007 10:26 pm     Reply with quote

newguy wrote:
The TI chip that you're using....do you have power supply decoupling capacitors to ground very near each Vdd pin? Is there supposed to be capacitors to ground on the touch screen sense lines? Is this a mock-up/prototype, or do you have everything mounted on a PCB? If so, does the PCB have a ground plane (internal or external or both)? Does your power suppy (Vdd rail) have sufficient capacitance attached to it?


using a PIC micro controller, not a TI chip
this is not a PCB, it's a mock up self soldered setup
the proper caps are in place and routed near the chip. this is a standard schematic taken from another manufacturer so the hardware setup shouldnt be a problem at all. the noise measured at the pin side is about 40mV, about the same as the manufacturer's
newguy



Joined: 24 Jun 2004
Posts: 1903

View user's profile Send private message

PostPosted: Thu Apr 26, 2007 12:09 am     Reply with quote

The link you provided in the first post uses a TI chip to interface to the system, I assumed you were using it as well.

What is your algorithm like? I assume something like this:
- set outputs to measure x position
- set PIC a/d channel to match
- measure x position (voltage)
- set outputs to measure y position
- set PIC a/d channel to match
- measure y position (voltage)
- repeat

If this is kind of familiar, how long do you wait between setting the outputs and pic's a/d channel before you actually measure the voltage? Can you increase this time? You probably already know this, but you must allow for a settling/rest time between changing the a/d channel and actually starting an a/d conversion. Are you doing an 8 or 10 bit conversion?
hanhao



Joined: 21 Mar 2007
Posts: 24

View user's profile Send private message

PostPosted: Thu Apr 26, 2007 1:09 am     Reply with quote

newguy wrote:
The link you provided in the first post uses a TI chip to interface to the system, I assumed you were using it as well.

What is your algorithm like? I assume something like this:
- set outputs to measure x position
- set PIC a/d channel to match
- measure x position (voltage)
- set outputs to measure y position
- set PIC a/d channel to match
- measure y position (voltage)
- repeat

If this is kind of familiar, how long do you wait between setting the outputs and pic's a/d channel before you actually measure the voltage? Can you increase this time? You probably already know this, but you must allow for a settling/rest time between changing the a/d channel and actually starting an a/d conversion. Are you doing an 8 or 10 bit conversion?


thanks for your reply

currently i am not using the TI chip at all. I am only reading their document because it provides good explanation of touch screen's concept

yes i know that there should be a settling rest time due to mux switching on the pic chip. i set it to 250us, it's more than enough,and i confirmed this with an O scope. currently i am doing 10 bit conversion at level range of 0-1023 and in analog, it's 0V-5V
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Thu Apr 26, 2007 7:27 am     Reply with quote

What if you calculate a new boundary circle based on the latest reading? If the old true point is within the new boundary circle you keep the cursor at the old point. If not then abandon the old point and move the cursor to the new point.
_________________
The search for better is endless. Instead simply find very good and get the job done.
hanhao



Joined: 21 Mar 2007
Posts: 24

View user's profile Send private message

PostPosted: Thu Apr 26, 2007 6:24 pm     Reply with quote

SherpaDoug wrote:
What if you calculate a new boundary circle based on the latest reading? If the old true point is within the new boundary circle you keep the cursor at the old point. If not then abandon the old point and move the cursor to the new point.


thanks for your reply
i am not sure but that would be equivalent to defining a small boundary circle wont it?
Douglas Kennedy



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

PostPosted: Fri Apr 27, 2007 6:22 am     Reply with quote

The issue is between a fixed point and a direction of movement. When fixed you have jitter which you don't want it interpreted as movement so you filter it out. When there is true movement you don't want the jitter to confuse the direction or overly delay the movement. Real movement has real direction that means for any x,y point the next point will be either x+d or x-d ,y+d or y-d where d is an integer representing the coarseness of movement that you can accept. When you get a reading outside your circle assume the direction is the line between the center of your circle and the new outlying point. You could then find the mid point of this line, move your display pointer to this point and use it as the next center for your jitter filtering. You could even have a start of movement latency...wait until you have confirmation of a movement of 2d away from your initial center ( first you detected a 1d movement then a further 1d the direction is either N,NE,E,SE,S,SW,W,NW if the original center 1d and 2d lie in these directions then move the point to the 1d step. I believe you'd do just as well with a box as a circle to filter your jitter...asumming your jitter is j any reading in the box x+-j or y+-j is considered jitter.This is equivalent to assuming the area has squares ( like pixels) that contain the jitter. If your reading moves from one "pixel" then you assume movement and draw a line between the old pixel and the new and move your pointer smoothly in smaller steps over to the new pixel.
hanhao



Joined: 21 Mar 2007
Posts: 24

View user's profile Send private message

PostPosted: Mon Apr 30, 2007 5:12 am     Reply with quote

thank u all for your suggestions! i managed to solve the problem with an alternate averaging method without any hardware alterations
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group