Commit Graph

281 Commits

Author SHA1 Message Date
Randy Mackay b3da8a462f Copter: CH6 tuning definition clean-up
Renamed and reorganised the CH6 #defines and parameter definitions
2013-06-29 23:51:43 -10:00
Randy Mackay fcf2429e39 Copter: remove throttle controller's ability to limit lean angle 2013-06-04 15:25:59 +09:00
Randy Mackay 40f5226518 Copter: reset yaw angle only when motors not spinning 2013-06-03 22:12:52 +09:00
Randy Mackay 5203ba9fe3 Copter: alt hold feed forward filter 2013-06-01 21:13:47 +09:00
Andrew Tridgell 25c576cad7 Copter: replaced constrain() with constrain_float() 2013-05-02 10:26:49 +10:00
Randy Mackay 0b29754920 Copter: simplify roll-pitch stabilize controller
remove check of whether to freeze i term when attitude is less than 5
degrees from horizontal.  I terms have been moved to the rate
controllers.
2013-04-22 18:47:56 +09:00
Andrew Tridgell c2c037ec0d Copter: use the right constrain() type in Attitude code
Pair-Programmed-With: Randy Mackay <rmackay9@yahoo.com>
2013-04-22 13:26:49 +10:00
Randy Mackay a9da3c9d3d Copter: remove unused throttle functions
removed get_pilot_desired_acceleration vand get_pilot_desired_direct_alt
were used for initial testing of the inertial alt-hold controller but
are no longer required.
2013-04-21 23:43:04 +09:00
Randy Mackay 745df9b13c Copter: add SONAR_GAIN to tune reaction to sonar
Some users report the response to sonar is too violent, this allows that
reaction to be reduced
2013-04-20 15:58:36 +09:00
Randy Mackay 50515e28e1 Copter: replace fabs with fabsf 2013-04-20 15:40:56 +09:00
Randy Mackay f5955d8915 Copter: auto climb and descent params removed
These params now reside in the AC_WPNav library
2013-04-18 14:52:21 +09:00
Randy Mackay 1ee825ee9a Copter: move alt and wp checking to AC_WPNAV
RTL fix so that if it starts rtl-ing from above 80m it returns home
while descending instead of descending at initial position.
add get and set_target_alt_for_reporting
2013-04-14 10:39:23 +09:00
Randy Mackay 7c559333f5 Copter: get_throttle_rate's target_speed a float 2013-04-14 10:38:51 +09:00
Randy Mackay ee7f40cfe9 Copter: Leonard's alt-hold feed forward 2013-04-14 10:38:37 +09:00
Randy Mackay f82ce449d7 AC_WPNav: add angle limits and set from AC's throttle controller 2013-04-14 10:38:34 +09:00
Randy Mackay 1516972eaa Copter: add panorama to CIRCLE mode
Yaw will slowly rotate if CIRCLE_RADIUS is set to zero
Circle center is projected forward CIRCLE_RADIUS from current position
and heading
2013-04-14 10:38:01 +09:00
Randy Mackay 49828eba7d Copter: integrate AC_WPNav 2013-04-14 10:37:48 +09:00
Randy Mackay 24dd167607 Copter: ACRO bug fix from Jason 2013-04-01 11:44:28 +09:00
Andrew Tridgell b280857025 Copter: use common angle wrap code 2013-03-29 13:14:31 +11:00
Randy Mackay fdcb78ccf7 Copter: leonard's smoother alt-hold transition
Target altitude when entering alt-hold is based on a projection from
current alt and climb rate
2013-03-17 13:24:49 +09:00
Randy Mackay 37040adfaa Copter: bug fix for auto missions over 320m
get_throttle_althold_with_slew's target_alt parameter defined as int16_t
(instead of int32_t) meaning missions with altitudes >320m could wrap
around and become negative.
2013-03-17 11:14:35 +09:00
Randy Mackay f9539384a1 Copter: rename failsafe to failsafe_radio
Makes way for separation of failsafes for throttle, gps and gcs
2013-03-16 17:14:21 +09:00
Randy Mackay 476a6d0164 Copter: fix for acro throttle bug 2013-03-02 10:28:44 +09:00
Randy Mackay d8515ff85e Compass: basic compensation for motor interference 2013-03-02 00:03:16 +09:00
Randy Mackay df1c0d92bd Copter: manual throttle scaling fix
Scaling of bottom half of throttle was changed from THR_MIN ~ 500.
Previously it was from 0 ~ 500.
2013-02-01 22:37:33 +09:00
Randy Mackay a0b65a262b Copter: use scaled throttle for accel-throttle's I term
Accel throttle's I term is taken from scaled manual throttle
2013-02-01 22:37:25 +09:00
Randy Mackay 06a71af12f Copter: THR_MID used to scale manual throttle 2013-02-01 22:37:16 +09:00
Randy Mackay aaecc25ac7 Copter: leonard's inav2
Moved loiter controller to navigation.pde
2013-01-25 15:16:35 +09:00
Randy Mackay deafbf1f56 Copter: inav loiter comment changes
removed unused get_loiter_vel function
2013-01-24 11:14:38 +09:00
Randy Mackay 68fc9ac1d8 Copter: add "f" to end of float constants
This is a small performance improvement for the px4
2013-01-23 14:51:37 +09:00
Randy Mackay 9a09f086d2 Copter: Leonard Hall's inertial nav ver 2 2013-01-23 12:34:49 +09:00
rmackay9 ab1978ad50 Copter: Leonard Hall's inertial nav based loiter 2013-01-22 18:38:00 +09:00
James Bielman 5631f865b2 Update floating point calculations to use floats instead of doubles.
- Allows use of hardware floating point on the Cortex-M4.
- Added "f" suffix to floating point literals.
- Call floating point versions of stdlib math functions.
2013-01-16 13:52:01 +11:00
Randy Mackay 175f69a64f ArduCopter: smooth throttle when switching from manual throttle to alt hold
new set_accel_throttle_I_from_pilot_throttle function copies the
difference between the pilot's throttle and hover throttle to the
accelerometer based throttle controller's I term.
2013-01-13 20:00:59 +11:00
rmackay9 21b6c78d12 ArduCopter: added get_throttle_althold_with_slew to allow slower altitude target changes
Improved surface tracking by using slewed althold controller
Reduced sonar mode filter to just 3 elements to reduce lag but at the possible consequence of allowing sonar noise to creep through for people with margin sonar set-ups.
2013-01-13 19:51:47 +11:00
Andrew Tridgell 860f4b2605 Copter: merge the latest 2.9 changes into master 2013-01-08 14:37:40 -08:00
Andrew Tridgell ead38f917f Copter: use GRAVITY_MSS 2013-01-02 14:45:08 +11:00
Andrew Tridgell 51d987a890 Copter: removed unusued variable 2013-01-02 09:55:55 +11:00
rmackay9 677b38a48e ArduCopter: first implementation of surface tracking using sonar
Note: not yet enabled as part of any flight mode
2013-01-02 09:55:37 +11:00
rmackay9 daac540e08 ArduCopter: get_throttle_althold - add check to avoid divide by zero 2013-01-02 09:55:37 +11:00
rmackay9 576af6d487 ArduCopter: bug fix to althold desired rate calculation. Fix from Jonathan. 2013-01-02 09:55:37 +11:00
rmackay9 ff40fa6aab ArduCopter: alt hold bug fix - should use 2x linear distance when calculating the desired rate
Bug fix from Leonard.
2013-01-02 09:55:37 +11:00
rmackay9 393c893cdb ArduCopter: bug fix (attempt #2) for accel based throttle controller
Thanks to Jonathan for this.
2013-01-02 09:25:58 +11:00
rmackay9 e583ade62d ArduCopter: bug fix to accel based throttle controller (was using m/s instead of cm/s) 2013-01-02 09:24:31 +11:00
rmackay9 e850ab7ccd ArduCopter: add AUTO_VELZ_MIN, AUTO_VELZ_MAX and PILOT_VELZ_MAX to allow better control of climb/descent rate in auto and manual throttle modes 2013-01-02 09:24:31 +11:00
rmackay9 466097b383 ArduCopter: use inertial nav for current altitude and climb rate 2013-01-02 09:22:51 +11:00
rmackay9 7a5e4b8549 ArduCopter: stop unnecessary updates of target altitude and knock-on effect of too many EV message in dataflash log 2013-01-02 09:19:17 +11:00
rmackay9 ac8af9a53f ArduCopter: Leonard Hall's changes to alt hold including adding low pass filter to climb rate
get_throttle_rate_stabilized changed to simply update the target altitude instead of talking directly to the rate controller.
get_throttle_althold changed to use sqrt of distance when calculating the desired rate towards the target altitude.
added reset of accel based throttle PID's I term.
unrelated small bug fix from Randy to allow CH6 tuning of throttle rate D term.
2013-01-02 09:19:17 +11:00
rmackay9 f4c50353b9 ArduCopter: allow tuning of the Throttle Rate D term 2013-01-02 09:16:48 +11:00
rmackay9 7ea34d4fb7 ArduCopter: updated accel based throttle to use ahrs's get_accel_ef method
Also removed slow low pass filter meant to correct for accelerometer calibration.  This is no longer required now that we have the improved calibration method.
2013-01-02 09:11:25 +11:00
Pat Hickey 7af03127f6 ArduCopter: more work 2012-12-20 14:52:28 +11:00
rmackay9 af77425636 ArduCopter: fix Failed to Init Optflow message at startup 2012-12-11 00:09:45 +09:00
rmackay9 2f1b2b70e6 ArduCopter: added ACRO_TRAINER parameter to allow enabling/disabling the acro training function which will bring the roll back to within +- 45 degrees 2012-12-10 22:27:46 +09:00
rmackay9 154e3c33f7 ArduCopter, AP_InertialNav: consolidated ThirdOrderComplementaryFilter into AP_InertialNav to save about 200bytes of RAM 2012-12-10 00:43:11 +09:00
Robert Lefebvre 0eb57bf93d ACM: TradHeli
Fix to make update_throttle_cruise work with stab_throttle scaling.
2012-12-08 15:12:39 -05:00
Robert Lefebvre 1b97a92098 ACM: Code Cleanup 2012-12-08 14:49:38 -05:00
rmackay9 9dd978576b ArduCopter: auto yaw changes to allow pilot override of yaw during missions
Added set_yaw_mode to better control of yaw controller changes and variable initialisation.
Replaced AUTO_YAW mode with separate yaw controllers YAW_LOOK_AT_NEXT_WP, YAW_LOOK_AT_LOCATION, YAW_LOOK_AT_HEADING.
Pilot manual override of yaw causes yaw to change to YAW_HOLD (i.e. manual yaw) until next waypoint is reached.
Added get_yaw_slew function to control how quickly autopilot turns copter
Changed YAW_LOOK_AHEAD to use GPS heading and moved to new get_look_ahead_yaw function in Attitude.pde
Renamed variables: target_bearing->wp_bearing, original_target_bearing->original_wp_bearing.
Removed auto_yaw_tracking and auto_yaw variables and update_auto_yaw function as they are no longer needed.
Simplified MAV_CMD_CONDITION_YAW handling (do_yaw).  We lose ability to control direction of turn and ability to do long panorama shots but it now works between waypoints and save 20bytes.
2012-12-08 14:23:32 +09:00
rmackay9 2dd4694eef ArduCopter: adjusted pid_throttle_accel dt to 0.01 (100hz) 2012-12-06 10:32:12 +09:00
rmackay9 39d524212f ArduCopter: allow accel based throttle controller to be enabled/disabled with the new THR_ACC_ENABLE parameter.
When disabled the original velocity based throttle controller is used.
2012-12-06 10:31:57 +09:00
rmackay9 a5bb54e36e ArduCopter: RTL clean-up and slightly improved landing sensor
Consolidated RTL state to be captured by rtl_state variable.
Combined update_RTL_Nav and verify_RTL functions which performed the same function but one was for missions, the other for the RTL flight mode.
Renamed some RTL parameters and global variables to have RTL at the front.
Landing detector now checks accel-throttle's I term and/or a very low throttle value
2012-12-06 10:31:52 +09:00
rmackay9 072ffec493 ArduCopter: allow INERTIAL_NAV to be enabled separately for horizontal and vertical position 2012-12-06 10:31:41 +09:00
rmackay9 bdb47c449a ArduCopter: pass linear altitude error to throttle rate controllers.
Previously the requested rate used the square root of the altitude error.

Scale pilot's desired vertical rate and acceleration based on ACCELERATION_MAX_Z and VELOCITY_MAX_Z #defines
2012-12-06 10:31:31 +09:00
rmackay9 7b4ed2d227 ArduCopter: restored landing detector to landing throttle mode.
Added LAND_SPEED parameter to control the rate of descent for the last 10m of a landing.
Added CH6 tuning for accel based throttle controller.
2012-12-06 10:31:20 +09:00
rmackay9 a94826f182 ArduCopter: add set_throttle_mode to better control initialisation of variables 2012-12-06 10:31:04 +09:00
rmackay9 1036b35128 ArduCopter: added back in angle boost and recombined for heli and multicopter 2012-12-06 10:30:55 +09:00
rmackay9 3cbef57c64 ArduCopter: first merge of leonard's accel based altitude controller plus other changes from Randy
Changes include:
New low-level get_throttle_accel function takes target acceleration and compares vs earth-frame Z accelerometer values to produce output to motors.
Higher level throttle controllers modified to call new get_throttle_accel controller
Throttle_rate_stabilized controller added which maintains a desired climb/descent rate
Throttle_land controller added - descends using normal auto throttle controller to 10m then descends at 50cm/s
Multiple throttle modes added including landing mode
Land flight mode no longer needs GPS
Throttle cruise maintenance moved to update_throttle_cruise function
2012-12-06 10:30:49 +09:00
Robert Lefebvre 1d589c0b7d ACM: TradHeli
Fixes for Attitude rate controllers.
2012-12-04 14:42:04 -05:00
Robert Lefebvre 07d7d90882 ACM: TradHeli
Bringing in Low Pass Filter for Rate Controllers
2012-11-26 21:51:23 -05:00
Robert Lefebvre 3f0e8dd358 ACM: TradHeli
Bringing in Low Pas Filter
Commented out because it does not build.
Needs updates to Low Pass Filter Lib
2012-11-26 21:21:12 -05:00
Robert Lefebvre e8d619acad ACM: Begin creation of TradHeli rate control.
May affect Multi-Rotors.
2012-11-26 21:02:41 -05:00
Robert Lefebvre 95eeda7cf7 ACM: TradHeli
Removing Angle Boost function.
Does not make sense for helis due to aerodynamics.  Can cause more problems than it solves.
2012-11-26 18:58:21 -05:00
Robert Lefebvre 6ffc115236 Changes to get_throttle_rate()
Commented out a bit of code that is not used currently
Change the output constrains to #defines so they can be easily changed, particularly for use in TradHeli.
2012-11-21 17:11:38 -05:00
rmackay9 07a7a1acd8 ArduCopter: replaced digitalRead and digitalWrite with faster calls
improved performance logging to dataflash
2012-11-19 01:16:07 +09:00
Jason Short 5f57678a9c ACM Nav_throttle- removed sign inversion 2012-11-16 17:38:57 -08:00
rmackay9 ac5dcc8d49 ArduCopter: remove last remanants of rate_d to resolve compiler warning of unused variables 2012-11-12 12:35:58 +09:00
Jason Short 69db678252 ACM: attitude.pde - adjusted the FF of the alt hold algorithm, the old way was pretty crap. increased the output range of rate controller. 2012-11-11 18:22:54 -08:00
Jason Short 5ad38a32bf ACM : Attitude : added nav param reset 2012-11-09 22:15:15 -08:00
Jason Short 3c78c4a7a3 ACM : Attitude.pde added ap bitfield for failsafe bit 2012-11-09 22:15:15 -08:00
Jason Short a42c6bb609 ACM : Attitude.pde removed stabilize D 2012-11-09 22:15:15 -08:00
rmackay9 14cbe37d3e ArduCopter: remove unused get_stabilize_rate_yaw 2012-11-07 23:28:25 +09:00
rmackay9 1f801714e8 ArduCopter: incorporate new version of inertial navigation
Moved several navigation functions from ArduCopter.pde to navigation.pde
2012-11-07 19:21:31 +09:00
rmackay9 a1b4ec6d0e ArduCopter: move to use new INS library instead of IMU library 2012-11-07 19:21:09 +09:00
Jason Short 8a8ed7a711 ACM : Formatting 2012-10-28 12:12:38 -07:00
rmackay9 4877348c49 ArduCopter: remove some unhelpful constraints on nav_lat and nav_lon.
Increase other constraints from 3200 to 32000.  These constraints are there to ensure int32_t do not cause an overflow when added to an int16_t.
2012-10-24 22:04:35 +09:00
rmackay9 5e8043fd9c ArduCopter: changed ACRO_ROLL_STABILIZE and ACRO_PITCH_STABILIZE to parameters
Changes on behalf of Leonard Hall
2012-10-23 21:30:50 +09:00
Jason Short a0752dc7dc ACM Acceleration management
removed unused waypoint_radius var
removed slow_wp
updated speed management system to maintain a constant acceleration or deceleration of 1m/s
changed version to 2.8.1a
2012-10-21 14:32:39 -07:00
rmackay9 583f2e49a3 ArduCopter: integrated Leonard Hall's improved ACRO mode 2012-10-18 23:24:34 +09:00
rmackay9 b944d9df26 ArduCopter: bug fix in earthframe->body frame translation.
Provided by Leonard Hall.

Also removed large unnecessary comments.
2012-10-17 19:15:25 +09:00
rmackay9 5fbe53a84d ArduCopter: bug fix for get_yaw_rate_stabilized_ef
Provided by Leonard Hall
2012-10-17 10:18:24 +09:00
LeonardTHall d7b7e1cefa New Yaw controller using rate feed forward and stabilize.
Signed-off-by: LeonardTHall <LeonardTHall@gmail.com>
2012-10-15 11:37:49 +09:00
rmackay9 997fe85880 ArduCopter: fixed acro mode
Changes included:
Removing earth frame roll_rate_trim, pitch_rate_trim and yaw_rate_trim.
Switch ACRO mode to use YAW_ACRO instead of YAW_HOLD.
Changed YAW_ACRO to use stabilize yaw when axis_enabled.
Reset ACRO roll, pitch and yaw targets to current attitude when first entering ACRO.
2012-10-14 17:47:46 +09:00
rmackay9 2848bb8ee6 ArduCopter: freeze I terms if motor limits breached 2012-10-11 17:20:00 +09:00
rmackay9 7cf60e61b4 ArduCopter: bug fix in earth-frame to body-frame conversion for roll 2012-10-07 19:14:40 +09:00
rmackay9 05fd04134a ArduCopter: fix heli build 2012-10-06 13:46:19 +09:00
rmackay9 e375a27058 ArduCopter: prioritise rate controllers, rate controller targets converted to body frame 2012-10-03 14:10:31 +09:00
rmackay9 361ff0c08f ArduCopter: allow PID logging of throttle. Make get_angle_boost actually use parameter passed in. 2012-09-18 23:19:23 +09:00
uncrustify f783ace0de uncrustify ArduCopter/Attitude.pde 2012-08-21 19:19:50 -07:00
Jason Short 0a25a189eb ACM | Attitude.pde - removed next_wp.alt reset. 2012-08-18 12:25:48 -07:00
Jason Short bc631b656e ACM: Added a more sane limit to Angle boost 2012-08-18 09:04:21 -07:00
rmackay9 87d5b5944d ArduCopter: commented out get_acro_yaw2 function to reduce compiler warnings 2012-08-18 16:03:49 +09:00