The hack that saved Apollo 14: A deep dive into the Apollo Guidance Computer


EXCERPT: Commanded by Alan Shepard, the only original Mercury astronaut to make it to the Moon on an Apollo mission, Apollo 14 was a reflight of Apollo 13's abandoned lunar landing plan. Accompanied by Lunar Module Pilot Ed Mitchell and Command Module Pilot Stu Roosa, Shepard's target was the Fra Mauro highlands, a hilly area near the lunar equator and just south of the giant crater Copernicus. Likely created from the ejecta thrown out when Mare Imbrium was created, the Fra Mauro site was thought to potentially contain material from deep inside the Moon that could shed light on our companion satellite's origin.

In the eight months since the harrowing flight of Apollo 13, engineers made several changes to the spacecraft to reduce the chance of another explosion happening. To help ensure that the crew could make it home if another emergency occurred, an additional oxygen tank and battery were added. The unplanned pause also allowed time for some software updates to be added to the lunar module computer; a particularly welcome addition was the ability of the computer to recognize changes in the height of the surface during the approach to the landing site. With this new capability, the computer would not be confused by the undulating terrain as the vehicle headed toward landing.

[...] The four days in transit and the time spent in lunar orbit were uneventful—or at least as uneventful as a flight to the Moon could be. Insertion into lunar orbit occurred at about 82 hours into the flight. To conserve precious fuel in the LM [lunar module named Antares], the combined spacecraft lowered its orbit to a nine mile (about 14.5 kilometers) perigee several hours later. Preparations for the descent started the next day, with the activation and checkout of the LM.

However, less than four hours before the scheduled landing, controllers noticed that according to the indications on their consoles in Mission Control, the LM's Abort pushbutton appeared to have been pressed. When asked via radio, Shepard confirmed that no one on board Antares had pressed the Abort button—which meant there was a short-circuit or other electrical issue somewhere inside the LM's complicated guts.

This was potentially a mission-ending problem: if the button was pressed and the engine was firing, the LM would immediately begin its abort procedure as soon as the lunar descent started, making a landing impossible. Under hard time pressure, the ground had to quickly figure out what was wrong and devise a workaround. What they came up with was the most brilliant computer hack of the entire Apollo program, and possibly in the entire history of electronic computing.

[...] In describing a "computer," one expects that the system would include the abilities we attribute to contemporary computers—the ability to run several programs at once, for example, or to present a simple yet intuitive interface, to control a wide variety of devices, and to gracefully recover from application errors. “Ha!” you might exclaim, “I carry a computer like that in my pocket!”

The idea of such capabilities being available nearly 60 years ago stretches credulity, but the Apollo Guidance Computer [AGC] had these features and more. An interpreter to process “virtual” machines, similar to Java byte code? Check. The ability for remote data updates? Yup. Given all of these capabilities and more, it’s quite reasonable to argue that the AGC compares favorably with a modern smartphone. Yes, the AGC is slower and has far less memory, but that is only due to its unfortunate timing at birth, being at the wrong end of the Moore’s Law curve.

Although the processor at approximately 80,000 instructions per second was not especially fast, it is impossible to overemphasize the impact that its scarce memory had on AGC software developers. Consider the limits the programmers were under: all the software for the flight to the Moon and back had to fit in 36K words (15 bits long, plus 1 bit for parity) of read-only core rope memory. As “bytes” were not a concept in the AGC, all 15 bits of a word were accessed at once with no easy way to break the word into smaller divisions.

Secondary storage was not an option: disk units, then the size of washing machines, could not even fit in the spacecraft. Tape storage, while a reliable and viable option, was considered far too late in the development cycle to be included in any designs. The AGC's software was entirely contained within core-rope modules housed inside the AGC itself, a 70lb (about 32kg) box measuring 61cm long, 32cm wide, and 17cm tall.

In addition to the 36k words of read-only memory for the core programming, the AGC had a trivial 2k words of RAM—necessary for the operating system, process management, recovery, and global variables for all mission phases. That’s it. Shoehorned amongst this meager amount of RAM were dedicated memory areas used by application programs: the software that performed the guidance and navigation tasks, landing on the Moon, or rendezvous. Basic programs were each allowed a whopping seven words for temporary variables. And no, that’s not a misprint.

With these constraints in mind, it’s easy to be cynical when facing the task of installing the latest multi-gigabyte application on our laptops. [...] To explain exactly what the hack was, how it functioned, and the issues facing the developers during its creation, we need to dig deep into how the Apollo Guidance Computer worked. Hold onto your hats, Ars readers—we're going in... (MORE - other details of Part 1 plus 4 more parts)


Possibly Related Threads…
Thread Author Replies Views Last Post
  Humour in the time of Stalin: The jokes always saved us C C 0 20 Dec 30, 2019 10:47 PM
Last Post: C C
  The Forgotten Plans to Reach the Moon—Before Apollo C C 2 132 Jul 24, 2019 05:50 PM
Last Post: Yazata
  Soviet officer who saved world in 1983 (Stanislav Petro dies) C C 1 588 Sep 20, 2017 02:23 AM
Last Post: elte

Users browsing this thread: 1 Guest(s)