Commit Graph

242 Commits

Author SHA1 Message Date
Paul Riseborough 3f7071772e AP_TECS: Assume flight at cruise speed if speed measurement not available 2022-09-26 14:17:53 +10:00
Joshua Henderson e338e4cdb6 AP_TECS: use TECS log bitmask in constructor 2022-08-09 09:44:50 +10:00
Ryan Beall 033266f94b TECS.cpp: Remove redundant throttle saturation 2022-07-23 18:23:27 -07:00
murata 531e92db8f AP_TECS: Unify coding style for if statements 2022-07-01 11:54:46 -07:00
Ryan Beall 77f922a1ae AP_TECS.cpp: remove line copy error
This was a copy paste error that is duplicated in the correct spot (in line 530)
2022-06-30 20:06:33 +10:00
Ruffalo-sunghwan 286e0f261e AP_TECS : correct comment spelling 2022-05-24 20:27:45 +09:00
Peter Barker e1dd53eb17 AP_TECS: stop libraries including AP_Logger.h in .h files
AP_Logger.h is a nexus of includes; while this is being improved over
time, there's no reason for the library headers to include AP_Logger.h
as the logger itself is access by singleton and the structures are in
LogStructure.h

This necessitated moving The PID_Info structure out of AP_Logger's
namespace.  This cleans up a pretty nasty bit - that structure is
definitely not simply used for logging, but also used to pass pid
information around to controllers!

There are a lot of patches in here because AP_Logger.h, acting as a
nexus, was providing transitive header file inclusion in many (some
unlikely!) places.
2022-04-08 19:18:38 +10:00
Peter Hall 98c5704b92 AP_TECS: add reset throttle I function 2021-12-22 18:46:14 +11:00
Ryan Beall beecca8da9 AP_TECS: Connsider throttle saturation in height demand limiting 2021-11-25 15:02:09 +11:00
Samuel Tabor 27078bccda AP_TECS: Log input height demands. 2021-11-23 11:15:50 +11:00
Iampete1 e0f03a3e09 AP_TECS: no longer child of SpdHgtController 2021-11-13 08:05:39 +11:00
Iampete1 d69d493ea6 AP_TECS: use float for get_throttle_demand 2021-10-20 18:29:58 +11:00
Andrew Tridgell 61d5910d0a AP_TECS: mark logger Write() calls as streaming where appropriate 2021-08-18 10:20:03 +10:00
Andrew Tridgell a789bb372b AP_TECS: added get_max_sinkrate() API 2021-06-05 13:05:30 +10:00
Samuel Tabor 5865e010b0 AP_TECS: Ensure no throttle output if is_gliding flag is true when flying without airspeed. 2021-05-19 17:53:43 +10:00
TunaLobster 444c413803 AP_TECS: add missing letter in meta data 2021-05-18 11:12:49 +10:00
Samuel Tabor fb8ec292cd AP_TECS: Clarify TECS_THR_DAMP and TECS_LAND_TDAMP descriptions. 2021-03-03 18:05:22 +11:00
Peter Barker d26b2a6f9a AP_TECS: replace '@User: User' with '@User: Standard' 2020-09-22 14:56:04 +10:00
Tom Pittenger 8ae34a1977 AP_TECS: Don't fetch the land slewrate if it's not needed
Co-authored-by: WickedShell <Wicked.Shell.Scripts@gmail.com>
2020-07-31 10:30:17 -07:00
Samuel Tabor bbe01adc7e AP_TECS: Use LAND_THR_SLEW if appropriate. 2020-07-31 10:30:17 -07:00
Samuel Tabor 88d4aa34db AP_TECS: Move the throttle rate limit code to ensure rate limit is respected when exiting takeoff stage. 2020-07-15 09:34:40 -07:00
Samuel Tabor 3228cc3309 AP_TECS: Update descriptions of pitch feed-forward parameters. 2020-04-08 09:11:54 +10:00
Samuel Tabor d04c6cb02e TECS: Don't override the speedweight to 0 if synthetic airspeed is in use. 2020-04-08 09:11:54 +10:00
Samuel Tabor 684ee11fc3 AP_TECS: Add flags to indicate gliding flight, and use these with AP_Soaring. 2020-04-08 09:11:54 +10:00
Samuel Tabor dc8c062fbe AP_TECS: Correct an error in the SEBdot FF term. 2020-04-08 09:11:54 +10:00
Samuel Tabor 247738518e AP_TECS: Add a feed-forward term from adjusted demanded airspeed to nav pitch. 2020-04-08 09:11:54 +10:00
Samuel Tabor a27c99fab9 AP_TECS: Return the adjusted demanded airspeed. The aspd_error mavlink message now shows the rate-limited airspeed. 2020-04-08 09:11:54 +10:00
Rishabh eeb55f8b16 TECS: Logger documentation TimeUS fix 2020-04-07 18:57:01 +10:00
Peter Barker 2b5f15fe78 AP_TECS: add missing field documentation in TECS and TEC2 2020-03-22 18:35:14 +11:00
Henry Wurzburg 8155f5dcbf AP_TECS: fix typos in logger message meta-data 2020-03-22 10:04:53 +11:00
Peter Barker 6c56f24e30 AP_TECS: add documentation for TECS and TEC2 2020-03-20 13:05:46 +11:00
Andrew Tridgell 176d3c0b2f AP_TECS: added reset() method
used at end of VTOL takeoff
2020-02-16 17:04:07 +11:00
Peter Hall 0afa144f80 AP_TECS: move to airspeed_estimate with pointer 2020-01-14 22:34:37 -07:00
Andrew Tridgell a415423975 AP_TECS: removed TECS_LAND_PMIN
thanks to TunaLobster for pointing out that it is redundent
2019-11-19 07:50:40 +11:00
Andrew Tridgell 3e72538f07 AP_TECS: added TECS_LAND_PMIN for min pitch in flare
this is useful to narrow the range of available pitch after flare
2019-10-26 18:05:17 +11:00
Andrew Tridgell 4f243aca02 AP_TECS: prevent rapid changing of pitch limits on landing approach
when on landing approach we estimate time to flare based on two noisy
numbers, the vertical speed and height above ground. With noisy
rangefinders this can change rapidly, which resulted in the pitch
limit changing rapidly, leading to a porpoising movement

this limits the rate of change, and also prevents it coming down once
it has nosed up due to pending flare on approach
2019-08-01 11:28:22 +10:00
Andrew Tridgell 4fd3008b4e AP_TECS: log pitch limits 2019-08-01 11:28:22 +10:00
Andrew Tridgell 3c8ed3d8e1 AP_TECS: fixed flare pitch limits
when limits are out of bounds
2019-08-01 11:28:22 +10:00
Andrew Tridgell d72ded4a9e AP_TECS: prevent numerical error with zero max throttle 2019-08-01 11:28:22 +10:00
Andrew Tridgell 587aa33617 AP_TECS: added TECS_OPTIONS
used for full-time glider
2019-08-01 11:28:22 +10:00
Andrew Tridgell df0cc40bba AP_TECS: allow TECS_PITCH_MAX to be negative 2019-08-01 11:28:22 +10:00
Peter Barker c0f25a96fb AP_TECS: move include of logger to .cpp file 2019-07-09 10:57:20 +10:00
Michael du Breuil ca65b214af AP_TECS: Include needed AP_Baro.h 2019-06-27 14:56:21 +10:00
Andrew Tridgell c3545be8a1 AP_TECS: fixed a bug in changes from rate-limited to non-limited airspeed
The calculation of the non-limited airspeed rate demand used the last
non-limited airspeed, whereas it should have used the last adjusted
value. This led to a single frame spike in airspeed demand, which fed
through to a sudden change in pitch integrator.
2019-04-01 12:14:25 +11:00
Andrew Tridgell 6898ec5776 AP_TECS: prevent airspeed demand spikes causing large pitch changes
a short term spike in the derivative of speed demand could cause the
constraint on the pitch integrator to push the pitch integrator to
very low values, causing a sharp nose down which takes a long time to
recover from
2019-03-31 21:05:09 +11:00
Nathan E 9ae5ada82f Correct AP_TECS.cpp typos per magicrub comments
poper changed to proper
2019-01-23 09:24:18 -07:00
Nathan E 24f3abde99 Update AP_TECS.cpp 2019-01-23 09:24:18 -07:00
Peter Barker 6fc76a32af GLOBAL: use AP::logger() and strip redundant Log_ from methods 2019-01-18 18:08:20 +11:00
Peter Barker b47733142f GLOBAL: rename DataFlash_Class to AP_Logger 2019-01-18 18:08:20 +11:00
Andrew Tridgell 60ec695f55 AP_TECS: set default pitch max to 15 2018-08-17 20:42:29 +10:00
Andrew Tridgell f3336fdb60 AP_TECS: removed dependency on soaring controller 2018-07-30 13:09:15 +10:00
Peter Barker f0daf392a5 AP_TECS: use ins singleton 2018-03-16 00:37:35 -07:00
Peter Barker ffcb9ce945 AP_TECS: use baro singleton 2018-03-08 21:20:05 -08:00
Andrew Tridgell b6ecce8329 AP_TECS: removed create() method for objects
See discussion here:

  https://github.com/ArduPilot/ardupilot/issues/7331

we were getting some uninitialised variables. While it only showed up in
AP_SbusOut, it means we can't be sure it won't happen on other objects,
so safest to remove the approach

Thanks to assistance from Lucas, Peter and Francisco
2017-12-14 08:12:28 +11:00
Peter Barker 22f1b5ed6f TECS: support for units on fields 2017-11-23 10:40:30 +11:00
Andrew Tridgell 5bd92b4b7e AP_TECS: improved support for VTOL transitions 2017-10-21 18:50:01 +11:00
Lucas De Marchi 61a629d766 AP_TECS: add static create method 2017-09-26 03:01:21 +01:00
JU Han eebef857f1 AP_TECS: gain scaler K_STE2Thr multiplies by (THRmax - THRmin)
Makes both feed forward and feed-back consistent
2017-08-15 14:27:43 +01:00
Andrey Kolobov 5fdebe23cc AP_TECS: disable bad descent for soaring 2017-03-14 08:53:11 +11:00
akolobov a3f3097941 AP_TECS: added function to reset integrator 2017-03-14 08:20:48 +11:00
Michael du Breuil 666c63da9f AP_TECS: Update for AHRS NED changes 2017-02-13 09:23:14 +11:00
Tom Pittenger 61bc0a6206 Plane: check stage==LAND instead of landing.in_progress 2017-01-26 13:11:44 -08:00
Tom Pittenger bf835c7aee AP_TECS: abstract out the landing stage checks 2017-01-26 13:11:43 -08:00
Tom Pittenger d1434602a5 AP_TECS: bug fix - use takeoff integrator during land abort 2017-01-26 13:11:43 -08:00
Tom Pittenger 063f517424 Plane, TECS, AP_Landing: rename stage LAND_ABORT to ABORT_LAND
this will reduce confusion when searching for FLIGHT_LAND_* and you get a bunch of takeoff related hits. It will also make more sense when the landing library fully manages the FLIGHT_LAND stage entirely because it will not mange FLIGHT_LAND_ABORT
2016-12-30 23:50:03 -08:00
Tom Pittenger 84e11fd899 Plane, AP_TECS: do not pass auto_land flag to TECS, it already knows it 2016-12-30 23:50:03 -08:00
Tom Pittenger 8019cedf5b AP_Vehicle,AP_SpdHgtControl,AP_TECS: move enum FlightStages to AP_Vehicle::FixedWing 2016-12-30 23:50:02 -08:00
Tom Pittenger b614b41d6d AP_TECS: fixed compiler warning
- AP_Landing _landing was declared out-of-order
2016-12-05 16:46:55 -08:00
Tom Pittenger c7bbb6998a TECS: set landing params as private and use accessors 2016-11-25 19:07:30 -08:00
Tom Pittenger 9035dcbbc5 AP_TECS: migrate aparm "LAND_" params from plane to AP_Landing 2016-11-25 19:07:30 -08:00
Peter Barker daf9a45efd AP_TECS: correct parameter metadata
Correct incomplete Description of LAND_PDAMP

Add DisplayName for LAND_PDAMP
2016-10-27 09:15:03 -07:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
Andrew Tridgell 1171b33419 AP_TECS: added TECS_SYNAIRSPEED parameter
this allows for the synthetic airspeed estimate to be used in TECS
2016-10-20 13:22:39 +11:00
Andrew Tridgell 7ee42d3a7e AP_TECS: fixed missing doc comment 2016-10-20 13:22:22 +11:00
Andrew Tridgell 2fab15dcd5 AP_TECS: added use_synthetic_airspeed() API
used by quadplane during transitions
2016-10-05 11:52:34 +11:00
Tom Pittenger e5bd23e34a Revert "AP_TECS: Convert references to AP_Airspeed."
This reverts commit 09d53eaeca.
2016-08-07 17:54:24 -07:00
Tom Pittenger 8dad05d12e Revert "Airspeed: store reference in libraries and populate it"
This reverts commit c090ba2257.
2016-08-07 17:54:24 -07:00
Tom Pittenger c090ba2257 Airspeed: store reference in libraries and populate it
- also had to move the initial definition in plane.h so it happened before the others.
2016-08-04 11:06:44 -07:00
AndersonRayner 09d53eaeca AP_TECS: Convert references to AP_Airspeed. 2016-08-04 10:09:04 -07:00
Murilo Belluzzo d8b58690ad AP_TECS: Remove useless 'if' statement
This should fix CID 91386.

Before removing the 'if', I checked the log to confirm that both branch
didn't end-up being equal by mistake in some commit. But it looks like
the file was added in the project this way.
2016-07-25 18:51:56 -03:00
Tom Pittenger 7be15be185 AP_TECS: slew the hgt_lag_filter when starting a land 2016-07-19 17:19:10 -07:00
Andrew Tridgell 2527859b59 AP_TECS: update comment on underspeed clearing 2016-07-20 08:21:08 +10:00
Andrew Tridgell d3d2ce3e0d AP_TECS: use full throttle in initial takeoff
during the first part of a takeoff when we have not yet reached the
target airspeed this forces the throttle to maximum. This fixes a case
where the throttle may drop too low during the first part of takeoff
and lead to a stall.
2016-07-16 08:14:29 +10:00
Tom Pittenger 773372d2f3 Revert "AP_TECS: coverity scan - variables not initialized in constructor"
This reverts commit 753c0d47f0.
2016-07-11 22:01:26 -07:00
Tom Pittenger c38c3ae7fe Revert "AP_TECS: coverity scan: init variable struct"
This reverts commit 19713200e5.
2016-07-11 22:01:02 -07:00
Tom Pittenger 19713200e5 AP_TECS: coverity scan: init variable struct 2016-07-05 14:09:40 -07:00
Tom Pittenger 6d0cf22358 AP_TECS: spelling 2016-07-05 14:09:39 -07:00
Tom Pittenger 753c0d47f0 AP_TECS: coverity scan - variables not initialized in constructor 2016-07-05 13:53:26 -07:00
Tom Pittenger 3c6323dd82 AP_TECS: Log TEC2.LF as Aerodynamic Load Factor 2016-05-17 20:17:27 -07:00
Tom Pittenger f9335e9d8c AP_TECS: fixed float->double print warning 2016-05-17 15:58:03 -07:00
Andrew Tridgell 98a86bd205 AP_TECS: create TEC2 log message for detailed energy internals 2016-05-14 08:26:10 +10:00
Andrew Tridgell ff97f52555 AP_TECS: removed log_tuning structure 2016-05-14 08:26:10 +10:00
Andrew Tridgell bc911d15d1 AP_TECS: convert to using Log_Write
preparation for a TEC2 message
2016-05-14 08:26:10 +10:00
Andrew Tridgell 9a6ac77c64 AP_TECS: prevent large glitches in the specific energy integrator
this tries to prevent problems like in issue#4066, or at least
reducing the impact when it happens
2016-05-14 08:26:10 +10:00
Andrew Tridgell c52451b01b AP_TECS: rename some variables to make them clearer 2016-05-14 08:26:09 +10:00
Andrew Tridgell e698d1f47e AP_TECS: use 64 bit micros
prevent possible wrap if TECS is not run for a long time
2016-05-14 08:26:09 +10:00
Tom Pittenger 431b3c7160 AP-TECS: constrain proportion to 0-1 for spdweight scale so it doesn't grow backup after land point 2016-04-21 21:31:02 -07:00
Tom Pittenger 595badce3e AP_TECS: rely on single flag for all land stage differences
recent fixes in Plane have made the stage more accurate so exceptions/hacks are no longer needed to differentiate between knowing if executing NAV_LAND vs being in stage_approach.
2016-04-21 21:30:52 -07:00
Tom Pittenger 0af878703f AP_TECS: move target land_airspeed logic to top layer 2016-04-21 21:30:49 -07:00
Tom Pittenger 525c7b24e3 AP_TECS: created accessor for TECS_LAND_ARSPD param 2016-04-21 21:30:48 -07:00