Posts: 1,506 Threads: 49 Likes Received: 714 in 525 posts Likes Given: 478 Joined: Oct 2020 Reputation: 93 The sensors tab is showing you the raw output from the magnetometer. The setup tab is showing you the heading calculated by iNav, combining data from the gyro on the flight controller and the magnetometer. For this to work, both compass and FC need to be moving together, with the alignment set properly, and both sensors calibrated. What exactly is the issue now? • Posts: 110 Threads: 31 Likes Received: 2 in 2 posts Likes Given: 0 Joined: Aug 2020 Reputation: 0 I noticed that when I tip my wing right and left the heading changes I can get it to come up with 0° but then if it tips it changes. Is that normal? • Posts: 3 Threads: 0 Likes Received: 7 in 2 posts Likes Given: 0 Joined: May 2020 Reputation: 1 01-Mar-2021, 07:21 PM (This post was last modified: 02-Mar-2021, 08:52 AM by s0lari.) (15-Jan-2021, 06:10 PM)jimv Wrote: I noticed that when I tip my wing right and left the heading changes I can get it to come up with 0° but then if it tips it changes. Is that normal? Hi jimv. Yes, if you are in front of a monitor, it's normal. Magnetic compass is very sensitive device, Earth's magnetic field strength is only around 50 uT, which is very small, compared to a your average NdFeB fridge magnet which has magnetic field strength somewhere around 500mT (10000 times stronger!). I suggest you fly your wing with your current settings and calibration, and watch the OSD how the heading behaves. If it's consistent, but shifted some degrees, then land, change the align_mag_yaw value in iNav, and try again. If it's erratic, then do recalibration (preferably outside, far from anything steel, or electronic other than your wing). Your compass has to point in the same direction as your FC, as mentioned by others already, if not, use align_mag_roll, align_mag_pitch, align_mag_yaw to cancel any axis rotation compared to your FC orientation. Last but not least, place your compass as far away from any source of interference as possible (power wires, motors, screws, carbon frame, steel battery strap buckle?). This is almost impossible on 5 inch quad, but quite doable on a wing. • Posts: 3 Threads: 0 Likes Received: 7 in 2 posts Likes Given: 0 Joined: May 2020 Reputation: 1 So again these are the steps you need to follow for successful magnetometer calibration and alignment: step 1. Find out how the magnetometer sensor is oriented on your board from manufacturer. For example I have M8Q-5883 GPS with magnetometer from Matek, where magnetometer (compass) is mounted CW270FLIP. Let's remember that. step 2. So in general you would only need to set mag alignment CW270FLIP in Configuration tab / Board and sensor alignment in iNav configurator. But this is only the case if you mount your GPS/compass board flat and arrow facing forward! But let's say you mounted it with arrow facing backward, and you tilted it 30 degrees backward (because you want to have the best GPS reception when flying forward pitched 30 degrees). In this case, change mag alignment to CW0, and you need to go to CLI, and set align_mag_roll, align_mag_pitch, align_mag_yaw. In other words, when iNav detects you have some values in align_mag_xxx variables, it will ignore align_mag value! So for our case, we need to combine both CW270FLIP sensor orientation and our mounting position. CW270FLIP is: align_mag_pitch = 1800 and align_mag_yaw = 2700 combined with our mouting position (arrow facing backward and 30 degree tilt backward) align_mag_roll=300 align_mag_pitch=1800 align_mag_yaw=900 save step 3. Put heading into your OSD, so you can see it in your goggles. Go outside with your goggles, transmitter and quad, some distance from buildings, and metal things. Turn on the transmitter, plug-in your battery into your quad and turn on goggles. Issue stick command throttle up+yaw right+pitch down (and hold it for 1 second!). Your FC board should start blinking and in your goggles heading will display ---, signaling that compass calibration is in progress. You have 30 seconds, or whatever value you put to mag_calibration_time variable, to calibrate your compass. Rotate your quad around each axis 360 degrees, take your time. When calibration is done (FC stops blinking, and heading in your goggles displays some number), point approximately north with the nose of your quad. THe heading should show 0 degrees. Turn east, heading should display 90 degrees, south 180, west 270. Then pitch quad's nose down 45 degrees and do the same, the heading should again display 0 (north), 90 (east), 180 (south), 270 (west). Now flip your quad upside-down, and do the same heading test. If in any of the above your heading is crap, you didn't set the correct values to align_mag_xxx variables. Re-set them and try again. Hope this guide helps you! Happy flying. Posts: 87 Threads: 14 Likes Received: 23 in 20 posts Likes Given: 7 Joined: Mar 2021 Reputation: 0 Hi guys, do you think it is possible to recalculate the mag adjustment values if I put the mag on a frame in a specific position (whatever, upside down, tilted, etc.) and then note the influence of drone tilting and rotating on the heading? For example: I install a mag, calibrate, connect to configurator, face North, and tilt the drone forward 45 deg, sideways 45 deg, yaw 45 deg. Since the mag is in a deliberate position every time I pitch, roll and yaw the mag Heading will change. I note the heading for each position, put them in a say excel calculator and get the adjustment values. Is this theoretically possible? I have a breakout mag board separate from GPS so not limited to place it only on top and would want to experiment to find the best location. Maybe the best position for a mag is not on the top but under the belly or even inside the frame. • Posts: 3 Threads: 0 Likes Received: 1 in 1 posts Likes Given: 0 Joined: May 2021 Reputation: 0 Hello all, after spending a lot of time trying to figure out magnetometer orientation, I still can’t get the quad to obtain correct heading information. Accelerometer is fine, the quad flies well in acro. The FC is rotated 180° in yaw, so the arrow is top side facing backwards. I use a Beitian BN-383 with an integrated QMC5883L magnetometer that I took out of its plastic casing. Unfortunately, I can’t find the magnetometer alignment regarding to the GPS, but I assume it is CW270Flip, as people told me this is mostly the case. Does anybody know if this is true for this GPS unit? I mounted the GPS as seen on the photograph, tilted 30° back and cables out to the front. I am not sure whether the mag alignment refers to the FC (rotated 180°) or to the quad. When I refer it to the quad, as seen below, I get more or less correct heading readings when the quad is lying flat. But they still change when I pitch the quad. Mag Alignment Roll 0° Pitch 180° (CW270Flip) - 30° (GPS tilt) = 150° Yaw 270°(CW270Flip) + 180° (GPS rotation) = 90° Can you guys help me out? • Posts: 3 Threads: 0 Likes Received: 1 in 1 posts Likes Given: 0 Joined: May 2021 Reputation: 0 Somehow, by trial and error I figured it out. I don't really understand it though. With Mag Alignment Roll 30° Pitch 180° Yaw 90° The quad holds its position alright (about +/- 2 m) and returns to home. It would be really nice to actually understand this. • Posts: 110 Threads: 31 Likes Received: 2 in 2 posts Likes Given: 0 Joined: Aug 2020 Reputation: 0 D-beam I know what you mean I got mine working but I don’t know what I did. I now have problems with my GPS coordinates I only get degrees and minutes but that isn’t enough to find my wing I lost video and my RTH didn’t work and the coordinates was not fine enough to find my wing. my googles had degrees and it would of helped but no video so no DVR recording to look at. My Taranis radio displayed degrees and minutes only without seconds it isn’t possible. Good luck. • Posts: 3 Threads: 0 Likes Received: 1 in 1 posts Likes Given: 0 Joined: Oct 2020 Reputation: 0 (24-May-2021, 07:18 PM)d-beam Wrote: Somehow, by trial and error I figured it out. I don't really understand it though. With Mag Alignment Roll 30° Pitch 180° Yaw 90° The quad holds its position alright (about +/- 2 m) and returns to home. It would be really nice to actually understand this. Thanks for posting this. I've been struggling with the same problem in iNav 3.0 using an iFlight M8Q-5883 GPS+Compass, and happen to have the same setup (180 deg FC orientation, 30 deg GPS/Compass tilt). The GPS is supposed to use the usual CW270Flip, but heading changed unexpectedly upon changes in pitch or roll. Your values worked, and I also do not understand it. CLI commands: Code: set align_mag_roll = 300 set align_mag_pitch = 1800 set align_mag_yaw = 900
• Posts: 1 Threads: 0 Likes Received: 0 in 0 posts Likes Given: 0 Joined: Jan 2022 Reputation: 0 23-Jan-2022, 09:11 PM (This post was last modified: 23-Jan-2022, 09:13 PM by kefear.) (26-Nov-2021, 04:46 AM)jseaber Wrote: Thanks for posting this. I've been struggling with the same problem in iNav 3.0 using an iFlight M8Q-5883 GPS+Compass, and happen to have the same setup (180 deg FC orientation, 30 deg GPS/Compass tilt). The GPS is supposed to use the usual CW270Flip, but heading changed unexpectedly upon changes in pitch or roll. Your values worked, and I also do not understand it. CLI commands: Code: set align_mag_roll = 300 set align_mag_pitch = 1800 set align_mag_yaw = 900
Hi, I had a similar issue. In my quad is FC (iflight succeX-E F722- FC with iNav 4.0) rotated by 90degs, I use also NAZA GPS with integrated compass (default compass align is CW180flip). I set it in CLI accordingly, but it resulted in unstable and wrong heading values. After few hours of trial-and-error method I have noticed, that every board alignment value I set in CLI is added also to mag readings. I physically rotated my board by 90degs and entered in CLI set align_board = 900. I expected that when I point my quad to north, heading will be 0, but it was 90. So I compensated board alignemnt by subtracting 90degs from mag align (align_mag_yaw) and now it works fine. • |