Howto:Implement a Fly-By-Wire System for Airliners: Difference between revisions

Jump to navigation Jump to search
m (→‎/Nasal/fbw.nas: formatting)
Line 38: Line 38:
<syntaxhighlight lang="php">
<syntaxhighlight lang="php">
#########################################
#########################################
## FLY BY WIRE SYSTEM FOR BOEING 787-8 ##
## FLY BY WIRE SYSTEM FOR FLIGHTGEAR  ##
#########################################
#########################################
## Designed by Omega Pilot and Redneck ##
## Designed by Omega Pilot and Redneck ##
#########################################
#########################################
# Fly By Wire Functions
## Dampen Surface positions
## Set Bank and Pitch Limits
## Help in turns with rudder
## Apply power while turning
## Maintain vertical speed during turns


# CONSTANTS
# CONSTANTS
Line 94: Line 86:
## Fix Damp Rate according to Framerate
## Fix Damp Rate according to Framerate


var fpsfix = 1;
if (getprop("/sim/frame-rate") != nil) var fpsfix = 25 / getprop("/sim/frame-rate");
if (getprop("/sim/frame-rate") != nil) fpsfix = 25 / getprop("/sim/frame-rate");
else fpsfix = 1;


## Bank Limit Setting
## Bank Limit Setting
Line 138: Line 130:


if (getprop("/systems/electrical/outputs/efis") != nil) {
if (getprop("/systems/electrical/outputs/efis") != nil) {
if ((getprop("/systems/electrical/outputs/efis") < 9) and (altitudeagl >= 200)) {
if ((getprop("/systems/electrical/outputs/efis") < 9) and (altitudeagl >= 200)) {
  setprop("/controls/fbw/active", 0);
setprop("/controls/fbw/active", 0);
  if (me.disconnectannounce == 0) {
if (me.disconnectannounce == 0) {
  screen.log.write("Fly By Wire Disconnected!", 1, 0, 0);
screen.log.write("Fly By Wire Disconnected!", 1, 0, 0);
  me.disconnectannounce = 1;
me.disconnectannounce = 1;
  } # of disconnectannounce
} } }
} # if efis < 9 and AGL alt >= 200
}


if (getprop("/controls/fbw/active")) {
if (getprop("/controls/fbw/active")) {
Line 357: Line 347:
# *Power-by-wire : corresponds to power steering in cars
# *Power-by-wire : corresponds to power steering in cars
</syntaxhighlight>
</syntaxhighlight>
=== -set.xml ===
Call the Nasal file in your aircraft's -set.xml file by adding the following code inside <nasal></nasal>
<syntaxhighlight lang="xml">
<fbw>
<file>Aircraft/787-8/Nasal/fbw.nas</file>
</fbw>
</syntaxhighlight>
Replace '787-8' with your aircraft folder name.
=== JSBSim FDM ===
Replace 'aileron-cmd-norm' with 'aileron-fbw-output'.
Replace 'elevator-cmd-norm' with 'elevator-fbw-output'.
Finally, replace 'rudder-cmd-norm' with 'rudder-fbw-output'.
== Configuration ==
Add the following switches anywhere (preferably the CDU) to be able to configure the CDU in FlightGear:
* /controls/fbw/active (controls whether the fly-by-wire system is active or not)
* /controls/fbw/yaw-damper (controls the yaw damper)
* /controls/fbw/rudder (controls whether the fly-by-wire controls rudder or not)
* /controls/fbw/bank-limit (controls the aircraft's bank limit)
If you don't want any of the configurations to be edited in Flightgear, but configured generally, add the following under </sim> to your -set.xml for the appropriate properties you want to configure:
<syntaxhighlight lang="xml">
<controls>
<fbw>
<yaw-damper type="int">1</yawdamper>
<rudder type="int">1</rudder>
<bank-limit type="int">30</bank-limit> <!-- 30 degrees bank permitted -->
</fbw>
</controls>
</syntaxhighlight>


[[Category:Howto]]
[[Category:Howto]]
[[Category:Nasal]]
[[Category:Nasal]]
449

edits

Navigation menu