Commit Graph

447 Commits

Author SHA1 Message Date
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