0
$\begingroup$

I can't find out the response so I am posting here.

My post kind of follow this one : Adding magnetic field vector to a Kalman filter but I already know that I don't have to put the magnetometer in a state vector.

I am working on a implementation of an Extended Kalman filter. So far I have integrated a gyroscope, an accelerometer and encoders wheels.

But I don't know what are the equation for the update state to integrate a magnetometer.

So far :

  • I have seen some kind of work where magnetometer are fuse with accelerometer. But I don't have any formulas and I am kind of stuck...

  • I have seen some kind of work where there is no quaternion but I can't afford this modelisation cause of gimbal lock and I have all my work already in quaternion...

Thanks in advance for help. Don't hesitate if you need complementary details.

$\endgroup$
  • 1
    $\begingroup$ What are you modeling/observing, because the magnetometer can probably be expressed as a function of your state. Probably only a function of the (unit) quaternion, when assuming that the magnetic field does not change direction relative to the earth at different positions. $\endgroup$ – fibonatic Nov 16 '18 at 17:59
  • $\begingroup$ I am modeling a robot in a 3D space. My kalman vector state is : (Quaternion, Angular velocity, x, y, Vx, Vy) $\endgroup$ – Benjamin Nov 19 '18 at 9:24
  • $\begingroup$ Don't hesitate if you need more infos ! $\endgroup$ – Benjamin Nov 20 '18 at 15:09
0
$\begingroup$

A magnetometer measures the local magnetic field. When assuming that the Earth is the only magnetic source, then this magnetic field should be constant in world coordinates. But the magnetometer measures the magnetic field in local body fixed coordinates. The world and body coordinates should be related via the unit quaternion. So the magnetometer measures a constant vector rotated by the quaternion. In order to find this constant vector you would need to do some calibration at the start of each flight.

$\endgroup$
0
$\begingroup$

First, you need a model of the magnetic field you are measuring. Have a look at the IGRF model, which is usually used in space applications. There are ready to go implementations for most programming languages.

With this model, you are able to calculate a theoretical magnetic field vector in the inertial coordinate frame, depending on your estimated position. With your estimated quaternion you transform this vector in your body coordinate frame.

Second, now you have a theoretical vector in the body frame and a measured vector in the body frame, provided by the sensor.

The rest is straight forward EKF formulation.

References: Three-axis attitude determination via Kalman filtering of magnetometer data, MARK L. PSIAKI

Fundamentals of Spacecraft Attitude Determination and Control, Markley, F. Landis

$\endgroup$
  • $\begingroup$ Thanks for the answer and references, I will research that way $\endgroup$ – Benjamin Dec 21 '18 at 14:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.