Tupolev Tu-154B-2 by Yurik and his team.
[fg:toms-fgdata.git] / Aircraft / tu154b / Systems / instrumentation.xml
1 <?xml version="1.0"?>
2 <!--
3
4   Author:   Yurik V. Nikiforoff, yurik@megasignal.com
5   Date:     nov 2008
6   Function: Custom instruments and misc systems for TU-154B
7   License:  GPL
8 -->
9 <system name="Instrumentation">
10   <!--Interface to TKS compass system-->
11   
12   <property>instrumentation/km-5-magvar-1</property>
13   <property>instrumentation/km-5-magvar-2</property>
14 <!--  
15   <property>instrumentation/pu11-latitude</property>
16   <property>instrumentation/bgmk-offset-1</property>
17   <property>instrumentation/bgmk-offset-2</property>
18   -->
19   
20   <property>instrumentation/bgmk-failure-1</property>
21   <property>instrumentation/bgmk-failure-2</property>
22   
23   <property>instrumentation/bgmk-corrector-1</property>
24   <property>instrumentation/bgmk-corrector-2</property>
25
26   <property>instrumentation/pnp-selector</property>
27   <property>instrumentation/pnp-right-selector</property>
28   <property>ap/input-magnetic-heading</property>
29   <property>ap/input-heading-gyro-1</property>
30   <property>ap/input-heading-gyro-2</property>
31   <!--Azimutal error from nasal handler-->
32   <property>instrumentation/az-err</property>
33
34   <channel name="Externals">
35     <!-- *********************** DISS staff *********************** -->
36     <fcs_function name="instrumentation/drift-angle-raw">
37             <description>Ground true heading</description>
38             <function>
39               <product>
40                 <difference>
41                     <atan2>
42                             <property>velocities/v-east-fps</property>
43                             <property>velocities/v-north-fps</property>
44
45                     </atan2>
46                     <property>attitude/heading-true-rad</property>
47                 </difference>
48                 <value>57.29578</value>
49               </product>
50             </function>
51     </fcs_function>
52     <switch name="instrumentation/drift-angle-bias">
53             <default value="0.0"/>
54             <test value="360.0">
55                     instrumentation/drift-angle-raw lt -180
56             </test>
57             <test value="-360.0">
58                     instrumentation/drift-angle-raw gt 180
59             </test>
60     </switch>
61     <summer name="instrumentation/drift-angle-deg">
62             <input>instrumentation/drift-angle-raw</input>
63             <input>instrumentation/drift-angle-bias</input>
64     </summer>
65     
66     
67     <!-- ******************* voice warning staff ****************** -->
68     <pure_gain name="instrumentation/mass-kg">
69       <input>inertia/weight-lbs</input>
70       <gain>0.454</gain>
71     </pure_gain>
72     
73     <pure_gain name="instrumentation/mass-t">
74       <input>instrumentation/mass-kg</input>
75       <gain>0.001</gain>
76     </pure_gain>
77     
78     <pure_gain name="instrumentation/vc-kmh">
79       <input>velocities/vc-fps</input>
80       <gain>1.09728</gain>
81     </pure_gain>
82     
83     <!--Safe speed-->
84     <fcs_function name="instrumentation/v-2">
85       <description>Safe speed</description>
86       <function>
87         <table name="Safe speed due mass and flaps">
88           <independentVar lookup="row">instrumentation/mass-t</independentVar>
89           <independentVar lookup="column">fcs/flap-pos-deg</independentVar>
90           <tableData>
91             0             15            28            
92             70             314           246           237
93             72             317           250           240
94             74             322           253           243
95             76             326           256           246
96             78             330           259           249
97             80             334           262           252
98             82             337           266           255
99             84             341           269           258
100             86             345           272           261
101             88             348           275           264
102             90             352           279           268
103             92             355           282           271
104             94             358           285           274
105             96             362           288           277
106             98             365           292           280
107           </tableData>
108         </table>
109       </function>
110     </fcs_function>
111     <!--Rotation speed-->
112     <fcs_function name="instrumentation/v-r">
113       <description>Rotation speed</description>
114       <function>
115         <table name="Rotation speed due mass and flaps">
116           <independentVar lookup="row">instrumentation/mass-t</independentVar>
117           <independentVar lookup="column">fcs/flap-pos-deg</independentVar>
118           <tableData>
119             15            28            
120             70             231           222
121             72             234           225
122             74             237           229
123             76             240           232
124             78             243           236
125             80             246           240
126             82             249           244
127             84             252           247
128             86             256           251
129             88             259           254
130             90             262           258
131             92             265           261
132             94             268           264
133             96             271           268
134             98             274           270
135           </tableData>
136         </table>
137       </function>
138     </fcs_function>
139     <!--Ref speed-->
140     <fcs_function name="instrumentation/v-ref">
141       <description>Ref speed</description>
142       <function>
143         <table name="Ref speed due mass and flaps">
144           <independentVar lookup="row">instrumentation/mass-t</independentVar>
145           <independentVar lookup="column">fcs/flap-pos-deg</independentVar>
146           <tableData>
147             0             15            28           45
148             60             290           265           247          233 
149             62             295           268           251          237
150             64             300           273           255          240
151             66             306           277           259          245
152             68             311           280           263          248
153             70             316           284           267          252
154             72             320           289           271          255
155             74             324           293           275          259
156             76             328           297           279          262
157             78             332           301           283          265
158             80             336           304           286          268
159             82             340           308           290          272
160             84             344           313           294          276
161             86             348           317           298          280
162             88             352           321           301          283
163             90             356           325           305          286
164             92             360           329           308          288
165             94             364           333           312          292
166             96             368           337           315          295
167             98             372           341           318          299
168           </tableData>
169         </table>
170       </function>
171     </fcs_function>
172     
173     <summer name="instrumentation/v-1">
174       <input>instrumentation/v-2</input>
175       <bias>-30.0</bias>
176     </summer>
177     
178     
179     <!-- ******************* RV-5M staff ****************** -->   
180     <pure_gain name="instrumentation/pitch-clipped">
181       <input>attitude/pitch-rad</input>
182       <gain>1.0</gain>
183       <clipto>
184         <min>-0.3</min>
185         <max>0.3</max>
186       </clipto>
187     </pure_gain>
188     <pure_gain name="instrumentation/roll-clipped">
189       <input>attitude/roll-rad</input>
190       <gain>1.0</gain>
191       <clipto>
192         <min>-0.3</min>
193         <max>0.3</max>
194       </clipto>
195     </pure_gain>
196     
197     
198     <fcs_function name="instrumentation/h-angle-corr">
199       <description>cos from pitch and roll</description>
200       <function>
201         <quotient>
202           <value>0.3048</value> <!--From feet to meters-->
203           <product>
204             <cos>
205               <property>instrumentation/pitch-clipped</property>
206             </cos>
207             <cos>
208               <property>instrumentation/roll-clipped</property>
209             </cos>          
210           </product>
211         </quotient>
212       </function>
213     </fcs_function>
214     
215     <pure_gain name="instrumentation/indicated-altitude-m">
216       <input>position/h-agl-ft</input>
217       <gain>instrumentation/h-angle-corr</gain>
218       <clipto>
219         <min>0.0</min>
220         <max>850.0</max>
221       </clipto>
222     </pure_gain>
223     
224     <!-- ******************* AUASP ****************** -->   
225             <lag_filter name="instrumentation/n-norm">
226               <input>accelerations/n-pilot-z-norm</input>
227               <c1>5.0</c1>
228             </lag_filter> 
229             
230 <!--************************** TKS staff ****************************-->
231             
232             <!--Latitudal correction-->
233             
234             <pure_gain name="instrumentation/pu11-lat-rad">
235               <input>instrumentation/pu11-latitude</input>
236               <gain>0.01745</gain>
237             </pure_gain>
238             
239             <switch name="instrumentation/tks-lat-rad">
240               <default value="instrumentation/pu11-lat-rad"/>
241               <test value="position/lat-gc-rad">
242                 instrumentation/tks-latitude-auto == 1
243               </test>
244             </switch>
245
246 <!--            <summer name="instrumentation/tks-lat-error-rad">
247               <input>instrumentation/tks-lat</input>
248               <input>-position/lat-gc-rad</input>
249             </summer>-->
250
251             <pure_gain name="instrumentation/tks-lat-deg">
252               <input>instrumentation/tks-lat-rad</input>
253               <gain>57.3</gain>
254             </pure_gain>
255             
256             <pure_gain name="instrumentation/tks-timeoffset-deg">
257              <!--<input>simulation/sim-time-sec</input> -->
258               <input>sim-time-sec</input>
259               <gain>0.0041666667</gain>
260             </pure_gain>
261             
262             
263             <fcs_function name="instrumentation/tks-lat-corr">
264               <description>Latitudal correction</description>
265               <function>
266                 <product>
267                   <property>instrumentation/tks-timeoffset-deg</property>
268                   <difference>
269                     <sin>
270                       <property>instrumentation/tks-lat-rad</property>
271                     </sin>
272                     <sin>
273                       <property>position/lat-gc-rad</property>
274                     </sin>                  
275                   </difference>
276                 </product>
277               </function>
278             </fcs_function>
279             
280 <!--For debug only!-->
281 <!--
282 <pure_gain name="instrumentation/heading-true-deg">
283         <input>attitude/heading-true-rad</input>
284     <gain>57.3</gain>
285 </pure_gain>
286             -->
287             <summer name="instrumentation/ga3-corrected-1">
288               <input>ap/input-heading-gyro-1</input>
289               
290         <!--<input>instrumentation/heading-true-deg</input>-->
291         
292               <input>instrumentation/az-err</input>
293               <input>-instrumentation/tks-lat-corr</input>
294             </summer>
295             
296             <summer name="instrumentation/ga3-corrected-2">
297               <input>ap/input-heading-gyro-2</input>
298               <input>instrumentation/az-err</input>
299               <input>-instrumentation/tks-lat-corr</input>
300             </summer>
301             <!--Main selector for tks heading source - 1 or 2-->
302             <switch name="instrumentation/tks-heading">
303               <default value="instrumentation/ga3-corrected-1"/>
304               <test value="instrumentation/ga3-corrected-2">
305                 instrumentation/tks-consumers == 1
306               </test>
307             </switch>
308             
309             <!--KM-5 procedure-->
310             <!--1\2 mag deviation-->
311             <!--Disabled yet-->
312             <scheduled_gain name="instrumentation/km-5-dev-1">
313               <input>systems/electrical-ok</input>      <!--Need 1 here-->
314               <table>
315                 <independentVar> ap/input-magnetic-heading </independentVar>
316                 <tableData>
317                   0     0.0
318                   90    0.0
319                   180   0.0
320                   270   0.0
321                   360   0.0
322                 </tableData>
323               </table>
324             </scheduled_gain>
325             
326             <scheduled_gain name="instrumentation/km-5-dev-2">
327               <input>systems/electrical-ok</input>      <!--Need 1 here-->
328               <table>
329                 <independentVar> ap/input-magnetic-heading </independentVar>
330                 <tableData>
331                   0     0.0
332                   90    0.0
333                   180   0.0
334                   270   0.0
335                   360   0.0
336                 </tableData>
337               </table>
338             </scheduled_gain>
339             
340             <summer name="instrumentation/km-5-1">
341               <input>ap/input-magnetic-heading</input>
342               <input>instrumentation/km-5-dev-1</input>
343               <input>instrumentation/km-5-magvar-1</input>
344             </summer>
345             
346             <summer name="instrumentation/km-5-2">
347               <input>ap/input-magnetic-heading</input>
348               <input>instrumentation/km-5-dev-2</input>
349               <input>instrumentation/km-5-magvar-2</input>
350             </summer>
351             
352             <!--Gyro-magnetic heading procedure-->    
353             <!--BGMK-1-->
354             
355             <summer name="instrumentation/bgmk-fork-1">
356               <input>-instrumentation/ga3-corrected-1</input>
357               <input>instrumentation/km-5-1</input>
358               <input>-instrumentation/bgmk-offset-1</input>
359               <clipto>
360                 <min>-10.0</min>
361                 <max>10.0</max>
362               </clipto>
363             </summer>
364             
365             <switch name="instrumentation/bgmk-tau-1">
366               <default value="0.0042"/>
367               <test value="0.3">
368                 instrumentation/bgmk-corrector-1 == 1
369               </test>
370             </switch>
371             
372             <integrator name="instrumentation/bgmk-1-integrator">
373               <input>instrumentation/bgmk-fork-1</input>
374               <c1>instrumentation/bgmk-tau-1</c1>
375               <trigger>instrumentation/bgmk-failure-1</trigger>
376               <output>instrumentation/bgmk-offset-1</output>
377             </integrator>
378             
379             <summer name="instrumentation/bgmk-1">
380               <input>instrumentation/ga3-corrected-1</input>
381               <input>instrumentation/bgmk-1-integrator</input>
382             </summer>
383             
384             <!--End BGMK-1-->
385             <!--BGMK-2-->
386             <summer name="instrumentation/bgmk-fork-2">
387               <input>-instrumentation/ga3-corrected-2</input>
388               <input>instrumentation/km-5-2</input>
389               <input>-instrumentation/bgmk-offset-2</input>
390               <clipto>
391                 <min>-10.0</min>
392                 <max>10.0</max>
393               </clipto>
394             </summer>
395             
396             <switch name="instrumentation/bgmk-tau-2">
397               <default value="0.0042"/>
398               <test value="0.3">
399                 instrumentation/bgmk-corrector-2 == 1
400               </test>
401             </switch>
402             
403             <integrator name="instrumentation/bgmk-2-integrator">
404               <input>instrumentation/bgmk-fork-2</input>
405               <c1>instrumentation/bgmk-tau-2</c1>
406               <trigger>instrumentation/bgmk-failure-2</trigger>
407               <output>instrumentation/bgmk-offset-2</output>
408             </integrator>
409             
410             <summer name="instrumentation/bgmk-2">
411               <input>instrumentation/ga3-corrected-2</input>
412               <input>instrumentation/bgmk-2-integrator</input>
413             </summer>
414             <!--End BGMK-2-->
415             <!--End gyro-magnetic proc-->
416             <!--PNP switches-->    
417             <switch name="instrumentation/pnp-heading-left">
418               <default value="instrumentation/ga3-corrected-1"/>
419               <test value="instrumentation/bgmk-1">
420                 instrumentation/pnp-left-selector == 0
421               </test>
422             </switch>
423             
424             <switch name="instrumentation/pnp-heading-right">
425               <default value="instrumentation/ga3-corrected-2"/>
426               <test value="instrumentation/bgmk-2">
427                 instrumentation/pnp-right-selector == 0
428               </test>
429             </switch>
430             
431             <switch name="instrumentation/pnp-heading">
432               <default value="instrumentation/pnp-heading-left"/>
433               <test value="instrumentation/pnp-heading-right">
434                 instrumentation/pnp-selector == 1
435               </test>
436             </switch>
437             
438             <!--************************** End TKS staff ****************************-->
439           </channel>
440           <!--******************** END externals channel ***********************-->
441
442 </system>