ardupilot/ArduCopter
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
..
Frame move Frame into ArduCopter 2011-09-09 11:52:15 +10:00
.gitignore Improvements to cmake. 2011-09-29 21:23:26 -04:00
APM_Config_mavlink_hil.h removed airspeed 2012-01-04 09:28:37 -08:00
APM_Config.h Eliminated second instance of APM2 #defines 2012-01-12 20:38:41 +00:00
ArduCopter.pde R10 2012-01-11 22:41:51 -08:00
Attitude.pde climb rate control 2012-01-10 23:42:26 -08:00
Camera.pde ArduCopter Camera.pde: changed from CH_n to CH_CAM_ notation. 2012-01-09 21:57:02 -08:00
command description.txt renamed top level directories 2011-09-09 11:27:41 +10:00
commands_logic.pde attempting to force down without using Manual boost. 2012-01-11 22:41:51 -08:00
commands_process.pde moved to verify_land 2012-01-11 22:41:51 -08:00
commands.pde added set_new_altitude call 2012-01-10 23:42:27 -08:00
config_channels.h Rename ArduCopter/config_motors.h to config_channels.h 2012-01-09 21:57:02 -08:00
config.h New Loiter Gains for new Loiter methods 2012-01-11 22:41:51 -08:00
control_modes.pde Cosmetic 2012-01-04 09:28:36 -08:00
defines.h Added altitude change flags 2012-01-10 23:42:26 -08:00
events.pde added set_new_altitude call() 2012-01-10 23:43:44 -08:00
flip.pde Fixed Flip code to compile. Flip still not flight tested! 2011-09-25 12:21:54 -07:00
GCS_Mavlink copy.txt removed unused vars 2012-01-04 09:28:37 -08:00
GCS_Mavlink.pde Added Xplane output option 2012-01-04 09:28:38 -08:00
GCS.h USB-MUX: enable USB MUX switching for ArduCopter 2011-11-25 20:00:19 -08:00
GCS.pde renamed top level directories 2011-09-09 11:27:41 +10:00
heli.pde APM_RC & ArduCopter: Change interface to SetFastOutputChannels to use _BV 2012-01-09 21:57:01 -08:00
leds.pde ACM: use LED_OFF/LED_ON instead of LOW/HIGH 2011-12-26 19:32:53 +11:00
Log.pde comma 2012-01-10 23:45:33 -08:00
Makefile sitl: added build targets for different ACM frames 2012-01-04 21:45:46 +11:00
motors_hexa.pde ArduCopter motors_hexa: rewrite remainder from CH_ macros to MOT_ macros. 2012-01-09 21:57:02 -08:00
motors_octa_quad.pde ArduCopter motors_octa_quad: rewrite remainder from CH_ macros to MOT_ macros 2012-01-09 22:06:48 -08:00
motors_octa.pde ArduCopter motors_octa: rewrite remainder from CH_ macros to MOT_ macros 2012-01-09 21:57:02 -08:00
motors_quad.pde motors_quad: translate from CH_ to MOT_ notation. 2012-01-09 21:57:02 -08:00
motors_tri.pde ArduCopter motors_tri: rewrite CH_ macros with MOT_ macros 2012-01-09 22:06:49 -08:00
motors_y6.pde ArduCopter motors_y6: rewrite CH_ macros with MOT_ macros 2012-01-09 22:06:49 -08:00
motors.pde ArduCopter: add ch_of_mot lookup to motors.pde 2012-01-09 21:57:02 -08:00
navigation.pde New Loiter control 2012-01-11 22:41:51 -08:00
Parameters.h ArduCopter - added ROLL_PITCH_STABLE_OF (i.e. Stabilised Roll/Pitch + adjustments based on optical flow) 2012-01-09 13:53:54 +09:00
planner.pde Stability patch updates, 2011-12-06 21:03:56 -08:00
radio.pde Fixed type error 2012-01-10 23:43:44 -08:00
read_me.text renamed top level directories 2011-09-09 11:27:41 +10:00
sensors.pde Bug fix for compass. 2012-01-12 14:44:24 -07:00
setup.pde Fixed Type Error 2012-01-10 23:43:44 -08:00
system.pde Switched to set_next_WP for mode switches 2012-01-10 23:43:44 -08:00
test.pde ArduCopter test.pde: translate from CH_ to MOT_ notation 2012-01-09 21:57:02 -08:00
UserCode.pde Added Andrew's user hooks. 2011-10-15 15:29:33 -07:00
UserVariables.h Added Andrew's user hooks. 2011-10-15 15:29:33 -07:00