Go to Post A constant awareness of safety is a plague I would welcome. - Alan Anderson [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #21   Spotlight this post!  
Unread 06-03-2013, 09:01
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,758
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: Sensor "de-noising"

Quote:
Originally Posted by Ether View Post

Here's a simple IIR filter which does essentially the same thing with 2 lines of code, no loops, and no conditional logic:

Code:
ave = 0.5*(input+ave);
output = truncate(ave+0.03);
It does use floating point (for ave), but the cRIO has an FPU.

input and output are 0 or 1.
It's been a while since I've done IIR filters and such, so my math on them is rusty. Is that actually exactly equivalent to checking than the signal has been 1 for the last X ms? It would seem that it would tolerate some blips low. And it definitely switches 1->0 quicker than 0->1.

Mind you, it's probably a perfectly cromulent and simple solution to the OP's actual problem, it just seems different than actual debouncing.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:54.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi