Hello,
I have a custom board with a KL43Z MCU and FXOS accelerometer sensor.
For my application, I am using the sensor fusion library to process the sensor data.
My question is, How can I "adjust" the axis according to the board orientation?
I plan to use the board as a tracking device, and thus, the initial position of the board may vary, is there a way to "zero" the axis according to the board orientation?
Sorry If I am not using the correct nomenclature, but this is the very first time I use this kind of sensor.
Thanks,
Thiago
The adjustment is commonly called the "hardware abstraction layer" and is used to align sensor orientations to the PCB orientation.
Some example code is in drivers.c in the function calls ApplyAccHal, ApplyMagHal and ApplyGyroHal.
The best way to do the alignment is experimentally by observing the sensor data you read in and then swapping or negating axes until it matches the PCB Coordinate system you have chosen.
Do please note that there are three PCB coordinate systems commonly in use: i) Aerospace (NED), ii) Android (ENU) and iii) Windows 8/10 (another ENU coordinate system). My personal preference is the Aerospace coordinate system where x is the far end of the PCB, y to the right and z downwards.
Thanks, I will look into that function calls.
From your answer I can flip the coordinates via coding, but what about the starting position values?
When I Turn on the sensor, its current position will allways be 0,0,0, or is it related to some other reference?
How can I tell it "ok, this is your default 0,0,0 position from now on".
All the sensors power up and give the first reading (and all later readings) correctly. The accelerometer gives acceleration in its package coordinate system, and so on.
The sensor fusion provides orientation (roll, pitch, yaw essentially). The software initializes the orientation to the orientation provided by the first sensor measurements, not to zero roll, pitch, yaw
mark