X-Plane 12 changes the way directional gyro drift is calculated and the behavior of the directional gyro drift data refs. If your aircraft or plugin adjusts or watches these datarefs, you will want to check whether your code still works with the new drift.
Types of Error
Once spun up fully, the directional gyro tracks a fixed point in space (its axis is aligned with an imaginary star in the sky, if you will) rather than a course. The pilot initially aligns this axis with the magnetic north at his point of departure. From there on out, gyro drift is now comprised of three components:
- apparent wander (the earth rotates while the gyro axis wants to stay fixed)
- transport wander (caused by meridian convergence as you fly east or west)
- random wander (caused by friction in the instrument itself, the only kind of wander previous versions of X-Plane simulated.).
Latitude adjustment screw
Apparent wander is counteracted by the instrument, which is calibrated to a latitude that it’s being operated at. This is a per-aircraft setting that is stored in the per-aircraft preference file in the _dg_lat_adjust_0 and _dg_lat_adjust_1 parameters for the pilot and copilot side instrument. If the aircraft stays close to the latitude set in the instrument, apparent wander will be very low. If the aircraft operates far away from the latitude setting, apparent wander will be higher. The screw can also be adjusted by datarefs (see below for data ref list).
The pilot periodically needs to adjust the gyro to compensate for random wander, transport wander, and whatever apparent wander is left that is not compensated by the latitude compensation. Therefore, pilot adjustment must equal the sum of the errors, with a negative sign. Previous versions of X-Plane always had you set the dg_drift_*_deg datarefs to 0 for no error. Now, the drift dataref refers to the pilot adjustment and must instead equal negative gyr_total_error, rather than 0.
In planes so equipped, the gyro is slaved to a magnetic sensing system, that keeps the gyro aligned with magnetic north. A new dataref has been introduced that measures the difference between the gyro and the magnetometer reading:
gyr_magnetometer_diff Note that this dataref does not necessarily equal 0 all the time the system is working. In turns, the magnetometer is subject to dip error, which will cause this dataref to show an excursion, even though the directional gyro is tracking perfectly. This slight deviation especially in turns is visible on real compensator instruments as well and is not an error.
sim/cockpit/gyros/gyr_latitude_nut float y degrees adjustment screw for the operational latitude of the directional gyro. Counteracts apparent wander of the gyro caused by rotation of the earth sim/cockpit/gyros/gyr_total_error float n degrees sum of directional gyro error due to earth wander, transport wander, and random wander. For calibration, the drift adjustment (what the pilot sets) must equal negative this value sim/cockpit/gyros/gyr_magnetometer_diff float n degrees detected difference between gyro heading and magnetic heading picked up by the magnetometer. Keep in mind that this is only accurate in sraight and level flight, as the magnetometer is subject to dip error (but not acceleration error)