Hundredths of Degrees From Death
I am in the process of pursing my next pilot rating: the instrument rating. I obtained my private pilot certificate in October 2018, and while it allows me to fly myself and passengers just about anywhere I want, I am not allowed to enter or get close to clouds or low visibility. The instrument rating teaches pilots how to control an airplane by reference to instruments only, as opposed to using the physical horizon as a reference.
The instrument approach
One of the most critical skills to learn for instrument flight is how to fly an instrument approach. The Federal Aviation Administration (FAA) publishes specific procedures for how to guide an airplane from the enroute environment to the runway with no visibility until just before the runway. These procedures make use of radios and GPS equipment onboard the airplane, as well as instruments that show a pilot their lateral and vertical deviation from the desired path.
The picture above shows a VOR/ILS indicator, which is installed in most aircraft. It helps a pilot determine their lateral position and vertical position (if installed) on an instrument approach. The lateral and vertical radio signals are emitted from separate trasmitters at the airport, and are received by the inbound aircraft’s radio. The transmitter for the lateral signal is called a localizer (shown below).
Flight simulators
I use the X-Plane 11 flight simulator at home to practice some instrument flying procedures on the cheap. To make the situations as realistic as possible, I use the most up-to-date databases from the FAA to generate up-to-date waypoints, navigational aids, and approaches in the virtual world. This is super neat because I am able to practice the actual procedures as I would encounter them in the real world.
I noticed when flying the ILS 28R approach at Modesto Airport that the localizer was offset from the runway center line by hundreds of feet. I discovered this as I popped out of the clouds after flying the approach aligned with my localizer needle perfectly centered. The runway was to my left and out of view. Having flown the approach in real life, I knew that something was wrong.
To debug, I removed my custom data file and used the factory X-Plane data. The localizer was aligned perfectly as expected. So I knew there was something wrong with the custom data I was using.
Coded Instrument Flight Procedures
The custom data I use in the simulator comes from the Coded Instrument Flight Procedures (CIFP) file and is released by the FAA every 28 days. You can download it for free on the FAA website. This data is the same data that gets processed by the GPS manufacturers and third-party companies to provide up-to-date databases and procedures for pilots in their aircraft.
The CIFP file is a plain text file that is formatted according to the ARINC 424 specification. The FAA currently uses version 18. I could only find the PDF for version 17 online, but it seems to be mostly the same. There is a ton of information in this file, including a digital representation of just about every airway, waypoint, physical navaid, and instrument approach procedure. It includes every localizer as well as its geolocation and bearing. The bearing of a localizer is the value in degrees which the localizer provides a “center line” for an aircraft’s instruments.
After combing through the dense PDF specification and decoding the data, I realized that the bearing for the localizer is represented in tenths of degrees. Further research online in the X-Plane forums confirmed that this precision is not good enough to properly simulate a localizer. The factory data for X-Plane represents the localizer bearing in thousandths of degrees.
Note: There is a bigger source of this error in precision, which is described in the Updates section.
The ARINC 424 specification has optional data fields to include a more accurate bearing for localizers specifically for simulation purposes, but these fields are not populated in the CIFP file provided by the FAA. I have a hunch that it is included for simulators approved by the FAA for flight instruction, but cannot confirm that.
Designing a Fix
There are already programs out there that use the existing X-Plane data to populate these simulation records, but I wanted to find a solution that does not depend on stale data. The aforementioned solution works great for all the approaches that X-Plane had in 2016, but what about going forward? In reality, localizers rarely get removed or moved so the simple solution works for probably 99% of cases. I had some spare time to kill so I did some more thinking on how to solve the problem generically.
I came up with the idea to calculate the bearing of the localizer as a function of two geolocations: the localizer and the final approach fix. The final approach fix is a point on an instrument approach where generally there are no more changes in course to the runway. I believe this is a safe assumption: I am not aware of any instrument approaches where the straight line connecting the final approach fix to the localizer would not be close to or equal the localizer’s “center line”.
I spent a week writing a parser in Golang that reads the FAA CIFP file and stores the relevant information necessary in order to calculate an approximate bearing for every published localizer. It then inserts an additional simulator entry that contains the more accurate bearing. All other content of the file is written out verbatim from the original.
I built a simple web app that automatically processes the latest FAA data and makes it available for you to download. If you are technically savvy, you can find the code for this project on GitHub and run the software yourself.
Lessons Learned
This project was a tremendous learning experience on so many different fronts. Other than the obvious programming practice and knowledge of the ARINC 424 specification, I think a few other things are worth mentioning:
- There are tons of variations of a localizer approach. I designed a program that works for every localizer. There are so many variations of localizer-based approaches that I had to account for in the program. Would you believe that there is only one approach in the entire national airspace system that has a VOR as a final approach fix? There are also tons of approaches in Alaska that have non-directional beacons (NDBs) co-located with distance measuring equipment (DME)? Because of the way the data is structured, these cases need to be specially handled or else there are a handful of localizers that cannot be processed.
- A handful of approaches do not exist in the data. If you run my program with the Feb 27 2020 data release (and probably future releases), it will spit out warnings that five localizers (IPAU, IHQZ, IJLN, ILRD, IROW) could not be processed. The reason is because there is no corresponding front-course localizer approach in the data file. I am going to check the next time I am in an airplane to see if the GPS is missing these approaches as well.
- Be careful when using a GPS to aid in flying a non-GPS approach in real life. As I clearly have shown in this article, the data in the GPS cannot be trusted in all cases. Make sure to verify all waypoints and to always use the VLOC functionality of your radios as primary navigation.
Updates
- April 4, 2020: A previous version of this article suggested that using the GPS to fly a localizer approach was a bad idea because of the incorrect final approach course information. This is not necessarily as bad as suggested because the GPS connects discrete waypoints on the approach and does not attempt to replicate the localizer “chute” as X-Plane does. While in normal operations it is generally not legal to use your GPS for primary navigation on a conventional approach, it may be justified in an emergency to navigate from waypoint to waypoint on the approach, provided you fly the non-precision approach minimums. Of course, if you have a GPS and there is an RNAV procedure available, maybe use that instead!
- June 4, 2022: It has been brought to my attention from a reader of this article that the source of the inaccuracy is more complex than simply one order of magnitude of precision for the localizer bearing. This precision difference would only account for a maximum of 10 feet of inaccuracy at the decision altitude. The bulk of inaccuracy comes from the fact that the localizer bearings reported in the CIFP are significantly out of date with regards to magnetic variation. Modesto’s localizer course is currently reported as 288.1 degrees magnetic in the CIFP, which is based on a 16 degree magnetic variation from 1985. X-Plane operates on true headings and uses the current magnetic variation to convert the localizer magnetic course to a true course. With today’s variation closer to 13 degrees, this is what is accounting for the hundreds of foot difference as observed at the decision altitude. The solution designed in this article is still correct since it calculates the true localizer course between two precise geolocations and inserts that into the simulator record. X-Plane uses this true course directly without any need to convert from magnetic.