A colleague (Philippe Ardit) and I are working on an AHRS (Attitude and Heading Reference System) based on the Puck.js 2.0 (or 2.1) (as 1.0 is not equipped with an IMU (Inertial Measurement Unit)).
This is a complete novel field for us and I was wondering if some people out there have already developed such a system?
Preliminary code from Philippe for the Puck.js is available at: github.com/PhilippeArdit/espruinoSandBox > Some test results > Some Espruino tests (I2C scan, AHRS cube, ...)
You need to click on this latest link, to select Puck.js, click on connect (pair your specific Puck.js) and then on Show AHRS Cube, to try the code that shows a cube moving in coordination with the Puck.js. (Press reset to stop the Puck.js from emitting.)
It is inspired from the Bangle.js Data Streaming > Bonus 3D Rendering Espruino original tutorial code, with main differences being that:
However, we are not satisfied with the performances: Mainly because making a full rotation about whatever axis doesn't bring back the original orientation in the display.
Certainly the magnetometers should be incorporated to be able to track a direction in the horizontal plane, but other inconsistencies make us think that filters, refreshing rates, or whatever other parameters or algorithms need to be implemented/tuned in a better way.
Any help would be appreciated~~
You might want to experiment with https://gtsam.org/.
Maybe too heavy weight for your final application, but good to get a feeling for what is ultimately possible with state of the art professional filtering. There are IMU only examples somewhere.
Nice idea - it's something that would be really handy to provide a library for.
I'd imagine that increasing the data rate and trying to do the sensor fusion on the Puck would be a good idea? If you lose just one gyro reading then that'd knock out the estimated angle.
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem