Hello guest, if you read this it means you are not registered. Click here to register in a few simple steps, you will enjoy all features of our Forum.
This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
iNav 2.6 aligning magnetometer(a compass)
#16
I'd mount everything back in the wing as it's going to be used, do the calibration, and check. I'm not sure how iNav corrects for magnetic declination (eg inav_auto_mag_decl = ON), but that could explain the slight offset you're seeing in the above test. You can look up the correct value here and set it manually: https://www.magnetic-declination.com/
Reply
Login to remove this ad | Register Here
#17
well just found out i had my fc set wrong i had the fc 90 deg and it should be 270 but now when i try it it is not working correctly not even when i change it to CW 270 flip. i'm back to square one.

does the fc board and compass have to move in same direction? on the screen direction changes moving compass like the picture but also changes moving just the fc board
Reply
#18
The FC and mag alignment both need to be set correctly, as iNav combines data from both to determine heading. Make sure the FC orientation is set correctly when the magnetometer is disabled, then enable the magnetometer and make sure that orientation is set properly as well.

Edit: The FC should be set to CW270 (not CW270FLIP). The magnetometer should be set to CW270FLIP.
Reply
#19
In the sensors tab what should it be reading if facing north should it be 0 for x y z? My mag refresh is 50 ms and scale is 1. My acc refresh is 50 ms but scale is 2 should they be the same and what should the x y z be?
Reply
#20
Those numbers are dependent on your location, the magnetic environment, and orientation of the sensor. They should not all be 0.

With the compass mounted in the wing, run the calibration as described here: https://github.com/iNavFlight/inav/wiki/...alibration
Then verify the compass is calibrated correctly by following the procedure here: https://github.com/iNavFlight/inav/wiki/...d-properly
Reply
#21
Thanks I have to absorb all this and try it out I will let you know how it turns out thanks all of you for the help.
Reply
#22
Jimv I'm struggling with inav issues too.... You're not alone. For one thing, what does GAIN mean with regard to the mag? Another thing, if we mount the mag/gps with arrow forward, like the manual says, why is it considered CW270FLIP? I understand the gps ceramic antenna needs to face up, and I guess they located the mag upside down and 90 degrees to the left.... Anyway, once I set mine cw270flip, I get readings just like you did, I can't get them to line up with a compass. Always off by ten degrees or so. From what one of the other guys said, a few degrees more or less is ok....
Reply
#23
If you're off by ~10 degrees that sounds like the magnetic declination is not set properly.

Lookup the correct value here: https://www.magnetic-declination.com/ and set it using "set mag_declination = "
Reply
#24
V-22

I'm starting from the beginning step-1 i have my fc and gps module mounted on plexiglass the way it would be in my flying wing so when i move it everything moves together. see photo:

[Image: 0etjNJnl.jpg]

i have my mag disabled the compass is pointing north and the board has 1.7 roll 1.1 pitch and 270.0 yaw and in the setup everthing is 0 heading pitch and roll.

[Image: qFjOEAPl.jpg]
[Image: yKNMlNAl.jpg]
Reply
#25
here is "get acc" from cli

# get acc
acc_notch_hz = 0
Allowed range: 0 - 255

acc_notch_cutoff = 1
Allowed range: 1 - 255

align_acc = CW270
Allowed values: DEFAULT, CW0, CW90, CW180, CW270, CW0FLIP, CW90FLIP, CW180FLIP, CW270FLIP

acc_hardware = MPU6000
Allowed values: NONE, AUTO, ADXL345, MPU6050, MMA845x, BMA280, LSM303DLHC, MPU6000, MPU6500, MPU9250, BMI160, ICM20689, FAKE

acc_lpf_hz = 15
Allowed range: 0 - 200

acc_lpf_type = BIQUAD
Allowed values: PT1, BIQUAD

acczero_x = 83
Allowed range: -32768 - 32767

acczero_y = -29
Allowed range: -32768 - 32767

acczero_z = -70
Allowed range: -32768 - 32767

accgain_x = 4090
Allowed range: 1 - 8192

accgain_y = 4117
Allowed range: 1 - 8192

accgain_z = 4017
Allowed range: 1 - 8192

motor_accel_time = 0
Allowed range: 0 - 1000

imu_acc_ignore_rate = 0
Allowed range: 0 - 20

imu_acc_ignore_slope = 0
Allowed range: 0 - 5

rate_accel_limit_roll_pitch = 0
Allowed range: 0 - 500000

rate_accel_limit_yaw = 10000
Allowed range: 0 - 500000

d_boost_max_at_acceleration =  7500.000
Allowed range: 1000 - 16000

antigravity_accelerator =  1.000
Allowed range: 1 - 20

inav_w_xyz_acc_p =  1.000
Allowed range: 0 - 1

inav_w_acc_bias =  0.010
Allowed range: 0 - 1

nav_fw_launch_accel = 1863
Allowed range: 1000 - 20000

acc_event_threshold_high = 0
Allowed range: 0 - 65535

acc_event_threshold_low = 0
Allowed range: 0 - 900

acc_event_threshold_neg_x = 0
Allowed range: 0 - 65535

I activated the mag and it is set at CW270flip.

now the heading is 53 deg

[Image: sJMMTaVl.jpg]

Here is the "get mag" from cli:

# get mag
align_mag = CW270FLIP
Allowed values: DEFAULT, CW0, CW90, CW180, CW270, CW0FLIP, CW90FLIP, CW180FLIP, CW270FLIP

mag_hardware = HMC5883
Allowed values: NONE, AUTO, HMC5883, AK8975, GPSMAG, MAG3110, AK8963, IST8310, QMC5883, MPU9250, IST8308, LIS3MDL, MSP, FAKE

mag_declination = -810
Allowed range: -18000 - 18000

magzero_x = 44
Allowed range: -32768 - 32767

magzero_y = -82
Allowed range: -32768 - 32767

magzero_z = -6
Allowed range: -32768 - 32767

maggain_x = 609
Allowed range: -32768 - 32767

maggain_y = 743
Allowed range: -32768 - 32767

maggain_z = 1016
Allowed range: -32768 - 32767

mag_calibration_time = 30
Allowed range: 30 - 120

align_mag_roll = 0
Allowed range: -1800 - 3600

align_mag_pitch = 0
Allowed range: -1800 - 3600

align_mag_yaw = 0
Allowed range: -1800 - 3600

imu_dcm_kp_mag = 10000
Allowed range: 0 - 65535

imu_dcm_ki_mag = 0
Allowed range: 0 - 65535

inav_auto_mag_decl = ON
Allowed values: OFF, ON

Now what do I do???????????

i'm sorry i changed the "mag_declination = -810" it was 0
and if you notice i left the "inav_auto_mag_decl = ON" to on nothing changes if the -810 is 0

if i turn the auto_mag off then in the setup the heading changes to 63 which is 10 deg.

if i turn off auto_mag_decl and set declination to -819 which iss for my location then in setup
the heading changes to 54 deg.

what should i do now?????
Reply
#26
here is the "sensors" reading;

[Image: ePpL8t4l.jpg]

what should i do now????????
Reply
#27
this is what is showing goggles:

[Image: b8WZPrDl.jpg]
Reply
#28
Have you calibrated the compass? Follow the procedure I linked above.

Note that the compass is extremely sensitive to the surrounding magnetic field, so if any of those wires near it or the battery or compass move or if you have it too close to a computer or something you will affect the readings. Since the compass is working you really should set the alignment and do the calibration with everything installed in the wing as it would be if you were flying. Otherwise you'll just have to repeat the entire procedure again.
Reply
#29
(11-Jan-2021, 05:17 AM)V-22 Wrote: Have you calibrated the compass? Follow the procedure I linked above.

Note that the compass is extremely sensitive to the surrounding magnetic field, so if any of those wires near it or the battery or compass move or if you have it too close to a computer or something you will affect the readings. Since the compass is working you really should set the alignment and do the calibration with everything installed in the wing as it would be if you were flying. Otherwise you'll just have to repeat the entire procedure again.

Yes when I had everything in the wig I went outside and did the DJI dance with the wing not a drone.
If I made changes would it change the calibration the numbers are the same now as they were when I did it.
Reply
#30
Does anyone know how to adjust the mag so the acc and mag equal the same thing in the sensors tab?

If you change the align_mag_yaw or pitch or roll to get them to match?

In the setup tab when you move right or left or up and down or yaw it will start to roll and that isn’t supposed to do that correct?
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  iNav on NeutronRC AT32F435 mini AIO necbot 17 1,635 20-May-2024, 09:47 AM
Last Post: jirisvabik
  Recently flashed INAV to speedybee f405 and already had issues on quad crash. grozaalex 0 331 03-May-2024, 09:25 PM
Last Post: grozaalex
  Switch from BF 4.5 RC3 to INAV Maverick 0 210 19-Apr-2024, 08:44 AM
Last Post: Maverick
  Announcement INAV 7.1 - Compass No Longer Required SnowLeopardFPV 2 726 15-Apr-2024, 10:34 PM
Last Post: SnowLeopardFPV
  inav artificial horizon offset range quinn 5 247 08-Apr-2024, 12:38 AM
Last Post: StuweFPV


Login to remove this ad | Register Here