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

m
Line 165: Line 165:
## Engine Throttle Positions
## Engine Throttle Positions


me.throttles[0] = getprop("controls/engines/engine[0]/throttle");
var engines = props.globals.getNode("controls/engines").getChildren("engine");
forindex(var index; engines ) {
me.throttles[index] = engines.getNode("engine",index).getNode("throttle").getValue() );
}
 
me.throttles[0] = getprop("[0]/throttle");
me.throttles[1] = getprop("controls/engines/engine[1]/throttle");
me.throttles[1] = getprop("controls/engines/engine[1]/throttle");


## This is where the FBW actually does its job ;)
## This is where the FBW actually does its job ;)
Line 309: Line 315:
setprop(fcs~"rudder-fbw-output", me.rudderout);
setprop(fcs~"rudder-fbw-output", me.rudderout);


setprop("controls/engines/engine[0]/throttle", throttles[0]);
setprop("controls/engines/engine[0]/throttle", me.throttles[0]);
setprop("controls/engines/engine[1]/throttle", throttles[1]);
setprop("controls/engines/engine[1]/throttle", me.throttles[1]);


me.throttle = throttles[0]; # This is to find out if the pilot moved the throttle
me.throttle = me.throttles[0]; # This is to find out if the pilot moved the throttle


} else {
} else {
Line 385: Line 391:
},
},
     check_if_active : func {
     check_if_active : func {
### The Fly-by--wire only works when it is active. In the Boeing 787, pilots have the option to disable
### The Fly-by--wire only works when it is active. In the Boeing 787, pilots have the option to disable fly-by-wire and use power-by-wire* in case of emergencies. The Fly By Wire Configuration includes: On/Off, Bank Limit and Rudder Control. The FBW Configs can be set in the FBW CONFIG Page in the CDU(s)
### fly-by-wire and use power-by-wire* in case of emergencies. The Fly By Wire Configuration includes:  
### On/Off, Bank Limit and Rudder Control. The FBW Configs can be set in the FBW CONFIG Page in the CDU(s)


## Turn on Fly By Wire only if we have power
## Turn on Fly By Wire only if we have power