Narrative:

We taxied out of ZZZ to runway xx. I had briefed the departure briefing at the gate prior to taxi-out. The brief included our special considerations for runway xx to put our aircraft in a dg mode prior to take off. Just after being cleared to cross runway xy; I switched the plane from mag mode to dg mode and verified that the standby compass and both left and right headings indicated correctly. Upon taxiing on runway xx and being cleared for takeoff; headings checked with runway heading.we took off and flew the [departure]. My pilot monitoring checked on with departure and they assigned us a climb to 6000 feet. Shortly after; we were assigned a left turn to 310; followed by a left turn to 290. Upon leveling at 6000 feet at 250 knots on a heading of 290; I switched the aircraft back to mag mode. ATC then assigned us direct to zzzzz and climb and maintain 15;000 feet. We executed direct zzzzz and selected nav mode. I looked at the mfd and it showed zzzzz to our left and the aircraft was turning to the right. I now selected heading mode and notified ATC. He gave us a frequency change to departure. After checking on with our new departure; we advised them we need a heading and could not proceed direct to zzzzz as we were having a navigation issue. He assigned us heading 290 and maintain 14;000 feet. Shortly after he turned us to 320. We received a TA right around this time showing a plane off our left 1000 feet below us.ATC then told us to turn right to 320 we told him we were on a 320 heading. He responded with 'turn more right; I will call for you to stop turning.' we complied. The pilot monitoring asked departure what heading he was showing us on; he replied with we were [on] a heading of 250 and we told him we were showing we were on a heading of 350 (100 degrees off). Shortly after; he told us to stop our turn. Both the left and the right headings were the same leading us to believe our ahars heading was correct and our compass heading was wrong; up until we confirmed this was not the case with ATC. In fact; our compass was right and our ahars was wrong. We requested to level off at 14;000 on a straight heading so we could get our compass and ahars slaved together. I had the first officer slave his side to match the compass. Once he was done I transferred the autopilot to his side and slave mine to the compass. I then re-selected mag mode and verified all the headings now aligned. I transferred the autopilot back to the left side and we told ATC we had fixed the issue and can proceed direct to zzzzz. He gave us direct zzzzz and climb and maintain 17;000. We had no further incident after this.from switching to dg to mag mode; I did like I normally do leaving ZZZ; level accelerated flight. I had never had this issue before and am not sure what caused it. As a crew; [we] were discussing which instruments to trust; our compass or pfd's. Both pfd's were the same so we went with that. Only after ATC confirmed our mfd's were wrong were able to discover the compass was right. We should have trusted our compass earlier then we actually did.

Google
 

Original NASA ASRS Text

Title: CRJ-900 flight crew reported a track deviation resulted when the PFD's provided incorrect heading information.

Narrative: We taxied out of ZZZ to Runway XX. I had briefed the departure briefing at the gate prior to taxi-out. The brief included our special considerations for Runway XX to put our aircraft in a DG Mode prior to take off. Just after being cleared to cross Runway XY; I switched the plane from Mag Mode to DG Mode and verified that the standby compass and both left and right headings indicated correctly. Upon taxiing on Runway XX and being cleared for takeoff; headings checked with runway heading.We took off and flew the [departure]. My pilot monitoring checked on with Departure and they assigned us a climb to 6000 feet. Shortly after; we were assigned a left turn to 310; followed by a left turn to 290. Upon leveling at 6000 feet at 250 knots on a heading of 290; I switched the aircraft back to Mag mode. ATC then assigned us direct to ZZZZZ and climb and maintain 15;000 feet. We executed direct ZZZZZ and selected Nav mode. I looked at the MFD and it showed ZZZZZ to our left and the aircraft was turning to the right. I now selected heading mode and notified ATC. He gave us a frequency change to Departure. After checking on with our new departure; we advised them we need a heading and could not proceed direct to ZZZZZ as we were having a navigation issue. He assigned us heading 290 and maintain 14;000 feet. Shortly after he turned us to 320. We received a TA right around this time showing a plane off our left 1000 feet below us.ATC then told us to turn right to 320 we told him we were on a 320 heading. He responded with 'turn more right; I will call for you to stop turning.' We complied. The pilot monitoring asked Departure what heading he was showing us on; he replied with we were [on] a heading of 250 and we told him we were showing we were on a heading of 350 (100 degrees off). Shortly after; he told us to stop our turn. Both the left and the right headings were the same leading us to believe our AHARS heading was correct and our compass heading was wrong; up until we confirmed this was not the case with ATC. In fact; our compass was right and our AHARS was wrong. We requested to level off at 14;000 on a straight heading so we could get our compass and AHARS slaved together. I had the First Officer slave his side to match the compass. Once he was done I transferred the autopilot to his side and slave mine to the compass. I then re-selected Mag mode and verified all the headings now aligned. I transferred the autopilot back to the left side and we told ATC we had fixed the issue and can proceed direct to ZZZZZ. He gave us direct ZZZZZ and climb and maintain 17;000. We had no further incident after this.From switching to DG to Mag mode; I did like I normally do leaving ZZZ; level accelerated flight. I had never had this issue before and am not sure what caused it. As a crew; [we] were discussing which instruments to trust; our compass or PFD's. Both PFD's were the same so we went with that. Only after ATC confirmed our MFD's were wrong were able to discover the compass was right. We should have trusted our compass earlier then we actually did.

Data retrieved from NASA's ASRS site and automatically converted to unabbreviated mixed upper/lowercase text. This report is for informational purposes with no guarantee of accuracy. See NASA's ASRS site for official report.