Delay/filter on a contact input

DarrellK

New Member
Joined
Jun 11, 2011
Messages
21
Location
Waukesha Wisconsin
I am flying a Velocity which has 2 wing tanks that gravity feed into a 2 gallon sump tank before going to the engine.  There is a float switch in the sump tank that I have connected to a contact input.  When the tank is full, the switch is held closed.  I have an indicator on the engine monitor page showing the state of the switch and set to announce if the tank is low.  This all works good until I get into bumpy air.  I get an "engine monitor" announcement which immediately clears.  The switch opens for less than 1 second and causes the message.  Is there a way to adjust the filter for this input to delay the announcement for maybe 3 seconds to eliminate these nuisance messages?  Would moving this to an analog input give me more options?  I would rather not have to add some type of hardware timer to the switch.
 

dynonsupport

Dynon Technical Support
Staff member
Joined
Mar 23, 2005
Messages
13,226
Darrell,
Yes, you can adjust the sensor config file to put a filter on this input.

Instructions are here:
http://wiki.dynonavionics.com/Making_your_own_sensor_definitions

What you want to do is copy the "CONTACT" sensor in your file and make it something like "FILTERED CONTACT"

Then at the bottom of the sensor definition, change the SHIFT to a larger number. If it's 3, try something like 6 (which will be 8 times larger than 3). This will slow down any response to changes.
 

DarrellK

New Member
Joined
Jun 11, 2011
Messages
21
Location
Waukesha Wisconsin
I don't see a shift value listed in the CONTACT sensor definition.  I tried adding one at the bottom.  I loaded the new file into the SkyView and was able to select the new "FILTERED CONTACT" but when I went back to the engine screen it said CFG with a red X over the sump indicator.
Here is the sensor definition I copied...

sensor={
id=CONTACT
;VERIFIED
function=CONTACT
pins=C37_P4 C37_P6 C37_P7 C37_P8 C37_P9 C37_P10 C37_P11 C37_P12 C37_P20 C37_P21 C37_P22 C37_P23 C37_P31
name=GEAR
name=CANOPY
name=PHEAT
min_val=0
max_val=5
resolution=1
round=.1
is_piecewise=0
low_coeff={
c_x4=0
c_x3=0
c_x2=0
c_x1=1
c_x0=0
}
low_resistance=PULL_UP_10K
low2high_cross=0
high_coeff={
c_x4=0
c_x3=0
c_x2=0
c_x1=0
c_x0=0
}
high_resistance=NONE
high2low_cross=0
}

Here is the new definition I made with the added shift value at the end...

sensor={
id=FILTERED CONTACT
;VERIFIED
function=CONTACT
pins=C37_P4 C37_P6 C37_P7 C37_P8 C37_P9 C37_P10 C37_P11 C37_P12 C37_P20 C37_P21 C37_P22 C37_P23 C37_P31
name=GEAR
name=CANOPY
name=PHEAT
min_val=0
max_val=5
resolution=1
round=.1
is_piecewise=0
low_coeff={
c_x4=0
c_x3=0
c_x2=0
c_x1=1
c_x0=0
}
low_resistance=PULL_UP_10K
low2high_cross=0
high_coeff={
c_x4=0
c_x3=0
c_x2=0
c_x1=0
c_x0=0
}
high_resistance=NONE
high2low_cross=0
shift=10
}
 

Attachments

  • screenshot-N207DK-SN01495-14_2_1_3698-20160519-164313-243-en_USs.png
    screenshot-N207DK-SN01495-14_2_1_3698-20160519-164313-243-en_USs.png
    11.4 KB · Views: 209

Dynon

Dynon Staff
Staff member
Joined
Jan 14, 2013
Messages
14,231
Location
Woodinville, WA
Delete the old contact from the screen layout editor and re-add it. Then it shouldn't be red X'd anymore. Essentially, that widget is tied to that pin and sensor name and since something changed it needs to be hooked back up. Deleting and adding the widget should get everything connected again.
 

DarrellK

New Member
Joined
Jun 11, 2011
Messages
21
Location
Waukesha Wisconsin
Ok, I got this working today and it works perfectly.  To get rid of the CFG error, all I had to do was go into the screen editor and re-save what was already there.  No need to delete the widget.
The filter works too.  A little trial and error I found a shift value of 6 is just about right for my needs.  With the bottom of range 1 set at 2.5 volts (where the message trips) it takes about 2.5 seconds to float up from 0 volts when the switch opens.  This should all but eliminate nuisance messages and still give an early warning of any problems.  Thanks for the spot on advice.   :) :) :)
 
Top