Cirrus Vision Pilot reported incorrectly configuring a departure procedure in the aircraft's automation; which resulted in a terrain alert; and an immediate heading assignment issued by ATC.

Date: 2023-04 · Aircraft: Cirrus Vision SF50 · Phase: takeoff

Anomalies: deviation-track-heading-all-types|deviation-discrepancy-procedural-clearance|deviation-discrepancy-procedural-published-material-policy|inflight-event-encounter-cftt-cfit

Synopsis

Cirrus Vision Pilot reported incorrectly configuring a departure procedure in the aircraft's automation; which resulted in a terrain alert; and an immediate heading assignment issued by ATC.

Narrative

I took off from Runway XX; and had the departure procedure for the departure entered into the FMS. When I engaged the autopilot; the aircraft began a left turn; heading direct to the ZZZZZ waypoint. I had flown out of ZZZ on this same runway before; and had always made a right turnout towards ZZZ1; but had on at least one occasion gotten a left turnout under VFR conditions before. I was asked by ATC if I was on the procedure; and I told them I was; and was told that I was heading toward terrain and to immediately turn to a heading of 270; which I did; continuing the left turn; after which I was vectored to ZZZZZ1. I was then told to call the ATC number. I realized afterwards that the routing in Foreflight had me taking off on Runway XY instead of XX; hence the autopilot's left turn to ZZZZZ. I did receive a notification as I was taking off to 'Check Runway' from the Garmin avionics; but I was taking off on the assigned runway; so I ignored the message. Another lesson learned. If I get that message; I will abort the takeoff roll. I have learned from this experience to: Always cross-check the departure runway with the chart and with what is in Foreflight and the FMS. Don't be dyslexic!

Source: NASA Aviation Safety Reporting System (public domain). Reports are voluntary submissions and are not verified by NASA.