Tu-154B2 version 3.1:
[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     
36     <!-- ******************* voice warning staff ****************** -->
37     <pure_gain name="instrumentation/mass-kg">
38       <input>inertia/weight-lbs</input>
39       <gain>0.454</gain>
40     </pure_gain>
41     
42     <pure_gain name="instrumentation/mass-t">
43       <input>instrumentation/mass-kg</input>
44       <gain>0.001</gain>
45     </pure_gain>
46     
47     <pure_gain name="instrumentation/vc-kmh">
48       <input>velocities/vc-fps</input>
49       <gain>1.09728</gain>
50     </pure_gain>
51     
52     <!--Safe speed-->
53     <fcs_function name="instrumentation/v-2">
54       <description>Safe speed</description>
55       <function>
56         <table name="Safe speed due mass and flaps">
57           <independentVar lookup="row">instrumentation/mass-t</independentVar>
58           <independentVar lookup="column">fcs/flap-pos-deg</independentVar>
59           <tableData>
60             0             15            28            
61             70             314           246           237
62             72             317           250           240
63             74             322           253           243
64             76             326           256           246
65             78             330           259           249
66             80             334           262           252
67             82             337           266           255
68             84             341           269           258
69             86             345           272           261
70             88             348           275           264
71             90             352           279           268
72             92             355           282           271
73             94             358           285           274
74             96             362           288           277
75             98             365           292           280
76           </tableData>
77         </table>
78       </function>
79     </fcs_function>
80     <!--Rotation speed-->
81     <fcs_function name="instrumentation/v-r">
82       <description>Rotation speed</description>
83       <function>
84         <table name="Rotation speed due mass and flaps">
85           <independentVar lookup="row">instrumentation/mass-t</independentVar>
86           <independentVar lookup="column">fcs/flap-pos-deg</independentVar>
87           <tableData>
88             15            28            
89             70             231           222
90             72             234           225
91             74             237           229
92             76             240           232
93             78             243           236
94             80             246           240
95             82             249           244
96             84             252           247
97             86             256           251
98             88             259           254
99             90             262           258
100             92             265           261
101             94             268           264
102             96             271           268
103             98             274           270
104           </tableData>
105         </table>
106       </function>
107     </fcs_function>
108     <!--Ref speed-->
109     <fcs_function name="instrumentation/v-ref">
110       <description>Ref speed</description>
111       <function>
112         <table name="Ref speed due mass and flaps">
113           <independentVar lookup="row">instrumentation/mass-t</independentVar>
114           <independentVar lookup="column">fcs/flap-pos-deg</independentVar>
115           <tableData>
116             0             15            28           45
117             60             290           265           247          233 
118             62             295           268           251          237
119             64             300           273           255          240
120             66             306           277           259          245
121             68             311           280           263          248
122             70             316           284           267          252
123             72             320           289           271          255
124             74             324           293           275          259
125             76             328           297           279          262
126             78             332           301           283          265
127             80             336           304           286          268
128             82             340           308           290          272
129             84             344           313           294          276
130             86             348           317           298          280
131             88             352           321           301          283
132             90             356           325           305          286
133             92             360           329           308          288
134             94             364           333           312          292
135             96             368           337           315          295
136             98             372           341           318          299
137           </tableData>
138         </table>
139       </function>
140     </fcs_function>
141     
142     <summer name="instrumentation/v-1">
143       <input>instrumentation/v-2</input>
144       <bias>-30.0</bias>
145     </summer>
146     
147     
148     <!-- ******************* AUASP ****************** -->   
149             <lag_filter name="instrumentation/n-norm">
150               <input>accelerations/n-pilot-z-norm</input>
151               <c1>5.0</c1>
152             </lag_filter> 
153             
154 <!--************************** TKS staff ****************************-->
155             
156             <!--Latitudal correction-->
157             
158             <pure_gain name="instrumentation/pu11-lat-rad">
159               <input>instrumentation/pu11-latitude</input>
160               <gain>0.01745</gain>
161             </pure_gain>
162             
163             <switch name="instrumentation/tks-lat-rad">
164               <default value="instrumentation/pu11-lat-rad"/>
165               <test value="position/lat-gc-rad">
166                 instrumentation/tks-latitude-auto == 1
167               </test>
168             </switch>
169
170 <!--            <summer name="instrumentation/tks-lat-error-rad">
171               <input>instrumentation/tks-lat</input>
172               <input>-position/lat-gc-rad</input>
173             </summer>-->
174
175             <pure_gain name="instrumentation/tks-lat-deg">
176               <input>instrumentation/tks-lat-rad</input>
177               <gain>57.3</gain>
178             </pure_gain>
179             
180             <pure_gain name="instrumentation/tks-timeoffset-deg">
181              <input>simulation/sim-time-sec</input>
182 <!--<input>sim-time-sec</input>-->
183               <gain>0.0041666667</gain>
184             </pure_gain>
185             
186             
187             <fcs_function name="instrumentation/tks-lat-corr">
188               <description>Latitudal correction</description>
189               <function>
190                 <product>
191                   <property>instrumentation/tks-timeoffset-deg</property>
192                   <difference>
193                     <sin>
194                       <property>instrumentation/tks-lat-rad</property>
195                     </sin>
196                     <sin>
197                       <property>position/lat-gc-rad</property>
198                     </sin>                  
199                   </difference>
200                 </product>
201               </function>
202             </fcs_function>
203             
204 <!--For debug only!-->
205 <!--
206 <pure_gain name="instrumentation/heading-true-deg">
207         <input>attitude/heading-true-rad</input>
208     <gain>57.3</gain>
209 </pure_gain>
210             -->
211             <summer name="instrumentation/ga3-corrected-1">
212               <input>ap/input-heading-gyro-1</input>
213               
214         <!--<input>instrumentation/heading-true-deg</input>-->
215         
216               <input>instrumentation/az-err</input>
217               <input>-instrumentation/tks-lat-corr</input>
218             </summer>
219             
220             <summer name="instrumentation/ga3-corrected-2">
221               <input>ap/input-heading-gyro-2</input>
222               <input>instrumentation/az-err</input>
223               <input>-instrumentation/tks-lat-corr</input>
224             </summer>
225             <!--Main selector for tks heading source - 1 or 2-->
226             <switch name="instrumentation/tks-heading">
227               <default value="instrumentation/ga3-corrected-1"/>
228               <test value="instrumentation/ga3-corrected-2">
229                 instrumentation/tks-consumers == 1
230               </test>
231             </switch>
232             
233             <!--KM-5 procedure-->
234             <!--1\2 mag deviation-->
235             <!--Disabled yet-->
236             <scheduled_gain name="instrumentation/km-5-dev-1">
237               <input>systems/electrical-ok</input>      <!--Need 1 here-->
238               <table>
239                 <independentVar> ap/input-magnetic-heading </independentVar>
240                 <tableData>
241                   0     0.0
242                   90    0.0
243                   180   0.0
244                   270   0.0
245                   360   0.0
246                 </tableData>
247               </table>
248             </scheduled_gain>
249             
250             <scheduled_gain name="instrumentation/km-5-dev-2">
251               <input>systems/electrical-ok</input>      <!--Need 1 here-->
252               <table>
253                 <independentVar> ap/input-magnetic-heading </independentVar>
254                 <tableData>
255                   0     0.0
256                   90    0.0
257                   180   0.0
258                   270   0.0
259                   360   0.0
260                 </tableData>
261               </table>
262             </scheduled_gain>
263             
264             <summer name="instrumentation/km-5-1">
265               <input>ap/input-magnetic-heading</input>
266               <input>instrumentation/km-5-dev-1</input>
267               <input>instrumentation/km-5-magvar-1</input>
268             </summer>
269             
270             <summer name="instrumentation/km-5-2">
271               <input>ap/input-magnetic-heading</input>
272               <input>instrumentation/km-5-dev-2</input>
273               <input>instrumentation/km-5-magvar-2</input>
274             </summer>
275             
276             <!--Gyro-magnetic heading procedure-->    
277             <!--BGMK-1-->
278             
279             <summer name="instrumentation/bgmk-fork-1">
280               <input>-instrumentation/ga3-corrected-1</input>
281               <input>instrumentation/km-5-1</input>
282               <input>-instrumentation/bgmk-offset-1</input>
283               <clipto>
284                 <min>-10.0</min>
285                 <max>10.0</max>
286               </clipto>
287             </summer>
288             
289             <switch name="instrumentation/bgmk-tau-1">
290               <default value="0.0042"/>
291               <test value="0.3">
292                 instrumentation/bgmk-corrector-1 == 1
293               </test>
294             </switch>
295             
296             <integrator name="instrumentation/bgmk-1-integrator">
297               <input>instrumentation/bgmk-fork-1</input>
298               <c1>instrumentation/bgmk-tau-1</c1>
299               <trigger>instrumentation/bgmk-failure-1</trigger>
300               <output>instrumentation/bgmk-offset-1</output>
301             </integrator>
302             
303             <summer name="instrumentation/bgmk-1">
304               <input>instrumentation/ga3-corrected-1</input>
305               <input>instrumentation/bgmk-1-integrator</input>
306             </summer>
307             
308             <!--End BGMK-1-->
309             <!--BGMK-2-->
310             <summer name="instrumentation/bgmk-fork-2">
311               <input>-instrumentation/ga3-corrected-2</input>
312               <input>instrumentation/km-5-2</input>
313               <input>-instrumentation/bgmk-offset-2</input>
314               <clipto>
315                 <min>-10.0</min>
316                 <max>10.0</max>
317               </clipto>
318             </summer>
319             
320             <switch name="instrumentation/bgmk-tau-2">
321               <default value="0.0042"/>
322               <test value="0.3">
323                 instrumentation/bgmk-corrector-2 == 1
324               </test>
325             </switch>
326             
327             <integrator name="instrumentation/bgmk-2-integrator">
328               <input>instrumentation/bgmk-fork-2</input>
329               <c1>instrumentation/bgmk-tau-2</c1>
330               <trigger>instrumentation/bgmk-failure-2</trigger>
331               <output>instrumentation/bgmk-offset-2</output>
332             </integrator>
333             
334             <summer name="instrumentation/bgmk-2">
335               <input>instrumentation/ga3-corrected-2</input>
336               <input>instrumentation/bgmk-2-integrator</input>
337             </summer>
338             <!--End BGMK-2-->
339             <!--End gyro-magnetic proc-->
340             <!--PNP switches-->    
341             <switch name="instrumentation/pnp-heading-left">
342               <default value="instrumentation/ga3-corrected-1"/>
343               <test value="instrumentation/bgmk-1">
344                 instrumentation/pnp-left-selector == 0
345               </test>
346             </switch>
347             
348             <switch name="instrumentation/pnp-heading-right">
349               <default value="instrumentation/ga3-corrected-2"/>
350               <test value="instrumentation/bgmk-2">
351                 instrumentation/pnp-right-selector == 0
352               </test>
353             </switch>
354             
355             <switch name="instrumentation/pnp-heading">
356               <default value="instrumentation/pnp-heading-left"/>
357               <test value="instrumentation/pnp-heading-right">
358                 instrumentation/pnp-selector == 1
359               </test>
360             </switch>
361             
362             <!--************************** End TKS staff ****************************-->
363           </channel>
364           <!--******************** END externals channel ***********************-->
365
366 </system>