proper JSBsim based FBW logic for inputs now, should be MUCH better to fly

This commit is contained in:
Joshua Davidson 2017-04-17 00:10:36 -04:00
parent 3a2512911b
commit a1bfea36ab
9 changed files with 605 additions and 588 deletions

View file

@ -560,7 +560,8 @@ YAW MOI_________3950000______23089847_______24848934
<system file="pushback" />
<!--system file="a320-fuel" /-->
<system file="glass-effect1"/>
<system file="glass-effect1" />
<system file="it-fbw" />
<flight_control name="FCS: A320">
<channel name="Pitch">

View file

@ -560,7 +560,8 @@ YAW MOI_________3950000______23089847_______24848934
<system file="pushback" />
<!--system file="a320-fuel" /-->
<system file="glass-effect1"/>
<system file="glass-effect1" />
<system file="it-fbw" />
<flight_control name="FCS: A320">
<channel name="Pitch">

View file

@ -35,7 +35,7 @@
</electrical>
<!-- Custom FBW System -->
<autopilot>
<path>Aircraft/A320Family/Systems/it-fbw.xml</path>
<path>Aircraft/A320Family/Systems/it-fbw-b.xml</path>
</autopilot>
<autopilot>
<path>Aircraft/A320Family/Systems/it-autoflight.xml</path>
@ -295,11 +295,6 @@
</settings>
</it-autoflight>
<it-fbw>
<roll-deg>0</roll-deg>
<pitch-deg>0</pitch-deg>
</it-fbw>
<apu>
<rpm type="float">0</rpm>
<egt type="float">0</egt>

View file

@ -560,7 +560,8 @@ YAW MOI_________3950000______23089847_______24848934
<system file="pushback" />
<!--system file="a320-fuel" /-->
<system file="glass-effect1"/>
<system file="glass-effect1" />
<system file="it-fbw" />
<flight_control name="FCS: A320">
<channel name="Pitch">

View file

@ -560,7 +560,8 @@ YAW MOI_________3950000______23089847_______24848934
<system file="pushback" />
<!--system file="a320-fuel" /-->
<system file="glass-effect1"/>
<system file="glass-effect1" />
<system file="it-fbw" />
<flight_control name="FCS: A320">
<channel name="Pitch">

View file

@ -38,7 +38,7 @@
<binding>
<command>nasal</command>
<script>
setprop("/it-fbw/law", "NORMAL");
setprop("/it-fbw/law", 0);
gui.popupTip("Fly By Wire switched to NORMAL law!");
</script>
</binding>
@ -50,7 +50,7 @@
<binding>
<command>nasal</command>
<script>
setprop("/it-fbw/law", "ALTERNATE");
setprop("/it-fbw/law", 1);
gui.popupTip("Fly By Wire switched to ALTERNATE law!");
</script>
</binding>
@ -62,7 +62,7 @@
<binding>
<command>nasal</command>
<script>
setprop("/it-fbw/law", "DIRECT");
setprop("/it-fbw/law", 2);
gui.popupTip("Fly By Wire switched to DIRECT law!");
</script>
</binding>
@ -74,7 +74,7 @@
<binding>
<command>nasal</command>
<script>
setprop("/it-fbw/law", "BACKUP");
setprop("/it-fbw/law", 3);
gui.popupTip("Fly By Wire switched to MECHANICAL BACKUP law!");
</script>
</binding>

View file

@ -1,5 +1,5 @@
# Airbus A3XX FBW System by Joshua Davidson (it0uchpods/411)
# V0.9.2
# V0.9.6
########################
# Roll Update Function #
@ -8,66 +8,23 @@
var roll_input = func {
var ail = getprop("/controls/flight/aileron");
if (getprop("/it-autoflight/output/ap1") == 0 and getprop("/it-autoflight/output/ap2") == 0 and ((getprop("/it-fbw/law") == "NORMAL") or (getprop("/it-fbw/law") == "ALTERNATE"))) {
if (ail >= 0.05 and ail < 0.15) {
var rfbw = getprop("/it-fbw/roll-deg");
setprop("/it-fbw/roll-deg", rfbw + "0.01");
} else if (ail >= 0.15 and ail < 0.3) {
var rfbw = getprop("/it-fbw/roll-deg");
setprop("/it-fbw/roll-deg", rfbw + "0.05");
} else if (ail >= 0.3 and ail < 0.5) {
var rfbw = getprop("/it-fbw/roll-deg");
setprop("/it-fbw/roll-deg", rfbw + "0.1");
} else if (ail >= 0.5 and ail < 0.7) {
var rfbw = getprop("/it-fbw/roll-deg");
setprop("/it-fbw/roll-deg", rfbw + "0.2");
} else if (ail >= 0.7 and ail <= 1) {
var rfbw = getprop("/it-fbw/roll-deg");
setprop("/it-fbw/roll-deg", rfbw + "0.3");
}
if (ail <= -0.05 and ail > -0.15) {
var rfbw = getprop("/it-fbw/roll-deg");
setprop("/it-fbw/roll-deg", rfbw - "0.01");
} else if (ail <= -0.15 and ail > -0.3) {
var rfbw = getprop("/it-fbw/roll-deg");
setprop("/it-fbw/roll-deg", rfbw - "0.05");
} else if (ail <= -0.3 and ail > -0.5) {
var rfbw = getprop("/it-fbw/roll-deg");
setprop("/it-fbw/roll-deg", rfbw - "0.01");
} else if (ail <= -0.5 and ail > -0.7) {
var rfbw = getprop("/it-fbw/roll-deg");
setprop("/it-fbw/roll-deg", rfbw - "0.2");
} else if (ail <= -0.7 and ail >= -1) {
var rfbw = getprop("/it-fbw/roll-deg");
setprop("/it-fbw/roll-deg", rfbw - "0.3");
}
}
if (getprop("/it-fbw/roll-deg") >= 33) {
if (getprop("/it-fbw/law") == "NORMAL") {
if (ail > 0.4) {
if (getprop("/it-fbw/roll-deg") >= 67) {
setprop("/it-fbw/roll-deg", "67");
}
} else {
if (getprop("/it-fbw/law") == 0) {
if (ail > 0.4 or ail < -0.4) {
setprop("/it-fbw/roll-lim-max", "67");
setprop("/it-fbw/roll-lim-min", "-67");
} else {
setprop("/it-fbw/roll-lim-max", "33");
setprop("/it-fbw/roll-lim-min", "-33");
if (getprop("/it-fbw/law") > 33) {
setprop("/it-fbw/roll-deg", "33");
}
}
}
if (getprop("/it-fbw/roll-deg") <= -33) {
if (getprop("/it-fbw/law") == "NORMAL") {
if (ail < -0.4) {
if (getprop("/it-fbw/roll-deg") <= -67) {
setprop("/it-fbw/roll-deg", "-67");
}
} else {
} else if (getprop("/it-fbw/law") < -33) {
setprop("/it-fbw/roll-deg", "-33");
}
}
} else {
setprop("/it-fbw/roll-lim-max", "160");
setprop("/it-fbw/roll-lim-min", "-160");
}
if (getprop("/gear/gear[0]/wow") == 1) {
@ -82,87 +39,26 @@ var roll_input = func {
var pitch_input = func {
var elev = getprop("/controls/flight/elevator");
if (getprop("/it-autoflight/output/ap1") == 0 and getprop("/it-autoflight/output/ap2") == 0 and ((getprop("/it-fbw/law") == "NORMAL") or (getprop("/it-fbw/law") == "ALTERNATE"))) {
if (elev >= 0.05 and elev < 0.15) {
var pfbw = getprop("/it-fbw/pitch-deg");
setprop("/it-fbw/pitch-deg", pfbw - "0.005");
} else if (elev >= 0.15 and elev < 0.3) {
var pfbw = getprop("/it-fbw/pitch-deg");
setprop("/it-fbw/pitch-deg", pfbw - "0.01");
} else if (elev >= 0.3 and elev < 0.5) {
var pfbw = getprop("/it-fbw/pitch-deg");
setprop("/it-fbw/pitch-deg", pfbw - "0.05");
} else if (elev >= 0.5 and elev < 0.7) {
var pfbw = getprop("/it-fbw/pitch-deg");
setprop("/it-fbw/pitch-deg", pfbw - "0.1");
} else if (elev >= 0.7 and elev <= 1) {
var pfbw = getprop("/it-fbw/pitch-deg");
setprop("/it-fbw/pitch-deg", pfbw - "0.2");
}
if (elev <= -0.05 and elev > -0.15) {
var pfbw = getprop("/it-fbw/pitch-deg");
setprop("/it-fbw/pitch-deg", pfbw + "0.005");
} else if (elev <= -0.15 and elev > -0.3) {
var pfbw = getprop("/it-fbw/pitch-deg");
setprop("/it-fbw/pitch-deg", pfbw + "0.01");
} else if (elev <= -0.3 and elev > -0.5) {
var pfbw = getprop("/it-fbw/pitch-deg");
setprop("/it-fbw/pitch-deg", pfbw + "0.05");
} else if (elev <= -0.5 and elev > -0.7) {
var pfbw = getprop("/it-fbw/pitch-deg");
setprop("/it-fbw/pitch-deg", pfbw + "0.1");
} else if (elev <= -0.7 and elev >= -1) {
var pfbw = getprop("/it-fbw/pitch-deg");
setprop("/it-fbw/pitch-deg", pfbw + "0.2");
}
if ((getprop("/controls/flight/flap-lever") >= 3) and (getprop("/controls/engines/engine[0]/throttle") < 0.65) and (getprop("/controls/engines/engine[1]/throttle") < 0.65) and (getprop("/position/gear-agl-ft") <= 50)) {
if (elev > -0.05 and elev < 0.05) {
var pfbw = getprop("/it-fbw/pitch-deg");
setprop("/it-fbw/pitch-deg", pfbw - "0.003");
}
var gear1 = setlistener("/gear/gear[1]/wow", func {
if (getprop("/gear/gear[1]/wow") == 1 and getprop("/gear/gear[2]/wow") == 1) {
removelistener(gear1);
setprop("/controls/flight/elevator-trim", -0.1);
}
});
var gear2 = setlistener("/gear/gear[2]/wow", func {
if (getprop("/gear/gear[1]/wow") == 1 and getprop("/gear/gear[2]/wow") == 1) {
removelistener(gear2);
setprop("/controls/flight/elevator-trim", -0.1);
}
});
}
}
if (getprop("/it-fbw/pitch-deg") >= 15) {
if (getprop("/position/gear-agl-ft") <= 30) {
setprop("/it-fbw/pitch-deg", "15");
}
if (getprop("/it-fbw/pitch-deg") >= 30) {
if (getprop("/it-fbw/law") == "NORMAL") {
setprop("/it-fbw/pitch-deg", "30");
}
}
}
if (getprop("/it-fbw/pitch-deg") <= -15) {
if (getprop("/it-fbw/law") == "NORMAL") {
setprop("/it-fbw/pitch-deg", "-15");
}
if (getprop("/it-fbw/law") == 0) {
setprop("/it-fbw/pitch-lim-max", "30");
setprop("/it-fbw/pitch-lim-min", "-15");
} else {
setprop("/it-fbw/pitch-lim-max", "160");
setprop("/it-fbw/pitch-lim-min", "-160");
}
if (getprop("/gear/gear[0]/wow") == 1) {
if (elev > -0.1 and elev < 0.1) {
if (elev > -0.05 and elev < 0.05) {
setprop("/it-fbw/pitch-deg", getprop("/orientation/pitch-deg"));
}
}
}
###########################
# Various Other Functions #
###########################
setlistener("/it-autoflight/output/ap1", func {
if (getprop("/it-autoflight/output/ap1") == 0) {
setprop("/it-fbw/roll-deg", getprop("/orientation/roll-deg"));
@ -178,17 +74,17 @@ setlistener("/it-autoflight/output/ap2", func {
});
setlistener("/it-fbw/law", func {
if (getprop("/it-fbw/law") == "NORMAL") {
if (getprop("/it-fbw/law") == 0) {
setprop("/it-fbw/roll-deg", getprop("/orientation/roll-deg"));
setprop("/it-fbw/pitch-deg", getprop("/orientation/pitch-deg"));
} else if (getprop("/it-fbw/law") == "ALTERNATE") {
} else if (getprop("/it-fbw/law") == 1) {
setprop("/it-fbw/roll-deg", getprop("/orientation/roll-deg"));
setprop("/it-fbw/pitch-deg", getprop("/orientation/pitch-deg"));
}
});
setlistener("/sim/signals/fdm-initialized", func {
setprop("/it-fbw/law", "DIRECT");
setprop("/it-fbw/law", 2);
update_roll.start();
update_pitch.start();
print("AIRBUS FBW ... OK!");
@ -196,12 +92,12 @@ setlistener("/sim/signals/fdm-initialized", func {
setlistener("/systems/electrical/bus/ac-ess", func {
if (getprop("/systems/electrical/bus/ac-ess") >= 110) {
if (getprop("/it-fbw/law") != "NORMAL") {
setprop("/it-fbw/law", "NORMAL");
if (getprop("/it-fbw/law") != 0) {
setprop("/it-fbw/law", 0);
}
} else {
if (getprop("/it-fbw/law") != "DIRECT") {
setprop("/it-fbw/law", "DIRECT");
if (getprop("/it-fbw/law") != 2) {
setprop("/it-fbw/law", 2);
}
}
});

450
Systems/it-fbw-b.xml Normal file
View file

@ -0,0 +1,450 @@
<?xml version="1.0"?>
<!-- IT-AUTOFLIGHT: Fly By Wire -->
<PropertyList>
<!-- =============================================================== -->
<!-- Lateral -->
<!-- =============================================================== -->
<pid-controller>
<name>IT-FBW: ROLL</name>
<debug>false</debug>
<enable>
<condition>
<and>
<equals>
<property>/it-autoflight/output/ap1</property>
<value>0</value>
</equals>
<equals>
<property>/it-autoflight/output/ap2</property>
<value>0</value>
</equals>
<equals>
<property>/gear/gear[1]/wow</property>
<value>0</value>
</equals>
<equals>
<property>/gear/gear[2]/wow</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>
</enable>
<input>
<property>/orientation/roll-deg</property>
</input>
<reference>
<property>/it-fbw/roll-deg</property>
</reference>
<output>
<property>/controls/flight/aileron-fbw-cmd</property>
</output>
<config>
<Kp>0.12</Kp>
<beta>1</beta>
<alpha>0.1</alpha>
<gamma>0</gamma>
<Ti>10</Ti>
<Td>0.00001</Td>
<u_min>-1</u_min>
<u_max>1</u_max>
</config>
</pid-controller>
<filter>
<name>IT-FBW: ROLL OPTION</name>
<debug>false</debug>
<feedback-if-disabled>true</feedback-if-disabled>
<initialize-to>output</initialize-to>
<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>
<equals>
<property>/gear/gear[1]/wow</property>
<value>0</value>
</equals>
<equals>
<property>/gear/gear[2]/wow</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>
<property>/controls/flight/aileron-fbw-cmd</property>
</input>
<input>
<condition>
<or>
<equals>
<property>/it-autoflight/output/ap1</property>
<value>1</value>
</equals>
<equals>
<property>/it-autoflight/output/ap2</property>
<value>1</value>
</equals>
<equals>
<property>/gear/gear[1]/wow</property>
<value>1</value>
</equals>
<equals>
<property>/gear/gear[2]/wow</property>
<value>1</value>
</equals>
<equals>
<property>/it-fbw/law</property>
<value>2</value>
</equals>
</or>
</condition>
<property>/controls/flight/aileron</property>
</input>
<input>
<condition>
<equals>
<property>/it-fbw/law</property>
<value>3</value>
</equals>
</condition>
<value>0</value>
</input>
<output>/controls/flight/aileron-fbw</output>
<type>noise-spike</type>
<max-rate-of-change>10</max-rate-of-change>
</filter>
<!-- =============================================================== -->
<!-- Vertical -->
<!-- =============================================================== -->
<pid-controller>
<name>IT-FBW: PITCH</name>
<debug>false</debug>
<enable>
<condition>
<and>
<equals>
<property>/it-autoflight/output/ap1</property>
<value>0</value>
</equals>
<equals>
<property>/it-autoflight/output/ap2</property>
<value>0</value>
</equals>
<equals>
<property>/gear/gear[1]/wow</property>
<value>0</value>
</equals>
<equals>
<property>/gear/gear[2]/wow</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>
</enable>
<input>
<property>/orientation/pitch-deg</property>
</input>
<reference>
<property>/it-fbw/pitch-deg</property>
</reference>
<output>
<property>/controls/flight/elevator-fbw-cmd</property>
</output>
<config>
<Kp>-0.20</Kp>
<beta>1</beta>
<alpha>0.1</alpha>
<gamma>0</gamma>
<Ti>10</Ti>
<Td>0.00001</Td>
<u_min>-1</u_min>
<u_max>1</u_max>
</config>
</pid-controller>
<filter>
<name>IT-FBW: PITCH OPTION</name>
<debug>false</debug>
<feedback-if-disabled>true</feedback-if-disabled>
<initialize-to>output</initialize-to>
<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>
<equals>
<property>/gear/gear[1]/wow</property>
<value>0</value>
</equals>
<equals>
<property>/gear/gear[2]/wow</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>
<property>/controls/flight/elevator-fbw-cmd</property>
</input>
<input>
<condition>
<or>
<equals>
<property>/it-autoflight/output/ap1</property>
<value>1</value>
</equals>
<equals>
<property>/it-autoflight/output/ap2</property>
<value>1</value>
</equals>
<equals>
<property>/gear/gear[1]/wow</property>
<value>1</value>
</equals>
<equals>
<property>/gear/gear[2]/wow</property>
<value>1</value>
</equals>
<equals>
<property>/it-fbw/law</property>
<value>2</value>
</equals>
</or>
</condition>
<property>/controls/flight/elevator</property>
</input>
<input>
<condition>
<equals>
<property>/it-fbw/law</property>
<value>3</value>
</equals>
</condition>
<value>0</value>
</input>
<output>/controls/flight/elevator-fbw</output>
<type>noise-spike</type>
<max-rate-of-change>10</max-rate-of-change>
</filter>
<pid-controller>
<name>AP PITCH HELPER PLUS</name>
<debug>false</debug>
<enable>
<condition>
<and>
<greater-than>
<property>/controls/flight/elevator-fbw</property>
<value>0.1</value>
</greater-than>
<equals>
<property>/it-autoflight/output/ap1</property>
<value>0</value>
</equals>
<equals>
<property>/it-autoflight/output/ap2</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>
<greater-than-equals>
<property>/position/gear-agl-ft</property>
<value>50</value>
</greater-than-equals>
</and>
</condition>
</enable>
<input>
<value>0</value>
</input>
<reference>
<value>1</value>
</reference>
<output>
<property>/controls/flight/elevator-trim-cmd</property>
</output>
<config>
<Kp>0.08</Kp>
<beta>1.0</beta>
<alpha>0.1</alpha>
<gamma>0.0</gamma>
<Ti>10</Ti>
<Td>0.00001</Td>
<u_min>-1.00</u_min>
<u_max>1.00</u_max>
</config>
</pid-controller>
<pid-controller>
<name>FBW PITCH HELPER MINUS</name>
<debug>false</debug>
<enable>
<condition>
<and>
<less-than>
<property>/controls/flight/elevator-fbw</property>
<value>-0.1</value>
</less-than>
<equals>
<property>/it-autoflight/output/ap1</property>
<value>0</value>
</equals>
<equals>
<property>/it-autoflight/output/ap2</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>
<greater-than-equals>
<property>/position/gear-agl-ft</property>
<value>50</value>
</greater-than-equals>
</and>
</condition>
</enable>
<input>
<value>0</value>
</input>
<reference>
<value>1</value>
</reference>
<output>
<property>/controls/flight/elevator-trim-cmd</property>
</output>
<config>
<Kp>-0.08</Kp>
<beta>1.0</beta>
<alpha>0.1</alpha>
<gamma>0.0</gamma>
<Ti>10</Ti>
<Td>0.00001</Td>
<u_min>-1.00</u_min>
<u_max>1.00</u_max>
</config>
</pid-controller>
<filter>
<name>IT-FBW: PITCH TRIM FILTER</name>
<debug>false</debug>
<feedback-if-disabled>true</feedback-if-disabled>
<initialize-to>output</initialize-to>
<enable>
<condition>
<and>
<and>
<equals>
<property>/it-autoflight/output/ap1</property>
<value>0</value>
</equals>
<equals>
<property>/it-autoflight/output/ap2</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>
<greater-than-equals>
<property>/position/gear-agl-ft</property>
<value>50</value>
</greater-than-equals>
</and>
<or>
<greater-than>
<property>/controls/flight/elevator-fbw</property>
<value>0.05</value>
</greater-than>
<less-than>
<property>/controls/flight/elevator-fbw</property>
<value>-0.05</value>
</less-than>
</or>
</and>
</condition>
</enable>
<input>
<property>/controls/flight/elevator-trim-cmd</property>
</input>
<output>/controls/flight/elevator-trim</output>
<type>noise-spike</type>
<max-rate-of-change>0.01</max-rate-of-change>
</filter>
</PropertyList>

View file

@ -1,450 +1,122 @@
<?xml version="1.0"?>
<system name="it-fbw">
<property value="0">/it-fbw/law</property>
<property value="0">/it-fbw/roll-deg</property>
<property value="0">/it-fbw/pitch-deg</property>
<property value="30">/it-fbw/roll-lim-max</property>
<property value="30">/it-fbw/roll-lim-min</property>
<property value="30">/it-fbw/pitch-lim-max</property>
<property value="30">/it-fbw/pitch-lim-min</property>
<!-- IT-AUTOFLIGHT: Fly By Wire -->
<PropertyList>
<!-- =============================================================== -->
<!-- Lateral -->
<!-- =============================================================== -->
<pid-controller>
<name>IT-FBW: ROLL</name>
<debug>false</debug>
<enable>
<condition>
<and>
<equals>
<property>/it-autoflight/output/ap1</property>
<value>0</value>
</equals>
<equals>
<property>/it-autoflight/output/ap2</property>
<value>0</value>
</equals>
<equals>
<property>/gear/gear[1]/wow</property>
<value>0</value>
</equals>
<equals>
<property>/gear/gear[2]/wow</property>
<value>0</value>
</equals>
<or>
<equals>
<property>/it-fbw/law</property>
<value>NORMAL</value>
</equals>
<equals>
<property>/it-fbw/law</property>
<value>ALTERNATE</value>
</equals>
</or>
</and>
</condition>
</enable>
<input>
<property>/orientation/roll-deg</property>
</input>
<reference>
<property>/it-fbw/roll-deg</property>
</reference>
<output>
<property>/controls/flight/aileron-fbw-cmd</property>
</output>
<config>
<Kp>0.12</Kp>
<beta>1</beta>
<alpha>0.1</alpha>
<gamma>0</gamma>
<Ti>10</Ti>
<Td>0.00001</Td>
<u_min>-1</u_min>
<u_max>1</u_max>
</config>
</pid-controller>
<filter>
<name>IT-FBW: ROLL OPTION</name>
<debug>false</debug>
<feedback-if-disabled>true</feedback-if-disabled>
<initialize-to>output</initialize-to>
<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>
<equals>
<property>/gear/gear[1]/wow</property>
<value>0</value>
</equals>
<equals>
<property>/gear/gear[2]/wow</property>
<value>0</value>
</equals>
<or>
<equals>
<property>/it-fbw/law</property>
<value>NORMAL</value>
</equals>
<equals>
<property>/it-fbw/law</property>
<value>ALTERNATE</value>
</equals>
</or>
</and>
</condition>
<property>/controls/flight/aileron-fbw-cmd</property>
</input>
<input>
<condition>
<or>
<equals>
<property>/it-autoflight/output/ap1</property>
<value>1</value>
</equals>
<equals>
<property>/it-autoflight/output/ap2</property>
<value>1</value>
</equals>
<equals>
<property>/gear/gear[1]/wow</property>
<value>1</value>
</equals>
<equals>
<property>/gear/gear[2]/wow</property>
<value>1</value>
</equals>
<equals>
<property>/it-fbw/law</property>
<value>DIRECT</value>
</equals>
</or>
</condition>
<property>/controls/flight/aileron</property>
</input>
<input>
<condition>
<equals>
<property>/it-fbw/law</property>
<value>BACKUP</value>
</equals>
</condition>
<value>0</value>
</input>
<output>/controls/flight/aileron-fbw</output>
<type>noise-spike</type>
<max-rate-of-change>10</max-rate-of-change>
</filter>
<!-- =============================================================== -->
<!-- Vertical -->
<!-- =============================================================== -->
<pid-controller>
<name>IT-FBW: PITCH</name>
<debug>false</debug>
<enable>
<condition>
<and>
<equals>
<property>/it-autoflight/output/ap1</property>
<value>0</value>
</equals>
<equals>
<property>/it-autoflight/output/ap2</property>
<value>0</value>
</equals>
<equals>
<property>/gear/gear[1]/wow</property>
<value>0</value>
</equals>
<equals>
<property>/gear/gear[2]/wow</property>
<value>0</value>
</equals>
<or>
<equals>
<property>/it-fbw/law</property>
<value>NORMAL</value>
</equals>
<equals>
<property>/it-fbw/law</property>
<value>ALTERNATE</value>
</equals>
</or>
</and>
</condition>
</enable>
<input>
<property>/orientation/pitch-deg</property>
</input>
<reference>
<property>/it-fbw/pitch-deg</property>
</reference>
<output>
<property>/controls/flight/elevator-fbw-cmd</property>
</output>
<config>
<Kp>-0.20</Kp>
<beta>1</beta>
<alpha>0.1</alpha>
<gamma>0</gamma>
<Ti>10</Ti>
<Td>0.00001</Td>
<u_min>-1</u_min>
<u_max>1</u_max>
</config>
</pid-controller>
<filter>
<name>IT-FBW: PITCH OPTION</name>
<debug>false</debug>
<feedback-if-disabled>true</feedback-if-disabled>
<initialize-to>output</initialize-to>
<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>
<equals>
<property>/gear/gear[1]/wow</property>
<value>0</value>
</equals>
<equals>
<property>/gear/gear[2]/wow</property>
<value>0</value>
</equals>
<or>
<equals>
<property>/it-fbw/law</property>
<value>NORMAL</value>
</equals>
<equals>
<property>/it-fbw/law</property>
<value>ALTERNATE</value>
</equals>
</or>
</and>
</condition>
<property>/controls/flight/elevator-fbw-cmd</property>
</input>
<input>
<condition>
<or>
<equals>
<property>/it-autoflight/output/ap1</property>
<value>1</value>
</equals>
<equals>
<property>/it-autoflight/output/ap2</property>
<value>1</value>
</equals>
<equals>
<property>/gear/gear[1]/wow</property>
<value>1</value>
</equals>
<equals>
<property>/gear/gear[2]/wow</property>
<value>1</value>
</equals>
<equals>
<property>/it-fbw/law</property>
<value>DIRECT</value>
</equals>
</or>
</condition>
<property>/controls/flight/elevator</property>
</input>
<input>
<condition>
<equals>
<property>/it-fbw/law</property>
<value>BACKUP</value>
</equals>
</condition>
<value>0</value>
</input>
<output>/controls/flight/elevator-fbw</output>
<type>noise-spike</type>
<max-rate-of-change>10</max-rate-of-change>
</filter>
<pid-controller>
<name>AP PITCH HELPER PLUS</name>
<debug>false</debug>
<enable>
<condition>
<and>
<greater-than>
<property>/controls/flight/elevator-fbw</property>
<value>0.1</value>
</greater-than>
<equals>
<property>/it-autoflight/output/ap1</property>
<value>0</value>
</equals>
<equals>
<property>/it-autoflight/output/ap2</property>
<value>0</value>
</equals>
<or>
<equals>
<property>/it-fbw/law</property>
<value>NORMAL</value>
</equals>
<equals>
<property>/it-fbw/law</property>
<value>ALTERNATE</value>
</equals>
</or>
<greater-than-equals>
<property>/position/gear-agl-ft</property>
<value>50</value>
</greater-than-equals>
</and>
</condition>
</enable>
<input>
<value>0</value>
</input>
<reference>
<value>1</value>
</reference>
<output>
<property>/controls/flight/elevator-trim-cmd</property>
</output>
<config>
<Kp>0.08</Kp>
<beta>1.0</beta>
<alpha>0.1</alpha>
<gamma>0.0</gamma>
<Ti>10</Ti>
<Td>0.00001</Td>
<u_min>-1.00</u_min>
<u_max>1.00</u_max>
</config>
</pid-controller>
<pid-controller>
<name>FBW PITCH HELPER MINUS</name>
<debug>false</debug>
<enable>
<condition>
<and>
<less-than>
<property>/controls/flight/elevator-fbw</property>
<value>-0.1</value>
</less-than>
<equals>
<property>/it-autoflight/output/ap1</property>
<value>0</value>
</equals>
<equals>
<property>/it-autoflight/output/ap2</property>
<value>0</value>
</equals>
<or>
<equals>
<property>/it-fbw/law</property>
<value>NORMAL</value>
</equals>
<equals>
<property>/it-fbw/law</property>
<value>ALTERNATE</value>
</equals>
</or>
<greater-than-equals>
<property>/position/gear-agl-ft</property>
<value>50</value>
</greater-than-equals>
</and>
</condition>
</enable>
<input>
<value>0</value>
</input>
<reference>
<value>1</value>
</reference>
<output>
<property>/controls/flight/elevator-trim-cmd</property>
</output>
<config>
<Kp>-0.08</Kp>
<beta>1.0</beta>
<alpha>0.1</alpha>
<gamma>0.0</gamma>
<Ti>10</Ti>
<Td>0.00001</Td>
<u_min>-1.00</u_min>
<u_max>1.00</u_max>
</config>
</pid-controller>
<filter>
<name>IT-FBW: PITCH TRIM FILTER</name>
<debug>false</debug>
<feedback-if-disabled>true</feedback-if-disabled>
<initialize-to>output</initialize-to>
<enable>
<condition>
<and>
<channel name="FBW Aileron">
<fcs_function name="/it-fbw/roll-deg">
<function>
<ifthen>
<and>
<equals>
<eq>
<property>/it-autoflight/output/ap1</property>
<value>0</value>
</equals>
<equals>
</eq>
<eq>
<property>/it-autoflight/output/ap2</property>
<value>0</value>
</equals>
</eq>
<eq>
<property>/gear/gear[0]/wow</property>
<value>0</value>
</eq>
<or>
<equals>
<eq>
<property>/it-fbw/law</property>
<value>NORMAL</value>
</equals>
<equals>
<value>0</value>
</eq>
<eq>
<property>/it-fbw/law</property>
<value>ALTERNATE</value>
</equals>
<value>1</value>
</eq>
</or>
<greater-than-equals>
<property>/position/gear-agl-ft</property>
<value>50</value>
</greater-than-equals>
</and>
<or>
<greater-than>
<property>/controls/flight/elevator-fbw</property>
<value>0.05</value>
</greater-than>
<less-than>
<property>/controls/flight/elevator-fbw</property>
<value>-0.05</value>
</less-than>
</or>
</and>
</condition>
</enable>
<input>
<property>/controls/flight/elevator-trim-cmd</property>
</input>
<output>/controls/flight/elevator-trim</output>
<type>noise-spike</type>
<max-rate-of-change>0.01</max-rate-of-change>
</filter>
</PropertyList>
<sum>
<property>/it-fbw/roll-deg</property>
<table>
<independentVar lookup="row">/controls/flight/aileron</independentVar>
<tableData>
-1.0 -0.2
-0.7 -0.1
-0.5 -0.05
-0.3 -0.01
-0.15 -0.005
-0.05 -0.001
0.00 0.00
0.05 0.001
0.15 0.005
0.3 0.01
0.5 0.05
0.7 0.1
1.0 0.2
</tableData>
</table>
</sum>
<v>0</v>
</ifthen>
</function>
<clipto>
<min><property>/it-fbw/roll-lim-min</property></min>
<max><property>/it-fbw/roll-lim-max</property></max>
</clipto>
</fcs_function>
</channel>
<channel name="FBW Elevator">
<fcs_function name="/it-fbw/pitch-deg">
<function>
<ifthen>
<and>
<eq>
<property>/it-autoflight/output/ap1</property>
<value>0</value>
</eq>
<eq>
<property>/it-autoflight/output/ap2</property>
<value>0</value>
</eq>
<or>
<eq>
<property>/it-fbw/law</property>
<value>0</value>
</eq>
<eq>
<property>/it-fbw/law</property>
<value>1</value>
</eq>
</or>
</and>
<sum>
<property>/it-fbw/pitch-deg</property>
<table>
<independentVar lookup="row">/controls/flight/elevator</independentVar>
<tableData>
-1.0 0.1
-0.7 0.05
-0.5 0.02
-0.3 0.01
-0.15 0.005
-0.05 0.001
0.00 0.00
0.05 -0.001
0.15 -0.005
0.3 -0.01
0.5 -0.02
0.7 -0.05
1.0 -0.1
</tableData>
</table>
</sum>
<v>0</v>
</ifthen>
</function>
<clipto>
<min><property>/it-fbw/pitch-lim-min</property></min>
<max><property>/it-fbw/pitch-lim-max</property></max>
</clipto>
</fcs_function>
</channel>
</system>