归一化成角度的地球磁场

Normalising angled Earth magnetic field

我和我的团队正在参加 ESA Astro Pi 挑战。我们的程序将 运行 在国际空间站上运行 3 个小时,我们会将结果返回并进行分析。


我们想研究 Sense HAT 磁力计的磁场强度测量值与世界磁场模型 (WMM) 的预测值之间的联系。我们想研究一下 Sense HAT 上磁力计的精度。

该程序将从 Sense HAT 获取微特斯拉中的原始磁力计数据(XYZ)并计算值 H 和 F,如 British geological survey's article 中所述(第 2.1 节)。然后它将它们保存到 CSV 文件,连同使用 ephem 计算的时间戳和位置。

然后我们将比较 ISS 和 WMM 的 Z、H 和 F 值,并使用我们的数据和差异创建地图(如图 6、8 和 10)。然后我们会研究,Sense HAT 磁力计数据的准确性如何。


我们想将我们的数据与 WMM 的数据进行比较,以了解 Sense HAT 磁力计的准确度如何,但我们有一个问题,即磁力计的方向始终不同。因此,我们的数据将始终(非常)不同于 WMM,因此我们将无法正确比较它们。

我们与 Astro Pi 支持团队进行了交谈,他们建议 "normalise the angled measurements so it looks like they were taken by a device aligned North/South"。

不幸的是,我们(和他们)不知道该怎么做,所以他们建议在 Stack Exchange 上问这个问题。我在 Math Stack Exchange, Physics Stack Exchange and Raspberry Pi Forums 上问过。很遗憾,他们没有收到任何答复,所以我再次提出这个问题。

我们怎样才能做到这一点?我们有时间戳、ISS 位置(纬度、经度、海拔)、磁数据(XYZ)以及北方方向的数据。

我们想要规范化我们的数据,以便我们能够正确地将它们与来自 WMM 的数据进行比较。


这是我们计算磁力计值(获取非标准化数据)的程序的一部分:

compass = sense.get_compass_raw()

try:
    # Get raw data (values are swapped because Sense HAT on ISS is in different position)
    # x: northerly intensity
    # y: easterly intensity
    #  z: vertical intensity
    x = float(compass['z'])
    y = float(compass['y'])
    z = float(compass['x'])

except (ValueError, KeyError) as err:
    # Write error to log (excluded from this snippet)
    pass

try:
    # h: horizontal intensity
    # f: total intensity
    # d: declination
    # i: inclination
    h = sqrt(x ** 2 + y ** 2)
    f = sqrt(h ** 2 + z ** 2)
    d = degrees(atan(y / x))
    i = degrees(atan(z / h))

except (TypeError, ValueError, ZeroDivisionError) as err:
    # Write error to log (excluded from this snippet)
    pass

我们的代码还提供了一些简单的模拟器:https://trinket.io/library/trinkets/cc87813ce7


Astro Pi 团队关于位置和磁力计位置的部分电子邮件:

  • Z is going down through the middle of the Sense Hat.
  • X runs between the USB ports and SD card slot.
  • Y runs across from the HDMI port to the 40 way pin header.

On the ISS the AstroPi orientation is that the Ethernet + USB ports face the deck and the SD card slot is towards the sky. So, that's basically a rotation around the Y axis from flat. So you keep the Y axis the same and swap around Z and X.


It can help to look at the Google Street view of the interior of the ISS Columbus module to get a better idea how the AstroPi is positioned; https://www.google.com/streetview/#international-space-station/columbus-research-laboratory

If you pan the camera down and to the right, you'll see a green light - that's the AstroPi. The direction of travel for the whole space station is towards the inflatable Earth ball you can see on the left.

So, broadly speaking, the SD card slot points towards azimuth as in away from the centre of the Earth (so the X axis). The LED matrix is facing the direction of travel of the space station (the Z axis).

Because of the orbital path of the ISS the Z and Y axes will continually change direction relative to the poles as it moves around the Earth.

So, I am guessing you want to normalise the angled measurements so it looks like they were taken by a device aligned North/South?

我认为您需要创建类似于 NEH(北,东,height/altitude/up)的局部参考坐标系

  • Representing Points on a Circular Radar Math approach.

它在航空中通常用作参考系(航向源自它),因此您的参考系是根据您的地理位置及其指向北、东向上

现在的问题是 aligned North/Southnormalizing.. 是什么意思?

如果参考设备仅测量 投影,则您需要执行以下操作:

dot(measured_vector,reference_unit_direction)

方向是 North 方向,但作为单位向量。

如果参考设备也测量全3D,那么您需要将参考和测试测量数据转换到相同的坐标系中。这是通过使用

如此简单的 matrix * vector 乘法就可以了...然后才计算值 H,F,Z,我不知道它们是什么,也懒得看论文...希望 E,HB 向量。

但是,如果您在测量时没有地理位置,那么您只有欧拉角形式的相对于国际空间站的 North 方向,因此您根本无法构建 3D 参考系(除非你有 2 个已知向量而不是像 UP 这样的向量)。在这种情况下,您需要使用选项 1 projection(使用点积和北向矢量)。因此,之后您将只处理标量值而不是 3D 向量。

[编辑 1]

来自您的 link:

The geomagnetic field vector, B, is described by the orthogonal components X (northerly intensity), Y (easterly intensity) and Z (vertical intensity, positive downwards);

这不是我的专业领域,所以我在这里可能是错的,但这是我的理解:


B(Bx,By,Bz) - 磁场矢量
a(ax,ay,az) - 加速度

现在 FB 的量级,所以它的旋转不变性:

F = |B| = sqrt( Bx*Bx + By*By + Bz*Bz )

您需要在 NED 参考系(北、东、下)中计算 B 的 X、Y、Z 值,因此您首先需要基向量:

Down = a/|a|  // gravity points down
North = B/|B| // north is close to B direction
East = cross(Down,North) // East is perpendicular to Down and North
North = cross(East,Down) // north is perpendicular to Down and East, this should convert North to the horizontal plane

你应该渲染它们以目视检查它们是否指向正确的方向,如果没有通过重新排序交叉操作数来否定它们(我可能顺序错了我习惯使用向上向量代替)。现在只需将 B 转换为 NED :

X = dot(North,B)
Y = dot(East,B)
Z = dot(Down,B)

现在您可以计算 H

H = sqrt( X*X +Y*Y )

您可以在上面的变换矩阵 link 中找到为此所需的矢量数学。

请注意,只有在不存在加速度的情况下(传感器在操作过程中不在机械臂上,或者 ISS 没有进行燃烧……)否则您需要获得 NED 不同的框架(比如来自机载系统)

如果这不能正常工作,那么您可以从您的国际空间站位置计算 NED,但为此您需要知道传感器相对于提供您位置的仿真模型的确切方向和位移。我不知道 ISS 会进行哪些旋转,所以除非万不得已,否则我不会触及该主题。

恐怕我有一段时间没有时间编码了……无论如何,没有样本输入数据、坐标系扩展和所有input/output变量的编码都是疯狂的……简单的否定axis 将使整个事情无效,并且沿途有很多口是心非,要涵盖所有这些,您最终会得到许多版本来尝试...

应逐步构建应用程序,但恐怕如果无法访问模拟或真实硬件,那是不可能的。并且有很多事情可能会出错......即使是简单的程序也很难编写代码......我会首先检查 F 因为它不需要任何 "normalization" 首先看看结果是否关闭。如果关闭,它可能会提示不同的单位或天知道是什么......