Commit Graph

202 Commits

Author SHA1 Message Date
Randy Mackay 0015747af9 Copter: ACRO bug fix from Jason 2013-04-01 11:41:52 +09:00
Randy Mackay bcedf0f8a1 Copter: bug fix for throttle after acro flip
Throttle was kept a min if user switched out of ACRO mode while inverted
2013-03-30 09:20:29 +09:00
Randy Mackay 0c520f89d6 Copter: bug fix for alt_hold being passed as int16_t to get_throttle_althold_with_slew 2013-03-30 09:07:18 +09:00
Randy Mackay ac764642ca Copter: manual throttle scaling fix
Scaling of bottom half of throttle was changed from THR_MIN ~ 500.
Previously it was from 0 ~ 500.
2013-01-31 23:21:18 +09:00
Randy Mackay 5a3c7b2d35 Copter: use scaled throttle for accel-throttle's I term
Accel throttle's I term is taken from scaled manual throttle
2013-01-31 16:30:03 +09:00
Randy Mackay 11ff042fea Copter: THR_MID used to scale manual throttle 2013-01-31 00:25:41 +09:00
Randy Mackay a18892229c 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-12 12:20:37 +09:00
rmackay9 b58a89e71e 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-08 14:40:47 -08:00
rmackay9 152ae7d737 ArduCopter: save 10bytes by replacing multiple static instances of log_counter with a single global variable called pid_log_counter
pid_log_counter is used to limit the rate at which we log PID controller values
2013-01-05 13:42:01 +09:00
rmackay9 0a101162c2 ArduCopter: update altitude_error reported to GCS 2013-01-05 10:59:07 +09:00
rmackay9 b9dbdadc80 ArduCopter: first implementation of surface tracking using sonar
Note: not yet enabled as part of any flight mode
2012-12-29 13:51:14 +09:00
rmackay9 71f6a116be ArduCopter: get_throttle_althold - add check to avoid divide by zero 2012-12-26 21:18:16 +09:00
rmackay9 c10af02c4a ArduCopter: bug fix to althold desired rate calculation. Fix from Jonathan. 2012-12-23 11:17:26 +09:00
rmackay9 dad2d2b800 ArduCopter: alt hold bug fix - should use 2x linear distance when calculating the desired rate
Bug fix from Leonard.
2012-12-22 17:57:11 +09:00
rmackay9 4749789bc2 ArduCopter: bug fix (attempt #2) for accel based throttle controller
Thanks to Jonathan for this.
2012-12-22 14:56:22 +09:00
rmackay9 085425fdbf ArduCopter: bug fix to accel based throttle controller (was using m/s instead of cm/s) 2012-12-22 14:21:25 +09:00
rmackay9 ecb388059e 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 2012-12-22 12:52:49 +09:00
rmackay9 c7a0a64eae ArduCopter: use inertial nav for current altitude and climb rate 2012-12-21 14:07:18 +09:00
rmackay9 c8c13046e3 ArduCopter: stop unnecessary updates of target altitude and knock-on effect of too many EV message in dataflash log 2012-12-17 16:34:20 +09:00
rmackay9 e3ee865dc0 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.
2012-12-17 14:36:05 +09:00
rmackay9 d8ea210019 ArduCopter: allow tuning of the Throttle Rate D term 2012-12-15 13:32:07 +09:00
rmackay9 ff9902c5d6 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.
2012-12-12 16:29:46 +09:00
rmackay9 628fb1da15 ArduCopter: fix Failed to Init Optflow message at startup 2012-12-11 00:09:45 +09:00
rmackay9 93fa3fbc69 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 b65f050b8a ArduCopter, AP_InertialNav: consolidated ThirdOrderComplementaryFilter into AP_InertialNav to save about 200bytes of RAM 2012-12-10 00:43:11 +09:00
Robert Lefebvre 083c451ec6 ACM: TradHeli
Fix to make update_throttle_cruise work with stab_throttle scaling.
2012-12-08 15:12:39 -05:00
Robert Lefebvre c6537ae6e3 ACM: Code Cleanup 2012-12-08 14:49:38 -05:00
rmackay9 f62c377062 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 c734a42e15 ArduCopter: adjusted pid_throttle_accel dt to 0.01 (100hz) 2012-12-06 10:32:12 +09:00
rmackay9 bdf236ef38 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 9750c14325 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 eb3ad15843 ArduCopter: allow INERTIAL_NAV to be enabled separately for horizontal and vertical position 2012-12-06 10:31:41 +09:00
rmackay9 8a0faebb21 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 dc0b35da30 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 e629fe2eb0 ArduCopter: add set_throttle_mode to better control initialisation of variables 2012-12-06 10:31:04 +09:00
rmackay9 1285198b71 ArduCopter: added back in angle boost and recombined for heli and multicopter 2012-12-06 10:30:55 +09:00
rmackay9 c1ce0ae752 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 5863c737a1 ACM: TradHeli
Fixes for Attitude rate controllers.
2012-12-04 14:42:04 -05:00
Robert Lefebvre 4463150122 ACM: TradHeli
Bringing in Low Pass Filter for Rate Controllers
2012-11-26 21:51:23 -05:00
Robert Lefebvre 332b728ebf 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 a4ae24de6c ACM: Begin creation of TradHeli rate control.
May affect Multi-Rotors.
2012-11-26 21:02:41 -05:00
Robert Lefebvre 311d190494 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 211f964553 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 38fdacd93b ArduCopter: replaced digitalRead and digitalWrite with faster calls
improved performance logging to dataflash
2012-11-19 01:16:07 +09:00
Jason Short ab215838a6 ACM Nav_throttle- removed sign inversion 2012-11-16 17:38:57 -08:00
rmackay9 702dd1fb2e ArduCopter: remove last remanants of rate_d to resolve compiler warning of unused variables 2012-11-12 12:35:58 +09:00
Jason Short 27a41c294b 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 d527d19635 ACM : Attitude : added nav param reset 2012-11-09 22:15:15 -08:00
Jason Short 9b295ca7cf ACM : Attitude.pde added ap bitfield for failsafe bit 2012-11-09 22:15:15 -08:00
Jason Short 9b16fdf182 ACM : Attitude.pde removed stabilize D 2012-11-09 22:15:15 -08:00