From 26ef6e854518c15a690fc8128461d4352a139c8e Mon Sep 17 00:00:00 2001 From: Mathieu Bresciani Date: Tue, 2 Apr 2024 14:03:13 +0200 Subject: [PATCH 1/6] Add FW auto-trimming doc --- en/config_fw/trimming_guide_fixedwing.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/en/config_fw/trimming_guide_fixedwing.md b/en/config_fw/trimming_guide_fixedwing.md index 78cea918f596..b514c3a8b2af 100644 --- a/en/config_fw/trimming_guide_fixedwing.md +++ b/en/config_fw/trimming_guide_fixedwing.md @@ -31,12 +31,15 @@ The correct order to set the above parameters is: 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`). +1. Run [auto-trimming](#auto-trimming) during a flight or 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. +### Auto-trimming +Auto-trimming continuously estimates the current trim of the aircraft during flight, uses it to reduce the constant load on the integrator of the angular rate control loop and adjusts general trim parameters (i.e.: `TRIM_ROLL`, `TRIM_PITCH` and `TRIM_YAW`) after landing. Auto-trimming can be enabled using [FW_ATRIM_MODE](../advanced_config/parameter_reference.md#FW_ATRIM_MODE). By default, this parameter is set to "Calibration" (trim parameters are replaced by the trim estimate) for the first flight and is then automatically changed to "Continuous" mode (trim estimate is used to slowly update the existing trim parameters). The trim estimate is only updated when the aircraft constantly flies with a bank angle of less than 10 degrees for more than 7 seconds. It is therefore recommended to fly large circles or several phases of straight and level flight during the first calibration flight to obtain best results. + ## 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. From 433918ce0287885d664c13fb74da13cc337a09e7 Mon Sep 17 00:00:00 2001 From: Hamish Willee Date: Wed, 3 Apr 2024 10:23:08 +1100 Subject: [PATCH 2/6] Initial subedit and release note --- en/config_fw/trimming_guide_fixedwing.md | 17 ++++++++++++++--- en/releases/main.md | 8 ++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/en/config_fw/trimming_guide_fixedwing.md b/en/config_fw/trimming_guide_fixedwing.md index b514c3a8b2af..69fae3a122dc 100644 --- a/en/config_fw/trimming_guide_fixedwing.md +++ b/en/config_fw/trimming_guide_fixedwing.md @@ -31,14 +31,25 @@ The correct order to set the above parameters is: 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. Run [auto-trimming](#auto-trimming) during a flight or 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`). +1. Run [auto-trimming](#auto-trimming) during a flight to set `TRIM_ROLL`, `TRIM_PITCH` and `TRIM_YAW`. + + You could also manually set the pitch trim (`TRIM_PITCH`) by looking 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). 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. ### Auto-trimming -Auto-trimming continuously estimates the current trim of the aircraft during flight, uses it to reduce the constant load on the integrator of the angular rate control loop and adjusts general trim parameters (i.e.: `TRIM_ROLL`, `TRIM_PITCH` and `TRIM_YAW`) after landing. Auto-trimming can be enabled using [FW_ATRIM_MODE](../advanced_config/parameter_reference.md#FW_ATRIM_MODE). By default, this parameter is set to "Calibration" (trim parameters are replaced by the trim estimate) for the first flight and is then automatically changed to "Continuous" mode (trim estimate is used to slowly update the existing trim parameters). The trim estimate is only updated when the aircraft constantly flies with a bank angle of less than 10 degrees for more than 7 seconds. It is therefore recommended to fly large circles or several phases of straight and level flight during the first calibration flight to obtain best results. + + + +Auto-trimming continuously estimates the current trim of the aircraft during flight, uses it to reduce the constant load on the integrator of the angular rate control loop, and adjusts general trim parameters (`TRIM_ROLL`, `TRIM_PITCH` and `TRIM_YAW`) after landing. + +Auto-trimming is enabled using [FW_ATRIM_MODE](../advanced_config/parameter_reference.md#FW_ATRIM_MODE). +This parameter is set to `(1) Calibration` (trim parameters are replaced by the trim estimate on landing) for the first flight and is then automatically changed to `(2) Continuous` mode (trim estimate is used to slowly update the existing trim parameters). + +The trim estimate is only updated when the aircraft constantly flies with a bank angle of less than 10 degrees for more than 7 seconds. +During the first calibration flight you should fly large circles or several phases of straight and level flight to obtain best results. ## Advanced Trimming @@ -51,6 +62,6 @@ For this purpose, a bilinear curve function of airspeed and a pitch trim increme ![Dtrim Curve](../../assets/config/fw/fixedwing_dtrim.png) +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. diff --git a/en/releases/main.md b/en/releases/main.md index 46fe59f74c87..098decd56447 100644 --- a/en/releases/main.md +++ b/en/releases/main.md @@ -78,6 +78,14 @@ Please continue reading for [upgrade instructions](#upgrade-guide). ### Fixed-wing - Improvement: Fixed-wing auto takeoff: enable setting takeoff flaps for hand/catapult launch. [PX4-Autopilot#23460](https://github.com/PX4/PX4-Autopilot/pull/23460) +- [Simplified airspeed sensor configuration](../config_vtol/vtol_without_airspeed_sensor.md): + Replacef parameter `CBRK_AIRSPD_CHK` with [SYS_HAS_NUM_ASPD](../advanced_config/parameter_reference.md#SYS_HAS_NUM_ASPD) and renamed parameter `FW_ARSP_MODE` to [FW_USE_AIRSPD](../advanced_config/parameter_reference.md#FW_USE_AIRSPD). + To be able to arm without an airspeed sensor set `SYS_HAS_NUM_ASPD` to 0. + To not use the airspeed sensor data in the controller, set `FW_USE_AIRSPD` to 0. + Added to PX4 in [PX4-Autopilot#22510](https://github.com/PX4/PX4-Autopilot/pull/22510). +- [Auto-trimming](../config_fw/trimming_guide_fixedwing.md#auto-trimming) (enabled by default). + Automatically calibrates trim parameters and then continuously adjusts trim of the aircraft during flight. + Added to PX4 in [PX4-Autopilot#22668](https://github.com/PX4/PX4-Autopilot/pull/22668). ### Rover From 2165acc3e96b812bf75da6bda448cb91b23fb622 Mon Sep 17 00:00:00 2001 From: Mathieu Bresciani Date: Wed, 3 Apr 2024 10:24:44 +0200 Subject: [PATCH 3/6] Update en/config_fw/trimming_guide_fixedwing.md Co-authored-by: Hamish Willee --- en/config_fw/trimming_guide_fixedwing.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/en/config_fw/trimming_guide_fixedwing.md b/en/config_fw/trimming_guide_fixedwing.md index 69fae3a122dc..5f33e3a94e69 100644 --- a/en/config_fw/trimming_guide_fixedwing.md +++ b/en/config_fw/trimming_guide_fixedwing.md @@ -43,14 +43,17 @@ You can then trim your remote (with the trim switches) and report the values to -Auto-trimming continuously estimates the current trim of the aircraft during flight, uses it to reduce the constant load on the integrator of the angular rate control loop, and adjusts general trim parameters (`TRIM_ROLL`, `TRIM_PITCH` and `TRIM_YAW`) after landing. +Auto-trimming is enabled by default. +On first flight, auto-trimming estimates the current trim of the aircraft, and then updates the general trim parameters (`TRIM_ROLL`, `TRIM_PITCH` and `TRIM_YAW`) with calibrated values after landing. +The trim estimate is only updated when the aircraft flies with a bank angle of less than 10 degrees for more than 7 seconds. +So for the first calibration flight you should fly large circles or several phases of straight and level flight. + +On subsequent flights auto-trimming continuously estimates the trim and slowly updates the stored trim parameters. +This reduces the constant load on the integrator of the angular rate control loop. Auto-trimming is enabled using [FW_ATRIM_MODE](../advanced_config/parameter_reference.md#FW_ATRIM_MODE). This parameter is set to `(1) Calibration` (trim parameters are replaced by the trim estimate on landing) for the first flight and is then automatically changed to `(2) Continuous` mode (trim estimate is used to slowly update the existing trim parameters). -The trim estimate is only updated when the aircraft constantly flies with a bank angle of less than 10 degrees for more than 7 seconds. -During the first calibration flight you should fly large circles or several phases of straight and level flight to obtain best results. - ## 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. From bf30ceb5cdec0e9ca94389ba3dd40205bad04ad4 Mon Sep 17 00:00:00 2001 From: Mathieu Bresciani Date: Wed, 3 Apr 2024 13:16:02 +0200 Subject: [PATCH 4/6] Update en/config_fw/trimming_guide_fixedwing.md --- en/config_fw/trimming_guide_fixedwing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/config_fw/trimming_guide_fixedwing.md b/en/config_fw/trimming_guide_fixedwing.md index 5f33e3a94e69..843eaa46b8a3 100644 --- a/en/config_fw/trimming_guide_fixedwing.md +++ b/en/config_fw/trimming_guide_fixedwing.md @@ -37,7 +37,7 @@ The correct order to set the above parameters is: 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. +You can then trim your remote (with the trim switches) and report the values to `TRIM_ROLL/PITCH/YAW` (and remove the trims from your transmitter) or update `TRIM_ROLL/PITCH/YAW` directly during flight via telemetry and QGC. ### Auto-trimming From f7034d60fa62cc80fb5e4df760d5bba05d3351c9 Mon Sep 17 00:00:00 2001 From: Mathieu Bresciani Date: Wed, 3 Apr 2024 13:27:54 +0200 Subject: [PATCH 5/6] rephrase manual trimming --- en/config_fw/trimming_guide_fixedwing.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/en/config_fw/trimming_guide_fixedwing.md b/en/config_fw/trimming_guide_fixedwing.md index 843eaa46b8a3..2abe25efb192 100644 --- a/en/config_fw/trimming_guide_fixedwing.md +++ b/en/config_fw/trimming_guide_fixedwing.md @@ -33,11 +33,10 @@ The correct order to set the above parameters is: If you are using an airspeed sensor, also set the correct cruise airspeed (`FW_AIRSPD_TRIM`). 1. Run [auto-trimming](#auto-trimming) during a flight to set `TRIM_ROLL`, `TRIM_PITCH` and `TRIM_YAW`. - You could also manually set the pitch trim (`TRIM_PITCH`) by looking 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). - 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_ROLL/PITCH/YAW` (and remove the trims from your transmitter) or update `TRIM_ROLL/PITCH/YAW` directly during flight via telemetry and QGC. + Alternatively, if you feel comfortable flying in manual mode, you can also set the trim values manually: + 1. Disable auto-trimming using [FW_ATRIM_MODE](../advanced_config/parameter_reference.md#FW_ATRIM_MODE). + 1. Fly in manual mode and trim your remote (with the trim switches). + 1. Report the values to `TRIM_ROLL/PITCH/YAW` (and remove the trims from your transmitter) or update `TRIM_ROLL/PITCH/YAW` directly during flight via telemetry and QGC. ### Auto-trimming From 4b7599410ba35067a9296d62aa1a1de4db28125e Mon Sep 17 00:00:00 2001 From: Hamish Willee Date: Thu, 4 Apr 2024 10:29:34 +1100 Subject: [PATCH 6/6] Apply suggestions from code review --- en/config_fw/trimming_guide_fixedwing.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/en/config_fw/trimming_guide_fixedwing.md b/en/config_fw/trimming_guide_fixedwing.md index 2abe25efb192..93943c13a85f 100644 --- a/en/config_fw/trimming_guide_fixedwing.md +++ b/en/config_fw/trimming_guide_fixedwing.md @@ -33,26 +33,29 @@ The correct order to set the above parameters is: If you are using an airspeed sensor, also set the correct cruise airspeed (`FW_AIRSPD_TRIM`). 1. Run [auto-trimming](#auto-trimming) during a flight to set `TRIM_ROLL`, `TRIM_PITCH` and `TRIM_YAW`. - Alternatively, if you feel comfortable flying in manual mode, you can also set the trim values manually: - 1. Disable auto-trimming using [FW_ATRIM_MODE](../advanced_config/parameter_reference.md#FW_ATRIM_MODE). + Alternatively, if you feel comfortable flying in [Manual mode](../flight_modes_fw/manual.md), you can also set the trim values manually: + 1. Disable auto-trimming by setting [FW_ATRIM_MODE=0](../advanced_config/parameter_reference.md#FW_ATRIM_MODE). 1. Fly in manual mode and trim your remote (with the trim switches). - 1. Report the values to `TRIM_ROLL/PITCH/YAW` (and remove the trims from your transmitter) or update `TRIM_ROLL/PITCH/YAW` directly during flight via telemetry and QGC. + 1. Report the values to `TRIM_ROLL/PITCH/YAW` (and remove the trims from your transmitter), or update `TRIM_ROLL/PITCH/YAW` directly during flight via telemetry and QGC. ### Auto-trimming -Auto-trimming is enabled by default. -On first flight, auto-trimming estimates the current trim of the aircraft, and then updates the general trim parameters (`TRIM_ROLL`, `TRIM_PITCH` and `TRIM_YAW`) with calibrated values after landing. +Auto-trimming estimates the "center trim" at cruise speed (usually), and is enabled by default. +On first flight (in "Calibration" mode), auto-trimming estimates the current trim of the aircraft, and then updates the general trim parameters (`TRIM_ROLL`, `TRIM_PITCH` and `TRIM_YAW`) with calibrated values after landing. The trim estimate is only updated when the aircraft flies with a bank angle of less than 10 degrees for more than 7 seconds. So for the first calibration flight you should fly large circles or several phases of straight and level flight. -On subsequent flights auto-trimming continuously estimates the trim and slowly updates the stored trim parameters. -This reduces the constant load on the integrator of the angular rate control loop. +On subsequent flights (in "Continuous" mode), auto-trimming continuously estimates the trim, reducing the constant load on the integrator of the angular rate control loop if the trim calibration was imperfect or if the trim has changed. +In this mode the stored trim parameters are updated gradually — the maximum change to the trim parameters following each flight is 0.05. Auto-trimming is enabled using [FW_ATRIM_MODE](../advanced_config/parameter_reference.md#FW_ATRIM_MODE). This parameter is set to `(1) Calibration` (trim parameters are replaced by the trim estimate on landing) for the first flight and is then automatically changed to `(2) Continuous` mode (trim estimate is used to slowly update the existing trim parameters). +The trims can be reset by setting the `TRIM_ROLL`, `TRIM_PITCH` and `TRIM_YAW` back to `0` and `FW_ATRIM_MODE` to `1`. +This should not normally be necessary as the trims are continuously corrected. + ## 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.