OpenMarine
ap.heading making jumps - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: Pypilot (https://forum.openmarine.net/forumdisplay.php?fid=17)
+--- Forum: General discussion (https://forum.openmarine.net/forumdisplay.php?fid=18)
+--- Thread: ap.heading making jumps (/showthread.php?tid=2761)



ap.heading making jumps - ironman - 2020-07-16

I normally have the scope running on ap.heading_error to quantify the amplitude of the error in order to optimize my gains. Yesterday I noticed the heading_error making sudden jumps - up and down. This coincided with jumps in ap.heading, and I concluded this was the cause for that. I've never seen this before and I have no reason to suspect a sudden increase in electric or magnetical influences. Also, I find it too easy to suspect the IMU, as there are tons of code between the IMU and ap.heading. Also, the lowpass filter should have smoothed off any IMU-induced jumps.

So what I suspect is that these jumps are artefacts of the compass calibration mechanism. That would be fine with me, as that mechanism has to do its work at some point anyway and some jump in heading is to be expected then. But not 5 jumps in 10 seconds or so. At some point it stopped jumping, and I had done my portion of gain-optimizing for the day; pypilot worked well for the remainder of the trip. I was not in a position to make movies or do some logging.

I'd like to know if my assumption could be right, and know a little bit more about how the 2D compass calibration (the one that sets imu.compass.calibration) relates to the 3D calibration, that provides the corrections for heading and pitch? What values should I set on my scope to see each mechanism at work? At least, this would enable me to search for the cause of these jumps.

Thx!


RE: ap.heading making jumps - seandepagnier - 2020-07-16

It can be an artifact of compass calibration, or if the user adjusts the compass offset. This is to hopefully hold the same course even though the heading is changing.

It should not jump more than 1 time in 20 seconds. The heading and heading command should change the same amount so as not to have much effect on course.


You could look at the compass calibration age and if it resets to 0 when the heading changes.


RE: ap.heading making jumps - ironman - 2020-07-17

(2020-07-16, 09:29 PM)seandepagnier Wrote: It can be an artifact of compass calibration, or if the user adjusts the compass offset.   This is to hopefully hold the same course even though the heading is changing.

It should not jump more than 1 time in 20 seconds.  The heading and heading command should change the same amount so as not to have much effect on course.


You could look at the compass calibration age and if it resets to 0 when the heading changes.

All right, I'll put ap.heading, ap.heading_command, and imu.heading on the scope then, keep a sharp eye on the calibration age and see what happens.

But if I'm right, ap.heading_error = ap.heading - ap.heading_command, so when the ap.heading_command is adjusted along with ap.heading, I would not have seen the jumps in ap.heading_error. That would mean that the jumps are not caused by the 2D compass calibration mechanism, but by something else. Couls this be the 3D correction mechanism? How does that tie into all this?

Eager to learn :-) thx!


RE: ap.heading making jumps - seandepagnier - 2020-07-18

You are correct. There should not be a significant jump in heading_error. Is there any chance you can capture a screenshot of the scope?