tTurn Trimming #1402
Replies: 5 comments 1 reply
-
|
I haven't looked at the trim code in a long time. So, sort of refreshing on the fly looking at the source code now. So, it looks like in the Then as you pointed out it calculates jsbsim/src/initialization/FGTrim.cpp Lines 773 to 784 in 0238e96 In
Using the following controls and states to achieve equilibrium. jsbsim/src/initialization/FGTrim.cpp Lines 874 to 881 in 0238e96 To answer your original question I think |
Beta Was this translation helpful? Give feedback.
-
|
In terms of having difficulty in getting a trim solution for a level turn I just tried trimming the A4 model in JSBSim at 15,000ft 250KCAS with bank angles from 5 deg to 60 deg in 5 deg increments and JSBSim was able to generate a trim solution for every bank angle. import jsbsim
AIRCRAFT_NAME="A4"
# Path to JSBSim files, location of the folders "aircraft", "engines" and "systems"
PATH_TO_JSBSIM_FILES="../.."
# Avoid flooding the console with log messages
#jsbsim.FGJSBBase().debug_lvl = 0
fdm = jsbsim.FGFDMExec(PATH_TO_JSBSIM_FILES)
# Load the aircraft model
fdm.load_model(AIRCRAFT_NAME)
# Set engines running
fdm['propulsion/set-running'] = -1
# Initial conditions
fdm['ic/h-sl-ft'] = 15000
fdm['ic/vc-kts'] = 250
fdm['ic/gamma-deg'] = 0
for phi in range(5, 61, 5):
fdm['ic/phi-deg'] = phi
# Initialize the aircraft with initial conditions
fdm.run_ic()
print(f"Trim solution for phi = {phi} degrees:")
# Trim
fdm['simulation/do_simple_trim'] = 5
print('')
print(f"V = {fdm['velocities/vtrue-fps']:.2f} fps")
print(f"u, v, w = {fdm['velocities/u-fps']:.2f}, {fdm['velocities/v-fps']:.2f}, {fdm['velocities/w-fps']:.2f}")Sample output: Trim solution for phi = 5 degrees:
Trim successful
Trim Results:
Angle of Attack: 2.82 wdot: 2.82e-04 Tolerance: 1e-03 Passed
Throttle: 0.62 udot: 4.41e-05 Tolerance: 1e-03 Passed
Pitch Trim: -0.13 qdot: -2.56e-06 Tolerance: 1e-04 Passed
Sideslip: -0.01 vdot: 1.15e-04 Tolerance: 1e-03 Passed
Ailerons: -0.00 pdot: 2.14e-05 Tolerance: 1e-04 Passed
Rudder: -0.01 rdot: -4.56e-19 Tolerance: 1e-04 Passed
V = 525.05 fps
u, v, w = 524.42, -0.06, 25.81
Trim solution for phi = 10 degrees:
Trim successful
Trim Results:
Angle of Attack: 2.87 wdot: 2.92e-04 Tolerance: 1e-03 Passed
Throttle: 0.63 udot: 1.42e-04 Tolerance: 1e-03 Passed
Pitch Trim: -0.14 qdot: -4.46e-06 Tolerance: 1e-04 Passed
Sideslip: -0.01 vdot: 2.38e-04 Tolerance: 1e-03 Passed
Ailerons: -0.00 pdot: 3.83e-05 Tolerance: 1e-04 Passed
Rudder: -0.02 rdot: 2.38e-18 Tolerance: 1e-04 Passed
V = 525.05 fps
u, v, w = 524.40, -0.13, 26.26
Trim solution for phi = 15 degrees:
Trim successful
Trim Results:
Angle of Attack: 2.95 wdot: 3.11e-04 Tolerance: 1e-03 Passed
Throttle: 0.63 udot: 5.10e-05 Tolerance: 1e-03 Passed
Pitch Trim: -0.14 qdot: -3.38e-06 Tolerance: 1e-04 Passed
Sideslip: -0.02 vdot: 3.72e-04 Tolerance: 1e-03 Passed
Ailerons: -0.00 pdot: 3.34e-05 Tolerance: 1e-04 Passed
Rudder: -0.03 rdot: -4.08e-18 Tolerance: 1e-04 Passed
V = 525.05 fps
u, v, w = 524.36, -0.20, 27.03
..........
..........
Trim solution for phi = 50 degrees:
Trim successful
Trim Results:
Angle of Attack: 5.15 wdot: 1.43e-04 Tolerance: 1e-03 Passed
Throttle: 0.69 udot: -5.47e-04 Tolerance: 1e-03 Passed
Pitch Trim: -0.27 qdot: 5.93e-06 Tolerance: 1e-04 Passed
Sideslip: -0.12 vdot: 9.50e-04 Tolerance: 1e-03 Passed
Ailerons: -0.01 pdot: -2.65e-05 Tolerance: 1e-04 Passed
Rudder: -0.11 rdot: -2.85e-18 Tolerance: 1e-04 Passed
V = 525.05 fps
u, v, w = 522.94, -1.07, 47.09
Trim solution for phi = 55 degrees:
Trim successful
Trim Results:
Angle of Attack: 5.94 wdot: 6.32e-05 Tolerance: 1e-03 Passed
Throttle: 0.72 udot: 5.62e-05 Tolerance: 1e-03 Passed
Pitch Trim: -0.31 qdot: -1.93e-06 Tolerance: 1e-04 Passed
Sideslip: -0.15 vdot: 1.17e-04 Tolerance: 1e-03 Passed
Ailerons: -0.02 pdot: 1.85e-05 Tolerance: 1e-04 Passed
Rudder: -0.11 rdot: 1.19e-18 Tolerance: 1e-04 Passed
V = 525.05 fps
u, v, w = 522.23, -1.38, 54.33
Trim solution for phi = 60 degrees:
Trim successful
Trim Results:
Angle of Attack: 7.03 wdot: 4.34e-05 Tolerance: 1e-03 Passed
Throttle: 0.76 udot: -5.94e-05 Tolerance: 1e-03 Passed
Pitch Trim: -0.38 qdot: -6.35e-07 Tolerance: 1e-04 Passed
Sideslip: -0.20 vdot: 2.95e-04 Tolerance: 1e-03 Passed
Ailerons: -0.02 pdot: 1.19e-05 Tolerance: 1e-04 Passed
Rudder: -0.12 rdot: -1.10e-17 Tolerance: 1e-04 Passed
V = 525.05 fps
u, v, w = 521.11, -1.87, 64.23Note the trim solutions have a small amount of sideslip, but |
Beta Was this translation helpful? Give feedback.
-
|
@AirshipSim @seanmcleod70 |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
Fix merged #1404 |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am reading through the FGTrim code. For tTurn, I see a small coding mistake below as phi is assigned twice the same value:
double phi = fgic.GetPhiRadIC();and just below again:
phi = fgic.GetPhiRadIC();jsbsim/src/initialization/FGTrim.cpp
Lines 788 to 813 in 0238e96
But the real question comes here for psidot calculation:
jsbsim/src/initialization/FGTrim.cpp
Line 796 in 0238e96
psidot is calculated using only
fgic.GetUBodyFpsIC(), that is the U velocity. With tPullup, Vtrue is used instead. I can understand that by definition we want to avoid sideslip to have a steady turn, so we decide V == 0. But what about W? Shouldn't you write:psidot = g*tan(phi) / sqrt( fgic.GetUBodyFpsIC()^2 + fgic.GetWBodyFpsIC()^2);If the current calculation is wrong, that would also mean that people so far had trouble with JSBSim turn trimming... Any clarification appreciated.
Note: my goal is to understand which variable is needed as user input for each trimming possibility, this is how I stumbled upon this code. I can not test the proper in flight behavior at the moment.
Best
Beta Was this translation helpful? Give feedback.
All reactions