Commit Graph

242 Commits

Author SHA1 Message Date
Eric Katzfey ede51888b0 AP_TECS: Removed an unused variable to get rid of a compiler warning 2024-12-14 15:42:46 +11:00
Peter Barker 9835fe80d6 AP_TECS: correct comment explaining roll-induced-drag scaling
Co-authored-by: George Zogopoulos <tailwhipx4@gmail.com>
2024-12-14 10:11:09 +11:00
Peter Barker 1ab0dcd45d AP_TECS: remove unneccessary sqrtf in Phi calculations
we take the square of this in the only use of it
2024-12-14 10:11:09 +11:00
George Zogopoulos 2f9ff3ef73 Plane: Call new TECS method in case of altitude change 2024-11-27 19:35:03 +11:00
George Zogopoulos 5b8a702b54 AP_TECS: Added method to handle home altitude change 2024-11-27 19:35:03 +11:00
George Zogopoulos 0f9268c6c8 AP_TECS: Delete redundant _hgt_afe setting 2024-11-27 19:35:03 +11:00
Peter Barker 4c72ca6ddc AP_TECS: make _EAS a local variable
not used outside this one function

Co-authored-by: Michelle Rossouw <michelleros128@gmail.com>
2024-11-16 08:50:56 +11:00
George Zogopoulos 68003a5eb4 AP_TECS: Reverted pitch limitation order 2024-10-02 17:09:07 +10:00
George Zogopoulos 121adf5f6d AP_TECS: Throttle limits refactor 2024-10-02 17:09:07 +10:00
George Zogopoulos 880ebbcdad AP_TECS: Takeoff improvements
- Refactor and split set_pitch_max_limit method.
- New _update_pitch_limits to encapsulate all relevant functionality.
- Automatically reset if pitch and throttle are overriden.
- nullified TAKEOFF alt_dem offset on external throttle.
- Simplify use of TKOFF_THR_MIN.
- Prevent takeoff altitude overshoot by capping the altitude setpoint offset.
- Move pitch limits after vertical acceleration limitation.
2024-10-02 17:09:07 +10:00
George Zogopoulos e227187e72 AP_TECS: Converted parameter TKOFF_MODE to TKOFF_OPTIONS 2024-07-29 15:50:32 +10:00
George Zogopoulos b163e13964 AP_TECS: Fixes to reset state
These concern the TAKEOFF flight stage and address #27147.

* Logging metadata fixes
* Disabled continuous TECS reset during takeoff
* Fixed bug in reached_speed_takeoff calculation
* Limited SPDWEIGHT=2 to only first part of takeoff climb
* _post_TO_hgt_offset set to constant
* Takeoff I-gain now defaults to 0 and is used
* Use at least TRIM_THROTTLE during the climb
* Updated description of TECS_TKOFF_IGAIN with new behaviour
* Forced max throttle while below TKOFF_LVL_ALT
* Added throttle constraints in no-airspeed mode

Additionally, set_min_throttle() has been created, that allows one to
set the minimum TECS throttle for the next update_pitch_throttle() loop.
Additionally, the throttle limits system has been reworked. TECS will
receive external throttle limits from Plane and will always take them
into account and respect them.
2024-07-29 15:50:32 +10:00
Michael du Breuil edaddc0431 AP_TECS: Use aircraft stall speed
When stall prevention is enabled we were scaling from the aircraft's
minimum flight speed. However this is normally already picked as being
above the stall speed, and for a variety of reasons we may want to pin
the aircraft at a higher minimum speed. But if the aircraft was
commanded to fly to close to that minimum speed as soon as it banked for
a pattern it would command a increase in speed to keep it away from
stalling. However if your minimum speed is far from stalling this
increase was incorrect. To make it worse what this actually results in
happening is an aircraft diving for more speed (over 10 m/s on some
aircraft) as well as descending to gain that speed resulting in over 200
foot deviations in altitude control.
2024-07-23 10:37:24 +10:00
George Zogopoulos 5ca8c0058c AP_TECS: Small legibility improvements
AP_TECS: Fixed bad whitespace
2024-06-20 09:12:50 +10:00
Andrew Tridgell eadf5596ed AP_TECS: fixed adjusting speed without airspeed sensor
the pitch trim variable that was not connected in aparm is needed to
allow tuning of the flight speed using PTCH_TRIM_DEG and
TRIM_THROTTLE.

This was broken in 4.4.x by this PR:

https://github.com/ArduPilot/ardupilot/pull/22191
2024-03-03 20:28:38 +11:00
Paul Riseborough 870c6c5080 AP_TECS: Remove unused variable 2024-02-26 09:20:12 +11:00
Paul Riseborough aecbd116e7 AP_TECS: Add /0 protection 2024-02-26 09:20:12 +11:00
Paul Riseborough 846eaecc0b AP_TECS: Add option for speed to increase up to FBW max during descent 2024-02-26 09:20:12 +11:00
Andrew Tridgell f51fa31aae AP_TECS: fixed param names in comments 2024-01-23 15:00:30 +11:00
Andrew Tridgell 2c73c56403 AP_TECS: convert LAND_PITCH_CD to LAND_PITCH_DEG 2024-01-23 15:00:30 +11:00
Andrew Tridgell 7d5685c55f AP_TECS: convert LIM_PITCH_MIN/MAX -> PTCH_LIM_MIN/MAX_DEG 2024-01-23 15:00:30 +11:00
Andrew Tridgell d65809ffc1 AP_TECS: convert ARSPD_FBW_MIN/MAX to AIRSPEED_MIN and AIRSPEED_MAX 2024-01-23 15:00:30 +11:00
Andrew Tridgell c8813677b3 AP_TECS: convert remaining uses of TRIM_ARSPD_CM to AIRSPEED_CRUISE 2024-01-23 15:00:30 +11:00
Andrew Tridgell b1e6c1de41 AP_TECS: change TRIM_ARSPD_CM to AIRSPEED_CRUISE 2024-01-23 15:00:30 +11:00
Tim Tuxworth b1c8511386 AP_TECS: use new pitch_trim in degrees 2024-01-23 15:00:30 +11:00
Peter Barker 512c1f030f AP_TECS: allow compilation with HAL_LOGGING_ENABLED false 2024-01-17 18:25:55 +11:00
Peter Barker 7f43facb37 AP_TECS: make AHRS attitude member variables private 2024-01-14 12:47:47 +11:00
coleschon af898220e7 AP_TECS: improve velRateMin scaling wrt airspeed 2024-01-08 17:10:28 +11:00
Iampete1 97101b6bd0 TECS: move to new `using_airspeed_sensor` ahrs method 2023-10-31 10:39:21 +11:00
Mark Agate 31bc321b70 AP_TECS: log SKE weight since both weights are now [0,1] 2023-10-24 10:44:12 +11:00
Andrew Tridgell 4a181ede62 AP_TECS: fixed descent or lack of climb bug
this fixes a state where we either cannot climb or descend in an
uncontrolled manner in a TECS controlled mode

the conditions under which this happened were:

- _use_synthetic_airspeed_once was true due to quadplane takeoff
- we left _thr_clip_status as MAX from previous use of synthetic airspeed
- then run without airspeed

note that this can also impact users with an airspeed sensor if they
disable it or it fails in flight, particularly during a climb
2023-09-28 20:37:41 +10:00
Henry Wurzburg a901d23de4 AP_TECS: correct/expand param metadata re synth airspeed 2023-09-26 09:04:51 +10:00
Peter Barker 99012bd525 AP_TECS: ensure good TECS state before running update_pitch_throttle
update_pitch_throttle can be called when update_50hz hasn't run in a very long time, or ever.  This requires a main loop rate >50Hz, and for the mode change to occur in the same loop that update_50Hz doesn't run but update_pitch_throttle does.
2023-09-10 12:32:13 +10:00
Andy Piper 2e2491f4ff AP_TECS: remove unused variables 2023-07-13 11:02:40 +10:00
Henry Wurzburg 5df9b8abf1 AP_TECS: set FW landing speed if not set 2023-07-04 10:24:30 +10:00
Henry Wurzburg 5dc7bfc718 AP_TECS: correct metadata for FLARE_HGT 2023-04-11 08:54:45 +10:00
Iampete1 6d552a32d7 AP_TECS: protect against low airspeed in reset 2023-02-19 10:20:03 -08:00
Ryan Beall 1d70180809 AP_Landing: Add Landing Max Throttle Option 2023-01-24 10:19:56 +11:00
Ryan Beall 4355d852b1 AP_TECS: Update documentation to alert user of maximum allowed 2023-01-24 10:19:56 +11:00
Andrew Tridgell abb3cdd6b8 AP_TECS: added max throttle time for takeoff with no airspeed sensor 2023-01-15 12:17:27 +11:00
Paul Riseborough 403d51b39f AP_TECS: Remove unused TECS_LAND_PTRIM parameter 2022-12-06 10:23:59 +11:00
Paul Riseborough 93ae6f1739 AP_TECS: Remove duplicate setting of flare pitch upper limit 2022-12-01 15:19:27 +11:00
Paul Riseborough dab61bf3ef AP_TECS: Fix flare initialisation bug 2022-12-01 15:19:27 +11:00
Paul Riseborough 9234e5168f AP_TECS: Fix TECS_OPTIONS documentation 2022-11-18 05:43:59 +11:00
Paul Riseborough d449ed885a AP_TECS: Protect against too small values of TECS_HDEM_TCONST 2022-11-18 05:43:59 +11:00
Paul Riseborough ec9445757e AP_TECS: Fix TECS_LAND_PTRIM documentation typos 2022-11-18 05:43:59 +11:00
Paul Riseborough 0840bf5a21 AP_TECS: Implement improved control loops 2022-11-18 05:43:59 +11:00
Peter Barker d438cd9ed2 AP_TECS: change namespace of MultiCopter and FixedWing params
this stops the libraries knowing anything about AP_Vehicle
2022-11-09 19:04:37 +11:00
Iampete1 3e8e846d1d AP_TECS: reset vdot filter if not been called 2022-10-11 10:41:25 +11:00
jackhong12 4a4f361a17 all: use CLASS_NO_COPY() macro 2022-10-04 11:23:04 +11:00