Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FW auto-trimming doc #3146

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions en/config_fw/trimming_guide_fixedwing.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,30 @@ 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`).
Set that value to the average offset of the pitch signal during wing-leveled flight.
1. Run [auto-trimming](#auto-trimming) during a flight to set `TRIM_ROLL`, `TRIM_PITCH` and `TRIM_YAW`.

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.
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.

### Auto-trimming
hamishwillee marked this conversation as resolved.
Show resolved Hide resolved

<Badge type="warning" text="main (PX4 v1.15)" />
bresch marked this conversation as resolved.
Show resolved Hide resolved

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 (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
hamishwillee marked this conversation as resolved.
Show resolved Hide resolved

Expand All @@ -48,6 +67,6 @@ For this purpose, a bilinear curve function of airspeed and a pitch trim increme
![Dtrim Curve](../../assets/config/fw/fixedwing_dtrim.png)

<!-- The drawing is on draw.io: https://drive.google.com/file/d/15AbscUF1kRdWMh8ONcCRu6QBwGbqVGfl/view?usp=sharing
Request access from dev team. -->
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.
8 changes: 8 additions & 0 deletions en/releases/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, that if this is going into v1.15 we'll have to move this text to releases/v1.15.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).

bresch marked this conversation as resolved.
Show resolved Hide resolved
### Rover

Expand Down
Loading