To the Moon and back

Remembering an Apollo Era pioneer

With all the talk these last few years of multiple countries making plans for a new human presence on the surface of our nearest neighbor in space, the Moon, perhaps it’s also time to take a moment to honor a pioneer from the original landings from over 50-years-ago.

If you heard the name, “Margaret Hamilton,” it might have made you at first think about the well-known actress of the 1930s who played the green-faced “Wicked Witch of the West” character in the 1939 classic film, “The Wizard of Oz.” But this isn’t the Hamilton we’re referring to here, but rather the person who lead the effort to create the computer software that safely navigated the Apollo astronauts to their lunar landings and back home to Earth again.

Although it was recently announced just two weeks ago, this Margaret Hamilton (1936 – 2026) had actually passed away on 30 September. Though not exactly a household name unless you are a student of space history, her contributions in “software engineering” (a term she actually invented, and later adopted by the profession) were immeasurable when it came to leaving 12 astronaut’s bootprints on the lunar surface.

Initially working with abstract mathematics after college, Hamilton found her way into programming by coming up with software applications that could be used in weather prediction. Starting to work at the Massachusetts Institute of Technology in 1961, by 1965 she had become interested in their work with the Apollo Guidance Computer (AGC). Becoming an expert within the project, she became the Director of the new Software Engineering Division at MIT, responsible for the team writing and testing all onboard in-flight software for the Apollo Command Module (CSM), and Lunar Module (LM) spacecraft. This even extended later on to the United States’ first future, post-Apollo space station, Skylab.

Sending a spacecraft from our world to its only natural satellite is not as easy as one might think. You have to “lead,” or anticipate, where you want your spacecraft to arrive at the Moon, which is moving along its orbit. This is very much like how a marksman has to anticipate where a clay pigeon is flying across the sky after it’s been thrown in order to hit it. As someone once referred to this feat, reaching the Moon was like trying to hit a distant bumble bee flying past with an air rifle’s 4.5 mm BB while sitting astride a painted wooden horse on an amusement park’s rotating merry-go-round! I’ll wait a moment while you try to mentally visualize this.

En leende kvinna med långt hår och glasögon står bredvid en mycket hög trave av tjocka, inbundna tekniska manualer i ett kontor med en vägg som är en griffeltavla.
Source: Public domain

This famous photograph shows the result of Hamilton’s group; a huge printout of computer code as tall as she is, making it possible to navigate to the Moon with the CSM and LM locked together, land on the lunar surface with just the LM, return to the CSM via the LM, jettison the unneeded LM to orbit the Moon, and then use just the CSM to fly back to Earth again.

En delad svartvit bild som till vänster visar en kvinna i en mönstrad tröja som hanterar en komplex kontrollpanel, och till höger ett porträtt av två personer, varav en äldre kvinna med glasögon och yngre en flicka.
Source: Public domain, montage by Tom Callen

During the development of the navigation program, Hamilton and her team were working around-the-clock, seven days a week. Now a single mother in 1967, she was bringing Lauren, her four-year-old daughter, with her to the lab at MIT, which is where they had a simulator for the crew compartment of the Apollo Command Module. While her mother worked, Lauren occupied herself with playing around with things in the lab, sometimes even sitting inside the simulator itself as she had often seen her mother do.

During one computer simulation test using the navigation software, Lauren was sitting inside the crew module, randomly pressing buttons as she played “astronaut.” While doing so, the youngster pushed some keys on the computer’s DSKY (pronounced “DISS-key”) input panel, causing it to run Program 01 (Prelaunch Initialization), or P01. The simulation crashed, and, instead of being mad at her daughter, when Hamilton looked at the resulting data to see what had gone wrong, she noted P01 had been entered and run. Discovering this command, it was more than obvious why the simulation that had already been running crashed. The Apollo Guidance Computer thought that the Command Module was sitting back on the launch pad at Cape Kennedy in Florida, so it immediately lost all of its current information where it was supposed to be in three-dimensional space as well as how fast and in what direction it was traveling between Earth and Moon. Instead, the computer was trying to reorient itself with the spacecraft sitting on top of the Saturn V rocket prior to launch.

To say the least, this was quite a serious and alarming issue. Suppose this happened during an actual lunar mission? Hamilton brought this to the attention of both her supervisors at MIT and at NASA, but they dismissed her concerns. There was no way that a highly trained astronaut, who had probably once been a highly trained aircraft test pilot, would make the same sort of a silly mistake as a four-year-old girl. There was no need to make any changes, or so they thought. Since there was no willingness to modify the program, the best Hamilton thought she could do at the time was to give the astronauts a “heads-up” warning in the form of a note in their software manual for the AGC about not running program P01 following the Saturn V’s launch during an actual Moon journey.

En Apollo-styrdator med tillhörande DSKY-gränssnittspanel bredvid en hand som håller i en iPhone 5s, allt mot en enfärgad blå bakgrund med text.
Source: public domain, montage by Tom Callen

The final Apollo Guidance Computer hardware, built by the Raytheon Company, was designed to fit into a particular physical space in the CSM and LM regardless of its capabilities. An important feature was being one of the world’s first large-scale uses of integrated circuits in such a device, which also included a hand-wired computer memory. And for every such navigation computer put onboard the Command Service Module, there was a similar unit in the Lunar Module to be used for actually landing on the Moon’s surface.

By today’s standards, the AGC was pretty simple, but it did the job. How powerful was it in terms of something more familiar today? Wheen Apple’s iPhone 5s was introduced in September 2013, it was 1,300 times more powerful than the navigation computer that went to the Moon! And, like any other smartphone today, you could easily carry an iPhone 5s in your pocket..

En jämförelse sida vid sida som visar Apollo-kommando- och servicemodulen i omloppsbana runt månen, samt månlandaren som flyger i den djupa rymden.
Source: NASA, montage by Tom Callen

Let’s take a moment and consider all this ongoing software development and testing in connection with NASA’s contemporary timeline of manned spaceflight plans. Apollo 7 was the 11-day-long crewed test of the Command Service Module (CSM – Apollo 15’s is seen in the left picture) in Earth orbit, which included having an Apollo Guidance Computer onboard. The next mission, the original Apollo 8, was going to be the test flight also including the Lunar Module (LM – Apollo 11’s to the right). Not only would it dock with the CSM after launch following extraction from the upper, third stage of the Saturn V rocket, but it was then also going to separate and fly off over 100 km away, then come back and re-dock its upper half with the CSM, just as the astronauts would have to do during an actual lunar landing.

Unfortunately, designing and building the LM at Grumann Aircraft Engineering Corporation (Grumann Aerospace after 1969) was behind schedule and would not be ready in time, so NASA hatched a bold plan. In order to beat the Soviet Union on their own rumored flight to the Moon, test the long-range capabilities of the Apollo Guidance Computer, plus how Mission Control’s personnel could handle running such a mission there and back again, why not send Apollo 8 to the Moon? Which is exactly what they did, making it the first manned mission to another world.

It was during Apollo 8’s late December 1968 flight when Command Module Pilot, Jim Lovell, accidentally activated the P01 program on the navigation computer. Lovell, quite tired during their return flight back to Earth, accidentally entered Program 01 (P01) into the DSKY input instead of Star 01, a routine used for tracking a navigational star, which is what he really meant to do. So, a highly trained astronaut had done the exact same thing four-year-old Lauren Hamilton did in the MIT Apollo simulator in Boston.

As expected, when running P01 the Apollo Guidance Computer now thought it was back on Earth awaiting launch. Because it considered its position to be on the ground before its Saturn V lift-off, it instantly erased the spacecraft’s digital understanding of its position, velocity, and orientation in space. And, since this was the real Apollo Command Service Module in flight home from the Moon, its small maneuvering thrusters on the outside of the spacecraft immediately began firing to force the spacecraft into a ”capsule nose-up” launch pad orientation, changing it from the correct way it should be pointing while in flight.

Fortunately, there was a procedure to “find themselves” in space again. Before the crew could trust using the computer again, Lovell needed to set a basic heading for the spacecraft. Bypassing the AGC, he took personal control of the thrusters to stop the spacecraft’s motion, then used the Command Module’s built-in manual navigation equipment: its optical scanning telescope and sextant. All the NASA astronauts had trained, or would be trained, at a famous American planetarium at the University of North Carolina, so they could recognize stars traditionally used in navigation back on Earth. Lovell was able to manually sight and then align the spacecraft with two of these prominent navigational stars: Rigel (in Orion), and Sirius (in Canis Major).

Meanwhile back at Mission Control, Margaret Hamilton’s underlying basic control system kept the overall computer from completely crashing. This allowed trajectory experts back on Earth to quickly calculate a new, corrected location and heading for the spacecraft, but they weren’t “out of the woods” just yet.

After Mission Control radioed up the correct positioning data, Apollo 8’s crew had to manually punch in the several hundred keystrokes over the next few hours to re-feed the correct coordinates and trajectory equations directly into the computer. Once these new numbers were successfully uploaded and confirmed against Lovell’s previous manual star sightings of Rigel and Sirius, the Apollo Guidance Computer successfully recalculated where it was between the Moon and the earth, thereby returning the spacecraft to a safe homeward trajectory.

As a result of the young girl’s accident, later nicknamed and known around NASA as the “Lauren bug,” it was also then that those in charge were convinced in the wisdom of Margaret Hamilton’s notion of “What if it does,” agreeing that changes had to be made. These were done before the next mission, Apollo 9, which tested the now-ready LM in low-Earth orbit.

Never actually a direct employee of NASA, but contracted to them with the Apollo software team at the MIT Instrumentation Laboratory, Hamilton left academia around 1976, eventually co-starting a company, Higher Order Software (HOS), with another person from her MIT AGC software team. Something HOS specialized in was dealing with ideas in error detection and fault tolerance, learned while working with the Apollo software. Extensive testing throughout the software development process and built-in software safety to prevent human errors from happening are as could be easily understood, important issues.

Barack Obama hänger presidentens frihetsmedalj runt halsen på Margaret Hamilton, som bär svartbågade glasögon och en mörk tröja.
Source: Public domain.

For her work in leading the development of the on-board flight software for NASA’s Apollo Moon missions, Margaret Hamilton received the Presidential Medal of Freedom, the United States’ highest civilian award, from then President Barack Obama on 22 November 2016. She was one of a total of 21 recipients on this occasion who had each made their own contributions to the nation.

Kartongen till LEGO-setet ”Women of NASA” visar tre byggbara uppställningar med historiska personer, samt en infälld bild på en minifigur av Margaret Hamilton och en trave blå böcker.
Source: Tom Callen

Perhaps her most unusual honor in her long career was when Hamilton was included as part of the 2017 LEGO Creator set, “Women of NASA,” along with space shuttle astronauts Mae Jemison and Sally Ride, plus Nancy Grace Roman, NASA’s first Chief of Astronomy. Roman was also that agency’s first woman executive. Also known as “the mother of Hubble,” it was she that the recently launched “Nancy Grace Roman Space Telescope” was named for.

You can listen to Margaret Hamilton describe, in her own words, how her young daughter, Lauren, crashed the MIT Apollo spacecraft simulator, which led to potential life-saving changes being made for the lunar landings.

Tip for teachers: If possible, why not take and video project these website articles so that students can follow along as you read them aloud, especially if you’re using the English version for improving language skills. Alternatively, display them on a large TV screen.



By: Tom Callen