Commit Graph

347 Commits

Author SHA1 Message Date
Andrew Tridgell 724301ea53 APM_Control: make 2nd reduction of P smaller
this prevents severe P reductions when we get a small oscillation
glitch after we've already got the primary P gain
2021-11-30 10:31:34 +11:00
Randy Mackay e85a95f21c AR_AttitudeControl: reduce some param defaults
These reductions are based on experirence helping users setup new vehicle.  In the vast majority of cases the existing values are too high

STEER_ANG_P is the default for the angle-to-rate controller and is used during pivot turns.  This value may still be slightly too high.
STEER_RATE_MAX is the maximum turn rate so the new value allows a 360 turn in 3 seconds
STEER_ACCEL_MAX is the acceleration for the turn rate meaning a vehicle can get to 120 deg/sec in 1 sec
THR_ACCEL_MAX is the maximum acceleration.  This new value means a vehicle can accelerate to 1m/s in 1 second.
2021-11-17 19:18:23 +11:00
Randy Mackay 9c54b3d252 AR_AttitudeControl: move param defines from .h to .cpp 2021-11-17 19:18:23 +11:00
Andrew Tridgell 8a73bdcbe6 APM_Control: suppress roll/pitch D term in ground_mode
prevent oscillations which are quite common
2021-10-30 18:45:53 +11:00
Iampete1 a590a675d6 AP_RollController: return floats 2021-10-20 18:29:58 +11:00
Iampete1 da4fd7a914 AP_PitchController: return floats 2021-10-20 18:29:58 +11:00
Andrew Tridgell 08fcfa04ae APM_Control: only save autotune gains when P finished
this prevents saving values which are temporarily high due to tuning
process

See this bug report
https://discuss.ardupilot.org/t/plane-4-1-0-stable/76507/45
2021-10-10 19:00:57 +11:00
Ben Wolsieffer 68ee2c21dd AP_Control: apply pitch rate limit to turn coordination
At high bank angles, for example when rolling to/from inverted, a large turn
coordination pitch rate offset is requested. Before this patch, this offset was
not subject to the configured pitch rate limit, which could result in pitch
controller integrator windup.
2021-09-29 17:03:32 +01:00
Randy Mackay 570c12215d AR_AttitudeControl: fix get_throttle_out_speed use of passed in limits 2021-09-10 07:50:00 +09:00
Peter Barker 066ad0f8da APM_Control: remove unused variables 2021-08-23 08:39:41 +09:00
Andrew Tridgell 47854ac4b7 APM_Control: lower the tuning trigger threshold
this allows for slower stick movements during tuning

This is based on analysing the log from kir850 on rcgroups
2021-07-31 10:01:14 +10:00
Iampete1 bb624074dd APM_Control: remove outdated tuning guide 2021-07-28 18:26:31 +10:00
Andrew Tridgell 45cf726a4b APM_Control: new autotune scheme
this separately tunes D and then P, which more closely follows the
technique used for a manual tune
2021-07-24 15:32:55 +10:00
Peter Barker d2102ce9b7 APM_Control: stop taking references to ahrs in APM_Control 2021-07-21 18:27:23 +10:00
Andrew Tridgell 1633afb6cd APM_Control: adjust fixed wing filter defaults
adjust defaults based on discussions with Paul, and initialise the
FLTT value based on the controller time constant
2021-07-05 20:07:47 +10:00
Andrew Tridgell cd43c0ecef APM_Control: use FF to increase but not reduce tau in autotune
if user wants a slow time constant we should not override
2021-05-25 12:14:38 +10:00
Hwurzburg 4f4389df2f APM_Control: make centideg metadata incr and range consistent 2021-05-25 10:10:18 +10:00
Iampete1 bc90ba5486 AR_AttitudeControl: get_steering_out_rate use abs speed for G limit 2021-05-19 16:02:20 +01:00
Randy Mackay b4fd9848df AR_AttitudeControl: add get_stop_speed accessor 2021-05-11 15:31:17 +09:00
Iampete1 980c41e273 APM_Control: G limit all turn rates 2021-05-03 19:22:16 -04:00
Andrew Tridgell f64c6f9ba1 APM_Control: fixed cygwin build
FF0 is a macro in cygwin
2021-04-15 06:57:16 +10:00
Andrew Tridgell 767a0b2a99 APM_Control: tweak the activation detection to catch more events 2021-04-15 06:57:16 +10:00
Andrew Tridgell bb1dc7192b APM_Control: lower default target filter frequencies
this will remove a lot of the level flight noise causing oscillation
at higher gains
2021-04-15 06:57:16 +10:00
Andrew Tridgell dd98f00947 APM_Control: prevent cross-axis tuning
this should fix tuning at higher AUTOTUNE_LEVEL values
2021-04-15 06:57:16 +10:00
Andrew Tridgell 320d3d20c2 APM_Control: log autotune at 25Hz 2021-04-15 06:57:16 +10:00
Andrew Tridgell 72b51a389c APM_Control: use ATRP log msg via structure 2021-04-15 06:57:16 +10:00
Andrew Tridgell 7b073a61f1 APM_Control: allow for gain reductions when idle 2021-04-15 06:57:16 +10:00
Andrew Tridgell 91856b1d8c APM_Control: prevent bad init of FF in autotune 2021-04-15 06:57:16 +10:00
Andrew Tridgell 3fdd507157 APM_Control: log I and prevent numercial errors in autotune 2021-04-15 06:57:16 +10:00
Andrew Tridgell 24d53eade4 APM_Control: adjust filter for autotune to 0.75 Hz
this should give a better FF estimate
2021-04-15 06:57:16 +10:00
Paul Riseborough 9e6561e6b5 APM_Control: Ensure adequate trim speed 2021-04-15 06:57:16 +10:00
Andrew Tridgell fa88967b6e APM_Control: adjust min value for tconst 2021-04-15 06:57:16 +10:00
Andrew Tridgell b079da33c5 APM_Control: use slew rate to move gains more smoothly 2021-04-15 06:57:16 +10:00
Andrew Tridgell 772b1262d4 APM_Control: added proportional reduction to D and P 2021-04-15 06:57:16 +10:00
Andrew Tridgell d561cd358f APM_Control: log RMAX and TAU 2021-04-15 06:57:16 +10:00
Andrew Tridgell d914ce6829 APM_Control: reset filters on autotune start 2021-04-15 06:57:16 +10:00
Andrew Tridgell 7e64875a02 APM_Control: tweak tuning settings 2021-04-15 06:57:16 +10:00
Andrew Tridgell ccd7b15d06 APM_Control: apply pitch limiting at high roll to rate
this fixes an issue with a large elevator trim error when rolled at
close to 90 degrees
2021-04-15 06:57:16 +10:00
Andrew Tridgell 4694820ac3 APM_Control: allow for smaller minimum tconst 2021-04-15 06:57:16 +10:00
Andrew Tridgell 97f88f67f6 APM_Control: allow for AUTOTUNE_LEVEL=0
this means keep the existing TCONST and RMAX parameters, if non-zero
2021-04-15 06:57:16 +10:00
Andrew Tridgell 316541017a APM_Control: fixed handling of clipped actuator in autotune 2021-04-15 06:57:16 +10:00
Andrew Tridgell 9997b191a8 APM_Control: log smoothed rates 2021-04-15 06:57:16 +10:00
Andrew Tridgell 20ef242280 APM_Control: fixed restore of tconst on autotune abort 2021-04-15 06:57:16 +10:00
Andrew Tridgell 53ee13a083 APM_Control: use instance logging and allow AUTOTUNE_LEVEL adjustments 2021-04-15 06:57:16 +10:00
Andrew Tridgell 70c194c358 APM_Control: fixed LoggerDocumentation test 2021-04-15 06:57:16 +10:00
Andrew Tridgell 0b76a8018f APM_Control: move rmax and tau more slowly 2021-04-15 06:57:16 +10:00
Andrew Tridgell 3cb32a18f0 APM_Control: fixed for cygwin build 2021-04-15 06:57:16 +10:00
Andrew Tridgell 364fa0680d APM_Control: use shorter tau for autotune higher levels 2021-04-15 06:57:16 +10:00
Andrew Tridgell f88622def8 APM_Control: implement new autotune system
use actuator/rate ratio with median filter for FF and Dmod/overshoot
for P,I,D
2021-04-15 06:57:16 +10:00
Andrew Tridgell 12fad55891 APM_Control: fixed pid_info for pitch controller 2021-04-15 06:57:16 +10:00
Andrew Tridgell ead011c7c2 APM_Control: move to only ACPID 2021-04-15 06:57:16 +10:00
Andrew Tridgell 6ca9033dde APM_Control: run AC_PID in parallel with old PID for roll/pitch 2021-04-15 06:57:16 +10:00
Randy Mackay f0ffaa5624 AR_AttitudeControl: reset speed filter and I term when stopped 2021-03-04 09:07:32 +09:00
Andrew Tridgell 9a244eef29 APM_Control: added SMAX param docs 2020-10-25 10:32:48 +11:00
Andrew Tridgell d2a4505184 APM_Control: fixed bug in slew filter 2020-10-25 10:32:48 +11:00
Peter Barker d20c6ceb3b APM_Control: replace '@User: User' with '@User: Standard' 2020-09-22 14:56:04 +10:00
Randy Mackay 2db57dffac AR_AttitudeControl: update param desc increment and range 2020-09-16 16:49:40 +09:00
Paul Riseborough 548bab5d24 APM_Control: Add gyro feedback limit cycle protection 2020-07-13 13:47:50 +10:00
Mark Whitehorn 442fa60651 APM_Control: validate parameter ARSPD_FBW_MIN 2020-04-02 19:43:06 -07:00
Peter Barker c9f2b9ff87 AR_AttitudeControl: correct spelling error in param docs 2020-03-16 17:44:35 +11:00
Peter Hall 84fe5f4e78 APM_Control: move to airspeed_estimate with pointer 2020-01-14 22:34:37 -07:00
Peter Hall c71cbe2729 APM_Control: AR_AttitudeControl: add description for new PID params 2019-09-23 09:45:46 +09:00
Peter Barker 7fbaea7971 APM_Control: wrap_180_cd no longer solely returns floats 2019-09-18 12:57:02 +10:00
Randy Mackay 1b533295a8 AR_AttitudeControl: minor comment fixes 2019-08-06 20:00:05 +09:00
Peter Hall 65d8047165 AR_AttitudeControl: fix sailboat heel PID 2019-08-06 20:00:05 +09:00
Leonard Hall 6f14673f08 APM_Control: support for upgrade to PID object 2019-07-25 17:38:15 +09:00
Leonard Hall 157f786adf Global: rename desired to target in PID info 2019-07-25 17:38:15 +09:00
Peter Barker cb692c6946 APM_Control: move logger include to .cpp 2019-07-09 10:57:20 +10:00
Andrew Tridgell 05bd0cb9f4 APM_Control: added decay_I() function
used by VTOL planes to decay integrator on fixed wing components when
at very low airspeed
2019-07-07 18:16:47 +10:00
Michael du Breuil 197804412a APM_Control: Fix AP_GPS include 2019-06-18 10:02:05 +10:00
Randy Mackay a96c146758 AR_AttitudeControl: set-throttle-out-stop considered same as running speed controller
update the speed-last-ms time when set-throttle-out-stop runs or else the desired throttle will not be acceleration limited when the desired speed is next increased above zero
2019-06-08 09:35:36 +09:00
Randy Mackay 4e68d16526 AR_AttitudeControl: use speed_control_active in get_desired_speed_accel_limited
also minor formatting fixes
this is a non-functional change
2019-05-10 06:55:35 +09:00
Randy Mackay 6d4d1bc20a AR_AttitudeControl: add get_turn_rate_from_heading 2019-05-10 06:55:35 +09:00
Randy Mackay 8907b727f6 AR_AttitudeControl: add get_turn_rate_from_lat_accel 2019-05-10 06:55:35 +09:00
Peter Hall 505e1d8c1d APM_Control: AP_RollContorller: move rate limit 2019-05-06 19:16:26 +10:00
Randy Mackay 415042e557 AR_AttitudeControl: minor declaration ordering change 2019-05-04 14:49:32 +09:00
Randy Mackay f6f5967a82 AR_AttitudeControl: minor param desc fix 2019-05-04 14:49:26 +09:00
Tom Pittenger 0a95785ff0 APM_Control: rename dataflash to logger 2019-03-28 16:40:57 +11:00
IamPete1 49ec059420 APM_Control: add function to relax rover i terms 2019-02-27 08:51:24 +09:00
Tom Pittenger 752804c2a5 APM_Control: unify singleton naming to _singleton and get_singleton() 2019-02-10 19:09:58 -07:00
Andrew Tridgell d7f90963ea APM_Control: fill in Act field of PID logs for plane 2019-01-28 09:38:32 +09:00
Nathan E 548a573803 Update AP_YawController.cpp 2019-01-23 09:24:18 -07:00
Nathan E f9aac6919c Update AP_RollController.cpp 2019-01-23 09:24:18 -07:00
Nathan E fbb2252fd9 Update AP_PitchController.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
Peter Barker d1f5bcb1ab APM_Control: stop taking reference to dataflash, use singleton 2019-01-18 14:14:22 +11:00
Peter Barker b276034c60 APM_Control: correct use of incorrect abs functions 2018-10-19 08:46:43 +11:00
IamPete1 e443b864c6 AR_AttitudeControl: add sail heel PID 2018-09-28 10:40:12 +09:00
Andrew Tridgell 3ab7fe348a APM_Control: halve the default pitch D term for planes
this is based on feedback from the 3.9.1 release
2018-09-14 07:32:13 +10:00
Randy Mackay d7d6c6ab04 AR_AttitudeControl: clarify units of get_steering_out_heading argument
also update comments
2018-09-11 14:39:50 +09:00
Randy Mackay 96097586c3 AR_AttitudeControl: reset I if speed controller not called recently 2018-09-04 15:00:41 +09:00
Randy Mackay 106b8abab7 AR_AttitudeControl: get_throttle_out_from_pitch accepts vehicle speed 2018-08-27 16:44:33 +09:00
Randy Mackay d5ef3c2e0f AR_AttitudeControl: get_throttle_out_from_pitch uses motor limits
This allows removing I-term build up from throttle hitting 100%
2018-08-27 16:44:33 +09:00
Randy Mackay 65b020eac3 AR_AttitudeControl: re-order pitch control to match other similar methods 2018-08-27 16:44:33 +09:00
Andrew Tridgell 9e2933df89 APM_Control: raised default PID gains for roll/pitch 2018-08-17 20:42:25 +10:00
Randy Mackay 1c18d06aa3 AR_AttitudeControl: move unnecessary else 2018-08-06 11:30:22 +09:00
Randy Mackay 9b60e0844b AR_AttitudeControl: add get_desired_pitch accessor 2018-08-06 11:30:22 +09:00
Ebin ccb32cf357 APM_Control: BRAKE param default is true 2018-07-20 14:41:32 +10:00
Ebin 1dc1b28234 APM_Control: changed default PID for Balance Bot 2018-07-20 14:41:32 +10:00