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)
#1
I'm about ready to give up on this.

i have a flying wing that i want to add a compass even though i don't need it i can just use the GPS
but i plan on adding one to my 5" drone also.

i have a pyrodrone BN-880 Flight control GPS module w/ compass.

Flight controller is a Matek F405 Wing

my iNav settings:

Accelerometer is    MPU6000
Magnetometer is     HMC5883
Barometer is        BMP280
Protocal is         UBLOX
Ground Ass Type is: Autodetect

if i turn the Magnetometer off everything works fine in the setup window
right is right, left is left, up is up, down is down and yaw is correct.

in inav Setup:
heading is 0
Pitch is   0
Roll is    0
setting the "Board and Sensor Alignment" as shown below:
(My FC is mounted with front arrow pointing towards the left wing looking from the back of the model look to the front)
 
"Board and Sensor Alignment"
----------------------------
2.1     Roll Degrees
1.0     Pitch Degrees
270.0   Yaw Degrees  
Default MAG Alignment

when i turn magnetometer back on, no matter what i change the "MAG Alignment"
to and i go back to "setup" when i move the wing the box in iNav will start to
rotate when i just move up, down, right or left.

reading iNav wiki on "GPS and Compass setup" is confusing and i tried changing
mag_align_x, y and z but don't understand how to get my heading to be 0 when 
it is pointing north. and when turning the model N is north E is east S is south
and W is west.

i know this is alot but i'm been working on this for days, now i'm about ready to give up
on a compass.

Please if anyone can help or give me a phone number to call to get a person to talk to about 
this or any help at all i would very much appreciate it.

Thank you
Jimv
Reply
Login to remove this ad | Register Here
#2
Can you post a photo of the wiring?
Reply
#3
I can but don’t know how to add a photo.
Reply
#4
https://intofpv.com/t-how-to-upload-pictures
Reply
#5
I'm sending pictures now:

[Image: gTVnl4gl.jpg]
[Image: i4ww5AZl.jpg]
[Image: WVDRsFJl.jpg]
[Image: 8HdWkgyl.jpg]
[Image: xMG1P41l.jpg]
[Image: RAFAz6Sl.jpg]
[Image: 5bnkfL5l.jpg]
Reply
#6
[Image: FFk62TTl.png]
Reply
#7
We can't see where the wires are connected on the GPS, but if the heading is changing in iNav when you move the model I assume the wiring is correct. Did you follow the setup guide here?
https://github.com/iNavFlight/inav/wiki/...pass-setup
Quote:Setting up the compass alignment
Before attempting any navigation modes, you should verify that the compass alignment is correct (Configurator or CLI set align_mag)

Perform any tests away of sources of magnetic interference. Domestic applicances or even audio speakers can cause erroneous affects.
Use an analogue compass in preference to a digital (mobile phone) compass. The compass in your phone is likely to be a similar chip to that on your aircraft, and is as susceptible to errors of interference and calibration
Alternatively, if you know the orientation of surrounding landmarks (e.g. my house is pretty much N/S), then you can do static tests against land orientation.
Check your machine at cardinal points (North (0°), East (90°), South (180°), West (270°)). Degree perfect alignment is not necessary (and probably not measurable), but you should aim for +/- 5° of known magnetic direction.

If the values are incorrect by a multiple of 90°, then the numeric alignment needs to be changed

If the values are just randomly wrong across the cardinal points, then FLIP is probably wrong (as well).

If external Compass module is mounted at 30 degree. For example at top of a Cam mount, free alignment is possible by Cli commands. Cli setting Align_mag must be set to Align_mag = default save

For example cw270flip, this value is to ADD manualy. For free Alignment, all three axis need to set manualy. A sensor flip is always to realise over the pitch axis. For example cw270flip:

set align_mag_pitch = 1800
set align_mag_roll = 0
set align_mag_yaw = 2700
save
For 30 Degree Backwards tilted GPS/Compass Module, reduce align_mag_roll about 300

set align_mag_roll = -300 save

Because Magnetometer with cw270° has its roll axis in relation to the Pitch Axis of the FC

Enhanced Eplaination in #6232 How to Align and Check if your readings are Correct

Post the output of get mag. What direction is the arrow on the GPS facing?
Reply
#8
Thanks V-22 for responding I did not try everything I’m not sure how to test the gps alignment and not have any electronic interference when it has to be connected to the flight controller and battery and a camera so I can see the screen to get the heading in direction of the compass
I guess I’ll have to pull everything out of the wing to do it but not sure I understand everything. I will try and get back with my results. I’ll try one step at a time.
I got and read the above article but it just hard to understand when you’re doing this for the first time.
Reply
#9
(08-Jan-2021, 04:10 PM)jimv Wrote: Thanks V-22 for responding I did not try everything I’m not sure how to test the gps alignment and not have any electronic interference when it has to be connected to the flight controller and battery and a camera so I can see the screen to get the heading in direction of the compass
I guess I’ll have to pull everything out of the wing to do it but not sure I understand everything. I will try and get back with my results. I’ll try one step at a time.
I got and read the above article but it just hard to understand when you’re doing this for the first time.
Start with the last two things, maybe it's something simple.
1. Go to the CLI in iNav and type "get mag" and paste the output here.
2. What direction are the wires coming out of the GPS when mounted on the wing?
Reply
#10
I have a simple question when you test the compass module alignment do you have to turn the module and the flight controller or just the module to test N, E, S and W? I’m thinking just the module since it is the compass.
Reply
#11
If you're just looking at the readout from the magnetometer (eg by checking magnetometer under the sensors tab), just turning the compass is fine.
Reply
#12
I already took everything out of the wing so I will solder everything back and show my compass wiring.

I made changes to mag settings and don’t know if everything is back to default but I will show you the mag settings.
Reply
#13
[Image: Rhtf21Nl.jpg]
[Image: ktqBZOAl.jpg]
[Image: 7MiLQtOl.jpg]
[Image: G3bx4rIl.jpg]


get mag
align_mag = DEFAULT
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 = 0
Allowed range: -18000 - 18000

magzero_x = 69
Allowed range: -32768 - 32767

magzero_y = -135
Allowed range: -32768 - 32767

magzero_z = 8
Allowed range: -32768 - 32767

maggain_x = 607
Allowed range: -32768 - 32767

maggain_y = 878
Allowed range: -32768 - 32767

maggain_z = 509
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


#
Reply
#14
The wiring looks correct.

When mounted in the wing, it looks like the wires exit facing the rear of the aircraft, so I believe the correct mag alignment is CW270FLIP.

set align_mag = CW270FLIP
save
Reply
#15
i changed the MAG alignment to CW 0 Flip and it works very close but still not correct looking at the compass look at picture below. what do you think?

[Image: wEzdln4l.jpg]
[Image: N3TnEqjl.jpg]
[Image: fsoeWJLl.jpg]
[Image: xr1ymvhl.jpg]
[Image: IFDZuA7l.jpg]
[Image: EeJntfol.jpg]
[Image: QpeTEGSl.jpg]
[Image: IwDY49ml.jpg]
[Image: 9tUa1whl.jpg]
[Image: ShMqFfBl.jpg]
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Recently flashed INAV to speedybee f405 and already had issues on quad crash. grozaalex 0 304 03-May-2024, 09:25 PM
Last Post: grozaalex
  Switch from BF 4.5 RC3 to INAV Maverick 0 203 19-Apr-2024, 08:44 AM
Last Post: Maverick
  Announcement INAV 7.1 - Compass No Longer Required SnowLeopardFPV 2 648 15-Apr-2024, 10:34 PM
Last Post: SnowLeopardFPV
  inav artificial horizon offset range quinn 5 236 08-Apr-2024, 12:38 AM
Last Post: StuweFPV
  Add a Servo Button in INav techdesk 1 269 14-Mar-2024, 01:38 PM
Last Post: StuweFPV


Login to remove this ad | Register Here