The round ball is the CCU, Course Computer Unit. It contains a magnetic heading sensor and also senses rate of turn. It is connected to the NMEA 2K bus, shadow drive sensor, ECU (Electronic Control Unit that is connected to the pump), and GHC display. I do not believe it contains a typical gyro. Per the installation manual it is supposed be be 24 inches from magnetic sources. Per the autopilot installation manual there are a couple of procedures to tune it for heading, a compass calibration and setting North. Both are done with the wizard in dealer installation mode on the GHC display. The compass calibration is a steady clockwise turn so the CCU can calibrate out magnetic deviation, these are errors caused by magnetic fields in the boat. The North setting procedure requires a period of straight cruising, about 45 seconds, the CCU uses the GPS data on the NMEA bus to determine the actual heading and sets North in the ECU. (you can cruise in any direction as long as it is straight). Obviously both of these are best done in light current/wind conditions.
In my tug the 5212 uses the heading information from the CCU to set the display up heading. It is not using GPS heading while the autopilot is powered on. While at anchor I have powered off the autopilot, after a short period the 5212 alarms that it has lost its heading source. I believe it swithes to GPS heading at this point, which causes wild display rotations while at anchor as the boat slowly swings. There is probably a 5212 configuration to control the default heading information source.
If you see different display errors on the 5212 map at different headings that are not explained by wind/currents then you should try running the calibration procedure on the autopilot, the magnetic fields in your boat may have changed since this was last done.
If the error is constant in a particular direction at any heading then the North setting in the CCU is off a bit, there is a manual tune process you can use in dealer configuration mode to adjust this (Fine heading adjustment), or run the set North wizard. Or you can rotate the CCU a bit, but I find it easier to use the GHC display and adjust it electronically.
The autopilot installation manual describes these procedures.
Howard