[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Paparazzi-devel] Disabling Magnetometer Heading?
From: |
Luke Ionno |
Subject: |
Re: [Paparazzi-devel] Disabling Magnetometer Heading? |
Date: |
Sat, 26 Nov 2011 19:01:05 -0500 |
I solved the problem... There is a small bug in the DCM body-to-IMU
rotation implementation, when the USE_GPS flag is enabled. The GPS heading
(which is obviously not dependent on the orientation of the IMU) is
incorporated into the state matrix, before it is rotated as defined by the
body-to-IMU variables... This of course results in an error in the reported
heading.
My quick solution was to add IMU_BODY_TO_IMU_PSI to the ground_course, to
compensate for it later being subtracted by the body-to-IMU rotation:
float ground_course = ((float)gps.course)/1.e7 - M_PI + IMU_BODY_TO_IMU_PSI;
~Luke
-----Original Message-----
From: Luke Ionno
Sent: Saturday, November 26, 2011 2:10 PM
To: address@hidden
Subject: Re: [Paparazzi-devel] Disabling Magnetometer Heading?
A followup to my previous question:
Looking through the code, I tried using the "USE_GPS" flag under the DCM
filter, though if I'm reading things right, leaving the "USE_MAGNETOMETER"
flag out should cause it to revert to GPS heading by default... Anyway,
this hasn't really solved the problem... Somehow, the magnetometer is still
influencing the solution, providing an initial heading, which by default is
180 deg. offset from the physical heading. I can change it by changing the
MAG_SIGN values, but there's also a dynamic issue coming up; when I fly
circles (~15m radius, maybe 3 m/s -- slowflyer speeds) , the heading is
almost immediately corrupted, and the aircraft is depicted as flying
sideways on the GCS; after landing, the heading has a residual error,
typically showing between 45-90 deg. of error, which can only be cleared by
rebooting. The roll/pitch solution is solid throughout the flight, though.
I'm using the Sparkfun 9-DOM sensor stick, which has the same components and
orientations as the PPZIMU board, and in the past, I've used those without
having such a bad time, though I always flew without the "USE_MAGNETOMETER"
flag. The only thing I can think of is that I’m using an IMU-to-aircraft
rotation of 90 deg. about the yaw axis, due to mounting constraints, but
given that the pitch and roll axes are working fine, it annoys me that the
heading is proving so difficult.
~Luke
-----Original Message-----
From: Luke Ionno
Sent: Saturday, November 26, 2011 1:03 AM
To: address@hidden
Subject: [Paparazzi-devel] Disabling Magnetometer Heading?
Hello,
Question: How do you disable the magnetometer-based heading for a fixed-wing
airframe (reverting to the GPS-based heading), when using an
Aspirin/PPZUAV/Sparkfun 9-DOM sensor-stick, and the DCM filter? Or is it
off by default, and on only when the USE_MAGNETOMETER define is included?
The reason I ask is that I've been bench-testing -without- the "define
USE_MAGNETOMETER", and while it seems to have an understanding of magnetic
heading (telemetry reports a heading, even before a GPS lock is obtained),
there's a lot of drift, and often ends up pointing 90-180+ deg. away from
the actual physical heading after a few minutes.
Thanks!
Regards,
~Luke
_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel