2021-01-24, 04:23 AM
Yes, it's true a small adjustment may be always needed especially if there are magnetic distortions. Then again, pypilot compass is for relative purposes and depending on distortions (or the actual mpu9255 used) you will not get exactly 90 degrees of change when the boat rotates 90 degrees.
So the compass offset will affect the pitch/roll alignment. Ideally you would set the compass offset to ensure there is no pitch when rolling, and accept the slight compass differences. The calibration is a compromise to ensure quick convergence rather than absolute precision which isn't needed for an autopilot, but then dialing the pypilot compass to read the same as a magnetic compass for example may lead to sligh pitch/roll mis alignments (hopefully a few degrees at most) This won't prevent the autopilot from basically working well because the basic pilot anyway makes use of the rate of change around the stationary z axis (which makes use of all the gyros) but is not affected by the compass alignment. In the future more algorithms may make use of other sensors, but I intend this to be for self-learing pilots which would end up compensating the misalignment anyway, although transferring the knowledge learned to a different pilot or even boat could be an issue...
So the compass offset will affect the pitch/roll alignment. Ideally you would set the compass offset to ensure there is no pitch when rolling, and accept the slight compass differences. The calibration is a compromise to ensure quick convergence rather than absolute precision which isn't needed for an autopilot, but then dialing the pypilot compass to read the same as a magnetic compass for example may lead to sligh pitch/roll mis alignments (hopefully a few degrees at most) This won't prevent the autopilot from basically working well because the basic pilot anyway makes use of the rate of change around the stationary z axis (which makes use of all the gyros) but is not affected by the compass alignment. In the future more algorithms may make use of other sensors, but I intend this to be for self-learing pilots which would end up compensating the misalignment anyway, although transferring the knowledge learned to a different pilot or even boat could be an issue...