-
Notifications
You must be signed in to change notification settings - Fork 17
Clarification about using TRICAL_estimate_update() #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@Lelelo1 Maybe you can help? Do you know which values to pass to the function? |
As far as I came to understand it. The expected field is from world magnetic model. You can check what the earth magnetic field is supposed to be in your location with Launch Single Point Calculator If you point your device to north it should print that vector when there is none or little magnetic distortion. The coordinate system of the vector from world magnetic model and the measurement in the application needs to match. Its used in a kalman filter, in |
Thank you very much for your help. I was using the same calculator and for me the "Total field" is calculated as 50,325.0 nT, which is ~50uT. That's why I did following: But in the
I tried with I found one repo which uses the function, but is really difficult to understand what is going on there. Which values did you use for the |
√(x2 + y2 + z2). Is same as norm (50) It could look like this the vector: For latitude: 57.698745, longitude: 11.966936 |
So I can make up any combination of 3 values which by formula will provide 50? Can I use fixed vector always? Or should it be updated according to something else? |
In the repository mentioned above, they use following:
Where
|
No That vector represent a arrow pointing the direction earths magnetic field in 3d. For instance ENU coordinate system means east component is x, north component is y, and vertical component is z. When there is no distortion all measurements become like a sphere, all of them having length(norm) of 50. The norm depend on how near earth's poles you are I recommend you collect the first measurement and use it as expected field instead. It assumes you are in spot with little magnetic distortion. Then you can test to distort measurement with some metal near sensor of the device. The kalman filter should block those values and application should still be accurate depending how well the Kalman is made |
Thank you for clarification. Then, if I understood correctly, I will do following:
Can you confirm? |
I tried with your values for demo purposes, the bias doesn't change. It is always 0, 0, 0. I wrote an example which you can run on your pc. I recorded the magnetometer values, and saved them in a header file to be used as an input for the TRICAL. Here is the link I am sorry for taking your time. I would appreciate if you can take a look. The program output is not normal: it prints NaN and ones . |
I have stopped programming this kind of stuff. So I can’t look at it in detail. But I can tell you that bias is distortion |
Ok, I understand :) Thank you very much for your help. If I will get it working I will post updates here. |
Found two repositories that are using TRICAL, which can serve as a reference, though it looks a little complicated: https://github.com/sfwa/fcs/blob/master/fcs/hardware/platform/cpuv1-ioboardv1.c |
Hi,
I am getting X, Y, Z values from magnetometer in uT units.
I am using following tool to identify magnetic field in my location, and the value is 50uT (though my calibrated reading are usually around ~55uT).
I don't understand which value should be used for
expected_field
argument inTRICAL_estimate_update(&global_instance, sensor_reading, expected_field)
. Can you please tell me what values should be put there?Below is the pseudocode that I am using, can you please check that the usage is correct?
The text was updated successfully, but these errors were encountered: