A couple weeks ago I was at a party where out of the corner of my eye I noticed what looked like a giant phone book sitting open on a table. It was printed with perforated green and white paper bound in a binder who’s cover looked a little worse for the wear. I had closer look with my friend James Kinsey. What we read was astonishing; Program 63, 64, 65, lunar descent and landing. Error codes 1201, 1202. Comments printed in the code, code segments hastily circled with pen. Was this what we thought we were looking at? And who brings this to a party?

We were looking at what is rumored to be the only remaining paper copy of the Lunar Module’s source code . This is the source code book used by Don Eyles during Apollo missions and for development. Don was responsible for writing code for the Lunar Module, specifically about 2000 lines that actually landed man on the moon. He turned up at the MIT Faculty Club in June and brought this original print out along, in its own suitcase of course.

How it works

Both the Apollo Command Module (CM) and Lunar Module (LM) were humankind’s first fly-by-wire aircraft. This means that the human does not actually fly it manually by stick, the computer is the one that controls the throttle, thrusters, gimbals (which are servo motors that control the direction of the larger thrusters), in real-time. This was done by necessity. Humans could not fly these spacecraft manually especially the LM during descent, which was very unstable.

One Page Per Millisecond

The core of the system was the Apollo Guidance Computer (AGC). Part real-time OS, part National Instruments Data Acquisition System, the AGC was a multi-threaded computer & feedback control system in communication with everything from radars, to telescopes, to gyroscopes and accelerometers controlling massive space engines and performing all tasks in real-time. Numerous programs shared CPU cycles, an executive program kept track and prioritized it all. You can read about it for yourself, the best book on this topic is Digital Apollo.

Don graciously took us through a tour of the code where he explained problems with various missions and how they were solved in the code. One example was an issue with LM descent engine’s frequency responses. The manufacturer did not specify an accurate transfer function for the engine’s throttle causing the system to be unstable. Remember, this is a feedback control system, this would be equivalent to not knowing the frequency response in the output circuit of an op-amp.

The error codes I mentioned earlier (1201, 1202 and etc.) were famously displayed during Apollo 11’s landing. These made Neil Armstrong very nervous during the last portion of the lunar landing. Don explained that these errors were due to leaving the docking radar on by accident. Unfortunately this scenario was never simulated or practiced on the ground.

The docking radar was sending numerous interrupts to the processor taking away precious cycles which caused the AGC to warn Neil Armstrong that it was over-taxed and that it would cease any non-essential programs. Essential programs, like flying and maintaining stability of the LM and navigation remained, non-essential programs like updating the DSKY were paused.

Although the picture in the video below can be a choppy at times, hear what Don has to say is where it shines. In addition to the examples above, he mentions so many interesting details like the rule of thumb during code development; each page of code takes about 1ms of CPU time. In this clip Dana Yoerger is asking most of the questions.

The Seventies: Weird-Looking Freak Saves Apollo 14!

Don was a rebel working for the military industrial complex knowing that he served a greater purpose which was to help land humankind on another world for the first time. This 1971 Rolling Stone piece provides a fascinating perspective of what motivated hackers like Don in the late 60’s.

It is truly spectacular to run into engineers from these world-changing projects and to hear what they have to say. If you are one such engineer, or can connect us with one, please don’t hesitate to reach out using the article tips line.

Very Heavy Source Code

I did not hide my enthusiasm for this history lesson. I think it was for this reason that Don asked if I wanted to carry the code back to his car. He was joking, but I took him up on the chance to handle artifact that will be sealed behind glass and displayed at a museum sooner or later. The source code was very heavy, I had to switch arms about three times over a journey of only two city blocks.

Like many involved with the Apollo program Don is very personable, kind, will not brag about himself, and is hesitant to take credit. This is a refreshing attitude in an era of reality television and self-promotion. We’ll learn more soon, keep an eye out for Don’s book due to be published within the next year or so.

Author Bio: Gregory L. Charvat takes every opportunity to learn from those who were involved with the Apollo program. Greg’s author bio can be found here.