Now I know why I couldn't understand your propositions for fixes - my compass is perfectly centered. The problem is other. I've tested it in game by making a circle with u-boat watching the compass and it is in right place, nicely turning. But as you see on the screenshoot in the first post, it looks like sometimes it jumps away from its place

This screenshoot was from campaign game, so in the middle of a long patrol. I have no idea now what can be the reason of this?