vault backup: 2025-06-30 14:22:44
Affected files: .obsidian/plugins/text-extractor/cache/899aad293a1fdfe252a45cce4fecf11a.json .obsidian/workspace.json Attachments/madgwick_internal_report.pdf Temporary/Madgwick Filter.md
This commit is contained in:
1
.obsidian/plugins/text-extractor/cache/899aad293a1fdfe252a45cce4fecf11a.json
vendored
Normal file
1
.obsidian/plugins/text-extractor/cache/899aad293a1fdfe252a45cce4fecf11a.json
vendored
Normal file
File diff suppressed because one or more lines are too long
63
.obsidian/workspace.json
vendored
63
.obsidian/workspace.json
vendored
@@ -36,9 +36,23 @@
|
||||
"icon": "lucide-file",
|
||||
"title": "2025-06-30"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "554d0a8a002b7009",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "markdown",
|
||||
"state": {
|
||||
"file": "Temporary/Madgwick Filter.md",
|
||||
"mode": "source",
|
||||
"source": false
|
||||
},
|
||||
"icon": "lucide-file",
|
||||
"title": "Madgwick Filter"
|
||||
}
|
||||
}
|
||||
],
|
||||
"currentTab": 1
|
||||
"currentTab": 2
|
||||
}
|
||||
],
|
||||
"direction": "vertical"
|
||||
@@ -285,11 +299,52 @@
|
||||
"periodic-notes:Open today": false
|
||||
}
|
||||
},
|
||||
"active": "b83d89fd7f7eedcb",
|
||||
"floating": {
|
||||
"id": "f49c6f7de5895e15",
|
||||
"type": "floating",
|
||||
"children": [
|
||||
{
|
||||
"id": "18da32de35f53adb",
|
||||
"type": "window",
|
||||
"children": [
|
||||
{
|
||||
"id": "f6e86550cdec0587",
|
||||
"type": "tabs",
|
||||
"children": [
|
||||
{
|
||||
"id": "fad31e0fc0101a29",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "markdown",
|
||||
"state": {
|
||||
"file": "Temporary/Madgwick Filter.md",
|
||||
"mode": "source",
|
||||
"source": false
|
||||
},
|
||||
"icon": "lucide-file",
|
||||
"title": "Madgwick Filter"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"direction": "vertical",
|
||||
"x": 1572,
|
||||
"y": 498,
|
||||
"width": 527,
|
||||
"height": 795,
|
||||
"maximize": false,
|
||||
"zoom": 0.5
|
||||
}
|
||||
]
|
||||
},
|
||||
"active": "fad31e0fc0101a29",
|
||||
"lastOpenFiles": [
|
||||
"Attachments/madgwick_internal_report.pdf",
|
||||
"0 Journal/0 Daily/2025-06-30.md",
|
||||
"Temporary/Madgwick Filter.md",
|
||||
"Temporary/2025-06-29.md",
|
||||
"Temporary/2025-06-30.md",
|
||||
"0 Journal/0 Daily/2025-06-30.md",
|
||||
"0 Journal/0 Daily/2025-06-28.md",
|
||||
"Dashboard Canvas.canvas",
|
||||
"Dashboard.md",
|
||||
@@ -322,8 +377,6 @@
|
||||
"Attachments/Pasted image 20250612221908.png",
|
||||
"99 Work/0 OneSec/OneSecNotes/30 Engineering Skills/Robotics/kalman_filter.excalidraw.md",
|
||||
"OneNote/PhD/Things to know very well when applying for a robotics PhD.md",
|
||||
"2 Personal/1 Skills/IT/React Learnings.md",
|
||||
"99 Work/0 OneSec/OneSecThoughts/Cofounder Meeting 1 - 04.06.25.md",
|
||||
"Attachments/Pasted image 20250604104446.png",
|
||||
"2 Personal/1 Skills/IT",
|
||||
"Sync",
|
||||
|
||||
BIN
Attachments/madgwick_internal_report.pdf
Normal file
BIN
Attachments/madgwick_internal_report.pdf
Normal file
Binary file not shown.
53
Temporary/Madgwick Filter.md
Normal file
53
Temporary/Madgwick Filter.md
Normal file
@@ -0,0 +1,53 @@
|
||||
---
|
||||
title: Madgwick Filter
|
||||
created_date: 2025-06-30
|
||||
updated_date: 2025-06-30
|
||||
aliases:
|
||||
tags:
|
||||
---
|
||||
# Madgwick Filter
|
||||
|
||||
## Summary
|
||||
- All operations are being done in [[Quaternion]]s for smooth and continuous rotation operations as well as to avoid the gimbal lock
|
||||
- [[Accelerometer]], [[Gyroscope]] and [[Magnetometer]]s are used as the input in order to estimate the attitude.
|
||||
- The [[Gradient Descent]] Method is used, in order to minimize the error between the measured and the estimated gravity and magnetic field vectors. This error is expressed as a cost function $J(q)$
|
||||
- The angular velocity data from the gyroscope is used to update the attitude quaternion by integrating it: $\dot{q}=\frac{1}{2}q\times \omega$
|
||||
- The accelerometer and magnetometer data are used to correct the drift in the gyroscope's integration. The correction is based on the expected vs the measured direction of gravity and the magnetic north.
|
||||
- The filter uses a complementary filter type to combine the different sensor types. This ensures the short-term (high frequency) changes are guided by the gyroscope and the long-term (low frequency) orientation is corrected by the accelerometer and the magnetometer.
|
||||
- we always normalize the quaternion to maintain a unit quaternion.
|
||||
|
||||
## Detailed Analysis
|
||||
White Paper:
|
||||
![[madgwick_internal_report.pdf]]
|
||||
|
||||
Quaternion rotation
|
||||
$$
|
||||
{}^{B}\mathbf{v}
|
||||
\;=\;
|
||||
{}^{A}_{B}\hat{\mathbf{q}}
|
||||
\;\otimes\;
|
||||
{}^{A}\mathbf{v}
|
||||
\;\otimes\;
|
||||
{}^{A}_{B}\hat{\mathbf{q}}^{*}
|
||||
$$
|
||||
|
||||
### Filter Derivation
|
||||
Definitions.
|
||||
- $S$: Sensor Frame
|
||||
- $E$: Earth Frame
|
||||
|
||||
The Gyroscope measures: $\omega_x$, $\omega_y$, $\omega_z$ in $rads^{-1}$
|
||||
This means we can define the following vector (format used to rotate it with a quaternion):
|
||||
$${}^{S}\boldsymbol{\omega}= \begin{bmatrix} 0 & \omega_x & \omega_y & \omega_z \end{bmatrix}$$
|
||||
|
||||
## Comparison agains the [[Kalman Filter]]
|
||||
1. Madgwick's algorithm is computationally more efficient. It's simpler and requires fewer computations.
|
||||
2. The Madgwick's algorithm is simpler and more straightforward to implement.
|
||||
3. The Madgwick's algorithm does require minimal tuning compared to the Kalman filter
|
||||
4. Madgwick's algorithm can have bettter robustness to sensor noise
|
||||
|
||||
|
||||
|
||||
## Resources
|
||||
- [Original White Paper - 2010](https://x-io.co.uk/downloads/madgwick_internal_report.pdf)
|
||||
-
|
||||
Reference in New Issue
Block a user