flitape.nas 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # Helionix flitape calculations
  2. ####Calculation into "FLI"###
  3. ## First Limit Indicator - FLI
  4. ## Originally adopted from ec130 VEMD.nas .
  5. ## However the ec135/ec130, VEMD FLI indication differs
  6. ## from the H145 Helionix FND FLI tape:
  7. ## according to Neuhaus/Ockier - "Helionix Cockpit Concept" the
  8. ## "FLI scale uses the collective lever position"
  9. ## to display the "moving collective pitch scale".
  10. ## The moving markers on top of the FLI tape indicate at which
  11. ## collective pitch the reaching of MCP, take-off- and transient-TO
  12. ## torque limits are expected.
  13. var flitape = {
  14. init: func () {
  15. # define objects constants
  16. me.flimcp = 7.4; # max. continuous 74% TRQ
  17. me.flitop = 9.5; # take off power 95% TRQ for max. 30 mins
  18. me.flisync = 0.1;
  19. me.flittop = 10.4; # transient take off power 104% TRQ for max. 10 sec.
  20. me.trqf = aircraft.lowpass.new(5); # slowly adapt the torque factor
  21. me.trqfac = 0;
  22. me.offset = 0;
  23. #set the calibration paramters
  24. if (!getprop("instrumentation/efis/fnd/fli-mcp-cal")) {
  25. setprop("instrumentation/efis/fnd/fli-mcp-cal",0.5);
  26. setprop("instrumentation/efis/fnd/fli-top-cal",0.3);
  27. setprop("instrumentation/efis/fnd/fli-ttop-cal",0.35);
  28. setprop("instrumentation/efis/fnd/fli-sync-cal",1);
  29. }
  30. me.trqf.set(2.0);
  31. setprop("instrumentation/efis/fnd/fli-tape", 0);
  32. setprop("instrumentation/efis/fnd/fli-mcp", 0);
  33. setprop("instrumentation/efis/fnd/fli-ttop", 0);
  34. setprop("instrumentation/efis/fnd/fli-top", 0);
  35. setprop("instrumentation/efis/fnd/fli-sync", 0);
  36. },
  37. update: func () {
  38. # for FLI all params normalized to 10
  39. var coll = getprop("/controls/engines/engine/throttle") or 0;
  40. var trq = max( getprop("/engines/engine/torque-pct") or 0,
  41. getprop("/engines/engine[1]/torque-pct") or 0)/10;
  42. # FLI tape follows the collective pitch
  43. var flitape = (1.0 - coll) * 10.0;
  44. if (flitape>1 and trq>1) me.trqf.filter(flitape/trq);
  45. # normalize to TRQ at medium TOW 2900 at 60kt (~2 --> 0)
  46. me.trqfac = clamp(me.trqf.get()-2, -1, 1);
  47. setprop("instrumentation/efis/fnd/fli-tape", flitape);
  48. # FLI marker positions relative to reference line:
  49. setprop("instrumentation/efis/fnd/fli-mcp",
  50. (me.flimcp - trq)* me.trqf.get() *
  51. getprop("instrumentation/efis/fnd/fli-mcp-cal"));
  52. setprop("instrumentation/efis/fnd/fli-top",
  53. (me.flitop - trq)* me.trqf.get() *
  54. getprop("instrumentation/efis/fnd/fli-top-cal"));
  55. setprop("instrumentation/efis/fnd/fli-ttop",
  56. (me.flittop - trq)* me.trqf.get() *
  57. getprop("instrumentation/efis/fnd/fli-ttop-cal"));
  58. setprop("instrumentation/efis/fnd/fli-sync",
  59. (me.flisync - trq)* me.trqf.get() *
  60. getprop("instrumentation/efis/fnd/fli-sync-cal"));
  61. }
  62. };
  63. # main timer loop:
  64. flitape.timer = maketimer(0.2, func flitape.update() );
  65. setlistener("/sim/signals/fdm-initialized", func () {
  66. flitape.init();
  67. flitape.timer.start() }
  68. );