-
Notifications
You must be signed in to change notification settings - Fork 297
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
Heading calculated incorrectly #853
Comments
I have connected the u-blox directly to a Windows PC and verified the GNVTG COG (true and magnetic) are accurate. However, connecting the same board to any Stratux results in incorrect heading being displayed, both in the Stratux web page and on the EFB. The Stratux web page and EFB display the same (incorrect) heading. |
I'm currently on a custom build based on 1.6r1-eu027. I was out flying yesterday with the Stratux connected to my iPad running GP and a GDL52 connected to a Garmin 760. Both were in agreement with each other. After updating did you remember to "Set AHRS Sensor Orientation"? I'll be flying next week so will get my branch in sync and test again next week. |
P.S. I was only 1 change behind the build you are using and it was a fix for race condition in disk usage. |
@jeffdamp-wave appreciate the info, but I'm more confused now. I don't have an AHRS module, just the u-blox M8 GPS chip. It's a good GPS chip that can do ded reckoning if signal is lost, which is a frequent occurrence during steep turns and a reason I chose the chip. But I can't set the AHRS sensor orientation, it's disabled, since I don't have AHRS enabled. Could you please elaborate? |
Right so it should be picking up current and previous position and displaying that as a heading. Yes the Unit orientation shouldn't matter. I'm pretty sure I'm using a ublox 8 myself. Like I said I didn't see any discrepancies in direction when I was out the other day. Where are you putting the Stratux in the plane? I found in Cessnas (high wing) the back window or the front window off to the side works best. If I put it on one of the side windows, the GPS loses lock a lot. You could turn on log to storage and then check the log file. P.S. from looking at the code I see that my Heading comes from my AHRS sensor while yours would come from the GPS Line 2027 in ec997fb
|
@jeffdamp-wave I don't think the heading bug issue is related to losing lock. I have a dedicated Garmin GA35 antenna on the top of the rear empennage for the Stratux. Losing lock is just a consequence of doing 45 degree banked turns for 180 degrees of heading at the end of a survey line. The heading is wrong all the time, even in straight and level flight with great lock. The heading problem is reproducible in the car too with an external antenna. I enabled verbose, persistent logging and drove due south down a street. I have a video of the car's navigation system showing us going due south, and the EFB showing our position translating south, but the heading of the "plane" pointed almost due west the whole time. There was great lock with 13 satellites in view. I'm really interested in how the code produces the heading. It seems it's definitely not directly using the NMEA GNVTG COG field, which would be the best for me. Maybe I can try to just jam that in. Since it's not using that, at least not without some manipulation, there seems to be a problem with what it is doing -- I just haven't dug in far enough to know myself yet. Not knowing which files would be helpful, I grabbed all the logs and will attach them here with the video. Please let me know if any other diagnostics would be useful and thanks for your help in troubleshooting. 20220619_124144.mp4 |
I didn't see the stratux.log file in your zip anywhere, that would be the most useful log. You might want to turn on the DEBUG settings too. |
@bri2k1 - |
@N129BZ thank you, I want to clarify what you are saying. Where did you see those values? Do you have additional logging/debugging enabled in Stratux to see them being parsed? I think I can add a line in gps.go to just use the value I am getting from GNVTG, because my u-blox does provide a valid COG in that message. @jeffdamp-wave here is a stratux.log from the flight I am currently on. You can see my flight track at https://flightaware.com/live/flight/N6439N, I am obviously flying E-W survey lines. When I am flying east (heading 090), the Stratux heading on my EFB is somewhere around 300, and when I am flying west (270) it's reporting around 120. This seems like maybe it's miscalculating a +/- sign somewhere, as a guess. I do not see the log trying to parse any GNVTG strings at any time. I also don't see any errors or anything obvious. When I'm not flying, I will try to hand-parse one of these strings through the code and see if I can catch the error, unless someone smarter than me gets to it first. |
FWIW: I've never seen such behaviour, and cannot reproduce it. Some ideas though: Then there is AHRS heading. If no AHRS is present, Stratux does some pseudo AHRS calculation based on GPS. That's what you can see as "GPS Attitude" in your log and will be transmitted in GDL90 AHRS messages. However, in case no AHRS is present, this will also be set to the GPS track. Maybe that's what's being displayed by your app, but has wrong values (or is encoded incorrectly, your your app decodes it incorrectly?) Anyway, without a proper dev setup - preferably with a debugger - this is hard to figure out. EDIT: |
@b3nn0 thank you, I'm not sure if you posted before seeing my last message. I will repeat a couple relevant details:
|
the http://192.168.1.1/getSituation is raw JSON output of all internal headings. Same with the web interface. There is AHRS heading and GPS Track. There is no logging during GxVTG parsing, that's probably why you don't see anything in the log. For setting up a development environemnt with debugging, see here: https://github.com/b3nn0/stratux/wiki/Developing-Stratux You can then set breakpoints and step through gps.go step by step, and inspect exactly what's going on. But that requires some developer experience.. |
@bri2k1 - |
That's a way.. or you could just change the code slightly to provide a fake GxVTG and GxRMC ;-) |
I'm used to running gdb, it's just tough to do all this while flying around 1,500 AGL so I appreciate the assist. There is some useful info here, confirmed with the attached files.
This was all gathered within a few seconds, with the aircraft on a constant heading of 270 true. I'm open to suggestions on what to do next. Thanks again |
@N129BZ I often run the Stratux from a high current USB outlet in my car. I do believe the GNVTG COG disappears when stationary. Today I'm in the airplane (with another pilot, don't worry) so I'm doing some airborne testing too. |
Just used precisely that GNVTG line and put it in my gps.go. It correctly parsed that and set GPSTrueCourse to 270.05. GxRMC also provides track, maybe these are wrong? Can you provide some samples? EDIT: ah nvm. Just noticed you appended a whole log. Thanks |
@b3nn0 from the same picocom.log here is a RMC message: The value 270.05 does appear here too, but it's in a different order in the message compared to the VTG. |
so yes, this GNRMC is also parsed correctly. When I hard-code that in gps.go, it will also parse and show up as 270°. There are exactly two assignments to the GPSTrueCourse variable in the whole code base. Are you somehow injecting NMEA in any other way, e.g. via socket or something? |
I just added a special standalone log file to my Stratux code that captures only the $GNRMC and $GNVTG sentences, and drove around the neighborhood... I can't reproduce @bri2k1 's issue either. My logged data faithfully reproduces all of the course and speed of my route. Now I'm wondering if I should try it again without the AHRS chip and with an external antenna and see if that makes any difference... Is it that this issue may be caused by the antenna being used... a Garmin GA35 WAAS antenna may be incompatible with a ublox gps... @bri2k1, how are you connecting a Garmin WAAS antenna to your Stratux? |
@b3nn0 no, it's just a USB connection to the Stratux, which again is a Pi 4. The specific ublox part is the Neo M8-U, which means built in USB, and ded reckoning capability. Btw I have run several different builds, including eu027, eu028, and the VirusPilot build, and they are all consistent in this way. I have tried on 3 different Pi boards and multiple antennas. @N129BZ I'm not sure why they would be incompatible, I use this setup with the same ublox and GA35 antenna and my own software for aerial survey. But I also reproduce the issue with a Trimble 66800-52D puck antenna and the stratux. |
I just re-ran my driving route test with the AHRS removed from my Stratux and the headings in my logs were 100% accurate. FWIW I'm using a ublox8 gps without external antenna in my Stratux. @bri2k1 , can you post a link to the Neo-M8U that you are using? |
The dead reckoning features of the NEO-M8U need to be configured and calibrated. I doubt Stratux knows how to do that. See section 29 starting on page 119: Perhaps a miscalibration problem is throwing off what the unit is reporting to Stratux. |
@bri2k1 - I just bought a Neo M8-U so I am going to try and duplicate the issue with that. |
Hey @kdknigga you were right on! We didn't know the M8 with its ded reckoning was orientation-sensitive, but it certainly is. Orienting it as printed on the PCB, or using the ublox utility to set the orientation, has completely resolved this. Thanks so much! We would like to suggest a feature where the Stratux webpage could include the orientation utility for the ublox with ded reckoning. @cyoung or whomever might log such requests. It includes an AHRS orientation function, so hopefully this is within reach. Thanks again all for the great support! |
It would be interesting to see if the Neo M8-U could also source the AHRS data since the device has an on-board IMU |
The roll, pitch, and heading is definitely available in the Neo M8U device, the data comes over serial as a UBX-HNR-ATT message, or alternatively this data can be accessed over I2C or SPI interfaces. The device is avaliable at Mouser for $69.65 at https://www.mouser.com/ProductDetail/474-GPS-16329 which seems very reasonable since it's around the same cost as buying a u-blox GPS and the AHRS chip separately... |
Stratux version: stratux-v1.6r1-eu028-32d5e58b-us
Stratux config:
SDR
GPS
type: u-blox M8
AHRS
power source: 120VAC to 5V 2.1A adapter
usb cable: USB-A to USB-C
EFB app and version: Adventure Pilot iFly GPS 11.1.43, and Garmin FltPlan Go 5.0.12
EFB platform: Android 12
EFB hardware: Galaxy Tab S7
Description of your issue: The heading is not calculated correctly, displayed both by the EFB and in the Stratux web page on GPS/AHRS page. It is not reciprocal or otherwise obviously offset; at times it somewhat matches actual heading. But it's never completely accurate. For example, the aircraft may be heading due north, but the displayed heading will be 270. Other times, the aircraft may be heading 270, but the displayed heading is 110. It's not wildly variable or changing, but it's just not right. The u-blox M8 is configured for GNSS only, 10x rate, NMEA sentences GGA.
The text was updated successfully, but these errors were encountered: