diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml index 0746fb6d..76d80ee4 100644 --- a/Models/FlightDeck/a320.flightdeck.xml +++ b/Models/FlightDeck/a320.flightdeck.xml @@ -78,11 +78,11 @@ /systems/electrical/bus/ac1 - 25 + 110 /systems/electrical/bus/ac2 - 25 + 110 @@ -128,6 +128,10 @@ /modes/fo-du-xfr 2 + + /controls/electrical/switches/emer-gen + 1 + @@ -159,16 +163,20 @@ /systems/electrical/bus/ac1 - 25 + 110 /systems/electrical/bus/ac2 - 25 + 110 /modes/cpt-du-xfr 2 + + /controls/electrical/switches/emer-gen + 1 + @@ -198,16 +206,20 @@ /systems/electrical/bus/ac1 - 25 + 110 /systems/electrical/bus/ac2 - 25 + 110 /modes/fo-du-xfr 2 + + /controls/electrical/switches/emer-gen + 1 + @@ -245,11 +257,11 @@ /systems/electrical/bus/ac1 - 25 + 110 /systems/electrical/bus/ac2 - 25 + 110 @@ -275,11 +287,11 @@ /systems/electrical/bus/ac1 - 25 + 110 /systems/electrical/bus/ac2 - 25 + 110 @@ -305,11 +317,11 @@ /systems/electrical/bus/ac1 - 25 + 110 /systems/electrical/bus/ac2 - 25 + 110 @@ -335,11 +347,11 @@ /systems/electrical/bus/ac1 - 25 + 110 /systems/electrical/bus/ac2 - 25 + 110 @@ -361,12 +373,16 @@ /systems/electrical/bus/ac1 - 25 + 110 /systems/electrical/bus/ac2 - 25 + 110 + + /controls/electrical/switches/emer-gen + 1 + diff --git a/Nasal/electrical.nas b/Nasal/electrical.nas index a7a22098..fa6f94a9 100644 --- a/Nasal/electrical.nas +++ b/Nasal/electrical.nas @@ -130,7 +130,7 @@ var master_elec = func { var emergen = getprop("/controls/electrical/switches/emer-gen"); var emergenvolts = getprop("/systems/electrical/extra/emergen-volts"); var emergenhz = getprop("/systems/electrical/bus/emergen-hz"); - var gs = getprop("/velocities/groundspeed-kt"); + var ias = getprop("/instrumentation/airspeed-indicator/indicated-speed-kt"); var rat = getprop("/controls/hydraulic/rat"); var manrat = getprop("/controls/hydraulic/rat-man"); var ac_ess_fail = getprop("/systems/failures/elec-ac-ess"); @@ -180,6 +180,10 @@ var master_elec = func { setprop("/systems/electrical/bus/dc1", dc_volt_std); setprop("/systems/electrical/bus/dc-ess", dc_volt_std); setprop("/systems/electrical/bus/dc1-amps", dc_amps_std); + } else if (emergen) { + setprop("/systems/electrical/bus/dc1", dc_volt_std); + setprop("/systems/electrical/bus/dc-ess", dc_volt_std); + setprop("/systems/electrical/bus/dc1-amps", dc_amps_std); } else { setprop("/systems/electrical/bus/dc1", 0); setprop("/systems/electrical/bus/dc1-amps", 0); @@ -205,6 +209,10 @@ var master_elec = func { setprop("/systems/electrical/bus/dc2", dc_volt_std); setprop("/systems/electrical/bus/dc-ess", dc_volt_std); setprop("/systems/electrical/bus/dc2-amps", dc_amps_std); + } else if (emergen) { + setprop("/systems/electrical/bus/dc2", dc_volt_std); + setprop("/systems/electrical/bus/dc-ess", dc_volt_std); + setprop("/systems/electrical/bus/dc2-amps", dc_amps_std); } else { setprop("/systems/electrical/bus/dc2", 0); setprop("/systems/electrical/bus/dc2-amps", 0); @@ -230,6 +238,14 @@ var master_elec = func { setprop("/systems/electrical/bus/ac1", ac_volt_std); setprop("/systems/electrical/extra/gen1-volts", ac_volt_std); setprop("/systems/electrical/bus/gen1-hz", ac_hz_std); + } else if (emergen) { + setprop("/systems/electrical/bus/ac1", ac_volt_std); + setprop("/systems/electrical/extra/ext-volts", 0); + setprop("/systems/electrical/extra/apu-volts", 0); + setprop("/systems/electrical/extra/ext-hz", 0); + setprop("/systems/electrical/extra/apu-hz", 0); + setprop("/systems/electrical/extra/gen1-volts", 0); + setprop("/systems/electrical/bus/gen1-hz", 0); } else { setprop("/systems/electrical/bus/ac1", 0); setprop("/systems/electrical/extra/ext-volts", 0); @@ -257,6 +273,14 @@ var master_elec = func { setprop("/systems/electrical/bus/ac2", ac_volt_std); setprop("/systems/electrical/extra/gen2-volts", ac_volt_std); setprop("/systems/electrical/bus/gen2-hz", ac_hz_std); + } else if (emergen) { + setprop("/systems/electrical/bus/ac2", ac_volt_std); + setprop("/systems/electrical/extra/ext-volts", 0); + setprop("/systems/electrical/extra/apu-volts", 0); + setprop("/systems/electrical/extra/ext-hz", 0); + setprop("/systems/electrical/extra/apu-hz", 0); + setprop("/systems/electrical/extra/gen2-volts", 0); + setprop("/systems/electrical/bus/gen2-hz", 0); } else { setprop("/systems/electrical/bus/ac2", 0); setprop("/systems/electrical/extra/ext-volts", 0); @@ -306,22 +330,16 @@ var master_elec = func { setprop("/systems/electrical/gen-ext", 0); } - if ((ac1 == 0) and (ac2 == 0) and (gs > 100) or (manrat)) { + if ((ac1 == 0) and (ac2 == 0) and (ias > 100) or (manrat)) { setprop("/controls/hydraulic/rat-deployed", 1); setprop("/controls/hydraulic/rat", 1); setprop("/controls/electrical/switches/emer-gen", 1); - setprop("/systems/electrical/bus/dc-ess", ac_volt_std); - setprop("/systems/electrical/bus/ac-ess", dc_volt_std); } - if (rat and (gs < 100)) { + if (ias < 100) { setprop("/controls/electrical/switches/emer-gen", 0); - setprop("/controls/hydraulic/rat", 0); - setprop("/systems/electrical/bus/dc-ess", 0); - setprop("/systems/electrical/bus/ac-ess", 0); } - # Battery Amps if (battery1_sw and !batt1_fail) { setprop("/systems/electrical/battery1-amps", dc_amps_std); diff --git a/Nasal/hydraulics.nas b/Nasal/hydraulics.nas index cd94d15d..45ad9376 100644 --- a/Nasal/hydraulics.nas +++ b/Nasal/hydraulics.nas @@ -58,7 +58,7 @@ var master_hyd = func { setprop("/systems/hydraulic/ptu-active", 0); } - if ((rat_man_sw == 1) and (gs > 100)) { + if ((rat_man_sw == 1 or getprop("/controls/electrical/switches/emer-gen") == 1) and (gs > 100)) { setprop("/controls/hydraulic/rat", 1); setprop("/controls/hydraulic/rat-deployed", 1); } else if (gs < 100) { diff --git a/Systems/hydraulics.xml b/Systems/hydraulics.xml index 5c11aac2..764fd2f0 100644 --- a/Systems/hydraulics.xml +++ b/Systems/hydraulics.xml @@ -4,6 +4,44 @@ + + + + + + Aileron Droop + gain + 1 + 0.05 + + + + /instrumentation/airspeed-indicator/indicated-speed-kt + 720.5 + 1160.0 +
+
+ + /systems/hydraulic/aileron-droop +
+ + + Elevator Droop + gain + 1 + 0.05 + + + + /instrumentation/airspeed-indicator/indicated-speed-kt + 870.5 + 1210.0 +
+
+ + /systems/hydraulic/elevator-droop +
+ @@ -74,7 +112,7 @@ - 0.5 + /systems/hydraulic/aileron-droop @@ -188,7 +226,8 @@ - -0.5 + /systems/hydraulic/aileron-droop + -1.0 @@ -754,7 +793,7 @@ - 0.1 + /systems/hydraulic/elevator-droop @@ -818,7 +857,7 @@ - 0.1 + /systems/hydraulic/elevator-droop