Commit Graph
12 Commits
Author SHA1 Message Date
Silvan Fuhrer b4134d75f2 feat(tecs): don't trade altitude for speed above trim airspeed (#29009)
* fix(tecs): don't trade altitude for speed above trim airspeed

With an airspeed setpoint above trim and the throttle at `FW_THR_MAX`, TECS pitches down to
keep chasing the setpoint and settles below the altitude setpoint.
Accelerating above trim should be the throttle's job; losing altitude at high speed is not wanted.

The pitch loop now sees the airspeed setpoint capped at max(trim, current airspeed);
the throttle loop still tracks the full setpoint. Below trim, pitch still trades height for speed, up to trim.
Overspeed above the setpoint is still corrected with pitch.
The cap fades out as the effective `FW_T_SPDWEIGHT` goes from 1 to 2, so gliders (weight 2),
fast descend and underspeed recovery keep using pitch to reach their airspeed.
The behaviour is documented in the TECS docs and the `FW_T_SPDWEIGHT` description.

Signed-off-by: Silvan <silvan@auterion.com>

* fix(tecs): use tas and not tas_sp for the pitch loop

Signed-off-by: Silvan <silvan@auterion.com>

* fix(tecs): don't counter throttle acceleration with pitch above trim

Capping the pitch loop's airspeed setpoint at max(trim, airspeed) keeps
pitch from diving to gain speed, but between trim and the setpoint the
throttle's acceleration still shows up in the kinetic energy rate
estimate. Against a kinetic energy rate setpoint of zero, the pitch loop
then pitches up and turns the throttle's energy into height. At a speed
weight of 1 this halves the acceleration and lifts the vehicle above the
altitude setpoint while accelerating.

Remove the kinetic term, setpoint and estimate, from the pitch loop
between trim and the setpoint, so pitch controls height only there. As
for the cap, this fades out with speed priority.

Point-mass simulation with the TECS defaults, speed step from 15 m/s:
- to 20 m/s: 95% of the step in 21 s instead of 37 s, 1.2 m instead of
  2.4 m above the altitude setpoint
- to 28 m/s, above the 24.7 m/s the vehicle can reach: 2.2 m instead of
  5.2 m above the altitude setpoint, still no altitude loss
- deceleration, climbs, a speed weight of 2 and cruise at trim are
  unchanged; in turbulent cruise above trim the pitch rate RMS is 6%
  higher, as the kinetic term switches when the airspeed crosses the
  setpoint

The remaining rise comes from the lift gained with speed at constant
pitch, which only altitude feedback corrects.

Assisted-by: Claude:claude-opus-5-5

* fix(tecs): fade the pitch loop's kinetic setpoint only once

Between trim airspeed and the airspeed setpoint, the capped pitch loop
setpoint already fades the kinetic energy rate setpoint in with the
speed weight between 1 and 2. Scaling it by the same fade factor again
faded the setpoint quadratically but the estimate only linearly, so at a
speed weight of 1.5 the pitch loop countered acceleration it should only
half ignore. Scale only the estimate.

Speed weights up to 1 and of 2 are unaffected. In a point-mass
simulation at a speed weight of 1.5, a step from 15 to 20 m/s now takes
30 s instead of 37 s and rises 1.6 m instead of 2.4 m, between the
results at weights 1 and 2 instead of worse than both.

Assisted-by: Claude:claude-opus-5-5

* docs(tecs): show the pitch and throttle speed roles in a diagram

The paragraph on how pitch and throttle share speed control above trim
was hard to follow. Show the three regions of measured airspeed (below
trim, between trim and the setpoint, above the setpoint) with what the
pitch and throttle loops do in each, and describe each region in its own
bullet. Also state that there is no middle region with a setpoint at or
below trim.

Assisted-by: Claude:claude-opus-5-5

---------

Signed-off-by: Silvan <silvan@auterion.com>
2026-10-15 08:33:02 +02:00
Silvan 357fe278ab docs(tecs): separate specific and normalised energy rates
The docs called the energy rate divided by m*g*V "specific", while the
code and its comments use "specific" for per unit mass (m^2/s^3). Define
both, and say which one TECS uses where.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Silvan <silvan@auterion.com>
2026-10-13 11:36:46 +02:00
Gennaro Guidone 2a0e048171 feat(mc_att_control): feedforward filtered q_d derivative on rate sp (#27255)
Add a 2nd-order critically-damped attitude reference model whose angular-velocity output is fed forward onto the rate setpoint, removing the steady-state ramp-tracking lag of the pure-P attitude law. The model uses an exact closed-form discretisation, so it is unconditionally stable.

Parameters:
- MC_REF_W_N     reference-model bandwidth [rad/s]
- MC_REF_FF      feedforward gain [0..1]; 0 disables the anticipation
- MC_REF_FF_MAX  per-axis feedforward saturation [deg/s]

The commanded yaw rate is always fed forward at unity (it is a setpoint, not a model prediction), so MC_REF_FF scales only the error-driven anticipation and MC_REF_FF=0 is the exact legacy pure-P law. Shipped disabled by default to avoid changing behaviour on existing platforms; enable per-airframe. Includes docs and the updated controller diagram.
2026-06-26 10:57:48 +02:00
PX4BuildBot b066181512 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-03-17 17:54:55 +00:00
ttechnick c5b8eee4c3 fix(fw_att_control): fix comments / docs 2026-03-17 17:59:20 +01:00
ttechnick 82bf75df0f docs(fw_att_ctrl): update quat turn coordination
fix(fw_att_control): use correct formula
2026-03-17 17:59:20 +01:00
ttechnick fdf258c2aa docs(fw_att_control): update docs 2026-03-17 17:59:20 +01:00
ttechnick 11ffa179bb docs(fw_att_control): update docs 2026-03-17 17:59:20 +01:00
Hamish Willee b37733459d docs: Codespell check on English sources + swd fixes (#26657) 2026-03-05 12:50:59 +11:00
PX4BuildBot e945c91f88 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-11 23:08:10 +00:00
PX4BuildBot 36b5e1e1bb docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-11 22:43:01 +00:00
Hamish WilleeandRamon Roche 88d623bedb 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>
2025-03-13 16:08:27 +11:00