Commit Graph

766 Commits

Author SHA1 Message Date
Jason Short 6d0f078fdd Added Landing throttle control to force down the copter 2012-01-12 22:28:58 -08:00
Jason Short b493cb1e55 removed unused defines
lowered default Loiter gain
2012-01-12 22:28:58 -08:00
Jason Short 8416de7e9c Added Ryan's GPS lag filter
Removed unused code
refined alt change
2012-01-12 22:28:58 -08:00
Jason Short 400d080d12 added notes 2012-01-12 22:28:58 -08:00
Doug Weibel 622217357c Bug fix for compass.
This is a fix for an interesting bug when a DCM matrix reset was added to the ground start.  This bug only showed up if (A) a ground start were performed after an air start or due to use of the "Calibrate Gryo" action, (B) if the current orientation were sufficiently different from 0/0/0, and (C.) if the particular magnetometer had sufficiently large offsets.  Why did resetting the DCM matrix to 0/0/0 pitch/roll/yaw at ground start cause a bug?  The magnetometer offset nulling determines the proper offsets for the magnetometer by comparing the observed change in the magnetic field vector with the expected change due to rotation as calculated from the rotation in the DCM matrix.  This comparison is made at 10Hz, and then filtered with a weight based on the amount of rotation to estimate the offsets. Normally it would take considerable time at normal in-flight rotation rates for the offset estimate to converge. 

If a DCM matrix reset occurs when the offset nulling algorithm is up and running, the algorithm sees the DCM reset as a instantaneous rotation, however the magnetic field vector did not change at all.  Under certain conditions the algorithm would interpret this as indicating that the offset(s) should be very large.  Since the "rotation" could also have been large the filter weighting would be large and it was possible for a large erroneous estimate of the offset(s) to be made based on this single (bad) data point.

To fix this bug methods were added to the compass object to start and stop the offset nulling algorithm.  Further, when the algorithm is started, it is set up to get fresh samples.  The DCM matrix reset method now calls these new methods to stop the offset nulling before resetting the matrix, and resume after the matrix has been reset.
2012-01-12 14:44:24 -07:00
analoguedevices c00bcc58d9 Eliminated second instance of APM2 #defines 2012-01-12 20:38:41 +00:00
Jason Short 33fe4db3fc R10 2012-01-11 22:41:51 -08:00
Jason Short 464038b3ea New Loiter control 2012-01-11 22:41:51 -08:00
Jason Short 2566f1fb95 New Loiter Gains for new Loiter methods 2012-01-11 22:41:51 -08:00
Jason Short 55cb0ad476 moved to verify_land 2012-01-11 22:41:51 -08:00
Jason Short 7978a2a21a attempting to force down without using Manual boost. 2012-01-11 22:41:51 -08:00
Jason Short db1fafaaec R9 2012-01-10 23:46:08 -08:00
Jason Short 22ebe00773 comma 2012-01-10 23:45:33 -08:00
Jason Short 7933492fec Switched to set_next_WP for mode switches 2012-01-10 23:43:44 -08:00
Jason Short 30f5ecda54 Fixed Type Error 2012-01-10 23:43:44 -08:00
Jason Short ed903c6cd3 Fixed type error 2012-01-10 23:43:44 -08:00
Jason Short 36516161b5 Climb rate control 2012-01-10 23:43:44 -08:00
Jason Short 78925d57c2 added set_new_altitude call() 2012-01-10 23:43:44 -08:00
Jason Short 0c9dc11ac1 Added ending for auto landing 2012-01-10 23:42:27 -08:00
Jason Short 7d4067a6ed updated climb rate control
Land detector
2012-01-10 23:42:27 -08:00
Jason Short f683371508 added set_new_altitude call 2012-01-10 23:42:27 -08:00
Jason Short 581657ab7a climb rate control 2012-01-10 23:42:26 -08:00
Jason Short 439c15f3fc Added climb rate control
removed unused vars
2012-01-10 23:42:26 -08:00
Jason Short c385db412e Added altitude change flags 2012-01-10 23:42:26 -08:00
Jason Short 9cbfcac802 Made timer unsigned 2012-01-10 23:42:26 -08:00
Jason Short 9d1b1dba77 Added comments 2012-01-10 23:42:26 -08:00
Jason Short 5b00928b15 added location error calc to get better data. Otherwise we'll be 1 GPS read off. 2012-01-10 23:42:26 -08:00
Jason Short 0744179970 Added comments
moved out failsafe check. otherwise the reporting was erroneous.
2012-01-10 23:42:26 -08:00
Jason Short 5d28e97339 Moved failsafe check to more logical place 2012-01-10 23:42:26 -08:00
Jason Short f240888b49 added #if to wind compensation code 2012-01-10 23:42:26 -08:00
Pat Hickey 7961021895 ArduCopter motors_y6: rewrite CH_ macros with MOT_ macros 2012-01-09 22:06:49 -08:00
Pat Hickey 397aef9c2a ArduCopter motors_y6: rewrite loop in terms of motors 2012-01-09 22:06:49 -08:00
Pat Hickey 2f11c3f17a ArduCopter motors_tri: rewrite CH_ macros with MOT_ macros
* Third Tricopter motor was on CH_4, so it is called MOT_4. This
  will be changed in a subsequent commit.
2012-01-09 22:06:49 -08:00
Pat Hickey 757471c3a3 ArduCopter motors_octa_quad: rewrite remainder from CH_ macros to MOT_ macros 2012-01-09 22:06:48 -08:00
Pat Hickey ee7356c1a7 ArduCopter motors_octa_quad: rewrite loop in terms of motors 2012-01-09 22:05:01 -08:00
Pat Hickey f8aa1456cc ArduCopter motors_octa: rewrite remainder from CH_ macros to MOT_ macros 2012-01-09 21:57:02 -08:00
Pat Hickey ad5c31cd38 ArduCopter motors_octa: rewrite janky loops to use ch_of_mot
* Previously the loop was written over channels, now it is over motors
* the correct channel for that motor is determined by ch_of_mot.
* ch_of_mot is defined correctly based on the config_channels macros.
2012-01-09 21:57:02 -08:00
Pat Hickey f055cbc720 ArduCopter motors_hexa: rewrite remainder from CH_ macros to MOT_ macros. 2012-01-09 21:57:02 -08:00
Pat Hickey 2cf935e2d2 ArduCopter motors_hexa: rewrite janky loops to use ch_of_mot
* Previously the loop was written over channels, now it is over motors
* the correct channel for that motor is determined by ch_of_mot.
* ch_of_mot is defined correctly based on the config_channels macros.
2012-01-09 21:57:02 -08:00
Pat Hickey b8b6e3c25b ArduCopter: add ch_of_mot lookup to motors.pde 2012-01-09 21:57:02 -08:00
Pat Hickey 87735fef24 ArduCopter test.pde: translate from CH_ to MOT_ notation 2012-01-09 21:57:02 -08:00
Pat Hickey 20b0e4cd33 ArduCopter setup.pde: translate from CH_ to MOT_ notation 2012-01-09 21:57:02 -08:00
Pat Hickey 38c2a052be ArduCopter radio.pde: translate CH_ to MOT_ outputs 2012-01-09 21:57:02 -08:00
Pat Hickey 8d4db05f50 Rename ArduCopter/config_motors.h to config_channels.h 2012-01-09 21:57:02 -08:00
Pat Hickey b22920c0ea ArduCopter: Change TRI_FRAME yaw servo output to CH_TRI_YAW define 2012-01-09 21:57:02 -08:00
Pat Hickey ccff9041f8 ArduCopter Camera.pde: changed from CH_n to CH_CAM_ notation. 2012-01-09 21:57:02 -08:00
Pat Hickey 8d595d7c53 motors_quad: translate from CH_ to MOT_ notation. 2012-01-09 21:57:02 -08:00
Pat Hickey 7b056f208d ArduCopter: include config_motors.h in sketch 2012-01-09 21:57:01 -08:00
Pat Hickey e969e0dc55 ArduCopter config_motors.h: stubs in for CH_CAM_PITCH and CH_CAM_ROLL 2012-01-09 21:57:01 -08:00
Pat Hickey eb345c009b ArduCopter config_motors.h: proper defs for APM1 MOT_[5..8] 2012-01-09 21:57:01 -08:00
Pat Hickey bcb43ec9b5 ArduCopter config.h: add standard ifndef/define header macro wrappers 2012-01-09 21:57:01 -08:00
Pat Hickey a1cc77f41e ArduCopter: add config_motors.h with MOT_n to CH_m mapping
* APM1 values are not valid, but hopefully APM2 will stay that way?
2012-01-09 21:57:01 -08:00
Pat Hickey d015e0d6d9 APM_RC & ArduCopter: Change interface to SetFastOutputChannels to use _BV
* Every use of MSK_CH_n changed to _BV(CH_n)
* Easier to read, and will allow CH_n to be parameterized without needing
  a separate macro expansion for the MSK value.
2012-01-09 21:57:01 -08:00
Jason Short ba72a98345 Slowed Auto Descent
Don't return true in Landing code to prevent flyways in Stabilize
2012-01-08 23:01:22 -08:00
Randy Mackay 7b9701fdd5 ArduCopter - added ROLL_PITCH_STABLE_OF (i.e. Stabilised Roll/Pitch + adjustments based on optical flow)
Removed optical flow from regular loiter for now until it's tested.
2012-01-09 13:53:54 +09:00
analoguedevices 8b68da3105 Put in commented-out APM2 #defines, to save people the trouble of having to type them in themselves 2012-01-09 01:59:55 +00:00
Jason Short fda12c8902 Added Acro to Rate_P 2012-01-08 14:52:10 -08:00
Randy Mackay 598593e1fc ArduCopter - changed Sonar to use A1 (was AN4) 2012-01-08 17:48:30 +09:00
Jason Short a8574e813d R8 2012-01-07 22:28:03 -08:00
Jason Short 0a7378856d Added finish to missions - auto-land or stabilize 2012-01-07 22:27:26 -08:00
Jason Short cf5e0b3a1b converted auto land to use the mission planner version
Removed gate that looked for already set control_mode. Wasn't compatible with failsafe
2012-01-07 22:27:26 -08:00
Jason Short 12493d6431 Moved wind comp into a define 2012-01-07 22:27:26 -08:00
Jason Short 7e96e0f7fa Quad frame - X is default
added wind comp stability option to config - off by default
2012-01-07 22:27:26 -08:00
Jason Short 250545f31d Auto-land updates - removed sonar option - not needed
updates from JLN
2012-01-07 22:27:26 -08:00
Jason Short ca80dc549c Made RTL hold position until it reaches altitude 2012-01-07 22:27:26 -08:00
Jason Short b8bcd81b39 Cleanup 2012-01-07 22:27:26 -08:00
Jason Short 048532ae98 scaled to 0-1023 2012-01-06 21:43:37 -08:00
Jason Short 058a3275c3 Revved to R7 2012-01-06 10:22:53 -08:00
Jason Short 056a08d838 Forced Faildafe throttle mode to throttle Auto 2012-01-06 10:21:50 -08:00
Jason Short 57c3405658 Added check for armed motors in failsafe 2012-01-06 10:21:23 -08:00
Jason Short a640311f58 Added Note 2012-01-06 10:20:59 -08:00
Jason Short e908390c64 Made RTL go up 10m for failsafe 2012-01-06 10:20:48 -08:00
Jason Short d430c847fa Changed default throttle type for failsafe to avoid checking
changed timer to 20 seconds.
2012-01-06 10:20:31 -08:00
Jason Short de912b5054 Auto_land update 2012-01-05 21:57:34 -08:00
Jason Short beac2930c9 Added auto_land to RTL 2012-01-05 21:15:12 -08:00
Jason Short 9d9bef37a8 Clears Auto_land timer 2012-01-05 21:15:12 -08:00
Jason Short a8af509517 timer set to unsigned 2012-01-04 17:31:20 -08:00
Andrew Tridgell 600a5680f8 ACM: reset all I terms on gyro calibration 2012-01-05 10:15:14 +11:00
Andrew Tridgell a6808162d6 ACM: fixed a warning
comment out some unused debug code
2012-01-05 10:14:53 +11:00
Andrew Tridgell 734b0a02be ACM: fixed a alt hold bug
== instead of =
2012-01-05 10:14:30 +11:00
Andrew Tridgell 3c965ff1a2 ACM: fixed a signed/unsigned warning 2012-01-05 10:14:12 +11:00
Andrew Tridgell 9ee3431928 ACM-simple: don't use uninitialised simple trig values 2012-01-05 10:13:36 +11:00
Jason Short 8341a080ce Disabled stable mode wind comp by default for release 2012-01-04 09:28:38 -08:00
Jason Short 5aa0861ec2 Added Xplane output option 2012-01-04 09:28:38 -08:00
Jason Short 6b9d35cc34 Added home offset for altitude 2012-01-04 09:28:38 -08:00
Jason Short f74e265bb9 Made landing disarm the motors 2012-01-04 09:28:38 -08:00
Jason Short 3ac37c09a9 Upped Revision 2012-01-04 09:28:38 -08:00
Jason Short a70fdc58a1 Cleaned up and documented each global vavriable
Added Wind compensation for Stability
Acro mode fixes
2012-01-04 09:28:37 -08:00
Jason Short 123ce533bb Added precalc for wind compensation when entering Stabilze mode 2012-01-04 09:28:37 -08:00
Jason Short bf8e3975ec Added Wind compensation for Stabilize
moved speed calc to it's own function
decreased acceleration from WPs
2012-01-04 09:28:37 -08:00
Jason Short 6b3094e053 removed PM test field 1 - not needed 2012-01-04 09:28:37 -08:00
Jason Short 7858976407 removed unused vars 2012-01-04 09:28:37 -08:00
Jason Short 22c3853020 removed unused vars 2012-01-04 09:28:37 -08:00
Jason Short e5994c578a removed unused vars 2012-01-04 09:28:37 -08:00
Jason Short 3d7f3f6b77 removed unused var 2012-01-04 09:28:37 -08:00
Jason Short 8d63af2a89 removed airspeed 2012-01-04 09:28:37 -08:00
Jason Short a1c3ce88a0 calc_wind_compensation called when exiting AP modes
Rate I terms reset in Acro Mode switch
Limit of 1 m set to alt hold
Reset circle angle to 0 by default
Land got land_complete var set to false by default
2012-01-04 09:28:37 -08:00
Jason Short e6887aa3ec added Reset_Rate_I function
Removed I term from Throttle rate calc
Added some basic constrains to Acro
2012-01-04 09:28:37 -08:00
Jason Short dd4b4c723a removed airspeed 2012-01-04 09:28:37 -08:00
Jason Short 7bef298a46 cleanup - removed unused functions, made pressure reading Float to avoid extra cast 2012-01-04 09:28:36 -08:00
Jason Short d7f4328441 cosmetic 2012-01-04 09:28:36 -08:00
Jason Short 1883d0c1a8 Added takeoff state and ground state variable 2012-01-04 09:28:36 -08:00
Jason Short c629795050 Cosmetic 2012-01-04 09:28:36 -08:00
Jason Short 801b3a8e8f removed unused Airspeed config 2012-01-04 09:28:36 -08:00
Jason Short fcd18d5538 Removed unused options 2012-01-04 09:28:36 -08:00
Jason Short 525ac4df88 Cosmetic 2012-01-04 09:28:36 -08:00
Jason Short c450cc4e92 removed unused Airspeed config 2012-01-04 09:28:36 -08:00
Jason Short 4a50e08ac1 change how Reset Nav params work - no longer clear I terms 2012-01-04 09:28:36 -08:00
Jason Short fe265b3040 Added JLN's landing patch, moved some variables local such as Jump counter 2012-01-04 09:28:36 -08:00
Jason Short 5de709ceea removed unused functions 2012-01-04 09:28:36 -08:00
Andrew Tridgell 54b91ce2f4 sitl: added build targets for different ACM frames 2012-01-04 21:45:46 +11:00
Andrew Tridgell d6ccffc71b ACM: don't set defaults in APM_Config.h
defaults set here prevent Makefile overrides, which breaks autotest
for non-default frame types
2012-01-04 19:35:05 +11:00
Andrew Tridgell 645eac6f38 I2c: default to 5ms timeout, and faster bus speed
we will slow down the speed when we get a failure
2012-01-04 16:36:47 +11:00
Jason Short 24bddb1c47 Added more constraints around velocity 2011-12-31 10:59:59 -08:00
Jason Short 86e01fce17 Cosmetic 2011-12-31 10:54:31 -08:00
Jason Short bfd7608f4d Lowered Yaw to prevent overshoot based on feedback 2011-12-31 10:10:45 -08:00
Jason Short e8db2225dd upped to r5 2011-12-31 10:05:13 -08:00
Jason Short e17c8705ba Loiter I reset 2011-12-31 09:45:25 -08:00
Jason Short e9d41897df R4 2011-12-30 23:54:02 -08:00
Jason Short 1d636219f9 New Style WP navigation for high wind 2011-12-30 23:48:05 -08:00
Jason Short fc93a73ad7 no longer calling reset_nav 2011-12-30 23:48:04 -08:00
Jason Short 170a646ecf removing I term clearance 2011-12-30 23:48:04 -08:00
Jason Short 4b2979743f no longer calling reset_nav 2011-12-30 23:48:04 -08:00
Jason Short 62ca68cdbb Reverted to Crosstrack like in Arduplane, requires Degrees * 100 2011-12-30 23:48:04 -08:00
Jason Short 27d3564eab Sync with Arduplane 2011-12-30 23:48:04 -08:00
Jason Short f5ffa7bd7e Updated Configs based on field testing. 2011-12-30 23:48:04 -08:00
Jason Short e08b550f44 Added a default Yaw tracking setting
Added Nav_Bearing
2011-12-30 23:48:04 -08:00
Jason Short 09db32ee02 Added Nav_bearing, just like APlane
added fix for LOITER in missions so we don't Yaw in circles
2011-12-30 23:48:04 -08:00
Jason Short 758a5240f2 removed old loiter method option 2011-12-30 23:48:04 -08:00
Randy Mackay c39ebde9de ArduCopter - init_compass - fixed HIL build issue 2011-12-31 12:29:54 +09:00
Jason Short 57b2d17d8a updated rev 2011-12-29 23:02:41 -08:00
Jason Short 8fc73844ee Yaw Performance tweaks 2011-12-29 23:02:03 -08:00
Jason Short 4535bc4fd9 lowered to nav_lat and nav_lon int16
added a version that didn't have I term added to get a better indication of velocity estimation
2011-12-29 23:02:03 -08:00
Jason Short 89c705c8b9 removed loiter I from Reset Nav 2011-12-29 23:02:03 -08:00
Jason Short 723adffc48 updated Loiter gains 2011-12-29 23:02:03 -08:00
Jason Short 4bfa5def76 removed Rate_I from Loiter, lowing Rate_P from Loiter too. Too aggressive leads to rapid oscillations in air, and not around loiter position. 2011-12-29 23:02:03 -08:00
Jason Short 2f657ebdbf cosmetic 2011-12-29 23:02:03 -08:00
Jason Short aa2e474b80 Added 5 sec Takeoff Timer to clear i terms when lifting
Moved loiter relocation function to update_nav
moved User hooks to correct place
Added tuning for D term
2011-12-29 23:02:03 -08:00
Jason Short 8a1b9df325 Added Stabilize_D parameter 2011-12-29 23:02:02 -08:00
Jason Short ce990f3050 Upped Yaw speed to deal with performance complaints
Added new Stabilize D term default of .25
2011-12-29 23:02:02 -08:00
Jason Short 83d52899b0 Added second order, filtered derivative in stabilize. Works much better than the non-filtered one I used to have. 2011-12-29 23:02:02 -08:00
Jason Short e42d5cb4f9 Fixes for Smooth Loiter 2011-12-29 23:02:02 -08:00
Jason Short c4ad864ed0 Set Define for Max throttle 2011-12-29 23:02:02 -08:00
Jason Short 737feabc6c Fixed a 1280 only test 2011-12-29 23:02:02 -08:00
Jason Short f94727ed02 added define for Max throttle 2011-12-29 23:02:02 -08:00
Jason Short 200f7da103 Added Dampening term for tuning 2011-12-29 23:02:02 -08:00
Jason Short 80e1715b12 updated Loiter PIDs 2011-12-29 23:02:02 -08:00
Jason Short db0a7be233 Enable Magnetometer by default 2011-12-29 23:02:02 -08:00
Jason Short 3202f1cf64 Missing ; 2011-12-29 23:02:01 -08:00
Jason Short 9832d8eccb removed takeoff complete flag from missions, not used and would be useful elsewhere. 2011-12-29 23:02:01 -08:00