FBW: Add Flare Mode, Auto Flap Retract with 1+F to 1, Very basig FMGC system started

This commit is contained in:
Joshua Davidson 2017-05-07 21:34:45 -04:00
parent a3e13effe8
commit e3243b796e
16 changed files with 179 additions and 22 deletions

View file

@ -138,6 +138,9 @@
<itaf>
<file>Aircraft/A320Family/Nasal/it-autoflight.nas</file>
</itaf>
<fmgc>
<file>Aircraft/A320Family/Nasal/FMGC.nas</file>
</fmgc>
<thrust>
<file>Aircraft/A320Family/Nasal/thrust.nas</file>
</thrust>

View file

@ -499,7 +499,7 @@ YAW MOI_________3950000______23089847_______24848934
<z> -33.9470 </z>
</location>
<capacity unit="LBS"> 11982 </capacity><!-- correct by FCOM -->
<contents unit="LBS"> 6000 </contents>
<contents unit="LBS"> 4480 </contents>
<standpipe unit="LBS">31</standpipe><!-- minimun fuel on pipes -->
<priority>3</priority>
<type>JET-A1</type>
@ -525,7 +525,7 @@ YAW MOI_________3950000______23089847_______24848934
<z> -33.9470 </z>
</location>
<capacity unit="LBS"> 11982 </capacity><!-- correct by FCOM -->
<contents unit="LBS"> 6000 </contents>
<contents unit="LBS"> 4480 </contents>
<standpipe unit="LBS">31</standpipe><!-- minimum fuel on pipes -->
<priority>3</priority>
<type>JET-A1</type>

View file

@ -131,6 +131,9 @@
<itaf>
<file>Aircraft/A320Family/Nasal/it-autoflight.nas</file>
</itaf>
<fmgc>
<file>Aircraft/A320Family/Nasal/FMGC.nas</file>
</fmgc>
<thrust>
<file>Aircraft/A320Family/Nasal/thrust.nas</file>
</thrust>

View file

@ -499,7 +499,7 @@ YAW MOI_________3950000______23089847_______24848934
<z> -33.9470 </z>
</location>
<capacity unit="LBS"> 11982 </capacity><!-- correct by FCOM -->
<contents unit="LBS"> 6000 </contents>
<contents unit="LBS"> 4480 </contents>
<standpipe unit="LBS">31</standpipe><!-- minimun fuel on pipes -->
<priority>3</priority>
<type>JET-A1</type>
@ -525,7 +525,7 @@ YAW MOI_________3950000______23089847_______24848934
<z> -33.9470 </z>
</location>
<capacity unit="LBS"> 11982 </capacity><!-- correct by FCOM -->
<contents unit="LBS"> 6000 </contents>
<contents unit="LBS"> 4480 </contents>
<standpipe unit="LBS">31</standpipe><!-- minimum fuel on pipes -->
<priority>3</priority>
<type>JET-A1</type>

View file

@ -334,6 +334,12 @@
<rpm type="float">0</rpm>
<egt type="float">0</egt>
</apu>
<FMGC>
<status>
<to-state type="bool">1</to-state>
</status>
</FMGC>
<controls>
<adirs n="0">
@ -404,6 +410,7 @@
<aileron-left>0.5</aileron-left>
<aileron-right>-0.5</aileron-right>
<aileron-sum>0.0</aileron-sum>
<elevator-input>0</elevator-input>
<elevator-fbw>0</elevator-fbw>
<elevator-left>0.1</elevator-left>
<elevator-right>0.1</elevator-right>

View file

@ -131,6 +131,9 @@
<itaf>
<file>Aircraft/A320Family/Nasal/it-autoflight.nas</file>
</itaf>
<fmgc>
<file>Aircraft/A320Family/Nasal/FMGC.nas</file>
</fmgc>
<thrust>
<file>Aircraft/A320Family/Nasal/thrust.nas</file>
</thrust>

View file

@ -499,7 +499,7 @@ YAW MOI_________3950000______23089847_______24848934
<z> -33.9470 </z>
</location>
<capacity unit="LBS"> 11982 </capacity><!-- correct by FCOM -->
<contents unit="LBS"> 6000 </contents>
<contents unit="LBS"> 4480 </contents>
<standpipe unit="LBS">31</standpipe><!-- minimun fuel on pipes -->
<priority>3</priority>
<type>JET-A1</type>
@ -525,7 +525,7 @@ YAW MOI_________3950000______23089847_______24848934
<z> -33.9470 </z>
</location>
<capacity unit="LBS"> 11982 </capacity><!-- correct by FCOM -->
<contents unit="LBS"> 6000 </contents>
<contents unit="LBS"> 4480 </contents>
<standpipe unit="LBS">31</standpipe><!-- minimum fuel on pipes -->
<priority>3</priority>
<type>JET-A1</type>

View file

@ -137,6 +137,9 @@
<itaf>
<file>Aircraft/A320Family/Nasal/it-autoflight.nas</file>
</itaf>
<fmgc>
<file>Aircraft/A320Family/Nasal/FMGC.nas</file>
</fmgc>
<thrust>
<file>Aircraft/A320Family/Nasal/thrust.nas</file>
</thrust>

View file

@ -499,7 +499,7 @@ YAW MOI_________3950000______23089847_______24848934
<z> -33.9470 </z>
</location>
<capacity unit="LBS"> 11982 </capacity><!-- correct by FCOM -->
<contents unit="LBS"> 6000 </contents>
<contents unit="LBS"> 4480 </contents>
<standpipe unit="LBS">31</standpipe><!-- minimun fuel on pipes -->
<priority>3</priority>
<type>JET-A1</type>
@ -525,7 +525,7 @@ YAW MOI_________3950000______23089847_______24848934
<z> -33.9470 </z>
</location>
<capacity unit="LBS"> 11982 </capacity><!-- correct by FCOM -->
<contents unit="LBS"> 6000 </contents>
<contents unit="LBS"> 4480 </contents>
<standpipe unit="LBS">31</standpipe><!-- minimum fuel on pipes -->
<priority>3</priority>
<type>JET-A1</type>

View file

@ -32,6 +32,7 @@ var colddark = func {
setprop("/controls/flight/flap-lever", 0);
setprop("/controls/flight/flap-pos", 0);
setprop("/controls/flight/flap-txt", " ");
A320.flaptimer.stop();
setprop("/controls/flight/speedbrake-arm", 0);
setprop("/controls/gear/gear-down", 1);
systems.elec_init();
@ -78,6 +79,7 @@ var beforestart = func {
setprop("/controls/flight/flap-lever", 0);
setprop("/controls/flight/flap-pos", 0);
setprop("/controls/flight/flap-txt", " ");
A320.flaptimer.stop();
setprop("/controls/flight/speedbrake-arm", 0);
setprop("/controls/gear/gear-down", 1);
systems.elec_init();
@ -148,6 +150,7 @@ var taxi = func {
setprop("/controls/flight/flap-lever", 0);
setprop("/controls/flight/flap-pos", 0);
setprop("/controls/flight/flap-txt", " ");
A320.flaptimer.stop();
setprop("/controls/flight/speedbrake-arm", 0);
setprop("/controls/gear/gear-down", 1);
systems.elec_init();
@ -246,6 +249,7 @@ var takeoff = func {
setprop("/controls/flight/flap-lever", 1);
setprop("/controls/flight/flap-pos", 2);
setprop("/controls/flight/flap-txt", "1+F");
A320.flaptimer.start();
setprop("/controls/flight/elevator-trim", -0.15);
}
});

29
Nasal/FMGC.nas Normal file
View file

@ -0,0 +1,29 @@
# A320Family FMGC
# Joshua Davidson (it0uchpods)
# Very Simple at the moment, but will evolve into a fully-fledged FMGC System. -JD
setlistener("/gear/gear[1]/wow", func {
gearfunc();
});
setlistener("/gear/gear[2]/wow", func {
gearfunc();
});
var gearfunc = func {
var gear1 = getprop("/gear/gear[1]/wow");
var gear2 = getprop("/gear/gear[2]/wow");
var state1 = getprop("/systems/thrust/state1");
var state2 = getprop("/systems/thrust/state2");
var flaps = getprop("/controls/flight/flap-pos");
if (gear1 == 1 and gear2 == 1 and (state1 == "MCT" or state1 == "TOGA") and (state2 == "MCT" or state2 == "TOGA") and flaps < 4) {
setprop("/FMGC/status/to-state", 1);
}
if (getprop("/position/gear-agl-ft") >= 55) {
setprop("/FMGC/status/to-state", 0);
}
if (gear1 == 1 and gear2 == 1 and getprop("/FMGC/status/to-state") == 0 and flaps >= 4) {
setprop("/controls/flight/elevator-trim", -0.15);
}
}

View file

@ -14,6 +14,7 @@ controls.flapsDown = func(step) {
setprop("/controls/flight/flap-lever", 1);
setprop("/controls/flight/flap-pos", 2);
setprop("/controls/flight/flap-txt", "1+F");
flaptimer.start();
return;
} else {
setprop("/controls/flight/flaps", 0.000);
@ -21,6 +22,7 @@ controls.flapsDown = func(step) {
setprop("/controls/flight/flap-lever", 1);
setprop("/controls/flight/flap-pos", 1);
setprop("/controls/flight/flap-txt", "1");
flaptimer.stop();
return;
}
} else if (getprop("/controls/flight/flap-lever") == 1) {
@ -29,6 +31,7 @@ controls.flapsDown = func(step) {
setprop("/controls/flight/flap-lever", 2);
setprop("/controls/flight/flap-pos", 3);
setprop("/controls/flight/flap-txt", "2");
flaptimer.stop();
return;
} else if (getprop("/controls/flight/flap-lever") == 2) {
setprop("/controls/flight/flaps", 0.645);
@ -36,6 +39,7 @@ controls.flapsDown = func(step) {
setprop("/controls/flight/flap-lever", 3);
setprop("/controls/flight/flap-pos", 4);
setprop("/controls/flight/flap-txt", "3");
flaptimer.stop();
return;
} else if (getprop("/controls/flight/flap-lever") == 3) {
setprop("/controls/flight/flaps", 1.000);
@ -43,6 +47,7 @@ controls.flapsDown = func(step) {
setprop("/controls/flight/flap-lever", 4);
setprop("/controls/flight/flap-pos", 5);
setprop("/controls/flight/flap-txt", "FULL");
flaptimer.stop();
return;
}
} else if (step == -1) {
@ -52,6 +57,7 @@ controls.flapsDown = func(step) {
setprop("/controls/flight/flap-lever", 3);
setprop("/controls/flight/flap-pos", 4);
setprop("/controls/flight/flap-txt", "3");
flaptimer.stop();
return;
} else if (getprop("/controls/flight/flap-lever") == 3) {
setprop("/controls/flight/flaps", 0.596);
@ -59,6 +65,7 @@ controls.flapsDown = func(step) {
setprop("/controls/flight/flap-lever", 2);
setprop("/controls/flight/flap-pos", 3);
setprop("/controls/flight/flap-txt", "2");
flaptimer.stop();
return;
} else if (getprop("/controls/flight/flap-lever") == 2) {
if (getprop("/velocities/airspeed-kt") <= 100) {
@ -67,6 +74,7 @@ controls.flapsDown = func(step) {
setprop("/controls/flight/flap-lever", 1);
setprop("/controls/flight/flap-pos", 2);
setprop("/controls/flight/flap-txt", "1+F");
flaptimer.start();
return;
} else {
setprop("/controls/flight/flaps", 0.000);
@ -74,6 +82,7 @@ controls.flapsDown = func(step) {
setprop("/controls/flight/flap-lever", 1);
setprop("/controls/flight/flap-pos", 1);
setprop("/controls/flight/flap-txt", "1");
flaptimer.stop();
return;
}
} else if (getprop("/controls/flight/flap-lever") == 1) {
@ -82,9 +91,23 @@ controls.flapsDown = func(step) {
setprop("/controls/flight/flap-lever", 0);
setprop("/controls/flight/flap-pos", 0);
setprop("/controls/flight/flap-txt", " ");
flaptimer.stop();
return;
}
} else {
return 0;
}
}
}
var flap_autoretract = func {
if (getprop("/controls/flight/flap-pos") == 2 and getprop("/velocities/airspeed-kt") >= 185) {
setprop("/controls/flight/flaps", 0.000);
setprop("/controls/flight/slats", 0.666);
setprop("/controls/flight/flap-lever", 1);
setprop("/controls/flight/flap-pos", 1);
setprop("/controls/flight/flap-txt", "1");
flaptimer.stop();
}
}
var flaptimer = maketimer(0.5, flap_autoretract);

View file

@ -64,6 +64,10 @@ var update_loop = func {
}
}
}
if (getprop("/it-fbw/law") == 1 and getprop("/controls/gear/gear-down") == 1 and getprop("/it-fbw/override") == 0) {
setprop("/it-fbw/law", 2);
}
}
###########################

View file

@ -68,12 +68,19 @@
</or>
</condition>
<expression>
<table>
<property>/controls/flight/aileron-fbw</property>
<entry><ind>-1</ind><dep>-0.5</dep></entry>
<entry><ind> 0</ind><dep> 0.0</dep></entry>
<entry><ind> 1</ind><dep> 0.5</dep></entry>
</table>
<sum>
<table>
<property>/controls/flight/aileron-fbw</property>
<entry><ind>-1</ind><dep>-0.5</dep></entry>
<entry><ind> 0</ind><dep> 0.0</dep></entry>
<entry><ind> 1</ind><dep> 0.5</dep></entry>
</table>
<table>
<property>/fdm/jsbsim/fcs/flap-pos-deg</property>
<entry><ind>1</ind><dep>0.0</dep></entry>
<entry><ind>5</ind><dep>0.2</dep></entry>
</table>
</sum>
</expression>
</input>
<output>/controls/flight/aileron-left-cmd</output>
@ -150,12 +157,19 @@
</or>
</condition>
<expression>
<table>
<property>/controls/flight/aileron-fbw</property>
<entry><ind>-1</ind><dep>-0.5</dep></entry>
<entry><ind> 0</ind><dep> 0.0</dep></entry>
<entry><ind> 1</ind><dep> 0.5</dep></entry>
</table>
<sum>
<table>
<property>/controls/flight/aileron-fbw</property>
<entry><ind>-1</ind><dep>-0.5</dep></entry>
<entry><ind> 0</ind><dep> 0.0</dep></entry>
<entry><ind> 1</ind><dep> 0.5</dep></entry>
</table>
<table>
<property>/fdm/jsbsim/fcs/flap-pos-deg</property>
<entry><ind>1</ind><dep> 0.0</dep></entry>
<entry><ind>5</ind><dep>-0.2</dep></entry>
</table>
</sum>
</expression>
</input>
<output>/controls/flight/aileron-right-cmd</output>

View file

@ -5,6 +5,70 @@
<PropertyList>
<!-- =============================================================== -->
<!-- Elevator Position Feeding -->
<!-- =============================================================== -->
<filter>
<debug>false</debug>
<type>gain</type>
<gain>1.0</gain>
<input>
<condition>
<and>
<equals>
<property>/it-autoflight/output/ap1</property>
<value>0</value>
</equals>
<equals>
<property>/it-autoflight/output/ap2</property>
<value>0</value>
</equals>
<less-than>
<property>/position/gear-agl-ft</property>
<value>50</value>
</less-than>
<greater-than-equals>
<property>/controls/flight/flap-pos</property>
<value>4</value>
</greater-than-equals>
<less-than>
<property>/controls/engines/engine[0]/throttle</property>
<value>0.65</value>
</less-than>
<less-than>
<property>/controls/engines/engine[0]/throttle</property>
<value>0.65</value>
</less-than>
<equals>
<property>/FMGC/status/to-state</property>
<value>0</value>
</equals>
<or>
<equals>
<property>/it-fbw/law</property>
<value>0</value>
</equals>
<equals>
<property>/it-fbw/law</property>
<value>1</value>
</equals>
</or>
</and>
</condition>
<expression>
<sum>
<property>/controls/flight/elevator</property>
<value>0.15</value>
</sum>
</expression>
</input>
<input>
<property>/controls/flight/elevator</property>
</input>
<output>/controls/flight/elevator-input</output>
</filter>
<!-- =============================================================== -->
<!-- Lateral -->
<!-- =============================================================== -->

View file

@ -88,7 +88,7 @@
<sum>
<property>/it-fbw/pitch-deg</property>
<table>
<independentVar lookup="row">/controls/flight/elevator</independentVar>
<independentVar lookup="row">/controls/flight/elevator-input</independentVar>
<tableData>
-1.0 0.1
-0.7 0.05