Commit Graph

709 Commits

Author SHA1 Message Date
Leonard Hall c00ee6aac5 AC_AttitudeControl: increase rate I gain to match P gain 2019-04-12 09:28:24 +09:00
Leonard Hall e170beaf8c AC_AttitudeControl: reduce throttle mix for manual modes 2019-04-12 09:28:22 +09:00
Peter Barker 9c9ebb908c AC_AttitudeControl: store integrators temps in correct type 2019-04-10 09:37:19 +09:00
Peter Barker 70aed0f29c AC_AttitudeControl: store acro passthrough values as float
The function which sets these has floats, and the function we send them
to uses floats... so store them as floats...
2019-04-10 09:37:19 +09:00
Leonard Hall 6e76dff930 AC_AttitudeControl: remove unused set_throttle_out_unstabilized 2019-04-08 09:42:21 +09:00
Mark Whitehorn b7957e820f AC_AttitudeControl: bodyframe roll log target attitude bugfix 2019-03-30 10:32:24 +11:00
Tom Pittenger ce872d83a4 AC_AttitudeControl: rename dataflash to logger 2019-03-28 16:40:57 +11:00
Patrick José Pereira 6152f31c1e AC_PosControl_Sub: Add new relax_alt_hold_controllers
When changing from manual to alt hold controller it's necessary to hold the I term
since this will help to fix the altitude with vehicles that are not neutral buoyancy

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2019-03-26 13:37:18 -04:00
Mark Whitehorn 55047324ac AC_AttitudeControl: add new tailsitter bodyframe roll option 2019-03-26 14:50:37 +11:00
Mark Whitehorn 4e9b6d1919 AC_AttitudeControl: improve tailsitter bodyframe roll control 2019-03-26 14:50:37 +11:00
Peter Barker eb1fc3107c AC_PosControl: log PSC data in metres in place of centimetres 2019-03-26 10:18:05 +11:00
Mark Whitehorn 1c52458d72 AC_AttitudeControl: use new method get_quat_body_to_ned() 2019-03-19 10:46:25 +11:00
Mark Whitehorn 20bbf99b28 AC_AttitudeControl: add body-frame yaw mode for tailsitters 2019-03-06 15:48:51 +11:00
Peter Barker 50d95943e3 AC_AttitudeControl: add pre-arm checks 2019-03-06 10:36:32 +09:00
Randy Mackay 8710526894 AC_PosControl: constify dt calcs 2019-01-30 15:58:34 +09:00
Randy Mackay b14be4e8ae AC_PosControl: increase accuracy of dt calcs 2019-01-30 15:58:34 +09: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
Pierre Kancir 96e629d83e AC_AttitudeControl: pass vector by const reference 2018-12-22 08:31:32 +09:00
Leonard Hall 8d572e8565 AC_AttitudeControl: Fix Autotune high hover throttle based limits 2018-12-21 22:17:52 +11:00
Randy Mackay ba3303dc61 AC_PosControl: set-alt-target-with-slew sets desired to 0 once at target
This resolves and issue with the set-alt-target-with-slew method leaving the z-axis desired velocity at the max speed-up or speed-down
this causes a jump in throttle if the user switches to Loiter after the vehicle has reached its target
2018-11-26 09:30:32 +09:00
Peter Barker 7e3ca19308 AC_AttitudeControl: add override keyword in many places 2018-11-08 11:30:12 +11:00
murata 6db54bd65e AC_AttitudeControl: Change from sqrt to safe_sqrt 2018-11-03 15:23:15 +09:00
Peter Barker dcd930497a AC_AttitudeControl: AC_PosControl: avoid calling norm()
The result of this won't be used as often as this loop is called
2018-10-30 09:00:23 +09:00
Michael du Breuil 5846a54c17 AC_AttitudeControl: Fix copy paste param doc error 2018-10-25 09:50:00 +11:00
Peter Barker 04e4484d96 AC_AttitudeControl: correct old and misleading comments 2018-10-23 09:40:21 +11:00
Leonard Hall 96a8bcf641 AC_AttitudeControl: limit gyro correction to 45 degrees error 2018-10-16 00:44:50 +09:00
Leonard Hall acaefe9316 AC_AttitudeControl: remove output limits 2018-10-16 00:44:50 +09:00
Peter Barker dabe8a13f7 AC_AttitudeControl: use EKF singleton to get ekfNavVelGainScaler 2018-10-09 10:47:38 +11:00
Michael du Breuil 1d13aff711 AC_AttitudeControl: Rename several set_speed and set_accel functions 2018-09-20 15:15:45 -07:00
Leonard Hall 34c0656675 AC_AttitudeControl: Add missing variable initalisations 2018-09-15 11:00:29 +10:00
Michael du Breuil eb1f3b205f AC_AttitudeControl: Use reset_rate_controller_I_terms() helper 2018-09-14 12:16:58 +09:00
Leonard Hall b15b5516cb AC_PosControl: Fix divide by zero check in limit_vector_length 2018-09-12 15:51:30 +09:00
Leonard Hall 706ff85be7 AC_AttitudeControl: Add minimum angle limit for get_althold_lean_angle_max 2018-09-12 15:51:30 +09:00
Leonard Hall 5863b84c35 AC_PosControl: reduce glitch on init 2018-09-04 13:37:28 +09:00
Andrew Tridgell 9766c4ed26 AC_AttitudeControl: fixed use of double precision maths 2018-05-07 11:43:23 +10:00
Jacob Walser 6ae1bf4cf4 AC_AttitudeControl: Allow zero gains for Sub
Close bluerobotics/ardusub#70
2018-04-25 17:18:26 +09:00
Michael du Breuil 334ff0fb66 AC_AttitudeControl: Prevent DCM fallback from triggering a flyaway 2018-03-31 13:40:52 +09:00
Randy Mackay 33f437a72c AC_AttitudeControl: use multiply instead of divide 2018-03-16 13:50:57 +09:00
Leonard Hall c53ba22daa AC_AttitudeControl: add new rate only attitude control 2018-03-16 13:50:57 +09:00
Randy Mackay ac82a37728 AC_PosControl: run horiz control at main loop rate 2018-03-16 13:50:57 +09:00
Randy Mackay 13007e2a07 AC_PosControl: dataflash logging of PSC message 2018-03-16 13:50:57 +09:00
Randy Mackay 69cfea4057 AC_PosControl: use float for local consts 2018-03-16 13:50:57 +09:00
Randy Mackay b988a6ca08 AC_AttitudeControl: add units to INPUT_TC param desc 2018-03-16 13:50:57 +09:00
Leonard Hall dadc6a63c4 AC_PosControl: add set_leash_length_xy 2018-03-16 13:50:57 +09:00
Leonard Hall e5bc2b26fe AC_PosControl: add lean angle max 2018-03-16 13:50:57 +09:00
Leonard Hall 0f3645b061 AC_PosControl: increase velocity gains 2018-03-16 13:50:57 +09:00
Leonard Hall 7ec043502f AC_PosControl: add accel limit to xy controller 2018-03-16 13:50:57 +09:00
Leonard Hall bd13704f6f AC_PosControl: update init for guided 2018-03-16 13:50:57 +09:00
Leonard Hall 85b7f06554 AC_PosControl: combine z position control into single method 2018-03-16 13:50:57 +09:00
Leonard Hall 993e638752 AC_PosControl: combine xy position control into single method
Also always limit lean angle to maintain altitude
2018-03-16 13:50:57 +09:00
Leonard Hall 74bb7616a7 AC_PosControl: add accel feedforward
also add limit_vector_length and sqrt_controller helper functions
enforce angle limits
rename accel-feedforward to accel-desired
remove freeze_ff_xy
remove unused VEL_XY_MAX_FROM_POS_ERR
remove xy mode
remove jerk limiting code including setters
limit_vector_length uses is_positive
Also modify formatting
2018-03-16 13:50:57 +09:00
Randy Mackay 9aa6415e1c AC_AttitudeControl: use is_positive and is_negative 2018-03-16 13:50:57 +09:00
Randy Mackay b3de52dc59 AC_AttitudeControl: minor comment fix 2018-03-16 13:50:57 +09:00
Leonard Hall 05418d3d29 AC_AttitudeControl: add EKF reset handling 2018-03-16 13:50:57 +09:00
Leonard Hall 8c45345863 AC_AttitudeControl: rename use_ff_and_input_shaping to use_sqrt_controller
Also rate controllers only use _rate_bb_ff_enabled flag to decide whether
to use ff for now
2018-03-16 13:50:57 +09:00
Leonard Hall 1e9e12e866 AC_AttitudeControl: rename heading_quad to yaw_vec_correction_quat
also rename flip_scalart local variable to feedforward_scalar
also add comments
non-functional change
2018-03-16 13:50:57 +09:00
Randy Mackay 59a2445ad3 AC_AttitudeControl: replace smoothing gain with INPUT_TC 2018-03-16 13:50:57 +09:00
Leonard Hall e1e224b68b AC_AttitudeControl: add angular velocity limit 2018-03-16 13:50:57 +09:00
Leonard Hall ee82943f85 AC_AttitudeControl: add input_shaping_rate_predictor 2018-03-16 13:50:57 +09:00
Leonard Hall 6175a896ee AC_AttitudeControl: add set smoothing gain
Smoothing gain value should be set once when entering a mode
2018-03-16 13:50:57 +09:00
Leonard Hall 213f7a4061 AC_AttitudeControl: add get_accel_roll/pitch/yaw_max_radss methods
Also constify existing get_accel_roll/pitch/yaw_max methods
2018-03-16 13:50:57 +09:00
Randy Mackay 3badcdcfba AC_PosControl: default gains for sub 2018-01-31 08:48:21 +09:00
Randy Mackay 61933c6f1c AC_PosControl: shorten PSC_ACCELZ param to PSC_ACCZ 2018-01-31 08:48:21 +09:00
Leonard Hall 692e6518cc AC_AttitudeControl: update param desc values for large copters 2018-01-27 11:54:04 +09:00
Leonard Hall 691abab95e AC_AttitudeControl: Update parameter ranges 2018-01-27 11:38:09 +09:00
Randy Mackay 9c00eb3d5f AC_PosControl_Sub: move pids to be local 2018-01-23 12:00:43 +09:00
Randy Mackay c70d3e0ab8 AC_PosControl: move pids to be local 2018-01-23 12:00:43 +09:00
Randy Mackay 00037fd50e AC_PosControl_Sub: replace velocity pi with local pid 2018-01-23 12:00:43 +09:00
Randy Mackay 3a73ff1e2e AC_PosControl: replace velocity control with local 2-axis PID 2018-01-23 12:00:43 +09:00
Leonard Hall e249e06714 AC_PosControl: minor enhancement to lean_angles_to_accel 2018-01-20 09:49:58 +09:00
Leonard Hall d5976442f8 AC_PosControl: minor comment change
non-functional change
2018-01-19 15:40:32 +09:00
Leonard Hall 3ada0f32b0 AC_AttitudeControl: minor comment update
Non-functional change
2018-01-19 15:40:24 +09:00
Leonard Hall b9ed8b292a AC_PosControl: pass dt to att control sqrt_controller 2018-01-16 12:13:48 +09:00
Leonard Hall 62cc25022c AC_AttitudeControl: protect against overshoot in sqrt controller 2018-01-16 12:13:48 +09:00
Leonard Hall 75de0cb4ef AC_AttitudeControl: sqrt_controller accepts dt 2018-01-16 12:13:48 +09:00
Leonard Hall cddd815a75 AC_AttitudeControl: comment thrust_heading_rotation_angles
non-functional change
2018-01-12 15:20:47 +09:00
Leonard Hall 3e0c24adf9 AC_PosControl: remove out-of-date comments 2018-01-11 21:18:34 +09:00
ChristopherOlson 569f55f5c6 AC_AttitudeControl:TradHeli - fix for alt_hold angle limiter active at hover collective in Traditional Helicopters
add definition for max collective/throttle for helicopters that compensates for negative collective pitch range
and sets proper collective overhead before alt_hold angle limiter becomes effective
2017-12-14 20:46:13 +09:00
Dr.-Ing. Amilcar Do Carmo Lucas fa4427fbce AC_AttitudeControl: Add AC_PosControl::get_bearing_to_target() method 2017-12-05 09:17:15 +09:00
Leonard Hall bd284d9fd7 AC_PosControl: correct lean-angle-to-accel formula
Thanks to @luweikxy for finding this issue!
2017-11-24 09:12:00 +09:00
Leonard Hall ebd864d2d2 AC_PosControl: minor update to comments 2017-11-16 09:46:28 +09:00
Randy Mackay 6315e6eb45 AC_AttitudeControl: remove unused get_tilt_limit_rad 2017-11-15 20:22:02 +09:00
bnsgeyer e8173f27df AC_AttitudeControl: reset target attitude
added method to reset current vehicle attitude to support swash
behaviors in Trad Heli
2017-10-28 12:31:06 +11:00
Dr.-Ing. Amilcar Do Carmo Lucas c7c2c4ff2c AC_AttitudeControl: use floating-point multiplication instead of a more expensive floating-point division 2017-10-23 09:20:17 -07:00
Andrew Tridgell f2efea4e1d AC_AttitudeControl: added inverted flight support
for helis
2017-10-03 10:16:41 +11:00
Andrew Tridgell 99aad41955 AC_AttitudeControl: added a update_vel_controller_xy() API
this allows for just XY control of velocity for quadplanes
2017-09-09 08:14:09 +10:00
Andrew Tridgell 1a25087dd5 AC_AttitudeControl: fixed PIRO_COMP index
this is a new conflict due to stricter checking in AP_Param
2017-08-14 09:28:57 +09:00
Leonard Hall ed0063d10d AC_AttControl: save accel max using shorter set_and_save
no functional change
2017-06-22 15:20:16 +09:00
Leonard Hall 0544cf1d82 AC_AttControl: add step input for autotune 2017-06-22 15:18:04 +09:00
Peter Barker d56eca036d AC_AttitudeControl: correct parameter markup 2017-06-05 21:02:30 +10:00
Leonard Hall ad74769fb7 AC_AttControl: adjust default rate IMAX and Yaw Filt
Increase Roll, Pitch and Yaw IMAX from 0.444 or 0.222 to 0.5
Decrease Yaw Filter from 5hz to 2.5hz based on the results of autotunes on many vehicles which always seems to produce values between 2 and 3hz
2017-06-01 10:08:41 +09:00
Dr.-Ing. Amilcar Do Carmo Lucas 188dfb6936 AC_AttitudeControl: Use SI units conventions in parameter units
Follow the rules from:
http://physics.nist.gov/cuu/Units/units.html
http://physics.nist.gov/cuu/Units/outside.html
and
http://physics.nist.gov/cuu/Units/checklist.html
one further constrain is that only printable (7bit) ASCII characters are allowed
2017-05-17 18:07:25 +10:00
Randy Mackay 3a397584a1 AC_PosControl: z-axis stopping point up to 3m above vehicle
Stopping point while descending remains at 2m for safety
2017-04-28 09:10:02 +09:00
Leonard Hall 6e92f74ca0 AC_PosControl: add clear_desired_velocity_ff_z method 2017-04-28 09:10:02 +09:00
Andrew Tridgell fe3e7e8153 AC_AttitudeControl: added get_throttle_mix()
and when we use set_throttle_mix_value(), set both desired and actual

thanks to Leonard for the suggestions
2017-04-19 09:08:43 +10:00
Randy Mackay 132979b12f AC_PosControl: protect against POS_Z_P, ACCEL_Z_P divide-by-zero 2017-03-15 09:22:23 +09:00
Randy Mackay 67097c8d59 AC_AttitudeControl: use gyro_latest
This allows moving the attitude control before the ahrs/ekf update

We continue to use ahrs.get_gyro for the non-time-critical heli
passthrough functions.  We should avoid using get_gyro_latest() unless we know there is a direct benefit because it could lead to inconsistent gyro values vs what the EKF is using.
2017-03-03 13:14:28 +11:00
Randy Mackay d79403707b AC_AttControl: add feed forward param descriptions
No functional change
2017-03-01 14:59:44 +09:00
Andrew Tridgell e5ed20d6f7 AC_AttitudeControl: added set_throttle_mix_value()
used by quadplane
2017-02-26 09:20:51 +11:00
Jacob Walser 0e124d0be5 AC_PosControl: Add AC_PosControl_Sub class 2017-02-21 11:26:14 +11:00
Jacob Walser 925fa5d214 AC_AttitudeControl: Add AC_AttitudeControl_Sub class 2017-02-21 11:26:14 +11:00
Andrew Tridgell 1345bf8737 AC_AttitudeControl: added support for AP_AHRS_View
this allows for tailsitters with a different attitude view
2017-02-18 17:26:43 +11:00
Andrew Tridgell 5acbf5d16e AC_AttitudeControl: use FF from AC_PID 2017-02-18 17:26:43 +11:00
Randy Mackay ff042528fe AC_PosControl: remove alt_max
AC_Avoidance enforces the altitude limit
2017-01-18 09:35:47 +09:00
Randy Mackay 127404acea AC_PosControl: add get_pos_z_kP accessor 2017-01-18 09:35:47 +09:00
Randy Mackay 189b766f2b AC_AttControl: remove redundant parameter set 2017-01-17 14:56:07 +09:00
Leonard Hall c6d2fc3d5d AC_AttitudeControl: add rpy mix manual
This allows adjusting the attitude control vs throttle level in manual
flight modes (Stabilize, ACRO)
2017-01-17 14:19:09 +09:00
Andrew Tridgell 5cf1c0869d AC_AttitudeControl: expose all functions via abstract class
this allows for a single class to be used for heli and multicopter
2017-01-12 17:39:37 +11:00
Dr.-Ing. Amilcar Do Carmo Lucas 8419045aea Spell in comments 2017-01-06 10:57:39 -08:00
Pierre Kancir 421524951f AC_PosControl: remove unnecessary parentheses 2016-12-05 10:59:45 -08:00
murata bcdd836820 AC_AttControl: remove unnecessary check of thr-mix-min
Checks directly above ensure this check can never be true
2016-12-01 13:52:04 +09:00
Leonard Hall 8af192ed9d AC_AttControl: allow MOT_THR_MIX_MAX to be 2.0
The parameter description maximum of 0.9 should keep most users from
setting this parameter above 0.9 but there are rare cases for very high powered copters with low hover-throttle values where setting as high as 2.0 improves attitude control
2016-11-30 17:56:34 +09:00
Randy Mackay 1012333eef AC_PosControl: add ekf position reset handling
Previously this was in AC_WPNav and used only for loiter but it should work for any flight modes that use horizontal or vertical position control
2016-11-24 19:57:56 +09:00
Leonard Hall ea0e413b04 AC_AttControl: do not limit rate if ATC_ACCEL_MAX param is zero 2016-11-23 14:43:29 +09:00
Peter Barker 2e2d39e628 AC_AttitudeControl: add missing parameter metadata 2016-10-27 09:15:03 -07:00
Leonard Hall 42672de606 AC_PosControl: set Alt_Hold filter for PID not just D
We normally don't use the D term here so setting the filter for PID not
just D lets us smooth the throttle response.
2016-10-26 21:00:43 +09: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
Jonathan Challinger 5a8db4f271 AC_PosControl: add interface to override horizontal velocity process variable 2016-10-14 10:46:01 +09:00
Jonathan Challinger 77dbf99cee AC_PosControl: fix bug related to ekfNavVelGainScaler 2016-10-11 15:25:59 +09:00
Tom Pittenger 3adf8c3e51 AC_AttitudeControl: comment odd math in get_att_target_euler_cd
degree(100) = 1 float multiplicaiton
vector3f * degree(100.0f)  = 4 float multiplications
degree(vector3f) * 100.0f  = 6 float multiplications and needs new degree(vector3f) function
degree(vector3f * 100.0f)  = 6 float multiplications and needs new degree(vector3f) function

These all come to the same conclusion but the one that is faster appears to be a bug but is mathematically correct.
2016-09-27 17:04:53 -07:00
Leonard Hall fdcdcb0033 AC_PosControl: check Z-axis accel imax can always overpower hover throttle
This removes the possibility of the vehicle constantly climbing if the hover throttle becomes a very large value
2016-09-05 14:19:43 +09:00
Randy Mackay 44830be172 AC_AttControl: add parameter check of throttle mix 2016-09-02 09:27:15 +09:00
Randy Mackay 535158e0d8 AC_AttControl: move var_info declaration
No functional change
2016-09-02 09:27:12 +09:00
Leonard Hall 29d4790fc7 AC_AttControl: reduce max_rate_step based on hover throttle
This changes reduces AutoTune's twitch size based on the hover throttle
This method is only used by AutoTune
2016-08-12 22:29:53 +09:00
Leonard Hall 50b694444b AC_AttControl: correct method comments
No functional change
2016-08-08 11:24:42 +09:00
Leonard Hall 34055944cd AC_PosControl: fix relax_alt_hold_controllers 2016-08-05 12:40:37 +09:00
Randy Mackay 24044e5611 AC_AttControl: get_throttle_avg_max always returns value in 0 to 1 range
throttle_avg_max is the total average throttle level (expressed as a number from 0 to 1) that the motors can safely be raised to in order to maintain attitude control.  This level can be higher than the pilot's or autopilot provided throttle level.
Previously passing in a negative throttle_in could result in a negative throttle_avg_max being returned.
2016-08-05 12:40:37 +09:00
Leonard Hall ac04fcd836 AC_AttControl: fix set_yaw_target_to_current_heading 2016-08-05 12:40:37 +09:00
Leonard Hall 011bc0a350 AC_AttControl: add reset_rate_controller_I_terms() 2016-08-05 12:40:37 +09:00
Randy Mackay d5c18dc987 AC_AttControl: remove unused 100hz definition 2016-08-01 17:21:04 +09:00
Jonathan Challinger 630e5378da AC_PosControl: add get_horizontal_error 2016-07-12 18:40:25 +09:00
Leonard Hall 80bda572ba AC_AttutudeControl: Yaw shift fix 2016-06-24 18:15:48 +09:00
Leonard Hall 8737f6b62d AC_AttitudeControl: enhanced quaternion attitude controller 2016-06-24 17:17:11 +09:00
Leonard Hall 117ae89505 AC_AttitudeControl: increase SLEW_YAW default to 60deg/sec 2016-06-24 16:24:17 +09:00
Randy Mackay a1548405c1 AC_AttitudeControlHeli: fix althold lean angle max 2016-06-24 15:03:59 +09:00
Andrew Tridgell d1b28aaed9 AC_AttitudeControl: fixed factor of 1000 error in init_takeoff 2016-06-22 11:48:43 +10:00
Randy Mackay ec7c1ab0b0 AC_PosControl: comment fix to set_alt_max method
No functional change
2016-06-18 11:55:49 +09:00
Leonard Hall dcbb071c07 AC_PosControl: Move hover throttle calculation to AP_Motors 2016-06-18 11:55:49 +09:00
Randy Mackay b27da7699e AC_AttitudeControlMulti: get_throttle_avg_max made private
Also fixed up method's description
2016-06-18 11:55:49 +09:00
Randy Mackay da946288a2 AC_AttitudeControl: rename throttle_ave_max to throttle_avg_max 2016-06-18 11:55:49 +09:00
Randy Mackay 570920c7d7 AC_AttitudeControlMulti: run control_monitor_update in rate_controller_run 2016-06-18 11:55:49 +09:00
Leonard Hall 1639e22b74 AC_AttitudeControl: set desired_vel for reporting purposes even when not used 2016-06-18 11:55:49 +09:00
Randy Mackay 558f29b95c AC_AttitudeControl: control mixing made protected 2016-06-18 11:55:49 +09:00
Leonard Hall 9bd8878c8b AC_AttitudeControlHeli: fix update_althold_lean_angle_max 2016-06-18 11:55:49 +09:00
Leonard Hall 096bdd67f8 AC_AttitudeControl: add ATC_ANG_LIM_TC parameter
This allow adjusting the reponse to limit lean angles to reduce altitude loss
2016-06-18 11:55:49 +09:00
Randy Mackay dafc45eb26 AC_AttitudeControl: move get_althold_lean_angle_max to parent class 2016-06-18 11:55:49 +09:00
Leonard Hall 3d27ecca92 AC_AttitudeControl: add TC for Alt_Hold angle limit 2016-06-18 11:55:49 +09:00
Randy Mackay 7ff0fcb25d AC_AttitudeControl: multicopter specific rate_controller_run 2016-06-18 11:55:49 +09:00
Randy Mackay b7431b7d0c AC_AttitudeControl: update throttle rpy mix on every iteration 2016-06-18 11:55:49 +09:00
Leonard Hall ca2977decf AC_AttitudeControl: set throttle vs attitude priority for flipped state
When performing a flip we want to allow throttle to go high to provide
maximum attitude control
2016-06-18 11:55:49 +09:00
Leonard Hall 1fb4c12cd0 AC_AttitudeControl: move in throttle vs attitude prioritisation
Previously this prioritisation of throttle vs attitude was done in the
AP_Motors library
2016-06-18 11:55:49 +09:00
Randy Mackay 0870ce9fc1 AC_AttitudeControl: remove get_throttle_boosted from parent class
This is only called from multicopters
2016-06-18 11:55:49 +09:00
Leonard Hall 25c77c154f AC_AttitudeControl: rename get_boosted_throttle to get_throttle_boosted 2016-06-18 11:55:49 +09:00
Leonard Hall 35ef761deb AC_AttitudeControl: Move set_throttle_out to _Multi and _Heli 2016-06-18 11:55:49 +09:00
Andrew Tridgell e070aeebe3 AC_AttitudeControl: added accessors for P and D RMS controller values 2016-06-10 17:48:31 +10:00
Andrew Tridgell 1c463e3f3b AC_AttitudeControl: log rms P and D separately
as discussed with Leonard
2016-06-10 17:48:31 +10:00
Tom Pittenger 64c2510be9 AC_AttitudeControl: fix compile warning float to double promotion in string conversion 2016-06-01 17:38:47 -07:00
Andrew Tridgell b4bdfa2451 AC_AttitudeControl: return roll, pitch and yaw controller error separately
as discussed with Leonard
2016-06-01 17:18:58 +10:00
Andrew Tridgell 6330060e49 AC_AttitudeControl: added monitoring of controller error
use RMS P+I+FF output. Thanks to Leonard for the suggestion
2016-05-28 17:33:30 +10:00
Andrew Tridgell 9bf0ada875 AC_AttitudeControl: removed use of AFF for tail control in heli 2016-05-12 17:37:22 +10:00
dgrat 41661f815f AP_Math: Replace the pythagorous* functions with a variadic template
The new function can deal with a variable number of function parameters.
Additionally, I renamed the functions to norm(), because this is the
standard name used in several other projects.
2016-05-10 11:41:26 -03:00
Randy Mackay 4a06ca4be2 AC_AttControl: remove unused call to motors.set_stabilizing
Also minor change to order of a call to motors library to make stabilizing
and non-stabilizing calls consistent.

Non functional change
2016-05-07 10:08:38 +09:00
Andrew Tridgell c7664291f9 AC_AttitudeControl: fixed comment on function 2016-04-28 17:46:58 +10:00
Andrew Tridgell 23a64e1227 AC_AttitudeControl: fixed accel limit trigonometry
Leonard had mentioned the limit should be tan(angle) not sin(angle). I
noticed this one was wrong.
2016-04-28 16:15:15 +10:00
Francisco Ferreira b7135175c9 AC_AttitudeControl: fix heli documentation 2016-04-18 07:40:34 +09:00
Andrew Tridgell d03a232659 AC_AttitudeControl: added set_limit_accel_xy() API
for preventing integrator buildup
2016-04-10 22:01:18 +10:00
Randy Mackay 87399776a3 AC_PosControl: hover throttle default to 0.5 2016-04-01 11:59:30 +09:00
Randy Mackay 165d739b45 AC_AttControl_Heli: roll, pitch, yaw passthrough to motors in -1 to +1 range 2016-04-01 11:59:30 +09:00
Randy Mackay 344d86a095 AC_AttControl_Heli: fix parameter description 2016-04-01 11:59:30 +09:00
Randy Mackay 685be4083c AC_AttControl_Heli: remove unnecessary cast to AC_HELI_PID 2016-04-01 11:59:30 +09:00
Randy Mackay 6c91e50f8c AC_AttControl_Heli: remove scaling for centi-degrees and legacy motor input 2016-04-01 11:59:30 +09:00
Randy Mackay 32d238187f AC_AttControl_Heli: get_althold_lean_angle_max in 0 to 1 range 2016-04-01 11:59:30 +09:00
Randy Mackay db04dddba5 AC_AttControl_Heli: adjust rate gain param descriptions 2016-04-01 11:59:30 +09:00
Randy Mackay 35c6ea994d AC_AttControl_Multi: fix parameter descriptions 2016-04-01 11:59:30 +09:00
Randy Mackay ace58d114f AC_AttControl_Multi: reduce rate gain defaults 2016-04-01 11:59:30 +09:00
Leonard Hall b30606bb22 AC_AttControl: remove scaling for centi-degrees and legacy motor input 2016-04-01 11:59:30 +09:00
Randy Mackay 7f2c1f830f AC_AttControl_Heli: add rate PIDs 2016-04-01 11:59:30 +09:00
Randy Mackay 5edc16dfb4 AC_AttControl_Multi: add rate PIDs 2016-04-01 11:59:30 +09:00
Randy Mackay 75042e5e27 AC_AttControl: remove rate PIDs 2016-04-01 11:59:30 +09:00
Randy Mackay 17c9db08f3 AC_AttControl: add angle and rate PIDs 2016-04-01 11:59:30 +09:00
Randy Mackay c49a914597 AC_AttControlHeli: remove unnecessary virtual declaration 2016-04-01 11:59:30 +09:00
Randy Mackay 2b123ee15d AC_AttControlHeli: fix rate_bf_to_motor_roll_pitch and yaw output in -1 to +1 range 2016-04-01 11:59:30 +09:00
Randy Mackay c5e5b4f783 AC_AttControl: fix rate controller max definitions to -1 to +1 range 2016-04-01 11:59:30 +09:00
Leonard Hall 979534279a AC_AttControl: roll, pitch, yaw output to motors in -1 to +1 range 2016-04-01 11:59:30 +09:00
Leonard Hall c64a505906 AC_PosControl: relax_alt_hold_controllers accepts throttle in 0 to 1 range 2016-04-01 11:59:30 +09:00
Leonard Hall 15be80a25d AC_PosControl: accel_to_throttle outputs 0 to 1 2016-04-01 11:59:30 +09:00
Leonard Hall e5d6d45851 AC_AttControl_Heli: angle_boost to float 2016-04-01 11:59:30 +09:00
Leonard Hall 2822b93cd4 AC_AttControl: add get_throttle_in accessor
Used for logging only
2016-04-01 11:59:30 +09:00
Leonard Hall c0f209fa42 AC_AttControl: angle_boost to float 2016-04-01 11:59:30 +09:00
Leonard Hall 6f29bbafb4 AC_AttControl_Multi: get_althold_lean_angle_max uses motor thrust in 0 to 1 range 2016-04-01 11:59:30 +09:00
Leonard Hall 24f975c16a AC_AttControl_Multi: fix throttle boost for 0 to 1 2016-04-01 11:59:30 +09:00
Leonard Hall bab08cbcc1 AC_AttControl_Multi: add divide by zero check 2016-04-01 11:59:30 +09:00
Lucas De Marchi f42484bcc5 AC_AttitudeControl: replace header guard with pragma once 2016-03-16 18:40:39 +11:00
Jonathan Challinger e946e047e6 AC_AttitudeControl: add attitude_controller_run functions, call from input functions 2016-03-02 20:16:18 +09:00
dgrat 5148e41c1a AP_Math: Cleaned macro definitions
Moved Definitions into a separate header. Replaced PI with M_PI and
removed the M_PI_*_F macros.
2016-02-27 02:51:33 -03:00
Leonard Hall 49a4bde5d9 AC_AttControl: lower minimum accelerations for large copters 2016-02-18 20:49:13 +09:00
Randy Mackay 8c7f36563c AC_AttControl: bug fix to angle_boost reporting
Thanks to OXINARF for finding this
2016-01-08 10:48:59 +09:00
Randy Mackay 5ddd332277 AC_AttControl: add ANGLE_BOOST param
This allows disabling angle boost
2016-01-07 12:31:52 +09:00
Randy Mackay 86bb03aa79 AC_AttControl: use ahrs get_rotation_body_to_ned
ahrs.get_dcm_matrix renamed to ahrs.get_rotation_body_to_ned
2015-12-23 11:38:21 +09:00
Jonathan Challinger 46e6ff3ca9 AC_AttitudeControl: modify comment on kinematic correction feedforward 2015-12-23 11:38:19 +09:00
Jonathan Challinger 829d6037fc AC_AttitudeControl: convert euler rates to angular velocity using the correct attitude 2015-12-23 11:38:16 +09:00
Jonathan Challinger ae3357baee AC_AttitudeControl: rotate angular velocity feedforward into vehicle frame 2015-12-23 11:38:14 +09:00
Jonathan Challinger 3d4bd92b48 AC_AttitudeControl: add helper functions to retrieve rotation matrices 2015-12-23 11:38:12 +09:00
Andrew Tridgell fbacb4c01f AC_AttitudeControl: fixed M_PI -> M_PI_F 2015-12-20 17:55:39 +11:00
Jonathan Challinger ee8090e25f AC_AttitudeControl: reflect renamed function in AP_AHRS 2015-12-18 18:08:37 +11:00
Randy Mackay c8661f804f AC_AttControl: reduce compiler warnings by fixing member init order
Also increased _dt's default to 400hz (no functional change)
2015-12-09 20:04:42 +09:00
Randy Mackay 02eda4dcab AC_AttControl: remove comment, fix formatting 2015-12-09 20:04:32 +09:00
Jonathan Challinger e8345fbaab AC_AttitudeControl: rename getters for attitude target and attitude error 2015-12-09 19:58:48 +09:00
Jonathan Challinger 3a06edcee3 AC_AttitudeControl: rename local variable to match naming convention 2015-12-09 19:58:46 +09:00
Jonathan Challinger 846ee7d2af AC_AttitudeControl: fix regression in angular velocity controller 2015-12-09 19:58:45 +09:00
Jonathan Challinger b8223771d3 AC_AttitudeControl: properly protect sqrt_controller from nonpositive acceleration limits 2015-12-09 19:58:44 +09:00
Jonathan Challinger 162d2a9112 AC_AttitudeControl: naming changes in response to Leonard's review 2015-12-09 19:58:42 +09:00
Jonathan Challinger a48f201a04 AC_AttitudeControl: comment changes in response to Paul's review 2015-12-09 19:58:41 +09:00
Jonathan Challinger 0baf86c485 AC_AttitudeControl: fixup more names 2015-12-09 19:58:39 +09:00
Jonathan Challinger 41e580e53a AC_AttitudeControl: add input_att_quat_bf_ang_vel and use for ACRO 2015-12-09 19:58:38 +09:00
Jonathan Challinger 5919e95635 AC_AttitudeControl: add input_ prefix to input shaper functions 2015-12-09 19:58:36 +09:00
Jonathan Challinger bba360ea2b AC_AttitudeControl: correct bugs found in review 2015-12-09 19:58:35 +09:00
Jonathan Challinger 9208003aab AC_AttitudeControl: remove unused variable 2015-12-09 19:58:34 +09:00
Jonathan Challinger f8c709478a AC_AttitudeControl: quaternion acro controller 2015-12-09 19:58:33 +09:00
Jonathan Challinger 8b886bc479 AC_AttitudeControl: minor comment changes and reorganization 2015-12-09 19:58:32 +09:00
Jonathan Challinger edda7e4e1e AC_AttitudeControl: keep _att_target_euler_deriv_rads updated in euler_angle_roll_pitch_yaw 2015-12-09 19:58:31 +09:00
Jonathan Challinger 1afab89991 AC_AttitudeControl: extensive renaming and recommenting 2015-12-09 19:58:29 +09:00
Jonathan Challinger 06c8457efd AC_AttitudeControl: rename and modify frame_conversion functions to follow conventions 2015-12-09 19:58:27 +09:00
Jonathan Challinger 7330de86e5 AC_AttitudeControl: change internals to use radians instead of centidegrees 2015-12-09 19:58:26 +09:00
Andrew Tridgell 58f0abaf4c AC_AttitudeControl: fixed one usage of zero accel limits
in other places zero accel limit means no limit
2015-12-07 13:43:14 +09:00
Lucas De Marchi 2591261af6 Global: rename min and max macros to uppercase
The problem with using min() and max() is that they conflict with some
C++ headers. Name the macros in uppercase instead. We may go case by
case later converting them to be typesafe.

Changes generated with:

	git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)max(/\1MAX(/g'
	git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)min(/\1MIN(/g'
2015-12-01 16:28:09 -02:00
Andrew Tridgell d8ee9feaac AC_AttitudeControl: fixed external tail gyro with no flybar
this sets up the tail pass-through for acro mode
2015-11-27 15:24:41 +09:00
Caio Marcelo de Oliveira Filho ea08b6115d AC_AttControl: use millis/micros/panic functions 2015-11-20 12:27:03 +09:00
Randy Mackay c9340dbeb6 AC_PosControl: run velocity controller z-axis at 400hz 2015-11-18 13:31:21 +09:00
Randy Mackay dbc8ce1d69 AC_PosControl: default z-axis controller to 400hz
No functional change as vehicle code always sets it explicitely
2015-11-18 13:31:20 +09:00
Randy Mackay 323a527734 AC_PosControl: velocity controller uses feed-forward althold 2015-11-18 13:31:19 +09:00
Randy Mackay 4b41710261 AC_AttControl: minor comment fix 2015-11-18 13:31:18 +09:00
Robert Lefebvre 1bc13fb9c0 AC_AttitudeControl_Heli: Add Hover Roll Trim Scalar 2015-11-12 19:37:35 +09:00
Robert Lefebvre 0b33ef3862 AC_AttitudeControl: Add Hover Roll Trim functionality for helicopters. 2015-11-12 19:37:26 +09:00
Robert Lefebvre 62864c9e2b AC_AttitudeControl_Heli: Remove commented out Cyclic Cross-Coupling code. Will resurrect in future. 2015-11-12 19:37:19 +09:00
Robert Lefebvre b8ce23970d AC_AttitudeControl_Heli: Implement Pirouette Compensation 2015-11-12 19:37:18 +09:00
Robert Lefebvre f39ac7c900 AC_AttitudeControl_Heli: Add initialization of _flags_heli members 2015-11-12 19:37:17 +09:00
Jonathan Challinger 6784fd8625 AC_AttitudeControl: reserve parameter IDs 2015-11-10 12:56:52 +09:00
Lucas De Marchi 831d8acca5 Remove use of PROGMEM
Now variables don't have to be declared with PROGMEM anymore, so remove
them. This was automated with:

    git grep -l -z PROGMEM | xargs -0 sed -i 's/ PROGMEM / /g'
    git grep -l -z PROGMEM | xargs -0 sed -i 's/PROGMEM//g'

The 2 commands were done so we don't leave behind spurious spaces.

AVR-specific places were not changed.
2015-10-30 14:35:16 +09:00
Randy Mackay 550ba478c9 AC_PosControl: add shift_pos_xy_target 2015-10-30 12:24:08 +09:00
Randy Mackay 16a0281c92 AC_PosControl: remove unused set_vel_target 2015-10-30 12:24:07 +09:00
Randy Mackay ee0abb1750 AC_PosControl: add set_jerk_xy 2015-10-29 12:10:44 +09:00
Randy Mackay 73f4533995 AC_PosControl: minor comment update 2015-10-28 20:21:53 +09:00
Randy Mackay 895a40893d AC_PosControl: use_desvel_ff flag added
This allows turning on/off desired velocity feedforward without setting desired_vel.z to zero.  Setting desired_vel.z to zero has the side effect of disrupting the landing detection which needs to know if we are trying to descend
2015-10-28 20:21:52 +09:00
Leonard Hall aec66c5db6 AC_PosControl: faster z-axis slowdown when over speed 2015-10-28 20:21:38 +09:00
Leonard Hall 245f7ce268 AC_PosControl: allow desired vel z to be above speed limit 2015-10-28 17:59:36 +09:00
Leonard Hall f55c31a157 AC_PosControl: add alt hold without feed forward 2015-10-28 17:57:20 +09:00
Andrew Tridgell e3f7b002c2 AC_AttitudeControl: use non-flybar leaky I handling
The standard leaky-I handling works fine on a flybar, so better not to
have a special case that isn't needed
2015-09-25 12:05:43 +10:00
Leonard Hall c8872e082d AC_AttControl: rename set_throttle_out parameter
No functional change
2015-09-07 15:10:15 +09:00