BjarneBitscrambler / OrientationSensorFusion-ESP

Files for performing orientation sensor fusion using NXP version 7 algorithm, ported to Espressif platforms.
BSD 3-Clause "New" or "Revised" License
23 stars 12 forks source link

Confirm that the Sensor Axes are oriented correctly #5

Closed BjarneBitscrambler closed 3 years ago

BjarneBitscrambler commented 3 years ago

Testing with the Sensor Toolbox indicates that the axes of the sensors might not be oriented correctly. It appears that the X and Y axes of both the magnetometer and the accelerometer are swapped. The file hal_axis_remap.c needs to be edited to correct this. The expected orientation for nautical use (and apparently aeronautical) is called NED, where X,Y,Z are in a right-hand coordinate system pointing North, East, and Down respectively.

BjarneBitscrambler commented 3 years ago

Corrected the X,Y swaps of the axes in hal_axis_remap.c

There is still an issue wherein the Sensor Toolbox shows the sensor rotating the opposite direction around the Z-axis than it really is. As well, the angular readout on the compass heading is inverted (e.g. 90 degrees shows up as 270 degrees).

Current functions in hal_axis_remap.c do not apply any operations to the axes.

BjarneBitscrambler commented 3 years ago

Completed adjusting and testing the axes - the current software works with the Adafruit AXOS8700/AXAS21002 combination sensor breakout board. The following comments are in hal_axis_remap.c and repeated below for convenience.

With an unknown sensor board, the most straightforward way to determine the correct axis transformations is with the help of the NXP Sensor Toolbox.

@tedenda and @DanielG86 : have you had a chance to try out the latest software? With the WiFi streaming, it's easier to test things without the USB cable getting wrapped.... Results this afternoon seemed good - I was getting quick response and stability on the heading reading after ensuring the magnetometer was calibrated (the Toolbox tab that shows magnetometer performance and cal readings is very useful, and the calibration can be uploaded to the ESP with a button-click.)

DanielG86 commented 3 years ago

Haven't had the time to look at your progress in the past days. And still learning how to use Github, so basically I don't know (yet) how to use your new code, unless it's merged in the SensESP main branch. Will dive into that first, I guess.

DanielG86 commented 3 years ago

mmm, you wrote a really good readme, which explains how to upload the code! Will take a chance whenever I have the time

BjarneBitscrambler commented 3 years ago

Great! Don't hesitate to ask me any questions that come up. Consider yourself a guinea pig :-)

I haven't worked on the new fusion code for a couple days, but it should be in a functional state. My next plan is some housekeeping: renaming files, functions, etc...

Cheers, Bjarne

On Tue, Nov 10, 2020 at 1:19 PM DanielG86 notifications@github.com wrote:

mmm, you wrote a really good readme, which explains how to upload the code! Will take a chance whenever I have the time

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/BjarneBitscrambler/OrientationSensorFusion-ESP/issues/5#issuecomment-724972874, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQJATFJHJZCNBELQVCFU5BTSPGU57ANCNFSM4TJTTONQ .