Just to add to Bill's comments. Without a magnetometer, True plane heading is derived from the GPS ground heading adjusted for wind strength and direction. One of the amazing features of MatrixPilot is the effectiveness of Bill's algorithm for calculating wind vectors any time the plane flies a curve. ( wonderful and inventive maths formulated in Bill's creative moments while walking the dog. ). (remember to credit the dog in the source code). The GPS / wind derived heading is more accurate and consistent than the magnetometer.
The Mag is vital when GPS ground speed is close to zero; strong head wind, hover, pre-take-off on runway.
I am not sure what happens when a strong headwind causes plane to go backwards.
A hybrid algorithm which smoothly used both sources for heading, and which understood their relative accuracy would be ideal. Another idea on the to do list.
Best wishes Pete
Hi Bill.Life is a continuing university.. and thanks for making it excitingly more so. This group and thread has had me into very interesting new fields as well as the push to relearning old ones..Magnetometer sounds like a handfull to manage and all your explanation and recommendations certainly will give me essentially what I need to get it working more effectively.I do use the latest revisions, e.g., right now have r1714 as (final-freeze) baseline for the enhancements: LOGO functions and use of sonar, Pete, Ben and I are in the loop for. I also have auto-takeoff and a lot of direction/angle related conditions in my LOGO flight plans that I'm hoping the magnetometer can add accuracy to.It's good to know of its issues on misalignment. And also your explanation, analysis and fix that should minimize the effects, not that I understand all (wish I did ;o) particularly the cosine matrix and linear algebra.. Tried to go through the formulas but right now gives me a headache, if I try too hard. I think I better leave these matters to your (as well as others in the group) genius and scientific expertise.I'll test flight a direct attached, with increased diligence in making sure of the alignments and also isolation from any source of emi. And flying with the mag moiunted outside of the fuse and will report back on the results, as soon as the weather permits.All the best.DanielOn Wednesday, September 26, 2012 7:09:06 PM UTC-4, William Premerlani wrote:Hi Daniel,The good location for the magnetometer is away from power wires, "soft iron", or magnets (such as in the motors). I think the best location for the magnetometer is to leave it home on your desk. Personally, for fixed wing aircraft, I think navigation performance is better without a magnetometer. I do not use one, in any case. The only reason you might want to use one is for autonomous takeoff.One issue with the magnetometers is that the newer Honeywell magnetometer, the HMC5883L, as much larger offsets than the older one, the HMC5843.If you do use a magnetometer, I recommend you use the latest version of MatrixPilot from the repository, to take advantage of firmware changes that were made to compensate for a couple of magnetometer issues.One issue is magnetometer offsets. Here is a discussion of the method that we are presently using to compensate for offsets in flight, that was implemented in October of 2011.Another issue, particularly if you mount the magnetometer separately from the UDB, is alignment of the magnetometer relative to the gyros and accelerometers on the UDB. A slight misalignment can lead to large errors. Here is a discussion of the method that we are presently using to compensate for magnetometer misalignment, that was also implemented in October of 2001.To take advantage of these improvements to the magnetometer firmware, you need to either use MatrixPilot released versin 3.2.1, or revision r1067 or newer from the repository.In any case, you might want to read the discussions to better understand the issues.Best regards,Bill PremerlaniOn Wed, Sep 26, 2012 at 12:54 AM, DB <dber...@gmail.com> wrote:
Greetings.It has just been brought to my attention by the very patient and thoughtful accommodations of Pete, how critical it is to isolate the magnetometer from any emi, however slight it is, vis-a-vis, the analysis of the log's kml turning on Google Earth's Earth Magnetic Vectors.My magnetometer is directly mounted on UDB4 and is miles away (so I thought) from any source of heavy emi (motor, esc, volt reg., RX, PPM encoder, open log, video TX, and OSD).But having seen the vectors (didn't know about this until now), I think even the servo wires passing by about half an inch away is enough to throw off the magnetometer. This is pretty apparent comparing Pete's (magnetometer on the wing) to my Google Earth's flight report (Pete, hope you don't mind.., pls. see attached images).So, now I'm relocating the magnetometer perhaps on one of the wings, per Pete's example and best practice. The disadvantage of this is in my case, is my Ventus has 2 pc. wing... An alternate loc. perhaps is near the t-tail on top of fuse?Any thoughts on best alternate locations?All the best.Daniel
Greetings Pete, Bill.
The mag fusion hybrid algorithm sounds like the great way to go, logically.
I'd like to add, the same with your recommendation to fuse sonar altitude to dead reckoning algorithm at the range of its accuracy (c. 4m alt).
Looking at my collection of flight log, Google earth analysis reports, there seem to be a consistent variance between IMU, GPS and Google earth (ground), indicated altitude relative to the sea level. At times, GPS goes underground if not above by a few meters, ....Hardly dependable and reassuring, to control a landing trajectory.
So, adding the sonar altitude to the dead reckoning algorithm will probably minimize the altitude variance (risk of plowing the plane on the ground) in using the ALT_~ controls in LOGO to ensure an appropriate plane pitch/speed/thrust relative to near ground altitude, while managing an auto landing trajectory. In this scenario, giving sonar altitude priority over GPS and IMU
makes logical sense as well.
I'd like to help, volunteer sometime do some of the code changes, and learn in the process, if possible. I've been looking at the UDB DCM libraries and found the codes details and structure mind-boggling, even with the smart models and class diagrams I've reversed engineered. Perhaps you can give me some hint on were to start (..time travel back to high school days and pay more serious attention to trigonometry, instead of looking at the pretty..., might be a good start ;o)?
I think I'll walk the dog and see if a pinch or spark of knowledge might rub on, before heading out to the fields.
Have a great weekend!
Kindest regards.
Daniel