mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-22 14:19:57 +08:00
docs(fw): define the fixed-wing pitch angle and FW_PSP_OFF
PX4 never said in which frame fixed-wing pitch angles are given, and FW_PSP_OFF was described as an offset added to the pitch setpoint and as the angle of attack, which holds only for TECS and Stabilized mode, and only in level flight measured from the body x-axis. - Trimming guide: a side-view diagram of the body frame, the pitch angle and FW_PSP_OFF, and where FW_PSP_OFF is used. - Messages: state that pitch setpoints and limits are absolute, drop the FRD frame tag on an Euler angle, correct the pitch range to +-pi/2, and describe the TECS pitch integrator as a correction term. Comment-only, so no message version change. - Parameters: describe FW_PSP_OFF as the level-flight pitch, mark the absolute pitch parameters as such, and describe the asymmetric FW_MAN_P_MAX range with a non-zero FW_PSP_OFF. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Silvan <silvan@auterion.com>
This commit is contained in:
1 parent
88cf23685e
commit
026f8d1fa8
9 files changed
+123
-21
No files matched your search
@@ -0,0 +1,71 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 420" width="760" height="420" font-family="Helvetica, Arial, sans-serif">
|
||||
<rect width="760" height="420" fill="#ffffff"/>
|
||||
|
||||
<text x="24" y="34" font-size="15" font-weight="bold" fill="#212529">Fixed-wing pitch angle θ and FW_PSP_OFF</text>
|
||||
<text x="24" y="54" font-size="12" fill="#868e96">Side view, nose to the right. Angles are exaggerated.</text>
|
||||
|
||||
<!-- horizon -->
|
||||
<line x1="30" y1="215" x2="730" y2="215" stroke="#adb5bd" stroke-width="1.5" stroke-dasharray="10 7"/>
|
||||
<text x="36" y="206" font-size="12" fill="#868e96">Horizon</text>
|
||||
|
||||
<!-- velocity in level flight, along the horizon -->
|
||||
<line x1="380" y1="215" x2="704" y2="215" stroke="#495057" stroke-width="2.5"/>
|
||||
<path d="M 704 209 L 718 215 L 704 221 Z" fill="#495057"/>
|
||||
<text x="590" y="237" font-size="12" fill="#495057">Velocity in level flight</text>
|
||||
|
||||
<!-- aircraft, pitched up by θ = 12° about the centre of gravity (380, 215) -->
|
||||
<g transform="rotate(-12 380 215)">
|
||||
<g transform="translate(380 215)">
|
||||
<!-- line-art light aircraft, centre of gravity at the origin, nose along +x -->
|
||||
<g fill="#ffffff" stroke="#343a40" stroke-width="1.6" stroke-linejoin="round" stroke-linecap="round">
|
||||
<!-- vertical tail with dorsal fin, swept back -->
|
||||
<path d="M -128 -18 C -150 -22 -168 -36 -180 -64 L -196 -65 C -199 -45 -200 -25 -201 -9 Z"/>
|
||||
<line x1="-189" y1="-64" x2="-191" y2="-12"/>
|
||||
<!-- fuselage -->
|
||||
<path d="M -201 -9 L -176 -13 C -120 -20 -64 -27 -32 -32 C -16 -39 0 -42 20 -42 L 54 -41 C 72 -38 86 -28 100 -19 L 148 -15 C 155 -14 158 -11 158 -8 L 158 9 C 157 12 152 14 146 14 L 102 18 C 60 22 0 23 -42 19 C -100 13 -160 4 -201 -2 Z"/>
|
||||
<!-- cabin windows -->
|
||||
<path d="M 22 -37 L 52 -37 C 62 -36 75 -29 86 -22 L 22 -22 Z"/>
|
||||
<path d="M -24 -30 C -12 -35 0 -37 14 -37 L 14 -22 L -20 -22 Z"/>
|
||||
<!-- engine cowling joint and air intake -->
|
||||
<line x1="134" y1="-16" x2="134" y2="15"/>
|
||||
<path d="M 142 10 L 152 10 L 152 13"/>
|
||||
<!-- low wing with flap line -->
|
||||
<path d="M -62 11 C -42 2 42 1 78 8 C 44 15 -40 17 -62 11 Z"/>
|
||||
<line x1="-44" y1="12" x2="-18" y2="13"/>
|
||||
<!-- horizontal stabiliser -->
|
||||
<path d="M -206 -5 C -195 -10 -170 -10 -148 -7 C -170 -3 -195 -2 -206 -5 Z"/>
|
||||
<!-- spinner and two-blade propeller -->
|
||||
<path d="M 158 -8 C 172 -7 181 -3 185 0 C 181 3 172 7 158 9 Z"/>
|
||||
<path d="M 181 -3 C 185 -22 185 -46 181 -60 C 177 -46 177 -22 181 -3 Z"/>
|
||||
<path d="M 181 3 C 185 22 185 46 181 60 C 177 46 177 22 181 3 Z"/>
|
||||
</g>
|
||||
|
||||
<!-- body frame: x forward -->
|
||||
<line x1="0" y1="0" x2="248" y2="0" stroke="#4c6ef5" stroke-width="2.5"/>
|
||||
<path d="M 248 -6 L 262 0 L 248 6 Z" fill="#4c6ef5"/>
|
||||
<!-- body frame: z down -->
|
||||
<line x1="0" y1="0" x2="0" y2="118" stroke="#4c6ef5" stroke-width="2.5"/>
|
||||
<path d="M -6 118 L 0 132 L 6 118 Z" fill="#4c6ef5"/>
|
||||
<!-- body frame: y out of the page (right wing) -->
|
||||
<circle cx="0" cy="0" r="8" fill="#ffffff" stroke="#4c6ef5" stroke-width="2"/>
|
||||
<circle cx="0" cy="0" r="2.5" fill="#4c6ef5"/>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- body axis labels (outside the rotated group so the text stays level) -->
|
||||
<text x="648" y="156" font-size="13" font-weight="bold" fill="#4c6ef5">x</text>
|
||||
<text x="662" y="156" font-size="12" fill="#4c6ef5">forward</text>
|
||||
<text x="418" y="350" font-size="13" font-weight="bold" fill="#4c6ef5">z</text>
|
||||
<text x="432" y="350" font-size="12" fill="#4c6ef5">down</text>
|
||||
<text x="236" y="286" font-size="13" font-weight="bold" fill="#4c6ef5">y</text>
|
||||
<text x="250" y="286" font-size="12" fill="#4c6ef5">right wing, out of the page</text>
|
||||
<line x1="340" y1="275" x2="373" y2="224" stroke="#4c6ef5" stroke-width="1.2" stroke-dasharray="4 3"/>
|
||||
|
||||
<!-- pitch angle θ between the horizon and the body x-axis -->
|
||||
<path d="M 610 215 A 230 230 0 0 0 605.0 167.2" fill="none" stroke="#d9480f" stroke-width="2.5"/>
|
||||
<text x="618" y="200" font-size="16" font-weight="bold" fill="#d9480f">θ</text>
|
||||
|
||||
<!-- explanation -->
|
||||
<text x="24" y="382" font-size="12" fill="#212529"><tspan font-weight="bold" fill="#d9480f">θ</tspan> (pitch): angle of the body x-axis above the horizon. PX4 pitch setpoints and pitch limits are θ.</text>
|
||||
<text x="24" y="404" font-size="12" fill="#212529"><tspan font-weight="bold">FW_PSP_OFF</tspan>: θ in level flight at trim airspeed. TECS adds the commanded climb angle to it.</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.4 KiB |
@@ -17,8 +17,8 @@ An overview of those parameters and their use case is shown below:
|
||||
These parameters are set automatically during [RC calibration](../config/radio.md).
|
||||
- [CA_SV_CSx_TRIM](../advanced_config/parameter_reference.md#CA_SV_CS0_TRIM) applies trim to a control surfaces channel.
|
||||
These are used to finely align the control surfaces to default angles before flying.
|
||||
- [FW_PSP_OFF](../advanced_config/parameter_reference.md#FW_PSP_OFF) applies an offset to the pitch setpoint.
|
||||
This is used to set the angle of attack at which your aircraft needs to fly at cruise speed.
|
||||
- [FW_PSP_OFF](../advanced_config/parameter_reference.md#FW_PSP_OFF) is the pitch angle at which your aircraft flies level at trim airspeed.
|
||||
See [Level-Flight Pitch](#level-flight-pitch) for how PX4 defines and uses it.
|
||||
- [FW_AIRSPD_TRIM](../advanced_config/parameter_reference.md#FW_AIRSPD_TRIM) is used by the rate controllers to scale their output depending on the measured airspeed.
|
||||
See [Airspeed Scaling](../flight_stack/controller_diagrams.md#airspeed-scaling) for more details.
|
||||
- [TRIM_ROLL](../advanced_config/parameter_reference.md#TRIM_ROLL), [TRIM_PITCH](../advanced_config/parameter_reference.md#TRIM_PITCH) and [TRIM_YAW](../advanced_config/parameter_reference.md#TRIM_YAW) apply trim to the control signals _before_ mixing.
|
||||
@@ -28,8 +28,7 @@ An overview of those parameters and their use case is shown below:
|
||||
The correct order to set the above parameters is:
|
||||
|
||||
1. Trim the servos by physically adjusting the linkages lengths if possible and fine tune by trimming the PWM channels (use `PWM_MAIN/AUX_TRIMx`) on the bench to properly set the control surfaces to their theoretical position.
|
||||
1. Fly in stabilized mode at cruise speed and set the pitch setpoint offset (`FW_PSP_OFF`) to desired angle of attack.
|
||||
The required angle of attack at cruise speed corresponds to the pitch angle that the airplane needs to fly at in order to keep constant altitude during wing-leveled flight.
|
||||
1. Fly in stabilized mode at cruise speed and set `FW_PSP_OFF` to the pitch angle that the airplane needs to fly at in order to keep constant altitude during wing-leveled flight.
|
||||
If you are using an airspeed sensor, also set the correct cruise airspeed (`FW_AIRSPD_TRIM`).
|
||||
1. Look at the actuator controls in the log file (upload it to [Flight Review](https://logs.px4.io) and check the _Actuator Controls_ plot for example) and set the pitch trim (`TRIM_PITCH`).
|
||||
Set that value to the average offset of the pitch signal during wing-leveled flight.
|
||||
@@ -37,6 +36,30 @@ The correct order to set the above parameters is:
|
||||
Step 3 can be performed before step 2 if you don't want to have to look at the log, or if you feel comfortable flying in manual mode.
|
||||
You can then trim your remote (with the trim switches) and report the values to `TRIM_PITCH` (and remove the trims from your transmitter) or update `TRIM_PITCH` directly during flight via telemetry and QGC.
|
||||
|
||||
## Level-Flight Pitch
|
||||
|
||||
PX4 measures the fixed-wing pitch angle θ between the body x-axis and the horizon.
|
||||
The body frame is fixed to the vehicle: x points forward through the nose, y along the right wing and z down.
|
||||
Its orientation follows the mounting of the flight controller (see [Flight Controller Orientation](../config/flight_controller_orientation.md)), not the wing chord.
|
||||
For tailsitters, the fixed-wing body frame is the multicopter body frame rotated by 90° in pitch.
|
||||
|
||||

|
||||
|
||||
[FW_PSP_OFF](../advanced_config/parameter_reference.md#FW_PSP_OFF) is θ in level flight at trim airspeed ([FW_AIRSPD_TRIM](../advanced_config/parameter_reference.md#FW_AIRSPD_TRIM)).
|
||||
In level flight the velocity is horizontal, so this is also the angle of attack measured from the body x-axis.
|
||||
It differs from the angle of attack of the wing by the angle between the wing chord and the body x-axis.
|
||||
|
||||
Pitch setpoints and pitch limits in PX4 are absolute pitch angles θ, and `FW_PSP_OFF` is not added to them.
|
||||
This applies for example to [FW_P_LIM_MIN](../advanced_config/parameter_reference.md#FW_P_LIM_MIN), [FW_P_LIM_MAX](../advanced_config/parameter_reference.md#FW_P_LIM_MAX), [FW_TKO_PITCH_MIN](../advanced_config/parameter_reference.md#FW_TKO_PITCH_MIN), [FW_LND_FL_PMIN](../advanced_config/parameter_reference.md#FW_LND_FL_PMIN), [FW_LND_FL_PMAX](../advanced_config/parameter_reference.md#FW_LND_FL_PMAX) and [RWTO_PSP](../advanced_config/parameter_reference.md#RWTO_PSP).
|
||||
|
||||
`FW_PSP_OFF` itself is used in these places:
|
||||
|
||||
- The altitude and airspeed controller (TECS) uses `FW_PSP_OFF` as the pitch at zero climb angle: its pitch setpoint is `FW_PSP_OFF` plus the commanded climb angle plus an integrator correction.
|
||||
The logged TECS pitch setpoint (`tecs_status.pitch_sp_rad`) is absolute, while the logged pitch integrator (`tecs_status.pitch_integ`) is a correction added to it rather than a pitch angle.
|
||||
- In [Stabilized mode](../flight_modes_fw/stabilized.md), the centred pitch stick commands `FW_PSP_OFF`.
|
||||
- During the front transition, standard VTOLs ramp their pitch setpoint to `FW_PSP_OFF`, and tailsitters end their pitch-down rotation at it.
|
||||
- The first principle check of the [airspeed validation](../advanced_config/airspeed_validation.md) considers the vehicle to be pitching down when θ is below `FW_PSP_OFF`.
|
||||
|
||||
## Advanced Trimming
|
||||
|
||||
Given that the downward pitch moment induced by an asymmetric airfoil increases with airspeed and when the flaps are deployed, the aircraft needs to be re-trimmed according to the current measured airspeed and flaps position.
|
||||
|
||||
+2
-2
@@ -21,10 +21,10 @@ float32 total_energy_balance_rate_sp # Energy balance rate setpoint [m^2/s^3]
|
||||
float32 total_energy_balance_rate # Energy balance rate estimate [m^2/s^3]
|
||||
|
||||
float32 throttle_integ # Throttle integrator value [-]
|
||||
float32 pitch_integ # Pitch integrator value [rad]
|
||||
float32 pitch_integ # Pitch integrator value [rad], a correction added to the pitch setpoint rather than a pitch angle
|
||||
|
||||
float32 throttle_sp # Current throttle setpoint [-]
|
||||
float32 pitch_sp_rad # Current pitch setpoint [rad]
|
||||
float32 pitch_sp_rad # Current pitch setpoint [rad], absolute: angle of the fixed-wing body x-axis above the horizon, FW_PSP_OFF included
|
||||
float32 throttle_trim # estimated throttle value [0,1] required to fly level at equivalent_airspeed_sp in the current atmospheric conditions
|
||||
|
||||
float32 underspeed_ratio # 0: no underspeed, 1: maximal underspeed. Controller takes measures to avoid stall proportional to ratio if >0.
|
||||
|
||||
@@ -23,4 +23,4 @@ float32 calibrated_ground_minus_wind_m_s # [m/s] [@invalid NaN] CAS calculated f
|
||||
float32 calibraded_airspeed_synth_m_s # [m/s] [@invalid NaN] Synthetic airspeed
|
||||
float32 airspeed_derivative_filtered # [m/s^2] Filtered indicated airspeed derivative
|
||||
float32 throttle_filtered # [-] Filtered fixed-wing throttle
|
||||
float32 pitch_filtered # [rad] Filtered pitch
|
||||
float32 pitch_filtered # [rad] Filtered absolute pitch angle of the fixed-wing body x-axis above the horizon
|
||||
@@ -3,6 +3,7 @@
|
||||
# Used by the fw_lateral_longitudinal_control module
|
||||
# If pitch_direct and throttle_direct are not both finite, then the controller relies on altitude/height_rate and equivalent_airspeed to control vertical motion.
|
||||
# If both altitude and height_rate are NAN, the controller maintains the current altitude.
|
||||
# Pitch angles are absolute: the angle of the fixed-wing body x-axis above the horizon, without FW_PSP_OFF applied.
|
||||
|
||||
uint32 MESSAGE_VERSION = 0
|
||||
|
||||
@@ -11,5 +12,5 @@ uint64 timestamp # [us] Time since system start
|
||||
float32 altitude # [m] Altitude setpoint AMSL, not controlled directly if NAN or if height_rate is finite
|
||||
float32 height_rate # [m/s] [@frame ENU] Scalar height rate setpoint. NAN if not controlled directly
|
||||
float32 equivalent_airspeed # [m/s] [@range 0, inf] Scalar equivalent airspeed setpoint. NAN if system default should be used
|
||||
float32 pitch_direct # [rad] [@range -pi, pi] [@frame FRD] NAN if not controlled, overrides total energy controller
|
||||
float32 pitch_direct # [rad] [@range -pi/2, pi/2] Absolute pitch angle setpoint. NAN if not controlled, overrides total energy controller
|
||||
float32 throttle_direct # [norm] [@range 0,1] NAN if not controlled, overrides total energy controller
|
||||
@@ -2,13 +2,14 @@
|
||||
#
|
||||
# Used by the fw_lateral_longitudinal_control module and TECS to constrain FixedWingLongitudinalSetpoint messages
|
||||
# and configure the resultant setpoints.
|
||||
# Pitch angles are absolute: the angle of the fixed-wing body x-axis above the horizon, without FW_PSP_OFF applied.
|
||||
|
||||
uint32 MESSAGE_VERSION = 0
|
||||
|
||||
uint64 timestamp # [us] Time since system start
|
||||
|
||||
float32 pitch_min # [rad] [@range -pi, pi] Defaults to FW_P_LIM_MIN if NAN.
|
||||
float32 pitch_max # [rad] [@range -pi, pi] Defaults to FW_P_LIM_MAX if NAN.
|
||||
float32 pitch_min # [rad] [@range -pi/2, pi/2] Minimum absolute pitch angle setpoint. Defaults to FW_P_LIM_MIN if NAN.
|
||||
float32 pitch_max # [rad] [@range -pi/2, pi/2] Maximum absolute pitch angle setpoint. Defaults to FW_P_LIM_MAX if NAN.
|
||||
float32 throttle_min # [norm] [@range 0,1] Defaults to FW_THR_MIN if NAN.
|
||||
float32 throttle_max # [norm] [@range 0,1] Defaults to FW_THR_MAX if NAN.
|
||||
float32 climb_rate_target # [m/s] Target climbrate to change altitude. Defaults to FW_T_CLMB_R_SP if NAN. Not used if height_rate is directly set in FixedWingLongitudinalSetpoint.
|
||||
|
||||
@@ -138,9 +138,12 @@ parameters:
|
||||
description:
|
||||
short: Pitch setpoint offset (pitch at level flight)
|
||||
long: |-
|
||||
An airframe specific offset of the pitch setpoint in degrees, the value is
|
||||
added to the pitch setpoint and should correspond to the pitch at
|
||||
typical cruise speed of the airframe.
|
||||
Pitch angle of the body x-axis above the horizon in level flight at trim airspeed (FW_AIRSPD_TRIM).
|
||||
|
||||
The altitude and airspeed controller (TECS) uses it as the pitch at zero climb angle,
|
||||
and in Stabilized mode the centred pitch stick commands it.
|
||||
Pitch setpoints and pitch limits set elsewhere, for example FW_P_LIM_MIN and FW_P_LIM_MAX,
|
||||
are absolute and do not include it.
|
||||
type: float
|
||||
default: 0.0
|
||||
unit: deg
|
||||
@@ -174,8 +177,11 @@ parameters:
|
||||
FW_MAN_P_MAX:
|
||||
description:
|
||||
short: Maximum manual pitch angle
|
||||
long: Applies to both directions in all manual modes with attitude stabilization
|
||||
but without altitude control
|
||||
long: |-
|
||||
Pitch angle commanded by full stick deflection, relative to FW_PSP_OFF (the centred-stick pitch).
|
||||
The resulting pitch setpoint is additionally limited to this angle around level,
|
||||
so with a non-zero FW_PSP_OFF the range is not symmetric.
|
||||
Applies in all manual modes with attitude stabilization but without altitude control.
|
||||
type: float
|
||||
default: 30.0
|
||||
unit: deg
|
||||
|
||||
@@ -98,7 +98,7 @@ parameters:
|
||||
default: 0
|
||||
FW_LND_FL_PMIN:
|
||||
description:
|
||||
short: Flare, minimum pitch
|
||||
short: Flare, minimum absolute pitch
|
||||
long: Minimum pitch during landing flare.
|
||||
type: float
|
||||
default: 2.5
|
||||
@@ -109,7 +109,7 @@ parameters:
|
||||
increment: 0.5
|
||||
FW_LND_FL_PMAX:
|
||||
description:
|
||||
short: Flare, maximum pitch
|
||||
short: Flare, maximum absolute pitch
|
||||
long: Maximum pitch during landing flare.
|
||||
type: float
|
||||
default: 15.0
|
||||
@@ -262,7 +262,7 @@ parameters:
|
||||
definitions:
|
||||
FW_TKO_PITCH_MIN:
|
||||
description:
|
||||
short: Minimum pitch during takeoff
|
||||
short: Minimum absolute pitch during takeoff
|
||||
type: float
|
||||
default: 10.0
|
||||
unit: deg
|
||||
@@ -350,7 +350,7 @@ parameters:
|
||||
definitions:
|
||||
FW_P_LIM_MIN:
|
||||
description:
|
||||
short: Minimum pitch angle setpoint
|
||||
short: Minimum absolute pitch angle setpoint
|
||||
long: Applies in any altitude controlled flight mode.
|
||||
type: float
|
||||
default: -30.0
|
||||
@@ -361,7 +361,7 @@ parameters:
|
||||
increment: 0.5
|
||||
FW_P_LIM_MAX:
|
||||
description:
|
||||
short: Maximum pitch angle setpoint
|
||||
short: Maximum absolute pitch angle setpoint
|
||||
long: Applies in any altitude controlled flight mode.
|
||||
type: float
|
||||
default: 30.0
|
||||
|
||||
@@ -19,7 +19,7 @@ parameters:
|
||||
increment: 0.01
|
||||
RWTO_PSP:
|
||||
description:
|
||||
short: Pitch setpoint during taxi / before rotation
|
||||
short: Absolute pitch setpoint during taxi / before rotation
|
||||
long: |-
|
||||
Pitch setpoint during taxi / before takeoff rotation airspeed is reached
|
||||
|
||||
|
||||
Reference in new issue
Block a user