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
Compass offset uneffective in autopilot GPS mode
#1
Hello everyone, using Openplotter on Raspi 3B+ and Pypilot on Sean's Tinypilot, I firstly want to thank Sean for his superb work.
I would like to solve a little issue occurring with autopilot in GPS mode. For practical reason (mainly steel hull and wish to get the display visible from the cockpit aft) the Tinypilot is not parallel to the heading line. I have adjusted the heading offset to 108° as to get the actual magnetic value on the display. This setting is working fine in compass mode, but as soon I switch to gps mode by activating a route the offset is no more used and the requested heading is dropped by 108°. Your help would be welcome as I am more newbie than geek...
Reply
#2
In gps mode it will just use the gps heading which is based on boat movement. The difference between compass and gps heading is constantly re-computed so that the compass is used to improve the stability of gps heading.

I dont know what you mean the requested heading is dropped 108. If the boat is not moving then the gps heading is meaningless so I am not sure if this is a real test underway or at the dock.
Reply
#3
Hello Sean, thank you for your quick response. Effectively I don't make the test underway, just alongside the pontoon. So I will make the trial as soon as possible and come back with the result.
Once again, many thanks for your work and for sharing the result with us.
Reply
#4
@Sean, would it make sense to use the GPS track to automatically set the compass offset? That way, you don't have to set that parameter manually anymore.
Reply
#5
Many thanks for your response. It has not be possible for me to sail since I posted my question, but I will make a trial as soon as possible.
Reply
#6
(2021-09-26, 04:05 AM)seandepagnier Wrote: In gps mode it will just use the gps heading which is based on boat movement.   The difference between compass and gps heading is constantly re-computed so that the compass is used to improve the stability of gps heading.

I dont know what you mean the requested heading is dropped 108.   If the boat is not moving then the gps heading is meaningless so I am not sure if this is a real test underway or at the dock.

GPS heading is true north and compass heading is magnetic.
If there is side current GPS heading will not be actual heading. Is it taken into account?

I see some issues with non-zero offset and pypilot reporting magnetic heading which goes completely out of wack over time.

Thanks
Download BBN Marine OS for raspberry pi 

https://bareboat-necessities.github.io/m...at-os.html

Video of actual installation:

https://www.youtube.com/watch?v=3zMjUs2X3qU


Reply
#7
I considered adding a "align heading" button, similar to "level" if traveling at a sufficient speed if you have gps and there are no magnetic distortions and when it is known that there are no currents to perform this operation. It would be difficult to make it completely automatic and the user would only press the button if appropriate (or get a wrong alignment) and all it would do is adjust the heading offset that you can manually enter now.

regardless, it will change over time (and space as you travel to different geographic with a different magnetic field) due to the nature of imperfect sensors, and many people prefer a magnetic heading. It would compensate using the world magnetic model to still get a magnetic alignment but still there will be some error as the magnetic model can be wrong and other sensor errors. Since many people mount the sensors facing forward or backward, it would technically be more accurate to simply enter 0 or 180 degree alignment manually since that is known. So yes, I intend to implement something that some people may find useful.

There are similar situations regarding wind sensors, and water speed and leeway sensors where gps or other sensors can cross-calibrate them, and I have mapped most of these cases out, but when I go to implement there can be flaws in the logic and so forth. Part of the key reason pypilot can work as it does is not to rely entirely on absolutes and instead perform corrections based on relative errors, so I have to always keep this in account and ensure if the wrong calibration is set, it can generally maintain course and work and at the worst display the wrong number.

I can actually automatically compensate for alignment error, even if there are currents, by using enough data from accelerometer integrations compared to gps velocity.... but I have not demonstrated this to be accurate or usable so I have experimenting. I write a lot of code that gets deleted...

Right now if the heading alignment is off, it does affect pitch and roll which could affect future algorithms. I am going to take a close look at all of this in the near future.
Reply
#8
(2022-09-24, 08:50 AM)seandepagnier Wrote: I considered adding a "align heading" button, similar to "level" if traveling at a sufficient speed if you have gps and there are no magnetic distortions and when it is known that there are no currents to perform this operation.    It would be difficult to make it completely automatic and the user would only press the button if appropriate (or get a wrong alignment) and all it would do is adjust the heading offset that you can manually enter now.

regardless, it will change over time (and space as you travel to different geographic with a different magnetic field) due to the nature of imperfect sensors, and many people prefer a magnetic heading.    It would compensate using the world magnetic model to still get a magnetic alignment but still there will be some error as the magnetic model can be wrong and other sensor errors.   Since many people mount the sensors facing forward or backward, it would technically be more accurate to simply enter 0 or 180 degree alignment manually since that is known.   So yes, I intend to implement something that some people may find useful.

There are similar situations regarding wind sensors, and water speed and leeway sensors where gps or other sensors can cross-calibrate them, and I have mapped most of these cases out, but when I go to implement there can be flaws in the logic and so forth.     Part of the key reason pypilot can work as it does is not to rely entirely on absolutes and instead perform corrections based on relative errors, so I have to always keep this in account and ensure if the wrong calibration is set, it can generally maintain course and work and at the worst display the wrong number.

I can actually automatically compensate for alignment error, even if there are currents, by using enough data from accelerometer integrations compared to gps velocity....   but I have not demonstrated this to be accurate or usable so I have experimenting.   I write a lot of code that gets deleted...

Right now if the heading alignment is off, it does affect pitch and roll which could affect future algorithms.   I am going to take a close look at all of this in the near future.

How do you calculate true from magnetic? Do you blindly trust what magnetic variation reported by GPS?
It's quite hard to debug wrong magnetic heading in pypilot when so many factors affect it.
I thought it's just based on IMU and offset you set it.
I haven't seen that offset changes over time by algorithm that supposed to adjust it from COG.
And using COG without current and leeway and on low speeds might make it worse.

Can you describe the fusion algorithm in details on how you change manually entered IMU offset for magnetic
heading in pypilot?

Thanks
Download BBN Marine OS for raspberry pi 

https://bareboat-necessities.github.io/m...at-os.html

Video of actual installation:

https://www.youtube.com/watch?v=3zMjUs2X3qU


Reply
#9
No, true is calculated using the world magnetic model which again is not perfect.

I agree that it can make things worse which is why I suggest manually entering it.
Reply
#10
(2022-09-26, 02:57 PM)seandepagnier Wrote: No, true is calculated using the world magnetic model which again is not perfect.

I agree that it can make things worse which is why I suggest manually entering it.

If it's manually entered will it be readjusted automatically or going to stay how it is entered?

Thanks
Download BBN Marine OS for raspberry pi 

https://bareboat-necessities.github.io/m...at-os.html

Video of actual installation:

https://www.youtube.com/watch?v=3zMjUs2X3qU


Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)