Commit Graph

663 Commits

Author SHA1 Message Date
Jason Short
a59c9ae22c added notes 2012-01-12 22:28:58 -08:00
Doug Weibel
9846822748 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
70b7951366 Eliminated second instance of APM2 #defines 2012-01-12 20:38:41 +00:00
Jason Short
a7bce15365 R10 2012-01-11 22:41:51 -08:00
Jason Short
99ea69ef7b New Loiter control 2012-01-11 22:41:51 -08:00
Jason Short
257890d5be New Loiter Gains for new Loiter methods 2012-01-11 22:41:51 -08:00
Jason Short
98f637282b moved to verify_land 2012-01-11 22:41:51 -08:00
Jason Short
5e9db462f5 attempting to force down without using Manual boost. 2012-01-11 22:41:51 -08:00
Jason Short
f35411ac45 R9 2012-01-10 23:46:08 -08:00
Jason Short
84e001594d comma 2012-01-10 23:45:33 -08:00
Jason Short
4b54887c6c Switched to set_next_WP for mode switches 2012-01-10 23:43:44 -08:00
Jason Short
6b836d1a09 Fixed Type Error 2012-01-10 23:43:44 -08:00
Jason Short
c4476bdd80 Fixed type error 2012-01-10 23:43:44 -08:00
Jason Short
3e8ff39d4b Climb rate control 2012-01-10 23:43:44 -08:00
Jason Short
a79d302b98 added set_new_altitude call() 2012-01-10 23:43:44 -08:00
Jason Short
e102cb9e6a Added ending for auto landing 2012-01-10 23:42:27 -08:00
Jason Short
3a5ffc252d updated climb rate control
Land detector
2012-01-10 23:42:27 -08:00
Jason Short
acd877abda added set_new_altitude call 2012-01-10 23:42:27 -08:00
Jason Short
f36aba8af2 climb rate control 2012-01-10 23:42:26 -08:00
Jason Short
5a91396f63 Added climb rate control
removed unused vars
2012-01-10 23:42:26 -08:00
Jason Short
dab4fb43d4 Added altitude change flags 2012-01-10 23:42:26 -08:00
Jason Short
351be7c305 Made timer unsigned 2012-01-10 23:42:26 -08:00
Jason Short
7b8767d846 Added comments 2012-01-10 23:42:26 -08:00
Jason Short
b1e971ea18 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
5f55780b5e Added comments
moved out failsafe check. otherwise the reporting was erroneous.
2012-01-10 23:42:26 -08:00
Jason Short
92f7b22722 Moved failsafe check to more logical place 2012-01-10 23:42:26 -08:00
Jason Short
cf92631d33 added #if to wind compensation code 2012-01-10 23:42:26 -08:00
Pat Hickey
fc6321b7ca ArduCopter motors_y6: rewrite CH_ macros with MOT_ macros 2012-01-09 22:06:49 -08:00
Pat Hickey
927e60d85b ArduCopter motors_y6: rewrite loop in terms of motors 2012-01-09 22:06:49 -08:00
Pat Hickey
ac7f6a5602 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
73610ddb6c ArduCopter motors_octa_quad: rewrite remainder from CH_ macros to MOT_ macros 2012-01-09 22:06:48 -08:00
Pat Hickey
7f4c994346 ArduCopter motors_octa_quad: rewrite loop in terms of motors 2012-01-09 22:05:01 -08:00
Pat Hickey
e2be119433 ArduCopter motors_octa: rewrite remainder from CH_ macros to MOT_ macros 2012-01-09 21:57:02 -08:00
Pat Hickey
46b8037a73 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
79030a84b8 ArduCopter motors_hexa: rewrite remainder from CH_ macros to MOT_ macros. 2012-01-09 21:57:02 -08:00
Pat Hickey
f7e14fff37 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
b907c1fd5c ArduCopter: add ch_of_mot lookup to motors.pde 2012-01-09 21:57:02 -08:00
Pat Hickey
7535c1c3fe ArduCopter test.pde: translate from CH_ to MOT_ notation 2012-01-09 21:57:02 -08:00
Pat Hickey
6a4442557c ArduCopter setup.pde: translate from CH_ to MOT_ notation 2012-01-09 21:57:02 -08:00
Pat Hickey
91bc2698a8 ArduCopter radio.pde: translate CH_ to MOT_ outputs 2012-01-09 21:57:02 -08:00
Pat Hickey
2f63c636ad Rename ArduCopter/config_motors.h to config_channels.h 2012-01-09 21:57:02 -08:00
Pat Hickey
f5b6746ad7 ArduCopter: Change TRI_FRAME yaw servo output to CH_TRI_YAW define 2012-01-09 21:57:02 -08:00
Pat Hickey
c105f64dca ArduCopter Camera.pde: changed from CH_n to CH_CAM_ notation. 2012-01-09 21:57:02 -08:00
Pat Hickey
e0e430895e motors_quad: translate from CH_ to MOT_ notation. 2012-01-09 21:57:02 -08:00
Pat Hickey
0b40f55334 ArduCopter: include config_motors.h in sketch 2012-01-09 21:57:01 -08:00
Pat Hickey
e5e8ed8a54 ArduCopter config_motors.h: stubs in for CH_CAM_PITCH and CH_CAM_ROLL 2012-01-09 21:57:01 -08:00
Pat Hickey
9eae2ec7fe ArduCopter config_motors.h: proper defs for APM1 MOT_[5..8] 2012-01-09 21:57:01 -08:00
Pat Hickey
a30558e9b2 ArduCopter config.h: add standard ifndef/define header macro wrappers 2012-01-09 21:57:01 -08:00
Pat Hickey
a7628b7f78 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
a19afd926a 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