Autopilot for F-15 #444
Replies: 38 comments 64 replies
-
Are you sure that altitude hold is enabled? Plot the auto-pilot modes to confirm and also the autopilot outputs in terms of the elevator and aileron control. |
Beta Was this translation helpful? Give feedback.
-
The F-15 autopilot and FCS was redone by @Octal450 (Josh) and are tightly integrated with the FCS and complicated Probably I'd start by confirming that you can control the surfaces and the aircraft. Also if this is just for fun you might find it easier to use the F-15 with a simpler autopilot such as in commit Zaretto/fg-aircraft@25137708 |
Beta Was this translation helpful? Give feedback.
-
Is the aircraft trimmed to a steady flight before enabling the autopilot ? If not, have you checked that the throttle is set so that the engine produce enough thrust to maintain a constant altitude ? |
Beta Was this translation helpful? Give feedback.
-
Fyi for vs to pitch I used a FlightGear autopilot file because it allows me much better resume behavior and is offset based not absolute value. Without it, he will maybe not do anything to pitch. I didn't quite understand what you are trying to do, but I wouldn't suggest any autopilot from the c172 to be used rather that you do it custom. Kind Regards, |
Beta Was this translation helpful? Give feedback.
-
@theorynice are you using the F-15 model that ships with JSBSim, or are you using @Zaretto's F-15 model? |
Beta Was this translation helpful? Give feedback.
-
@Octal450, could you please elaborate a bit on this ? I'm not sure I'm getting what you mean by "VS of 0" or "barometric 0 VS" ? |
Beta Was this translation helpful? Give feedback.
-
Hi, all |
Beta Was this translation helpful? Give feedback.
-
@ha-2022 take a look at @Octal450's IT-AutoFlight - https://github.com/Octal450/IT-AUTOFLIGHT, although it's not a pure JSBSim solution, it uses Nasal etc. it will give you some ideas in terms of developing an auto-pilot to handle multiple aircraft types etc. |
Beta Was this translation helpful? Give feedback.
-
@ha-2022 generally people answering discussion requests here aren't going to download and unzip your code and then perform a diff or manually inspect your code looking for the issue. Rather show the relevant changes in the discussion, or fork the JSBSim repo and provide a link to a commit showing your changes. Have you double-checked simple things like, is the engine actually running? |
Beta Was this translation helpful? Give feedback.
-
Oh ok. My first time posting for help so wasn't sure what to include. Thanks for the tips. dt = 0.01;
//Load initial conditions
fdmExec.GetIC()->SetAltitudeASLFtIC(20000);
fdmExec.GetIC()->SetGeodLatitudeRadIC(0.52);
fdmExec.GetIC()->SetLongitudeRadIC(-1.64);
fdmExec.GetIC()->SetUBodyFpsIC(1013); //=600 knots
fdmExec.GetIC()->SetPsiDegIC(90);
fdmExec.Setdt(dt);
//apply initial conditions
fdmExec.RunIC();
//Start engines and heading autopilot
fdmExec.GetPropulsion()->InitRunning(-1);
setPropValue(AP_HEADING_HOLD, 1);
while (true)
{
double heading = std::fmod(getCurrentHeadingRad() + TWO_PI, TWO_PI);
setApAltitudeSetpoint(20000);
setApGroundSpeedSetpoint(1013); //=600 knots
setApHeadingErrorRad(1.5708 - heading); //maintain heading at 90 degrees
fdmExec.Run();
sim_nsleep(dt*1e+9);
} Here's the autopilot. I just use the existing one from the KC135-E model. <?xml version="1.0"?>
<autopilot name="F-35B Autopilot">
<!-- INTERFACE PROPERTIES -->
<property>ap/attitude_hold</property>
<property>ap/yaw_damper</property>
<property>ap/active-waypoint</property>
<property>ap/altitude_setpoint</property>
<property>ap/heading_hold</property>
<property>ap/heading_setpoint</property>
<property>ap/heading-setpoint-select</property>
<property>ap/aileron_cmd</property>
<property>ap/elevator_cmd</property>
<property>ap/rudder_cmd</property>
<property>ap/groundspeed_setpoint</property>
<property>ap/airspeed_hold</property>
<property>ap/throttle-cmd-norm</property>
<property>ap/heading-error-rad</property>
<property>ap/use_expedited_turn</property>
<property value="0.104">ap/roll-rate-width</property>
<property value="0.41">ap/max_bank_angle_rad</property>
<property value="0.79">ap/expedited_bank_angle_rad</property>
<!-- Added these properties to get the model to load <4/27/22>-->
<property>/sim/model/pushback/position-norm</property>
<property>/gear/gear/wow</property>
<property>/sim/model/pushback/ki</property>
<property>/sim/model/pushback/kp</property>
<property>/sim/model/pushback/kd</property>
<property>fcs/throttle1</property>
<property>fcs/throttle2</property>
<property>fcs/throttle3</property>
<property>fcs/autothrottle-cmd-norm</property>
<property>ap/roll-pid-ki</property>
<property>ap/roll-pid-kp</property>
<property>ap/roll-pid-kd</property>
<property>guidance/wp-heading-deg</property>
<!-- =============================================================== -->
<!-- Altitude Hold -->
<!-- =============================================================== -->
<channel name="Altitude Hold">
<summer name="ap/alt-error">
<input> ap/altitude_setpoint </input>
<input> -position/h-sl-ft </input>
</summer>
<lag_filter name="ap/alt-error-lag">
<input> ap/alt-error </input>
<c1> 1 </c1>
</lag_filter>
<pid name="ap/target-climb-rate-fps">
<input> ap/alt-error-lag </input>
<kp> 0.1 </kp>
<clipto>
<min>-25</min>
<max>25</max>
</clipto>
</pid>
<summer name="ap/climb-rate-error">
<input> ap/target-climb-rate-fps </input>
<input> -velocities/h-dot-fps </input>
</summer>
<pid name="ap/elevator-pid">
<input> ap/climb-rate-error </input>
<kp> -0.01 </kp>
<ki> -0.001 </ki>
<kd> -0.002 </kd>
<clipto>
<min>-1</min>
<max>1</max>
</clipto>
<output>fcs/elevator-cmd-norm</output>
</pid>
</channel>
<!-- =============================================================== -->
<!-- Auto Throttle -->
<!-- =============================================================== -->
<channel name="Auto Throttle">
<summer name="ap/speed-error">
<input> ap/groundspeed_setpoint </input>
<input> -velocities/vg-fps </input>
</summer>
<pid name="ap/throttle-pid">
<input> ap/speed-error </input>
<kp> 0.2 </kp>
<ki> 0 </ki>
<kd> 0.1 </kd>
<clipto>
<min>-1</min>
<max>1</max>
</clipto>
<output>fcs/throttle-cmd-norm[0]</output>
<output>fcs/throttle-cmd-norm[1]</output>
<output>fcs/throttle-cmd-norm[2]</output>
<output>fcs/throttle-cmd-norm[3]</output>
</pid>
</channel>
<!-- =============================================================== -->
<!-- Wing Leveler -->
<!-- =============================================================== -->
<channel name="Wing leveler">
<switch name="ap/wing-leveler-on-off">
<default value="-1"/>
<test value="0">
ap/attitude_hold == 1
</test>
</switch>
<pid name="ap/roll-error-pid">
<input>attitude/phi-rad</input>
<kp> 75 </kp>
<ki> 6 </ki>
<kd> 18 </kd>
<trigger> ap/wing-leveler-on-off </trigger>
</pid>
<switch name="ap/roll-ap-autoswitch">
<default value="0"/>
<test value="-ap/roll-error-pid">
ap/attitude_hold == 1
</test>
<clipto>
<min>-1</min>
<max> 1</max>
</clipto>
</switch>
</channel>
<!-- =============================================================== -->
<!-- Heading Hold -->
<!-- =============================================================== -->
<channel name="Roll heading hold">
<switch name="ap/heading-hold-on-off">
<default value="-1"/>
<test value="0">
ap/heading_hold == 1
</test>
</switch>
<switch name="ap/turn_amount_rad">
<default value="ap/max_bank_angle_rad"/>
<test value="ap/expedited_bank_angle_rad">
ap/use_expedited_turn == 1
</test>
</switch>
<lag_filter name="ap/heading-roll-error-lag">
<input> ap/heading-error-rad </input>
<c1> 0.5 </c1>
<clipto>
<min>-ap/turn_amount_rad</min>
<max>ap/turn_amount_rad</max>
</clipto>
</lag_filter>
<summer name="ap/heading-roll-error">
<input> ap/heading-roll-error-lag </input>
<input> -attitude/phi-rad </input>
</summer>
<pid name="ap/target-roll-rate">
<input> ap/heading-roll-error</input>
<kp> 30 </kp>
<ki> 0.1 </ki>
<kd> 0.1 </kd>
<clipto>
<min>-0.052</min>
<max>0.052</max>
</clipto>
</pid>
<deadband name="ap/roll-rate-saturation">
<input>ap/target-roll-rate</input>
<width>ap/roll-rate-width</width>
</deadband>
<summer name="ap/roll-rate-error">
<input> ap/target-roll-rate </input>
<input> -velocities/p-aero-rad_sec </input>
</summer>
<pid name="ap/heading-pid-controller">
<input> ap/roll-rate-error </input>
<c1> 100.0 </c1>
<kp> 2.5 </kp>
<ki> 0 </ki>
<kd> 0 </kd>
<trigger>ap/heading-hold-on-off</trigger>
</pid>
<switch name="ap/roll-command-selector">
<default value="0.0"/>
<test value="ap/heading-pid-controller">
ap/heading_hold == 1
</test>
<test value="ap/roll-ap-autoswitch">
ap/attitude_hold == 1
</test>
<output>fcs/aileron-cmd-norm</output>
</switch>
</channel>
</autopilot> |
Beta Was this translation helpful? Give feedback.
-
@ha-2022 what about some plots showing things like altitude, speed, control positions, throttle command, attitude etc. versus time? You also reference a F-35 aircraft model, but the JSBSim repo doesn't a F-35. So it's impossible to check, without a reference to the model what it's FCS implementation is and how compatible it may or may not be with your auto-pilot. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the reply! Perhaps the F35-B model is not a good one to start with? It doesn't have to be that model, F16 or F22 would be an ok alternative. Though I've tried all those models they all dropped speed (rather quickly). Here's the F35-B model: <?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="http://jsbsim.sourceforge.net/JSBSim.xsl"?>
<fdm_config name="Lockheed Martin F-35B" version="2.0" release="TRIAL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd">
<fileheader>
<author> F-GTUX from Erik Hofman F-16 and aeromatic </author>
<filecreationdate> 2011-10-15 </filecreationdate>
<version> 1.0 </version>
<license>
<licenseName>GPL (General Public License)</licenseName>
<licenseURL>http://www.gnu.org/licenses/gpl.html</licenseURL>
</license>
<description> Models a F-35B. </description>
</fileheader>
<metrics>
<wingarea unit="FT2"> 459.67 </wingarea>
<wingspan unit="FT" > 35.11 </wingspan>
<wing_incidence> 2.00 </wing_incidence>
<chord unit="FT" > 13.09 </chord>
<htailarea unit="FT2"> 91.93 </htailarea>
<htailarm unit="FT" > 20.47 </htailarm>
<vtailarea unit="FT2"> 55.16 </vtailarea>
<vtailarm unit="FT" > 20.47 </vtailarm>
<location name="AERORP" unit="IN">
<x> 368.52 </x>
<y> 0.00 </y>
<z> 0.00 </z>
</location>
<location name="EYEPOINT" unit="IN">
<x> 122.84 </x>
<y> 0.00 </y>
<z> 36.00 </z>
</location>
<location name="VRP" unit="IN">
<x>0</x>
<y>0</y>
<z>20</z>
</location>
</metrics>
<mass_balance>
<ixx unit="SLUG*FT2"> 24918 </ixx>
<iyy unit="SLUG*FT2"> 89003 </iyy>
<izz unit="SLUG*FT2"> 82602 </izz>
<emptywt unit="LBS" > 32000 </emptywt>
<location name="CG" unit="IN">
<x> 368.52 </x>
<y> 0.00 </y>
<z> -15.36 </z>
</location>
</mass_balance>
<ground_reactions>
<contact type="BOGEY" name="NOSE">
<location unit="IN">
<x> 79.85 </x>
<y> 0.00 </y>
<z> -73.70 </z>
</location>
<static_friction> 0.80 </static_friction>
<dynamic_friction> 0.50 </dynamic_friction>
<rolling_friction> 0.02 </rolling_friction>
<spring_coeff unit="LBS/FT"> 10000.00 </spring_coeff>
<damping_coeff unit="LBS/FT/SEC"> 2000.00 </damping_coeff>
<max_steer unit="DEG"> 45.00 </max_steer>
<brake_group>NONE</brake_group>
<retractable>1</retractable>
</contact>
<contact type="BOGEY" name="LEFT_MAIN">
<location unit="IN">
<x> 383.26 </x>
<y> -77.92 </y>
<z> -73.70 </z>
</location>
<static_friction> 0.80 </static_friction>
<dynamic_friction> 0.50 </dynamic_friction>
<rolling_friction> 0.02 </rolling_friction>
<spring_coeff unit="LBS/FT"> 30000.00 </spring_coeff>
<damping_coeff unit="LBS/FT/SEC"> 6000.00 </damping_coeff>
<max_steer unit="DEG">0</max_steer>
<brake_group>LEFT</brake_group>
<retractable>1</retractable>
</contact>
<contact type="BOGEY" name="RIGHT_MAIN">
<location unit="IN">
<x> 383.26 </x>
<y> 77.92 </y>
<z> -73.70 </z>
</location>
<static_friction> 0.80 </static_friction>
<dynamic_friction> 0.50 </dynamic_friction>
<rolling_friction> 0.02 </rolling_friction>
<spring_coeff unit="LBS/FT"> 30000.00 </spring_coeff>
<damping_coeff unit="LBS/FT/SEC"> 6000.00 </damping_coeff>
<max_steer unit="DEG">0</max_steer>
<brake_group>RIGHT</brake_group>
<retractable>1</retractable>
</contact>
<contact type="STRUCTURE" name="LEFT_WING">
<location unit="IN">
<x> 368.52 </x>
<y> -17.55 </y>
<z> -15.36 </z>
</location>
<static_friction> 0.80 </static_friction>
<dynamic_friction> 0.50 </dynamic_friction>
<spring_coeff unit="LBS/FT"> 59535.00 </spring_coeff>
<damping_coeff unit="LBS/FT/SEC"> 11907.00 </damping_coeff>
</contact>
<contact type="STRUCTURE" name="RIGHT_WING">
<location unit="IN">
<x> 368.52 </x>
<y> 17.55 </y>
<z> -15.36 </z>
</location>
<static_friction> 0.80 </static_friction>
<dynamic_friction> 0.50 </dynamic_friction>
<spring_coeff unit="LBS/FT"> 59535.00 </spring_coeff>
<damping_coeff unit="LBS/FT/SEC"> 11907.00 </damping_coeff>
</contact>
</ground_reactions>
<propulsion>
<engine file="F135-PW-600">
<location unit="IN">
<x> 454.20 </x>
<y> 0.00 </y>
<z> -15.36 </z>
</location>
<orient unit="DEG">
<pitch> 0.00 </pitch>
<roll> 0.00 </roll>
<yaw> 0.00 </yaw>
</orient>
<feed>0</feed>
<feed>1</feed>
<feed>2</feed>
<feed>3</feed>
<thruster file="direct">
<location unit="IN">
<x> 454.20 </x>
<y> 0.00 </y>
<z> -15.36 </z>
</location>
<orient unit="DEG">
<pitch> 0.00 </pitch>
<roll> 0.00 </roll>
<yaw> 0.00 </yaw>
</orient>
</thruster>
</engine>
<engine file="liftfan">
<location unit="IN">
<x> 164.20 </x>
<y> 0.00 </y>
<z> -15.36 </z>
</location>
<orient unit="DEG">
<pitch> 90.00 </pitch>
<roll> 0.00 </roll>
<yaw> 0.00 </yaw>
</orient>
<feed>0</feed>
<feed>1</feed>
<feed>2</feed>
<feed>3</feed>
<thruster file="direct">
<location unit="IN">
<x> 164.20 </x>
<y> 0.00 </y>
<z> -15.36 </z>
</location>
<orient unit="DEG">
<pitch> 90.00 </pitch>
<roll> 0.00 </roll>
<yaw> 0.00 </yaw>
</orient>
</thruster>
</engine>
<engine file="sidefan">
<location unit="IN">
<x> 368.52 </x>
<y> 80.00 </y>
<z> -15.36 </z>
</location>
<orient unit="DEG">
<pitch> 90.00 </pitch>
<roll> 0.00 </roll>
<yaw> 0.00 </yaw>
</orient>
<feed>0</feed>
<feed>1</feed>
<feed>2</feed>
<feed>3</feed>
<thruster file="direct">
<location unit="IN">
<x> 368.52 </x>
<y> 80.00 </y>
<z> -15.36 </z>
</location>
<orient unit="DEG">
<pitch> 90.00 </pitch>
<roll> 0.00 </roll>
<yaw> 0.00 </yaw>
</orient>
</thruster>
</engine>
<engine file="sidefan">
<location unit="IN">
<x> 368.52 </x>
<y> -80.00 </y>
<z> -15.36 </z>
</location>
<orient unit="DEG">
<pitch> 90.00 </pitch>
<roll> 0.00 </roll>
<yaw> 0.00 </yaw>
</orient>
<feed>0</feed>
<feed>1</feed>
<feed>2</feed>
<feed>3</feed>
<thruster file="direct">
<location unit="IN">
<x> 368.52 </x>
<y> -80.00 </y>
<z> -15.36 </z>
</location>
<orient unit="DEG">
<pitch> 90.00 </pitch>
<roll> 0.00 </roll>
<yaw> 0.00 </yaw>
</orient>
</thruster>
</engine>
<tank type="FUEL"> <!-- Tank number 0 -->
<location unit="IN">
<x> 368.52 </x>
<y> 40.00 </y>
<z> -15.36 </z>
</location>
<capacity unit="LBS"> 6650 </capacity>
<contents unit="LBS"> 6650 </contents>
</tank>
<tank type="FUEL"> <!-- Tank number 1 -->
<location unit="IN">
<x> 368.52 </x>
<y> -40.00 </y>
<z> -15.36 </z>
</location>
<capacity unit="LBS"> 6650 </capacity>
<contents unit="LBS"> 6650 </contents>
</tank>
<tank type="FUEL"> <!-- External Tank number 0 (station 4) -->
<location unit="IN">
<x> 368.52 </x>
<y> 80.00 </y>
<z> -15.36 </z>
</location>
<capacity unit="LBS"> 2991 </capacity>
<contents unit="LBS"> 0 </contents>
</tank>
<tank type="FUEL"> <!-- External Tank number 1 (station 6) -->
<location unit="IN">
<x> 368.52 </x>
<y> -80.00 </y>
<z> -15.36 </z>
</location>
<capacity unit="LBS"> 2991 </capacity>
<contents unit="LBS"> 0 </contents>
</tank>
</propulsion>
<flight_control name="F-35B">
<!-- Declare some interface properties -->
<property>fcs/alpha-norm</property>
<property>fcs/canopy-engage</property>
<property>fcs/fbw-override</property>
<channel name="Flaps">
<fcs_function name="tef pos rad">
<function>
<description>none</description>
<sum>
<product>
<value>1</value>
<table>
<independentVar lookup="row">velocities/vc-kts</independentVar>
<tableData>
0 0.349
150 0.349
200 0
</tableData>
</table>
</product>
<product>
<value>1</value>
<table>
<independentVar lookup="row">velocities/mach</independentVar>
<tableData>
0 0
0.85 0
0.95 -0.0349
</tableData>
</table>
</product>
</sum>
</function>
</fcs_function>
<aerosurface_scale name="flap pos norm">
<input>fcs/tef-pos-rad</input>
<domain>
<min>-0.0349</min>
<max>0.349</max>
</domain>
<range>
<min>-0.1</min>
<max>1</max>
</range>
<output>fcs/flap-pos-norm</output>
</aerosurface_scale>
</channel>
<channel name="Roll">
<!-- Calculate the normalized roll-rate -->
<pure_gain name="roll rate norm">
<input>velocities/p-aero-rad_sec</input>
<gain>0.09</gain>
</pure_gain>
<!--
- Calculate the difference between actual roll-rate and
- commanded roll-rate.
-->
<summer name="roll trim error">
<input>fcs/aileron-cmd-norm</input>
<input>-fcs/roll-rate-norm</input>
<input>fcs/roll-trim-cmd-norm</input>
<clipto>
<min> -1 </min>
<max> 1 </max>
</clipto>
</summer>
<pure_gain name="roll p">
<input>fcs/roll-trim-error</input>
<gain>3.00</gain>
</pure_gain>
<!--
- Make sure the integrator is only active when the aircraft
- has gained some speed. This will prevent bad behaviour when the
- aircraft has been parked for a while.
-->
<switch name="aileron trigger">
<default value="1"/>
<test value="0">
velocities/vc-kts lt 5.0
</test>
</switch>
<integrator name="roll i">
<input>fcs/roll-trim-error</input>
<trigger>fcs/aileron-trigger</trigger>
<c1>0.0005</c1>
</integrator>
<lead_lag_filter name="roll d">
<input>fcs/roll-trim-error</input>
<c1>0.00125</c1>
<c2>0.0</c2>
<c3>0.000125</c3>
<c4>1</c4>
</lead_lag_filter>
<summer name="roll command">
<input>fcs/roll-p</input>
<input>fcs/roll-i</input>
<input>fcs/roll-d</input>
<clipto>
<min>-1</min>
<max>1</max>
</clipto>
</summer>
<kinematic name="roll trim sum">
<input>fcs/roll-command</input>
<traverse>
<setting>
<position>-1</position>
<time>0.35</time>
</setting>
<setting>
<position>1</position>
<time>0.35</time>
</setting>
</traverse>
<output>fcs/roll-trim-sum</output>
</kinematic>
<aerosurface_scale name="left-aileron-pos-rad">
<input>fcs/roll-trim-sum</input>
<range>
<min> -0.40 </min>
<max> 0.40 </max>
</range>
<output>fcs/left-aileron-pos-rad</output>
</aerosurface_scale>
<aerosurface_scale name="Aileron Pos Norm">
<input>fcs/left-aileron-pos-rad</input>
<domain>
<min>-0.40</min>
<max>0.40</max>
</domain>
<range>
<min>-1</min>
<max>1</max>
</range>
<output>fcs/aileron-pos-norm</output>
</aerosurface_scale>
</channel>
<channel name="Pitch">
<!--
- The F-16 has a G limit of 9G positive and 4G negative (44.44%
- of 9G). This section limits the stick output to 100% up and 44%
- down.
-->
<summer name="elevator-cmd-limiter">
<input>fcs/elevator-cmd-norm</input>
<input>fcs/pitch-trim-cmd-norm</input>
<clipto>
<min>-1</min>
<max>0.44</max>
</clipto>
</summer>
<fcs_function name="fcs/g-load-norm">
<function>
<description>none</description>
<product>
<value>1</value>
<table>
<independentVar lookup="row">accelerations/n-pilot-z-norm</independentVar>
<tableData>
-12 0.8
-4 0
0 0
2.33 0
7 -0.8
</tableData>
</table>
</product>
</function>
</fcs_function>
<fcs_function name="fcs/alpha-limiter">
<function>
<description>none</description>
<product>
<property>aero/alpha-rad</property>
<value>1.0472</value>
<table>
<independentVar lookup="row">fcs/fbw-override</independentVar>
<tableData>
0 1
1 0
</tableData>
</table>
</product>
</function>
</fcs_function>
<summer name="g load error">
<input>fcs/elevator-cmd-limiter</input>
<input>fcs/g-load-norm</input>
<input>fcs/alpha-limiter</input>
</summer>
<pure_gain name="g load p">
<input>fcs/g-load-error</input>
<gain>0.66</gain>
</pure_gain>
<!--
- Make sure the integrator is only active when the aircraft
- has gained some speed. This will prevent bad behaviour when the
- aircraft has been parked for a while.
-->
<switch name="elevator trigger">
<default value="1"/>
<test value="0">
velocities/vc-kts lt 5.0
</test>
</switch>
<integrator name="g load i">
<input>fcs/g-load-error</input>
<trigger>fcs/elevator-trigger</trigger>
<c1>0.005</c1>
</integrator>
<lead_lag_filter name="g load d">
<input>fcs/g-load-error</input>
<c1>0.000125</c1>
<c2>0.0</c2>
<c3>0.0000125</c3>
<c4>1</c4>
</lead_lag_filter>
<summer name="g load command">
<input>fcs/g-load-p</input>
<input>fcs/g-load-i</input>
<input>fcs/g-load-d</input>
<clipto>
<min>-1</min>
<max>1</max>
</clipto>
</summer>
<kinematic name="elevator position">
<input>fcs/g-load-command</input>
<traverse>
<setting>
<position>-1</position>
<time>0.35</time>
</setting>
<setting>
<position>1</position>
<time>0.35</time>
</setting>
</traverse>
<output>fcs/elevator-pos-norm</output>
</kinematic>
<aerosurface_scale name="elevator-pos-rad">
<input>fcs/elevator-pos-norm</input>
<range>
<min>-0.79</min>
<max>0.79</max>
</range>
<output>fcs/elevator-pos-rad</output>
</aerosurface_scale>
</channel>
<channel name="Yaw">
<!-- Calculate the normalized yaw-rate -->
<pure_gain name="yaw rate norm">
<input>velocities/r-aero-rad_sec</input>
<gain>100</gain>
</pure_gain>
<!-- Calculate the normalized yaw-load -->
<pure_gain name="yaw load norm">
<input>accelerations/n-pilot-y-norm</input>
<gain>0.25</gain>
</pure_gain>
<!--
- Calculate the difference between the current yaw-rate
- and the one requiested for.
-->
<summer name="yaw trim error">
<input>fcs/rudder-cmd-norm</input>
<input>fcs/yaw-rate-norm</input>
<input>fcs/yaw-load-norm</input>
</summer>
<!--
- Make sure the PID controller is only active when the aircraft
- has gained some speed. This will prevent bad behaviour when the
- aircraft has been parked for a while.
-->
<switch name="rudder pid trigger">
<default value="1"/>
<test value="0">
velocities/vc-kts lt 10.0
</test>
</switch>
<pid name="yaw load pid">
<trigger>fcs/rudder-pid-trigger</trigger>
<input>fcs/yaw-trim-error</input>
<kp> 0.105500 </kp>
<ki> 0.000010 </ki>
<kd> 0.00005 </kd>
<clipto>
<min>-1</min>
<max>1</max>
</clipto>
<output>fcs/yaw-load-pid</output>
</pid>
<summer name="yaw scheduler">
<input>fcs/rudder-cmd-norm</input>
<input>fcs/yaw-trim-cmd-norm</input>
<input>fcs/yaw-load-pid</input>
<clipto>
<min>-1</min>
<max>1</max>
</clipto>
</summer>
<kinematic name="rudder position">
<input>fcs/yaw-scheduler</input>
<traverse>
<setting>
<position>-1</position>
<time>0.35</time>
</setting>
<setting>
<position>1</position>
<time>0.35</time>
</setting>
</traverse>
<output>fcs/rudder-position</output>
</kinematic>
<lag_filter name="rudder pos norm">
<input>-fcs/rudder-position</input>
<c1>10</c1>
<clipto>
<min>-1</min>
<max>1</max>
</clipto>
<output>fcs/rudder-pos-norm</output>
</lag_filter>
<aerosurface_scale name="Rudder Control">
<input>-fcs/rudder-pos-norm</input>
<range>
<min>-0.524</min>
<max>0.524</max>
</range>
<output>fcs/rudder-pos-rad</output>
</aerosurface_scale>
<lag_filter name="rudder-cmd-norm-filtered">
<input>fcs/rudder-cmd-norm</input>
<c1>2</c1>
<clipto>
<min>-1</min>
<max>1</max>
</clipto>
<output>fcs/rudder-cmd-norm-filtered</output>
</lag_filter>
</channel>
<channel name="Leading Edge Flap">
<switch name="lef pos rad">
<default value="0.0"/>
<test logic="AND" value="-0.0349">
fcs/gear-wow eq 1
gear/gear-pos-norm gt 0
</test>
<test logic="AND" value="0.436">
gear/gear-pos-norm eq 0
aero/alpha-rad gt 0.2618
</test>
<test logic="AND" value="0.262">
fcs/gear-wow eq 0
aero/alpha-rad gt 0.0873
</test>
<test logic="AND" value="-0.0349">
velocities/mach gt 0.9
</test>
</switch>
<pure_gain name="slat pos norm">
<input>fcs/lef-pos-rad</input>
<gain>2.293578</gain>
</pure_gain>
<kinematic name="lef control">
<input>fcs/slat-pos-norm</input>
<traverse>
<setting>
<position>-1.0</position>
<time>3.0</time>
</setting>
<setting>
<position>1.0</position>
<time>3.0</time>
</setting>
</traverse>
</kinematic>
<aerosurface_scale name="lef pos deg">
<input>fcs/lef-control</input>
<domain>
<min>-1.0</min>
<max>1.0</max>
</domain>
<range>
<min>-25</min>
<max>25</max>
</range>
</aerosurface_scale>
</channel>
<channel name="Throttle">
<pure_gain name="throttle-pos-norm">
<input>fcs/throttle-cmd-norm</input>
<gain>1</gain>
<output>fcs/throttle-pos-norm</output>
</pure_gain>
<pure_gain name="throttle-pos-norm[1]">
<input>fcs/throttle1</input>
<gain>1</gain>
<output>fcs/throttle-pos-norm[1]</output>
</pure_gain>
<pure_gain name="throttle-pos-norm[2]">
<input>fcs/throttle2</input>
<gain>1</gain>
<output>fcs/throttle-pos-norm[2]</output>
</pure_gain>
<pure_gain name="throttle-pos-norm[3]">
<input>fcs/throttle3</input>
<gain>1</gain>
<output>fcs/throttle-pos-norm[3]</output>
</pure_gain>
</channel>
<channel name="Speedbrake">
<!--
- To prevent deep stall the Flight Computer commands speedbrake
- deflection at high angle of attack (alpha) and low speeds. This
- will provide just enough pitch down moment to keep the aircraft
- under control.
-->
<switch name="speedbrake alpha limiter">
<default value="0"/>
<test logic="AND" value="1">
aero/alpha-deg ge 53
velocities/v-fps le 18
fcs/fbw-override == 0
</test>
</switch>
<switch name="speedbrake initiate">
<default value="0"/>
<test logic="OR" value="1">
fcs/speedbrake-alpha-limiter eq 1
fcs/speedbrake-cmd-norm eq 1
</test>
</switch>
<!--
- Speedbrake deflection is limited to 43 degrees (instead of 60
- degrees) when the gear is extended to prevent physical
- speedbrake damage on touchdown.
-->
<scheduled_gain name="speedbrake scheduler">
<input>fcs/speedbrake-initiate</input>
<table>
<independentVar>gear/gear-cmd-norm</independentVar>
<tableData>
0 1.0
1 0.71667
</tableData>
</table>
<output>fcs/steer-pos-deg</output>
</scheduled_gain>
<kinematic name="Speedbrake Control">
<input>fcs/speedbrake-scheduler</input>
<traverse>
<setting>
<position>0</position>
<time>0</time>
</setting>
<setting>
<position>60</position>
<time>1</time>
</setting>
</traverse>
<output>fcs/speedbrake-pos-deg</output>
</kinematic>
<aerosurface_scale name="Speedbrake Pos Norm">
<input>fcs/speedbrake-control</input>
<domain>
<min>0</min>
<max>60</max>
</domain>
<range>
<min>0</min>
<max>1</max>
</range>
<output>fcs/speedbrake-pos-norm</output>
</aerosurface_scale>
</channel>
<channel name="Canopy">
<kinematic name="Canopy Control">
<input>fcs/canopy-engage</input>
<traverse>
<setting>
<position>0</position>
<time>0</time>
</setting>
<setting>
<position>1</position>
<time>10</time>
</setting>
</traverse>
<output>fcs/canopy-pos-norm</output>
</kinematic>
</channel>
<channel name="Landing Gear">
<switch name="gear-wow">
<default value="0"/>
<test logic="AND" value="1">
gear/unit[1]/WOW eq 1
gear/unit[2]/WOW eq 1
</test>
</switch>
<kinematic name="Gear Control">
<input>gear/gear-cmd-norm</input>
<traverse>
<setting>
<position>0</position>
<time>0</time>
</setting>
<setting>
<position>1</position>
<time>5</time>
</setting>
</traverse>
<output>gear/gear-pos-norm</output>
</kinematic>
<scheduled_gain name="Scheduled Steer Pos Deg">
<input>fcs/steer-cmd-norm</input>
<table>
<independentVar>velocities/vg-fps</independentVar>
<tableData>
10.0 80.0
50.0 15.0
150.0 2.0
</tableData>
</table>
<output>fcs/steer-pos-deg</output>
</scheduled_gain>
</channel>
</flight_control>
<aerodynamics>
<axis name="LIFT">
<function name="aero/coefficient/CLalpha">
<description>Lift_due_to_alpha</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<table>
<independentVar lookup="row">aero/alpha-rad</independentVar>
<tableData>
-3.14 -0.300
-2.60 -0.800
-2.08 -0.800
-1.57 0.000
-1.00 -2.000
-0.20 -1.280
0.00 0.078
0.09 0.581
0.17 1.013
0.26 1.279
0.52 1.800
0.61 1.800
1.00 1.400
1.20 0.200
1.57 0.000
2.08 0.800
2.60 0.800
3.14 -0.300
</tableData>
</table>
</product>
</function>
<function name="aero/coefficient/dCLflap">
<description>Delta_Lift_due_to_flaps</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>fcs/tef-pos-rad</property>
<value> 0.66 </value>
</product>
</function>
<function name="aero/coefficient/dCLsb">
<description>Delta_Lift_due_to_speedbrake</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>fcs/speedbrake-pos-norm</property>
<value>0</value>
</product>
</function>
<function name="aero/coefficient/CLde">
<description>Lift_due_to_Elevator_Deflection</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>fcs/elevator-pos-rad</property>
<value>0.2</value>
</product>
</function>
</axis>
<axis name="DRAG">
<function name="aero/coefficient/CD0">
<description>Drag_at_zero_lift</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<table>
<independentVar lookup="row">aero/alpha-rad</independentVar>
<tableData>
-3.14 0.300
-1.57 1.500
-0.26 0.240
-0.1750 0.1560
-0.0870 0.0410
0.0000 0.0210
0.0870 0.0400
0.1750 0.0960
0.2620 0.1820
0.3490 0.3470
0.4360 0.5770
0.5240 0.8260
0.6110 1.0840
0.6980 1.3260
0.7850 1.4780
1.57 1.500
3.14 0.300
</tableData>
</table>
</product>
</function>
<function name="aero/coefficient/CDi">
<description>Induced_drag</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>aero/cl-squared</property>
<value>0.12</value>
</product>
</function>
<function name="aero/coefficient/CDmach">
<description>Drag_due_to_mach</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<table>
<independentVar lookup="row">velocities/mach</independentVar>
<tableData>
0.00 0.000
0.81 0.000
1.10 0.023
1.80 0.015
</tableData>
</table>
</product>
</function>
<function name="aero/coefficient/CDflap">
<description>Drag_due_to_flaps</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>fcs/tef-pos-rad</property>
<value> 0.15219 </value>
</product>
</function>
<function name="aero/coefficient/CDgear">
<description>Drag_due_to_gear</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>gear/gear-pos-norm</property>
<value>0.02</value>
</product>
</function>
<function name="aero/coefficient/CDsb">
<description>Drag_due_to_speedbrakes</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>fcs/speedbrake-pos-norm</property>
<value>0.021</value>
</product>
</function>
<function name="aero/coefficient/CDft">
<description>Drag_due_to_fan_trap</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<table>
<independentVar lookup="row">fcs/mixture-pos-norm</independentVar>
<tableData>
0 1
1 0
</tableData>
</table>
<value>0.031</value>
</product>
</function>
<function name="aero/coefficient/CDbeta">
<description>Drag_due_to_sideslip</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<table>
<independentVar lookup="row">aero/beta-rad</independentVar>
<tableData>
-1.57 1.230
-0.26 0.050
0.00 0.000
0.26 0.050
1.57 1.230
</tableData>
</table>
</product>
</function>
<function name="aero/coefficient/CDde">
<description>Drag_due_to_Elevator_Deflection</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<abs><property>fcs/elevator-pos-norm</property></abs>
<value>0.04</value>
</product>
</function>
</axis>
<axis name="SIDE">
<function name="aero/coefficient/CYb">
<description>Side_force_due_to_beta</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>aero/beta-rad</property>
<value>-1</value>
</product>
</function>
</axis>
<axis name="ROLL">
<function name="aero/coefficient/Clb">
<description>Roll_moment_due_to_beta</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/bw-ft</property>
<property>aero/beta-rad</property>
<value>-0.01</value>
</product>
</function>
<function name="aero/coefficient/Clp">
<description>Roll_moment_due_to_roll_rate</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/bw-ft</property>
<property>aero/bi2vel</property>
<property>velocities/p-aero-rad_sec</property>
<value>-0.4</value>
</product>
</function>
<function name="aero/coefficient/Clr">
<description>Roll_moment_due_to_yaw_rate</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/bw-ft</property>
<property>aero/bi2vel</property>
<property>velocities/r-aero-rad_sec</property>
<value>0.15</value>
</product>
</function>
<function name="aero/coefficient/Clda">
<description>Roll_moment_due_to_aileron</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/bw-ft</property>
<property>fcs/left-aileron-pos-rad</property>
<value>1.5</value> <!-- to match real datas -->
<table>
<independentVar lookup="row">velocities/mach</independentVar>
<tableData>
0.0 0.110
1.0 0.067
</tableData>
</table>
</product>
</function>
<function name="aero/coefficient/Cldr">
<description>Roll_moment_due_to_rudder</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/bw-ft</property>
<property>fcs/rudder-pos-rad</property>
<value>0.01</value>
</product>
</function>
</axis>
<axis name="PITCH">
<function name="aero/coefficient/Cmalpha">
<description>Pitch_moment_due_to_alpha</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/cbarw-ft</property>
<property>aero/alpha-rad</property>
<value>-0.3</value>
</product>
</function>
<function name="aero/coefficient/Cmde">
<description>Pitch_moment_due_to_elevator</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/cbarw-ft</property>
<property>fcs/elevator-pos-rad</property>
<table>
<independentVar lookup="row">velocities/mach</independentVar>
<tableData>
0.0 -0.800
2.0 -0.200
</tableData>
</table>
</product>
</function>
<function name="aero/coefficient/Cmq">
<description>Pitch_moment_due_to_pitch_rate</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/cbarw-ft</property>
<property>aero/ci2vel</property>
<property>velocities/q-aero-rad_sec</property>
<value>-18</value>
</product>
</function>
<function name="aero/coefficient/Cmadot">
<description>Pitch_moment_due_to_alpha_rate</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/cbarw-ft</property>
<property>aero/ci2vel</property>
<property>aero/alphadot-rad_sec</property>
<value>-9</value>
</product>
</function>
</axis>
<axis name="YAW">
<function name="aero/coefficient/Cnb">
<description>Yaw_moment_due_to_beta</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/bw-ft</property>
<property>aero/beta-rad</property>
<value>0.12</value>
</product>
</function>
<function name="aero/coefficient/Cnr">
<description>Yaw_moment_due_to_yaw_rate</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/bw-ft</property>
<property>aero/bi2vel</property>
<property>velocities/r-aero-rad_sec</property>
<value>-0.15</value>
</product>
</function>
<function name="aero/coefficient/Cndr">
<description>Yaw_moment_due_to_rudder</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/bw-ft</property>
<property>fcs/rudder-pos-rad</property>
<value>-0.1</value>
</product>
</function>
<function name="aero/coefficient/Cnda">
<description>Adverse_yaw</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/bw-ft</property>
<property>fcs/left-aileron-pos-rad</property>
<value>0</value>
</product>
</function>
</axis>
</aerodynamics>
<system file="pushback"/>
<external_reactions>
<force name="pushback" frame="BODY">
<location unit="IN">
<x> -2.98081 </x>
<y> 0.0 </y>
<z> -1.9683 </z>
</location>
<direction>
<x>1</x>
<y>0</y>
<z>0</z>
</direction>
</force>
</external_reactions>
<autopilot file="autopilot"/>
</fdm_config> |
Beta Was this translation helpful? Give feedback.
-
Hmm, so it maintains roughly 500kt for round about 50min. Have you tried to investigate what happens around the 50min mark? Maybe it ran out of fuel? Plot things like thrust, drag, alpha etc. and see what happens to them around the 50min mark. |
Beta Was this translation helpful? Give feedback.
-
Ok I will see how to go about grabbing those values but another problem was I asked it to fly at 600 knots but it never could reach and maintain that speed. What settings in the autopilot should I change to get it to the speed I specified? Thank you! |
Beta Was this translation helpful? Give feedback.
-
Well physics comes into play, the amount of thrust available at that altitude and the amount of drag. The autopilot can't overcome the physics. So you'll need to confirm how much thrust is available, is the autopilot making use of all of the thrust, what is the weight, drag etc.? |
Beta Was this translation helpful? Give feedback.
-
@dpculp I changed to hold air speed like you suggested but didn't see the difference. I changed the altitude to 15000 feet and the airplane is flying a little faster. Air speed is 100 knots slower than ground speed. Is that normal? @seanmcleod it's for a realistic flight simulation for collection platforms. Unfortunately I only have a short period of time to investigate this before moving on to a different approach (that doesn't involve me trying to learn all these flying business in a few days). Here's the the result flying at 1500 feet: <style> </style>
|
Beta Was this translation helpful? Give feedback.
-
This is where some basic aerodynamics/flight dynamics knowledge would be useful 😉 i.e. to understand the difference between IAS, TAS and ground speed. So it looks like your throttle is maxed out. And the alpha value looks reasonable, i.e. you haven't ended up with say 10 degrees of alpha resulting in some massive induced drag. So you need to confirm the thrust output and see whether it makes sense given the engine specs, i.e. that there isn't some error where the thrust for full throttle hasn't been limited to less than what it should be. If it isn't then double-check the drag, e.g. checking gear position which I think you did earlier, maybe the flaps are extended etc. If you've removed the lateral auto-pilot why the big fluctuations in roll angle? Actually your roll column is confusing, is this the roll angle as suggested by the first line in the column, or roll rate (degs per sec) as implied by the 2nd line?
Collection platforms? If we know the intended use we could also potentially give advice on other options. |
Beta Was this translation helpful? Give feedback.
-
Confirmed at 400 KTAS it's not at full throttle. <style> </style>
Full throttle at this speed <style> </style>
Does this mean it's not using the maximum thrust? Full engine file:
|
Beta Was this translation helpful? Give feedback.
-
You didn't read enough 😉 The are two air speeds, IAS (Indicated Air Speed) and TAS (True Air Speed), the statement relating ground speed to air speed in terms of the wind applies to TAS.
Yep, exactly the reason I was asking @ha-2022 for more details on his actual project requirements, since we could then potentially make suggestions like this to make things easier, and a lot more quickly/earlier in the thread as well. |
Beta Was this translation helpful? Give feedback.
-
We are providing a simulation environment that depends upon realistic speed, motion and maneuverability of the platform (i.e., aircraft model). Our targeted software is now being applied to different platforms, so to ensure correct operation of our software, @dpculp If using afterburner vs. changing "milthrust" will give me the same result as how the F-35B would fly then that works too. I believe max speed for F35-B is ~1040 kts. I guess we don't really need the complicated details of the aircraft model, just the motion, so hopefully I don't need the afterburner? But if I need the afterburner to properly simulate the motion of the F-35B then I would be forever grateful if you could step me through it. Thank you all so much for your help so far! |
Beta Was this translation helpful? Give feedback.
-
Definitely won't. A username of @ha-2022 didn't give me any clues, sorry about the assumption.
But that will be with the afterburner engaged, and as you can see from the engine file there is a massive difference in thrust with the afterburner engaged. I think as @dpculp suggested the easiest is to simply bump up the "milthrust" to very close to the "augthrust" value of 43000, that way your speed control PID loop will be able to access the full thrust range without having to worry about switching into/out of afterburner etc. Which will allow you to get closer to the 1040 kts max, although you'll need to understand whether that's IAS or TAS etc. and also remember that it doesn't mean that you can achieve that speed across the full altitude range from sea-level to max altitude etc.
Not sure how realistic "realistic as possible" really needs to be ;-) In other words whether you need a full flight simulation engine like JSBSim or whether you can make use of a fairly simple trajectory calculation approach. I mention this because one of the projects I worked on a while ago was a GCI (Ground Control Intercept) Radar simulator for training GCI radar operators. Where we needed to generate 'plausible/realistic' trajectories for various aircraft to show up on the radar display, e.g. These trajectories could be scripted by issuing auto-pilot commands, e.g. change speed to X, change heading to Y, climb/descend to altitude Z etc. at particular times into the lesson. Time:0:10 AP:R1 Alt:9100 Speed:0.85
Time:2:00 AP:R1 Hdg:190 Plus the instructors could manually issue auto-pilot commands manually at any stage. Where on a per-aircraft type the rates for turning could be selected from 'Standard', 'Tight', 'Max' which were then mapped to a particular g to be used, so fighter type A might have g values of 2, 4, 6 for the 3 options and an airliner type would have say 1.2, 1.3, 1.5. similar concept for climb/descent performance. The trajectory calculations were then coded up in a couple of hundred lines of python code, taking into account a standard atmosphere so that instructors could specify IAS, Mach at specific altitudes and those would be converted to TAS to then be used in the arc calculations based on the g specified etc. to generate realistic trajectories. So for this specific GCI Radar Sim project a full-blown JSBSim instance to model each aircraft would've been overkill. |
Beta Was this translation helpful? Give feedback.
-
Autothrottle and afterburner don't play nice together because there is a discontinuity in the thrust curve when the afterburner is activated. If you happen to pick a speed target that requires the throttle to be near the afterburner activation position, then you'll get poor results. This is a real effect, not just a modeling problem. In fact, it's possible (I haven't tested it) that the model will fail to initialize at the selected speed because the discontinuity in the thrust curve will overwhelm the trim algorithm. Relevant story from the old days (because I'm old): When air-refueling a heavy loaded fighter, for example an F-4, as the fighter gains weight it may eventually get to a weight that requires some afterburner. The thrust discontinuity makes it very difficult to maintain position behind the tanker. The common solution is to pull one throttle back a bit and push the other throttle above the afterburner detent so that it can stay above the detent. This solves the discontinuity problem. Back to 2022, I recommend bypassing the afterburner in your model and just increase the "milthrust" value to give you the thrust you need. -- Dave |
Beta Was this translation helpful? Give feedback.
-
Although you've now got a yaw moment to deal with 😉 |
Beta Was this translation helpful? Give feedback.
-
I followed your suggestion and up the "milthrust" to
But when I changed the speed to 650 kts weird things start to happen. Notice the speed is slower. <style> </style>
So I up the "milthrust" to
|
Beta Was this translation helpful? Give feedback.
-
I'd second that, often I see users wanting to use something like the F-22, F-16 etc. without realizing the extra complication there is in terms of an existing FBW based FCS, which may complicate things when they want to control the aircraft, e.g. to follow a trajectory etc. For example in the F-35 example above it looks like someone has cut out a portion of the F-16's g-command FBW law and inserted it. So how sure are you of the interaction of the auto-pilot you're busy trying to implement with the existing FBW FCS? For example are some of the AoA perturbations coming from the g-command law? For something that is fairly simple and has the sort of rough performance you're looking for, although you may still want to remove the afterburner complication, is the existing F-15 model in the JSBSim repo since it doesn't come with an existing FBW FCS. |
Beta Was this translation helpful? Give feedback.
-
Hİ @theorynice, I know it's been a long time since the last comment, but I'll try my luck anyway. I'm trying to fly at constant altitude with the f15 autopilot you shared, but something is going wrong. Can you share an example script? |
Beta Was this translation helpful? Give feedback.
-
@theorynice Regards |
Beta Was this translation helpful? Give feedback.
-
Hello everyone, I am newbie trying to understand how jsbsim autopilot system works. I have successfully flied the C310 plane with the script available in the JSBSim, I am trying to do the same with f15 and same script. When I try to fly the plane to the points I describe the plane doesn't follow the coordinates of any point. I've used the f15 files shared here, and here is my script that works with c310 but not with f15: <?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" ?>
<runscript name="C310-01A takeoff run">
<use aircraft="f15" initialize="../../test/init"/>
<run start="0.0" end="1800" dt="0.01">
<event name="Start engine">
<condition>simulation/sim-time-sec ge 0.25</condition>
<set name="fcs/mixture-cmd-norm[0]" value="1"/>
<set name="fcs/mixture-cmd-norm[1]" value="1"/>
<set name="fcs/advance-cmd-norm[0]" value="1.0"/>
<set name="fcs/advance-cmd-norm[1]" value="1.0"/>
<set name="fcs/throttle-cmd-norm[0]" value="1.0"/>
<set name="fcs/throttle-cmd-norm[1]" value="1.0"/>
<set name="propulsion/starter_cmd" value="1"/>
<set name="ap/attitude_hold" value="0"/>
<set name="guidance/target_wp_latitude_rad" value="0.7153061271745532"/>
<set name="guidance/target_wp_longitude_rad" value="0.5027776995410569"/>
<set name="ap/heading_setpoint" value="0"/>
<set name="ap/heading_hold" value="1"/>
<set name="ap/active-waypoint" value="1"/>
</event>
<event name="Raise landing gear">
<condition>position/h-agl-ft ge 40</condition>
<set name="gear/gear-cmd-norm" value="0"/>
</event>
<event name="Head to first waypoint">
<condition>position/h-agl-ft ge 900</condition>
<set name="ap/active-waypoint" value="1"/>
<set name="ap/altitude_setpoint" value="4000.52292046198406" />
<set name="ap/altitude_hold" value="1"/>
<notify/>
</event>
<event name="Set waypoint 4">
<condition>
guidance/wp-distance lt 2500
ap/active-waypoint eq 3
</condition>
<set name="guidance/target_wp_latitude_rad" value="0.7119963305506742"/>
<set name="guidance/target_wp_longitude_rad" value="0.5089349211346755"/>
<set name="ap/altitude_setpoint" value="4000.52292046198406" />
<set name="ap/active-waypoint" value="4"/>
<notify/>
</event>
<event name="Set waypoint 3">
<condition>
guidance/wp-distance lt 2500
ap/active-waypoint eq 2
</condition>
<set name="guidance/target_wp_latitude_rad" value="0.7124925864880752"/>
<set name="guidance/target_wp_longitude_rad" value="0.5070509900512948"/>
<set name="ap/altitude_setpoint" value="4000.52292046198406" />
<set name="ap/altitude_hold" value="1"/>
<set name="ap/active-waypoint" value="3"/>
<notify/>
</event>
<event name="Set waypoint 2">
<condition>
guidance/wp-distance lt 2500
ap/active-waypoint eq 1
</condition>
<set name="guidance/target_wp_latitude_rad" value="0.7138967395660176"/>
<set name="guidance/target_wp_longitude_rad" value="0.5232904103935886"/>
<set name="ap/altitude_setpoint" value="8000.52292046198406" />
<set name="ap/altitude_hold" value="1"/>
<set name="ap/active-waypoint" value="2"/>
<notify/>
</event>
<event name="Terminate">
<condition>
guidance/wp-distance lt 100
ap/active-waypoint eq 4
</condition>
<set name="simulation/terminate" value="1"/>
</event>
</run>
</runscript> I've only added <set name="ap/heading-setpoint-select" value="1"/>
<set name="propulsion/magneto_cmd" value="3"/> because JSBSim threw fatal error that they didn't exist in the autopilot file. |
Beta Was this translation helpful? Give feedback.
-
Have you included the autopilot system in your F-15 as per the very first post in this dicussion? |
Beta Was this translation helpful? Give feedback.
-
Confirm the engine work
…---Original---
From: ***@***.***>
Date: Fri, Aug 23, 2024 10:28 AM
To: ***@***.***>;
Cc: ***@***.******@***.***>;
Subject: Re: [JSBSim-Team/jsbsim] Autopilot for F-15 (Discussion #444)
我在编写f16自动驾驶仪时也遇到了类似的问题,不知道该怎么解决,我是将JSBSim中的C310ap.xml运用到f16中,并且改写了pitch yaw roll Channel,但还是不成功,可以提一些建议吗
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all, I am developing a heading hold autopilot for F-15. I try to transplant the c172ap.xml to F-15, but failed to get an ideal result after adjusting the gain of PID. Does anyone do similar work? My modified code of f15.xml is shown below:
The altitude change when auto level flight is :

Beta Was this translation helpful? Give feedback.
All reactions