mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-06 07:21:36 +08:00
Move PX4 Guide source into /docs (#24490)
* Add vitepress tree * Update existing workflows so they dont trigger on changes in the docs path * Add nojekyll, package.json, LICENCE etc * Add crowdin docs upload/download scripts * Add docs flaw checker workflows * Used docs prefix for docs workflows * Crowdin obvious fixes * ci: docs move to self hosted runner runs on a beefy server for faster builds Signed-off-by: Ramon Roche <mrpollo@gmail.com> * ci: don't run build action for docs or ci changes Signed-off-by: Ramon Roche <mrpollo@gmail.com> * ci: update runners Signed-off-by: Ramon Roche <mrpollo@gmail.com> * Add docs/en * Add docs assets and scripts * Fix up editlinks to point to PX4 sources * Download just the translations that are supported * Add translation sources for zh, uk, ko * Update latest tranlsation and uorb graphs * update vitepress to latest --------- Signed-off-by: Ramon Roche <mrpollo@gmail.com> Co-authored-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
co-authored by
Ramon Roche
parent
8e6d2ebe4a
commit
88d623bedb
@@ -0,0 +1,19 @@
|
||||
# Fixed-wing Vehicle Configuration
|
||||
|
||||
Fixed-wing configuration and calibration follows the same high level steps as other frames: selection of firmware, configuration of the frame including actuator/motor geometry and output mappings, sensor configuration and calibration, configuration of safety and other features, and finally tuning.
|
||||
|
||||
::: info
|
||||
This topic is the recommended entry point when performing first-time configuration and calibration of a new multicopter frame.
|
||||
:::
|
||||
|
||||
The main steps are:
|
||||
|
||||
- [Standard Configuration](../config/index.md)
|
||||
- [Autotune](../config/autotune_fw.md) - PID Tuning
|
||||
|
||||
::: info
|
||||
Autotune simplifies the manual process described in: [Fixed-wing Rate/Attitude Controller Tuning Guide](../config_fw/pid_tuning_guide_fixedwing.md).
|
||||
:::
|
||||
|
||||
- [Fixed-wing Altitude/Position Controller Tuning Guide](../config_fw/position_tuning_guide_fixedwing.md)
|
||||
- [Fixed-wing Trimming Guide](../config_fw/trimming_guide_fixedwing.md)
|
||||
@@ -0,0 +1,113 @@
|
||||
# Fixed-wing Rate/Attitude Controller Tuning Guide
|
||||
|
||||
This guide explains how to manually tune the fixed-wing PID loop.
|
||||
It is intended for advanced users / experts, as incorrect PID tuning may crash your aircraft.
|
||||
|
||||
::: info
|
||||
[Autotune](../config/autotune_fw.md) is recommended for most users, as it is far faster, easier and provides good tuning for most frames.
|
||||
Manual tuning is recommended for frames where autotuning does not work, or where fine-tuning is essential.
|
||||
:::
|
||||
|
||||
## Preconditions
|
||||
|
||||
- Trims must be configured first (before PID turning).
|
||||
The [Fixed-Wing Trimming Guide](../config_fw/trimming_guide_fixedwing.md) explains how.
|
||||
- Incorrectly set gains during tuning can make attitude control unstable.
|
||||
A pilot tuning gains should therefore be able to fly and land the plane in [manual](../flight_modes_fw/manual.md) (override) control.
|
||||
- Excessive gains (and rapid servo motion) can violate the maximum forces of your airframe - increase gains carefully.
|
||||
- Roll and pitch tuning follow the same sequence.
|
||||
The only difference is that pitch is more sensitive to trim offsets, so [trimming](../config_fw/trimming_guide_fixedwing.md) has to be done carefully and integrator gains need more attention to compensate this.
|
||||
|
||||
## Establishing the Airframe Baseline
|
||||
|
||||
If a pilot capable of manual flight is available, its best to establish a few core system properties on a manual trial.
|
||||
To do this, fly these maneuvers.
|
||||
Even if you can't note all the quantities immediately on paper, the log file will be very useful for later tuning.
|
||||
|
||||
::: info
|
||||
All these quantities will be automatically logged.
|
||||
You only need to take notes if you want to directly move on to tuning without looking at the log files.
|
||||
|
||||
- Fly level with a convenient airspeed.
|
||||
Note throttle stick position and airspeed (example: 70% → 0.7 throttle, 15 m/s airspeed).
|
||||
- Climb with maximum throttle and sufficient airspeed for 10-30 seconds (example: 12 m/s airspeed, climbed 100 m in 30 seconds).
|
||||
- Descend with zero throttle and reasonable airspeed for 10-30 seconds (example: 18 m/s airspeed, descended 80 m in 30 seconds).
|
||||
- Bank hard right with full roll stick until 60 degrees roll, then bank hard left with full roll stick until 60 degrees in the opposite side.
|
||||
- Pitch up hard 45 degrees, pitch down hard 45 degrees.
|
||||
:::
|
||||
|
||||
This guide will use these quantities to set some of the controller gains later on.
|
||||
|
||||
## Tune Roll
|
||||
|
||||
Tune first the roll axis, then pitch.
|
||||
The roll axis is safer as an incorrect tuning leads only to motion, but not a loss of altitude.
|
||||
|
||||
### Tuning the Feedforward Gain
|
||||
|
||||
To tune this gain, first set the other gains to their minimum values (nominally 0.005, but check the parameter documentation).
|
||||
|
||||
#### Gains to set to minimum values
|
||||
|
||||
- [FW_RR_I](../advanced_config/parameter_reference.md#FW_RR_I)
|
||||
- [FW_RR_P](../advanced_config/parameter_reference.md#FW_RR_P)
|
||||
|
||||
#### Gains to tune
|
||||
|
||||
- [FW_RR_FF](../advanced_config/parameter_reference.md#FW_RR_FF) - start with a value of 0.4.
|
||||
Increase this value (doubling each time) until the plane rolls satisfactorily and reaches the setpoint.
|
||||
Back down the gain 20% at the end of the process.
|
||||
|
||||
### Tuning the Rate Gain
|
||||
|
||||
- [FW_RR_P](../advanced_config/parameter_reference.md#FW_RR_P) - start with a value of 0.06.
|
||||
Increase this value (doubling each time) until the system starts to wobble / twitch.
|
||||
Then reduce gain by 50%.
|
||||
|
||||
### Tuning the Trim Offsets with the Integrator Gain
|
||||
|
||||
- [FW_RR_I](../advanced_config/parameter_reference.md#FW_RR_I) - start with a value of 0.01.
|
||||
Increase this value (doubling each time) until there is no offset between commanded and actual roll value (this will most likely require looking at a log file).
|
||||
|
||||
## Tune Pitch
|
||||
|
||||
The pitch axis might need more integrator gain and a correctly set pitch offset.
|
||||
|
||||
### Tuning the Feedforward Gain
|
||||
|
||||
To tune this gain, set the other gains to their minimum values.
|
||||
|
||||
#### Gains to set to minimum values
|
||||
|
||||
- [FW_PR_I](../advanced_config/parameter_reference.md#FW_PR_I)
|
||||
- [FW_PR_P](../advanced_config/parameter_reference.md#FW_PR_I)
|
||||
|
||||
#### Gains to tune
|
||||
|
||||
- [FW_PR_FF](../advanced_config/parameter_reference.md#FW_PR_FF) - start with a value of 0.4.
|
||||
Increase this value (doubling each time) until the plane pitches satisfactory and reaches the setpoint.
|
||||
Back down the gain 20% at the end of the process.
|
||||
|
||||
### Tuning the Rate Gain
|
||||
|
||||
- [FW_PR_P](../advanced_config/parameter_reference.md#FW_PR_P) - start with a value of 0.04.
|
||||
Increase this value (doubling each time) until the system starts to wobble / twitch.
|
||||
Then reduce value by 50%.
|
||||
|
||||
### Tuning the Trim Offsets with the Integrator Gain
|
||||
|
||||
- [FW_PR_I](../advanced_config/parameter_reference.md#FW_PR_I) - start with a value of 0.01.
|
||||
Increase this value (doubling each time) until there is no offset between commanded and actual pitch value (this will most likely require looking at a log file).
|
||||
|
||||
## Adjusting the Time Constant of the Outer Loop
|
||||
|
||||
The overall softness / hardness of the control loop can be adjusted by the time constant.
|
||||
The default of 0.5 seconds should be fine for normal fixed-wing setups and usually does not require adjustment.
|
||||
|
||||
- [FW_P_TC](../advanced_config/parameter_reference.md#FW_P_TC) - set to a default of 0.5 seconds, increase to make the Pitch response softer, decrease to make the response harder.
|
||||
- [FW_R_TC](../advanced_config/parameter_reference.md#FW_R_TC) - set to a default of 0.5 seconds, increase to make the Roll response softer, decrease to make the response harder.
|
||||
|
||||
## Other Tuning Parameters
|
||||
|
||||
The most important parameters are covered in this guide.
|
||||
Additional tuning parameters are documented in the [Parameter Reference](../advanced_config/parameter_reference.md).
|
||||
@@ -0,0 +1,86 @@
|
||||
# Fixed-wing Altitude/Position Controller Tuning
|
||||
|
||||
This guide offers some help in tuning the high-level fixed-wing controllers needed for flying missions and in altitude/position control mode.
|
||||
PX4 uses TECS for altitude and airspeed control, and NPFG for horizontal heading/position control.
|
||||
|
||||
::: info
|
||||
An incorrectly set gain during tuning can make altitude or heading control unstable.
|
||||
A pilot tuning the TECS gains should therefore be able to fly and land the plane in stabilized control mode.
|
||||
:::
|
||||
|
||||
:::tip
|
||||
All parameters are documented in the [Parameter Reference](../advanced_config/parameter_reference.md#fw-tecs).
|
||||
The most important parameters are covered in this guide.
|
||||
:::
|
||||
|
||||
## TECS Tuning (Altitude and Airspeed)
|
||||
|
||||
TECS (Total Energy Control System) is a guidance algorithm for fixed-wing aircraft that coordinates throttle and pitch angle setpoints to control the aircraft's altitude and airspeed.
|
||||
For a detailed description of the TECS algorithm and the control diagram, see [Controller Diagrams](../flight_stack/controller_diagrams.md).
|
||||
|
||||
A well-tuned attitude controller is required before tuning TECS: [PID Tuning Guide](../config_fw/pid_tuning_guide_fixedwing.md).
|
||||
|
||||
Tuning TECS is mainly about setting the airframe limitations correctly.
|
||||
Those limitations can be specified in terms of parameters that can be determined from a sequence of flight maneuvers, which are described below.
|
||||
Most of the maneuvers required the plane to be flown by a pilot in [Stabilized flight mode](../flight_modes_fw/stabilized.md).
|
||||
|
||||
:::tip
|
||||
It is highly beneficial to have a person available who can read and take note of telemetry data while the pilot is flying the maneuvers.
|
||||
To improve accuracy we also recommended that you verify the data obtained during flight with the data recorded in the flight logs.
|
||||
:::
|
||||
|
||||
#### 1st: Trim Conditions
|
||||
|
||||
Fly in [stabilized mode](../flight_modes_fw/stabilized.md) and find trim values for both throttle and pitch angle for level flight at trim airspeed.
|
||||
Use throttle to adjust airspeed and pitch to keep level flight.
|
||||
|
||||
Set the following parameters:
|
||||
|
||||
- [FW_AIRSPD_TRIM](../advanced_config/parameter_reference.md#FW_AIRSPD_TRIM) - set to the desired trim airspeed flown during the maneuver.
|
||||
- [FW_THR_TRIM](../advanced_config/parameter_reference.md#FW_THR_TRIM) - set to the throttle required to fly at trim airspeed.
|
||||
- [FW_PSP_OFF](../advanced_config/parameter_reference.md#FW_PSP_OFF) - set to the pitch angle required to maintain level flight.
|
||||
|
||||
#### 2nd: Airspeed & Throttle Limits
|
||||
|
||||
Fly in [stabilized mode](../flight_modes_fw/stabilized.md) and increase throttle while maintaining level flight using pitch control - until the vehicle reaches
|
||||
the maximum allowed airspeed.
|
||||
|
||||
Set the following parameters:
|
||||
|
||||
- [FW_THR_MAX](../advanced_config/parameter_reference.md#FW_THR_MAX) - set to the throttle you applied to reach maximum airspeed during level flight.
|
||||
- [FW_THR_MIN](../advanced_config/parameter_reference.md#FW_THR_MIN) - set to the minimum throttle the plane should fly at.
|
||||
- [FW_AIRSPD_MAX](../advanced_config/parameter_reference.md#FW_AIRSPD_MAX) - set to the maximum airspeed you achieved during level flight at `FW_THR_MAX`.
|
||||
|
||||
#### 3rd: Pitch & Climb Rate Limits
|
||||
|
||||
:::warning
|
||||
Do not use [FW_T_CLMB_MAX](../advanced_config/parameter_reference.md#FW_T_CLMB_MAX), [FW_T_SINK_MAX](../advanced_config/parameter_reference.md#FW_T_SINK_MAX) or [FW_T_SINK_MIN](../advanced_config/parameter_reference.md#FW_T_SINK_MIN) to specify the desired climb or sink performance you would like to get from the vehicle!
|
||||
The parameters define the operating limitations and they should be set during the tuning phase, as described below.
|
||||
:::
|
||||
|
||||
Fly in stabilized mode, apply full throttle (`FW_THR_MAX`) and slowly increase the pitch angle of the vehicle until the airspeed reaches `FW_AIRSPD_TRIM`.
|
||||
|
||||
- [FW_P_LIM_MAX](../advanced_config/parameter_reference.md#FW_P_LIM_MAX) - set to the pitch angle required to climb at trim airspeed when applying `FW_THR_MAX`.
|
||||
- [FW_T_CLMB_MAX](../advanced_config/parameter_reference.md#FW_T_CLMB_MAX) - set to the climb rate achieved during the climb at `FW_AIRSPD_TRIM`.
|
||||
|
||||
Fly in stabilized mode, reduce the throttle to `FW_THR_MIN` and slowly decrease the pitch angle until the vehicle reaches `FW_AIRSPD_MAX`.
|
||||
|
||||
- [FW_P_LIM_MIN](../advanced_config/parameter_reference.md#FW_P_LIM_MIN) - set to the pitch angle required to reach `FW_AIRSPD_MAX` at `FW_THR_MIN`.
|
||||
- [FW_T_SINK_MAX](../advanced_config/parameter_reference.md#FW_T_SINK_MAX) - set to the sink rate achieved during the descent.
|
||||
|
||||
Fly in stabilized mode, reduce throttle to `FW_THR_MIN` and adjust the pitch angle such that the plane maintains `FW_AIRSPD_TRIM`.
|
||||
|
||||
- [FW_T_SINK_MIN](../advanced_config/parameter_reference.md#FW_T_SINK_MIN) - set to the sink rate achieved while maintaining `FW_AIRSPD_TRIM`.
|
||||
|
||||
Specify the target climb and sink rate for autonomous missions by adjusting [FW_T_CLMB_R_SP](../advanced_config/parameter_reference.md#FW_T_CLMB_R_SP) and [FW_T_SINK_R_SP](../advanced_config/parameter_reference.md#FW_T_SINK_R_SP).
|
||||
These specify the height rates at which the vehicle will climb or descend in order to change altitude.
|
||||
Furthermore, these two values define the height rate limits commanded by the user in [Altitude mode](../flight_modes_fw/altitude.md) and [Position mode](../flight_modes_fw/position.md).
|
||||
|
||||
### FW Path Control Tuning (Position)
|
||||
|
||||
All path control parameters are described [here](../advanced_config/parameter_reference.md#fw-path-control).
|
||||
|
||||
- [NPFG_PERIOD](../advanced_config/parameter_reference.md#NPFG_PERIOD) - This is the previously called L1 distance and defines the tracking point ahead of the aircraft it's following.
|
||||
A value of 10-20 meters works for most aircraft.
|
||||
Shorten slowly during tuning until response is sharp without oscillation.
|
||||
Vehicles with a slow roll dynamic should have this value increased.
|
||||
@@ -0,0 +1,53 @@
|
||||
# Fixed-Wing Trimming Guide
|
||||
|
||||
Trims are used to calibrate the control surfaces at trim conditions (relative airspeed, air density, angle of attack, aircraft configuration, etc.).
|
||||
A properly trimmed aircraft flying at trim conditions will keep its attitude without requiring any control inputs from the pilot or the stabilizing computer.
|
||||
|
||||
General aviation, commercial and large unmanned planes trim their control surfaces using [trim tabs](https://en.wikipedia.org/wiki/Trim_tab) while small UAVs simply add an offset to the actuator of the control surface.
|
||||
|
||||
The [Basic trimming](#basic-trimming) section explains the purpose of each trim parameter and how to find the correct value.
|
||||
The [Advanced Trimming](#advanced-trimming) section introduces parameters that can be set to automatically adjust the trims based on the measured airspeed and flap position.
|
||||
|
||||
## Basic Trimming
|
||||
|
||||
There are several parameters an operator might want to use in order to properly trim a fixed-wing aircraft.
|
||||
An overview of those parameters and their use case is shown below:
|
||||
|
||||
- [RCx_TRIM](../advanced_config/parameter_reference.md#RC1_TRIM) applies trim to the signal received from the RC transmitter.
|
||||
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_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.
|
||||
For example, if you have two servos for the elevator, `TRIM_PITCH` applies trim to both of them.
|
||||
These are used when your control surfaces are aligned but the aircraft pitches/rolls/yaws up/down/left/right during manual (not stabilized) flight or if the control signal has a constant offset during stabilized flight.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
## 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.
|
||||
For this purpose, a bilinear curve function of airspeed and a pitch trim increment function of the flaps state (see figure below) can be defined using the following parameters:
|
||||
|
||||
- [FW_DTRIM\_\[R/P/Y\]\_\[VMIN/VMAX\]](../advanced_config/parameter_reference.md#FW_DTRIM_R_VMIN) are the roll/pitch/yaw trim value added to `TRIM_ROLL/PITCH/YAW` at min/max airspeed (defined by [FW_AIRSPD_MIN](../advanced_config/parameter_reference.md#FW_AIRSPD_MIN) and [FW_AIRSPD_MAX](../advanced_config/parameter_reference.md#FW_AIRSPD_MAX)).
|
||||
- [CA_SV_CSx_FLAP](../advanced_config/parameter_reference.md#CA_SV_CS0_FLAP) and [CA_SV_CSx_SPOIL](../advanced_config/parameter_reference.md#CA_SV_CS0_SPOIL) are the trimming values that are applied to these control surfaces if the flaps or the spoilers are fully deployed, respectively.
|
||||
|
||||

|
||||
|
||||
<!-- The drawing is on draw.io: https://drive.google.com/file/d/15AbscUF1kRdWMh8ONcCRu6QBwGbqVGfl/view?usp=sharing
|
||||
Request access from dev team. -->
|
||||
|
||||
A perfectly symmetrical airframe would only require pitch trim increments, but since a real airframe is never perfectly symmetrical, roll and yaw trims increments are also sometimes required.
|
||||
@@ -0,0 +1,135 @@
|
||||
# Advanced TECS Tuning (Weight and Altitude)
|
||||
|
||||
This topic shows how you can compensate for changes to the [weight of the vehicle](#vehicle-weight-compensation) and the [air density](#air-density-compensation), along with information about the [algorithms](#weight-and-density-compensation-algorithms) that are used.
|
||||
|
||||
:::warning
|
||||
This topic requires that you have already performed [basic TECS tuning](../config_fw/position_tuning_guide_fixedwing.md#tecs-tuning-altitude-and-airspeed).
|
||||
:::
|
||||
|
||||
[Basic TECS tuning](../config_fw/position_tuning_guide_fixedwing.md#tecs-tuning-altitude-and-airspeed) established the key performance limitations of the vehicle that are required for the altitude and airspeed controller to function properly.
|
||||
|
||||
While those limitations are specified using constant parameters, in reality vehicle performance is not constant and is affected by various factors.
|
||||
If changes in weight and air density are not taken into account, altitude and airspeed tracking will likely deteriorate in the case where the configuration (air density and weight) deviate significantly from the configuration at which the vehicle was tuned.
|
||||
|
||||
## Vehicle Weight Compensation
|
||||
|
||||
Set (both) the following parameters to scale the maximum climb rate, minimum sink rate, and adjust airspeed limits for weight:
|
||||
|
||||
- [WEIGHT_BASE](../advanced_config/parameter_reference.md#WEIGHT_BASE) — the weight of the vehicle at which the [Basic TECS tuning](../config_fw/position_tuning_guide_fixedwing.md#tecs-tuning-altitude-and-airspeed) was performed.
|
||||
- [WEIGHT_GROSS](../advanced_config/parameter_reference.md#WEIGHT_BASE) — the actual weight of the vehicle at any given time, for example when using a larger battery, or with a payload that was not present during tuning.
|
||||
|
||||
You can determine the values by measuring the weight of the vehicle using a scale in the tuning configuration and when flying with a payload.
|
||||
|
||||
Scaling is performed when _both_ `WEIGHT_BASE` and `WEIGHT_GROSS` are greater than `0`, and will have no effect if the values are the same.
|
||||
See the [algorithms](#weight-and-density-compensation-algorithms) section below for more information.
|
||||
|
||||
## Air Density Compensation
|
||||
|
||||
### Specify a Service Ceiling
|
||||
|
||||
In PX4 the service ceiling [FW_SERVICE_CEIL](../advanced_config/parameter_reference.md#FW_SERVICE_CEIL) specifies the altitude in standard atmospheric conditions at which the vehicle is still able to achieve a maximum climb rate of 0.5 m/s at maximum throttle and weight equal to [WEIGHT_BASE](../advanced_config/parameter_reference.md#WEIGHT_BASE).
|
||||
By default this parameter is disabled and no compensation will take place.
|
||||
|
||||
This parameter needs to be determined experimentally.
|
||||
It is always better to set a conservative value (lower value) than an optimistic value.
|
||||
|
||||
### Apply Density Correction to Minimum Sink Rate
|
||||
|
||||
The minimum sink rate is set in [FW_T_SINK_MIN](../advanced_config/parameter_reference.md#FW_T_SINK_MIN).
|
||||
|
||||
If the [Basic TECS tuning](../config_fw/position_tuning_guide_fixedwing.md#tecs-tuning-altitude-and-airspeed) was not done in standard sea level conditions then the [FW_T_SINK_MIN](../advanced_config/parameter_reference.md#FW_T_SINK_MIN) parameter must be modified by multiplying with correction factor $P$ (where $\rho$ is the air density during tuning):
|
||||
|
||||
$$P = \sqrt{\rho\over{\rho_{sealevel}}}$$
|
||||
|
||||
For more information see [Effect of Density on minimum sink rate](#effect-of-density-on-minimum-sink-rate).
|
||||
|
||||
### Apply Density Correction to Trim Throttle
|
||||
|
||||
The trim throttle is set using [FW_THR_TRIM](../advanced_config/parameter_reference.md#FW_THR_TRIM).
|
||||
|
||||
If basic tuning was not done in standard sealevel conditions then the value for [FW_THR_TRIM](../advanced_config/parameter_reference.md#FW_THR_TRIM) must be modified by multiplying with correction factor $P$:
|
||||
|
||||
$$P = \sqrt{\rho\over{\rho_{sealevel}}}$$
|
||||
|
||||
For more information see [Effect of Density on Trim Throttle](#effect-of-density-on-trim-throttle)
|
||||
|
||||
## Weight and Density Compensation Algorithms
|
||||
|
||||
This section contains information about the scaling operations performed by PX4.
|
||||
This is provided for interest only, and may be of interest to developers who want to modify the scaling code.
|
||||
|
||||
### Notation
|
||||
|
||||
In the following sections we will use the notation $\hat X$ to specify that this value is a calibrated value of the variable $X$.
|
||||
By calibrated we mean the value of that variable measured at sea level in standard atmospheric conditions, and when vehicle weight was equal to [WEIGHT_BASE](../advanced_config/parameter_reference.md#WEIGHT_BASE).
|
||||
|
||||
E.g. by $\hat{\dot{h}}_{max}$ we specify the maximum climb rate the vehicle can achieve at [WEIGHT_BASE](../advanced_config/parameter_reference.md#WEIGHT_BASE) at sea level in standard atmospheric conditions.
|
||||
|
||||
### Effect of Weight on Maximum Climb Rate
|
||||
|
||||
The maximum climb rate ([FW_T_CLMB_MAX](../advanced_config/parameter_reference.md#FW_T_CLMB_MAX)) is scaled as a function of the weight ratio.
|
||||
|
||||
From the steady state equations of motions of an airplane we find that the maximum climb rate can be written as:
|
||||
|
||||
$$\dot{h}_{max} = { V * ( Thrust - Drag ) \over{m*g}}$$
|
||||
|
||||
where `V` is the true airspeed and `m` is the vehicle mass.
|
||||
From this equation we see that the maximum climb rates scales with vehicle mass.
|
||||
|
||||
### Effect of Weight on Minimum Sink Rate
|
||||
|
||||
The minimum sink rate ([FW_T_SINK_MIN](../advanced_config/parameter_reference.md#FW_T_SINK_MIN)) is scaled as a function of weight ratio
|
||||
|
||||
The minimum sink rate can be written as:
|
||||
|
||||
$$\dot{h}_{min} = \sqrt{2mg\over{\rho S}} f(C_L, C_D)$$
|
||||
|
||||
where $\rho$ is the air density, S is the wing surface reference area and $f(C_L, C_D)$ is a function of the polars, lift and drag.
|
||||
|
||||
From this equation we see that the minimum sink rate scales with the square root of the weight ratio.
|
||||
|
||||
### Effect of Weight on Airspeed Limits
|
||||
|
||||
The minimum airspeed ([FW_AIRSPD_MIN](../advanced_config/parameter_reference.md#FW_AIRSPD_MIN)), the stall airspeed ([FW_AIRSPD_STALL](../advanced_config/parameter_reference.md#FW_AIRSPD_STALL)) and trim airspeed ([FW_AIRSPD_TRIM](../advanced_config/parameter_reference.md#FW_AIRSPD_TRIM)) are adjusted based on the weight ratio specified by [WEIGHT_BASE](../advanced_config/parameter_reference.md#WEIGHT_BASE) and [WEIGHT_GROSS](../advanced_config/parameter_reference.md#WEIGHT_GROSS).
|
||||
|
||||
In steady state flight we can demand that lift should equal weight of the vehicle:
|
||||
|
||||
$$Lift = mg = {1\over{2}} \rho V^2 S C_L$$
|
||||
|
||||
rearranging this equation for airspeed gives:
|
||||
|
||||
$$V = \\sqrt{\\frac{2mg}{\\rho S C_D }}$$
|
||||
|
||||
From this equation we see that if we assume a constant angle of attack (which we generally desire), the vehicle weight affects airspeed with a square root relation.
|
||||
Therefore, the airspeed limits mentioned above are all scaled using the square root of the weight ratio.
|
||||
|
||||
### Effect of Density on Maximum Climb Rate
|
||||
|
||||
The maximum climb rate is set using [FW_T_CLMB_MAX](../advanced_config/parameter_reference.md#FW_T_CLMB_MAX).
|
||||
|
||||
As we have seen previously, the maximum climb rate can be formulated as:
|
||||
|
||||
$$\dot{h}_{max} = { V * ( Thrust - Drag ) \over{m*g}}$$
|
||||
|
||||
The air density affects the airspeed, the thrust and the drag and modelling this effects is not straight forward.
|
||||
However, we can refer to literature and experience, which suggest that for a propeller airplane the maximum climb rate reduces approximately linear with the air density.
|
||||
Therefore, we can write the maximum climb rate as:
|
||||
|
||||
$$\dot{h}_{max} = \hat{\dot{h}} * {\rho_{sealevel} \over{\rho}} K$$
|
||||
|
||||
where $\rho_{sealevel}$ is the air density at sea level in the standard atmosphere and K is a scaling factor which determines the slope of the function.
|
||||
Rather than trying to identify this constants, the usual practice in aviation is to specify a service ceiling altitude at which the vehicle is still able to achieve a minimum specified climb rate.
|
||||
|
||||
### Effect of Density on Minimum Sink Rate
|
||||
|
||||
The minimum sink rate is set using [FW_T_SINK_MIN](../advanced_config/parameter_reference.md#FW_T_SINK_MIN).
|
||||
|
||||
In previous sections we have seen the formula for the minimum sink rate:
|
||||
|
||||
$$\dot{h}_{min} = \sqrt{2mg\over{\rho S}} f(C_L, C_D)$$
|
||||
|
||||
This shows that the minimum sink rate scales with the square root of the inverse air density.
|
||||
|
||||
### Effect of Density on Trim Throttle
|
||||
|
||||
TODO: Add derivation here.
|
||||
Reference in New Issue
Block a user