I have been implementing the algorithm in the paper titled Design of a Modified Madgwick Filter for Quaternion-Based Orientation Estimation Using AHRS by Amjed S. Al-Fahoum and Momtaz S. Abadir (thank you IJCEE for being open access). I have been able to figure out most parts, but am confused by equations 15 to 17 on page 5 (178 in Journal). They reference Mahoney et al., but that paper is much more opaque to me. I asked the authors recently, but no response yet (if you're reading, you're welcome to answer this here for all).
The equations define $\omega_{error,t}$ as a quaternion estimate of gyroscope error, $\omega_{b,t}$ as the DC component of $\omega_{error,t}$, and $\omega_{c,t}$ as the compensated gyroscope measurement:
$\omega_{error,t} = 2.\hat{q}^*_{est,t-1} \otimes \dot{q}_{est,t} \tag{15}$
where $\hat{q}^*_{est,t-1}$ is the conjugate of the previous time's orientation, and $\dot{q}_{est,t}$ is an estimated rate of change of the orientation quaternion from the current and previous estimates.
$\omega_{b,t} = \sigma\sum{\omega_{error,t}\Delta t} \tag{16}$
where $\Delta t$ is the time since the previous estimate and $\sigma$ is a gain parameter.
$\omega_{c,t} = \omega_{b,t} - \omega_{error,t} \tag{17}$
- Why does the error equation hava a different coefficient from the quaternion derivative equation $\dot{q}=\frac12 \omega q$?
- Why aren't the gyroscope measurements ($\omega_t$ or $\dot{q}_{\omega,t}$) explicitly included in the bias calculation?
- This seems important since $\omega_{c,t}$ is used in place of gyroscope measurements $\omega_t$.
Reply from one of the authors:
This aligns more with my expectations, but the factor of two in Equation 15 is unexpected to me. It could be absorbed into the $\sigma$ in any case, so perhaps it is just a scaling.