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
IMU what information uses pypilot
#2
I once started some narrative on how pypilot works internally. It never got to see the end, and probably never will, but this snipplet might answer some of your questions. I might miss the nail as well, but I think it goes in the general direction. I come to think for now the IMU is only used to provide an accurate compass heading.

"The first other python subprocess is Boatimu.py. Main thing to remember is that it puts the compass heading of your boat into imu.heading, so the autopilot process knows the heading of your boat. But you should also understand that there is much more to Boatimu.py. That teeny-weeny little chip attached to your raspberry i2c bus, called an IMU, Inertial Measurement Unit, measures motion over 6 axes and the earth magnetic field in 3 axes. But compass heading is only 2-dimentional, right? It’s a vector in the 2-dimensional horizontal plane? Yes, but apart from heading a certain way, the boat rocks like mad. Your standard fluid-filled or fluxgate compass is gimbaled, so it stays somewhat horizontal. The IMU, however, is attached to the boat. You could say the gimbaling is done programmatically, based on the input of the motion sensors. But there’s more.
Many know that even a plastic boat has metals in it that affect the measured magnetic field differently for various headings. Hence the deviation table that comes with a properly installed compass. With regular fluxgate compass solutions, you would need to sail one full circle to automatically establish this basic deviation table. This is done during calibration, sometimes called linearization. In the old days, this calibration process had to be started manually. PyPilot however, in particular Boatimu.py, does this automatically, so there is no need to search for the manual to put the autopilot in calibration mode. Because of all the motion sensors on board, you don’t need to have a constant rate of turn, or wait for calm water to calibrate. So those motion sensors already come in handy.
Lesser known is that heel and pitch also affect the measured magnetic field. Now the good thing about the 6 axes of motion measuring is that Boatimu.py knows what attitude your boat is in. And therefor, it can correct for pitch and heel. How? Suppose your boat is level and the measured compass heading is due north. Suddenly, the boat heels 20 degrees and pitches 20 degrees, so that’s a rotation over 2 axes. It does not yaw, so the actual compass heading does not change. But due to the changed magnetic influence of the boat, the measured heading might be different. Since the imu has not recorded any yaw, it knows now the correction vector for 20/20 heel/pitch. With a handful of those correction vectors it can interpolate the heading for each attitude of your boat, but the more correction vectors, the better. Recording those correction vectors is a constant process, called auto-calibration. Think of it as a 3-D deviation table. The end result is that Boatimu.py puts a value in the data layer that is seriously reliable, and it’s getting better as you sail more. Only this is reason enough to convert your tiller pilot into a pypilot!"
Reply


Messages In This Thread
IMU what information uses pypilot - by Andreas29 - 2021-01-27, 11:08 AM
RE: IMU what information uses pypilot - by ironman - 2021-01-27, 02:48 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)