Replies: 7 comments 58 replies
-
You could implement an autopilot which uses elevator to keep alpha constant and uses the throttle to keep altitude constant. |
Beta Was this translation helpful? Give feedback.
-
Take a look in the JSBSim Reference Manual for some examples and explanations - http://jsbsim.sourceforge.net/JSBSimReferenceManual.pdf There are a handful implemented in the JSBSim repo. |
Beta Was this translation helpful? Give feedback.
-
The You can't simply change the airspeed at some time. It's read-only: jsbsim/src/models/FGAuxiliary.cpp Line 314 in 375f5be Even if you could, then immediately during the next timestep the aircraft wouldn't be in trim anyway so it would start rotating, translating etc. |
Beta Was this translation helpful? Give feedback.
-
Regarding the autothrotlle, I think that you should start simple and drop all the I guess that you don't plan to simulate asymmetric thrust so all you need from the autopilot is one thrust lever position (say <channel name="Alpha hold">
<summer name="aero/alpha-error">
<input> ap/alpha_setpoint </input>
<input> -aero/alpha-deg </input>
<clipto>
<min>-1</min>
<max> 1</max>
</clipto>
</summer> Here you may not want to clip your <pid name="aero/alpha-hold-pid">
<input> aero/ap-alpha-hold-switch </input>
<kp> 100 </kp>
<ki> 2 </ki>
<kd> 20 </kd>
<trigger> aero/n2-trigger </trigger>
<clipto> <min>-1</min>
<max> 1</max> </clipto>
</pid> The same applies to your PID: since you want a throttle command, the output value should be between 0 and 1. So the min/max values of Also I'd suggest to start setting The So your channel should look like this (:warning: this is untested code !): <channel name="Alpha hold">
<!-- Compute the error between the target alpha and the actual value -->
<summer name="aero/alpha-error">
<input> ap/alpha_setpoint </input>
<input> -aero/alpha-deg </input>
<clipto>
<min>-5</min>
<max> 5</max>
</clipto>
</summer>
<pid name="aero/alpha-hold-pid">
<input> aero/alpha-error </input>
<kp> 100 </kp>
<ki> 0 </ki>
<kd> 0 </kd>
<clipto>
<min> 0 </min>
<max> 1</max> </clipto>
</pid>
<!-- Forces the auto throttle value to 0 when ap/alpha_hold is different than 1.0
This allows to disable the autothrottle. -->
<switch name="ap/throttle-cmd">
<default value="0.0"/>
<test value="aero/alpha-hold-pid">
ap/alpha_hold == 1
</test>
</switch>
<!-- Drives engine #0 throttle position -->
<summer name="fcs/throttle-pos-norm[0]">
<input> fcs/throttle-cmd-norm[0] </input>
<input> ap/throttle-cmd </input>
<clipto>
<min> 0 </min>
<max> 1.0 </max>
</clipto>
</summer>
<!-- Drives engine #1 throttle position -->
<summer name="fcs/throttle-pos-norm[1]">
<input> fcs/throttle-cmd-norm[1] </input>
<input> ap/throttle-cmd </input>
<clipto>
<min> 0 </min>
<max> 1.0 </max>
</clipto>
</summer>
</channel> Also note that if you want to change the sign of |
Beta Was this translation helpful? Give feedback.
-
In other words you would have two PID controllers, the first one would control alpha by looking at the alpha-error and driving the elevator to zero the alpha-error. The second PID controller would control altitude by looking at the altitude-error and driving the throttle to zero the altitude-error. Pretty much the way aircraft carrier landings are performed 😉 |
Beta Was this translation helpful? Give feedback.
-
In terms of constant alpha during cruise during a long flight, your original question, if it's to do with optimizing fuel mileage take a look at the following:
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
How to keep the angle of attack in a long flight? The fuel consumption decrease the aircraft weight so it changes the lift required and changes the angle of attack due to constant speed.
I have the L/D_max KCAS for heavy and light aircraft and it varies along the flight. Instead of KCAS constant, I would like to keep the alpha during the 5 hours flight to have the L/D_max condition.
Beta Was this translation helpful? Give feedback.
All reactions