SenecaII: replace some Nasal by more efficient property-rule
[fg:toms-fgdata.git] / Aircraft / SenecaII / Systems / Instrument-filter.xml
1 <?xml version="1.0"?>
2 <!--
3  This file is part of FlightGear, the free flight simulator
4  http://www.flightgear.org/
5
6  Copyright (C) 2009 Torsten Dreyer, Torsten (at) t3r _dot_ de
7
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 2 of the
11  License, or (at your option) any later version.
12
13  This program is distributed in the hope that it will be useful, but
14  WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  General Public License for more details.
17 -->
18 <!-- Some low pass filters to soften the response of various instruments -->
19 <PropertyList>
20   <filter>
21     <name>NAV1 gs-needle deflection filter</name>
22     <debug>false</debug>
23     <type>exponential</type>
24     <filter-time>2.0</filter-time> 
25     <input>instrumentation/nav[0]/gs-needle-deflection-norm</input>
26     <output>instrumentation/nav[0]/gs-needle-deflection-filtered</output>
27   </filter>
28
29   <filter>
30     <name>NAV2 gs-needle deflection filter</name>
31     <debug>false</debug>
32     <type>exponential</type>
33     <filter-time>1.5</filter-time> 
34     <input>instrumentation/nav[1]/gs-needle-deflection-norm</input>
35     <output>instrumentation/nav[1]/gs-needle-deflection-filtered</output>
36   </filter>
37
38   <filter>
39     <name>RPM Indicator-Left filter</name>
40     <debug>false</debug>
41     <type>exponential</type>
42     <filter-time>0.5</filter-time> 
43     <input>engines/engine[0]/rpm</input>
44     <output>engines/engine[0]/rpm-filtered</output>
45   </filter>
46
47   <filter>
48     <name>RPM Indicator-Right filter</name>
49     <debug>false</debug>
50     <type>exponential</type>
51     <filter-time>0.6</filter-time>
52     <input>engines/engine[1]/rpm</input>
53     <output>engines/engine[1]/rpm-filtered</output>
54   </filter>
55
56   <filter>
57     <name>MAP Indicator-Left filter</name>
58     <debug>false</debug>
59     <type>exponential</type>
60     <filter-time>1.0</filter-time> 
61     <input>engines/engine[0]/mp-osi</input>
62     <output>engines/engine[0]/mp-osi-filtered</output>
63   </filter>
64
65   <logic>
66     <name>Overboost Indicator Left</name>
67     <input>
68       <greater-than>
69         <property>engines/engine[0]/mp-osi-filtered</property>
70         <value>40.0</value>
71       </greater-than>
72     </input>
73     <output>instrumentation/annunciator/overboost[0]</output>
74   </logic>
75
76   <logic>
77     <name>Overboost Indicator Right</name>
78     <input>
79       <greater-than>
80         <property>engines/engine[1]/mp-osi-filtered</property>
81         <value>40.0</value>
82       </greater-than>
83     </input>
84     <output>instrumentation/annunciator/overboost[1]</output>
85   </logic>
86
87   <logic>
88     <name>Oil Pressure annunciator</name>
89     <input>
90       <or>
91         <less-than>
92           <property>/engines/engine[0]/oil-pressure-psi</property>
93           <value type="double">30.0</value>
94         </less-than>
95         <less-than>
96           <property>/engines/engine[1]/oil-pressure-psi</property>
97           <value type="double">30.0</value>
98         </less-than>
99       </or>
100     </input>
101     <output>/instrumentation/annunciator/oil</output>
102   </logic>
103
104   <filter>
105     <name>RPM-NORM-Inv Left</name>
106     <type>gain</type>
107     <gain>1</gain>
108     <input>
109       <expression>
110         <clip>
111           <clipMin>0.0</clipMin>
112           <clipMax>1.0</clipMax>
113           <difference>
114             <value>1.0</value>
115             <div>
116               <property>/engines/engine[0]/rpm</property>
117               <value>2575</value>
118             </div>
119           </difference>
120         </clip>
121       </expression>
122     </input>
123     <output>/engines/engine[0]/rpm-norm-inv</output>
124   </filter>
125
126   <filter>
127     <name>RPM-NORM-Inv Right</name>
128     <type>gain</type>
129     <gain>1</gain>
130     <input>
131       <expression>
132         <clip>
133           <clipMin>0.0</clipMin>
134           <clipMax>1.0</clipMax>
135           <difference>
136             <value>1.0</value>
137             <div>
138               <property>/engines/engine[1]/rpm</property>
139               <value>2575</value>
140             </div>
141           </difference>
142         </clip>
143       </expression>
144     </input>
145     <output>/engines/engine[1]/rpm-norm-inv</output>
146   </filter>
147
148   <filter>
149     <name>Suction indicator</name>
150     <type>gain</type>
151     <gain>1</gain>
152     <input>
153       <expression>
154         <max>
155           <property>/systems/vacuum[0]/suction-inhg</property>
156           <property>/systems/vacuum[1]/suction-inhg</property>
157         </max>
158       </expression>
159     </input>
160     <output>/instrumentation/vacuum/suction-inhg</output>
161   </filter>
162
163   <logic>
164     <name>Left Suction annunciator</name>
165     <input>
166       <less-than>
167         <property>/systems/vacuum[0]/suction-inhg</property>
168         <value type="double">3.5</value>
169       </less-than>
170     </input>
171     <output>/instrumentation/vacuum/inoperative[0]</output>
172   </logic>
173
174   <logic>
175     <name>Right Suction annunciator</name>
176     <input>
177       <less-than>
178         <property>/systems/vacuum[1]/suction-inhg</property>
179         <value type="double">3.5</value>
180       </less-than>
181     </input>
182     <output>/instrumentation/vacuum/inoperative[1]</output>
183   </logic>
184
185   <filter>
186     <name>MAP Indicator-Right filter</name>
187     <debug>false</debug>
188     <type>exponential</type>
189     <filter-time>1.1</filter-time> 
190     <input>engines/engine[1]/mp-osi</input>
191     <output>engines/engine[1]/mp-osi-filtered</output>
192   </filter>
193
194   <filter>
195     <name>EGT Indicator-Left filter</name>
196     <debug>false</debug>
197     <type>exponential</type>
198     <filter-time>8.0</filter-time> 
199     <input>engines/engine[0]/egt-degf</input>
200     <output>engines/engine[0]/egt-degf-filtered</output>
201   </filter>
202
203   <filter>
204     <name>EGT Indicator-Right filter</name>
205     <debug>false</debug>
206     <type>exponential</type>
207     <filter-time>8.3</filter-time> 
208     <input>engines/engine[1]/egt-degf</input>
209     <output>engines/engine[1]/egt-degf-filtered</output>
210   </filter>
211
212   <!-- adjust the MAP due to RPM change by modifying the airtake-impedance -->
213   <filter>
214     <name>MAP by RPM adjust-Left</name>
215     <type>gain</type>
216     <gain>1.0</gain>
217     <input>
218       <property>engines/engine[0]/rpm</property>
219       <scale>-.002</scale>
220       <offset>5.240</offset>
221     </input>
222     <output>fdm/jsbsim/propulsion/engine[0]/air-intake-impedance-factor</output>
223     <min>0.0</min>
224     <max>9999</max>
225   </filter>
226
227   <filter>
228     <name>MAP by RPM adjust-Right</name>
229     <type>gain</type>
230     <gain>1.0</gain>
231     <input>
232       <property>engines/engine[1]/rpm</property>
233       <scale>-.0021</scale>
234       <offset>5.4975</offset>
235     </input>
236     <output>fdm/jsbsim/propulsion/engine[1]/air-intake-impedance-factor</output>
237     <min>0.0</min>
238     <max>9999</max>
239   </filter>
240
241   <filter>
242     <name>Pitot-fail filter</name>
243     <initialize-to>output</initialize-to>
244     <enable>
245       <condition>
246         <not>
247           <property>systems/pitot/serviceable</property>
248         </not>
249       </condition>
250     </enable>
251     <type>exponential</type>
252     <filter-time>2</filter-time> 
253     <input>environment/pressure-inhg</input>
254     <output>systems/pitot/total-pressure-inhg</output>
255   </filter>
256
257   <logic>
258     <name>L/H fuel pump</name>
259     <debug>false</debug>
260     <input>
261       <or>
262         <greater-than>
263           <property>/engines/engine[0]/rpm</property>
264           <value type="double">600.0</value>
265         </greater-than>
266         <property>/controls/engines/engine[0]/primer</property>
267         <property>/controls/engines/engine[0]/fuel-pump</property>
268       </or>
269     </input>
270     <output>/systems/fuel/fuel-pump[0]/enabled</output>
271   </logic>
272
273   <logic>
274     <name>L/H fuel pump</name>
275     <debug>false</debug>
276     <input>
277       <or>
278         <greater-than>
279           <property>/engines/engine[1]/rpm</property>
280           <value type="double">600.0</value>
281         </greater-than>
282         <property>/controls/engines/engine[1]/primer</property>
283         <property>/controls/engines/engine[1]/fuel-pump</property>
284       </or>
285     </input>
286     <output>/systems/fuel/fuel-pump[1]/enabled</output>
287   </logic>
288
289   <flipflop>
290     <type>monostable</type>
291     <name>WingTailDeiceLight</name>
292     <S><property>/controls/deice/surface-deice</property></S>
293     <output>/controls/deice/surface-deice-wingtail-light</output>
294     <time><value>6.0</value></time>
295   </flipflop>
296
297 </PropertyList>