fcs-management.nas 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # based on OH-1 by Tatsuhiro Nishioka
  2. # AFCS configuration
  3. var fcs_params = {
  4. 'gains' : {
  5. 'cas' : {
  6. 'input' : {
  7. 'roll' : 60,
  8. 'pitch' : -60,
  9. 'yaw' : 30,
  10. 'attitude-roll' : 80,
  11. 'attitude-pitch' : -80,
  12. 'attitude-control-threshold' : 0.7,
  13. 'rate-control-threshold' : 0.95,
  14. 'anti-side-slip-min-speed' : 0.015
  15. },
  16. 'output' : {
  17. 'roll' : 0.06,
  18. 'pitch' : -0.1,
  19. 'yaw' : 0.5,
  20. 'roll-brake-freq' : 10,
  21. 'pitch-brake-freq' : 3,
  22. 'roll-brake' : 0.4,
  23. 'pitch-brake' : 6,
  24. 'anti-side-slip-gain' : -4.5,
  25. 'heading-adjuster-gain' : -8,
  26. 'heading-adjuster-limit' : 5
  27. }
  28. },
  29. 'tail-rotor' : {
  30. 'src-minimum' : 0.10,
  31. 'src-maximum' : 1.00,
  32. 'low-limit' : 0.00011,
  33. 'high-limit' : 0.0035,
  34. 'error-adjuster-gain' : -0.5
  35. },
  36. 'stabilator' : {
  37. # 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160, 170, 180, .....
  38. 'gain-table' : [-0.9, -0.8, 0.1, -0.5, 0.0, 0.7, 0.8, 0.9, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9, 0.8, 0.4, 0.2, 0.2, -1.0]
  39. }
  40. },
  41. 'switches' : { # initial status of FCS
  42. 'auto-hover' : 0,
  43. 'cas' : 0,
  44. 'sas' : 0,
  45. 'auto-stabilator' : 1,
  46. 'sideslip-adjuster' : 1,
  47. 'tail-rotor-adjuster' : 1,
  48. 'heading-adjuster' : 1,
  49. 'debug' : 1 # Add this only when you are adjusting FCS parameters
  50. }
  51. };
  52. var setAFCSConfig = func() {
  53. var confNode = props.globals.getNode("/controls/flight/fcs", 1);
  54. confNode.setValues(fcs_params);
  55. # This invokes fcs.initialize()
  56. setprop("/sim/signals/fcs-initialized", 1);
  57. }
  58. _setlistener("/sim/signals/fdm-initialized", setAFCSConfig);