The Measure of Doubt
How hand-stitched memory, star sightings, and signals from Earth took three men to the Moon and back on a best guess
In February 1953, a B-29 bomber lifted off from Hanscom Air Force Base in Bedford, Massachusetts. In the back sat 2,700 pounds of equipment the lab called SPIRE, alongside Charles Stark Draper and seven engineers. The bomber's destination was Los Angeles, 2,250 nautical miles away, a flight that would take twelve and a half hours. SPIRE had been given its starting coordinates on the Bedford airstrip, but once airborne, it would receive no information from the outside world.
Inside the fuselage, the roar of four piston engines shook the aircraft. Outside, the ground moved past at hundreds of miles an hour, but SPIRE had no need to look out. The lab's own account says the windows could just as well have been painted black.
The safety pilot flew the take-off and landing. In between, he touched the controls just once, for a planned course correction. The rest of the time, he watched the equipment do its work.
Opinions on board varied. The engineers were delighted; the safety pilot had reached a different conclusion.
"You can celebrate, but I've just lost my job."
Draper had timed the landing so he could go straight to a top-secret navigation conference and tell the room how he had made the journey there.
SPIRE had crossed a continent without looking outside. It knew where it was.
How had it done that?
SPIRE navigated by inertia, the tendency of anything moving to carry on as it is until something pushes it. The principle was simple enough: give a machine a starting point, let it feel every push, and keep adding them up. The idea had a history. The V-2 rocket had already steered itself using gyroscopes, and Draper's laboratory had grown out of wartime work on gyroscopic gunsights.
Inside SPIRE, a platform supported gyroscopes that provided a steady reference for direction. Accelerometers detected changes in velocity: the pushes and pulls that made the aircraft speed up, slow down or change course. Imagine riding blindfolded in a car. You might not know where you were going, but you could feel the driver brake, accelerate and turn.
SPIRE did something similar, only it kept count. Add up the changes in velocity and you can calculate how fast you are moving. Add up the speed over time and you can calculate how far you have travelled. Before take-off, SPIRE had been told where it was and aligned to a starting direction; it could carry that information forward, but it could not conjure a starting point from nothing. From there, it could keep track of where the aircraft should be without looking outside. Draper called it "astronomy in a closet".
There was one catch. Every measurement had to be accurate, and an accelerometer cannot tell a genuine push from a tiny flaw in its own mechanism. If one registered a little more acceleration than was really there, the computer would add that extra amount to its calculations, then add it again, and again. Its estimate of speed would gradually drift from reality. Its estimate of distance would drift further still.
The computer would keep calculating, faithfully following its measurements. The longer it went without a correction, the further its answer could stray.
SPIRE could navigate without looking out. It could also be wrong.
Over a twelve-hour flight, a little drift could be lived with. Eight years later, Draper's laboratory was asked to guide a crew to the Moon: a journey of days rather than hours, with the Moon itself cutting the spacecraft off from Earth for part of the trip. The machine would need a way to check its own answer, and a way to decide how far to trust what it found.
NASA made it official on 10 August 1961, ten weeks after Kennedy announced his goal of reaching the Moon. It was the only Apollo prime contract awarded to a university, without competitive bidding. The lab had spent more than a decade teaching machines to work out where they were without looking outside.
Draper's team took the gyroscope platform it had developed for a Navy missile and built a computer around it. The Apollo Guidance Computer (AGC) had to fit inside a spacecraft, weigh almost nothing and perform several jobs at once. To save space and weight, it was built from integrated circuits, still a new technology, that Apollo would be trusting with human lives. Above all, it had to know where the spacecraft was. That knowledge came from three sources.
Radio signals sent from Earth and returned by the spacecraft gave Houston the distance; the Doppler shift in the returning signal gave its speed. Star sightings through the optics offered an independent check from on board. Gyroscopes and accelerometers kept the count going between observations, tracking every change in its movement.
Houston and the spacecraft each maintained an estimate of where the vehicle was. During the long coast between manoeuvres, the ground generally led, gathering measurements and sending improved positions up to the crew. The onboard computer's version was always ready, to guide a burn or carry the spacecraft through periods when the Moon blocked contact with Earth. A signal took more than a second to reach the Moon, and there was no signal at all on the far side.
The crew's role lay between two extremes. An early design paper from the lab warned against wrapping astronauts up "like any inert payload", but also against giving them "a rocket, a control stick, a big window, and appropriate charts and tables". That might suit Charles Lindbergh's solo flight from New York to Paris, the paper argued, but not a journey to the Moon. Apollo's answer was a partnership: astronauts would use their senses and judgement where those were better than a machine's, and rely on automation when people could not do the job or were under too much stress. The machine had its own version of the problem. When several jobs competed for attention at once, a scheduler called the Executive, designed by Hal Laning, decided which mattered most.
All of this depended on memory, and the computer needed two very different kinds: instructions that had to stay exactly as written for the whole mission, and a picture of the flight that changed every second. Apollo kept the two apart, and one of them was made by hand.
The instructions were woven at Raytheon's factory in Waltham, Massachusetts. There, women sat opposite each other across metal frames. One held a hollow needle threaded with wire; the other waited on the far side. Together, they passed the wire back and forth through a grid of tiny, donut-shaped ferrite cores.
If the wire passed through a core, it registered as a one. If it bypassed the core, passing around the outside, it was a zero.
This was core rope memory, a technology entirely distinct from the computer's silicon chips. Here, software was a manufactured physical object. A program was woven, wire by wire, into a dense web.
Because the code was built into the wire itself, once finished it could not be edited or corrupted. A mistake noticed during weaving could be unpicked, but a completed rope was set for good. So the program had to be thoroughly tested and frozen long before flight, passing through multiple inspections before it was signed off.
The flown Apollo Guidance Computer carried roughly 36,000 words of this hand-woven fixed memory. Beside it sat a far smaller bank of memory: 2,000 words of conventional magnetic cores.
This smaller memory was erasable. The fixed rope held the instructions and the method of calculation. The erasable memory held the flight's live data: where the computer believed the spacecraft was at any given second, and how fast it was going. The instructions were set in wire. The estimate was written in pencil.
On the way to the Moon, it would be rubbed out and rewritten over and over. But keeping an estimate was only part of the job. The computer also needed a way to judge how much to trust it.
To the computer, "where" meant six numbers: the spacecraft's position in three directions, and how fast it was moving along each of them. Together they formed the state vector. Between observations, the computer predicted how those numbers would change, based on the spacecraft's motion and the gravity of the Earth and the Moon.
When an astronaut sighted a star and entered the measurement, the AGC calculated what angle it expected to see from where it believed the spacecraft to be, then compared that prediction with the actual sighting. If the star appeared somewhere unexpected, the difference offered a clue that the estimate needed correcting.
But a clue is not a verdict. The sighting had its own margin of error. How much should one measurement be allowed to move the needle?
The computer kept track of its own uncertainty. The lab's technical director put it plainly: "The computation scheme also keeps an estimate of the uncertainties in its determination of position and velocity." That uncertainty lived in erasable memory, in a mathematical structure called the W-matrix.
The computer had to weigh the new sighting against what it already knew. If its answer had grown shaky, it could give the measurement more influence. If its answer was reliable, the same measurement would move it less. Each time, it adjusted its figures for position and velocity, along with its measure of uncertainty, ready for the next observation.
Predict, observe, compare, update; then round again. The mathematics drew on work published by Rudolf Kalman in 1960, and later research adapted it for navigation. Richard Battin's team at MIT developed the calculations for Apollo's onboard computer.
It never knew exactly where it was. It kept working out the best answer the evidence allowed.
Margaret Hamilton, known as the "Rope Mother", was the first programmer hired for Apollo at MIT, and by 1968 an assistant director of the team writing the command module's software. One day, in the simulator, her four-year-old daughter, Lauren, selected P01 while the simulated spacecraft was in flight. P01 was intended for use before launch. The simulator crashed.
Hamilton wanted a safeguard. She was told astronauts were trained not to make that type of mistake. As she later recalled, "They were trained to be perfect."
So Hamilton added a warning to the documentation: do not select P01 during flight.
On Christmas Eve 1968, Apollo 8 fired its engine behind the Moon, out of contact with Earth, and entered lunar orbit. Ten orbits later, on Christmas Day, a second burn behind the Moon sent it home. When contact returned, Jim Lovell radioed: "Please be informed there is a Santa Claus."
The Moon was behind them. Seventeen hours later, on the long coast back to Earth, Lovell set up a routine star sighting.
The computer's display and keyboard, the DSKY, used a short command language. A verb said what to do; a noun said what to do it to. Verb 16, Noun 36 meant show the mission clock. Verb 37 was different: it meant change program, and the number that followed chose which program to run.
Lovell meant to key Verb 37, then 23, to start P23, the navigation program, and then give it star 01, Alpheratz. At the program step, he keyed 01. The computer did exactly what it was told. It started P01, the program Hamilton's warning had named.
"For some reason, we suddenly got a Program 01 and a 'No Attitude' light on our computer," Lovell reported.
The computer now behaved as though it were sitting on the launch pad in Florida. It began a launch alignment, swinging the platform away from its reference. The state vector, its record of position and speed, was untouched.
Mike Collins, relaying from Mission Control, asked whether Lovell had selected 01. "I might have done that, yeah," Lovell replied. Later, he was certain: "It was my goof; I must have put in 3701 instead of 3723 and star 01."
Collins explained the damage. The state vector "is just fine"; the W-matrix, however, "shares some computer memory cells with P01". The position estimate survived, but the computer had lost the information it needed to judge how much to trust it against the next star sighting.
The recovery came in two parts. First the platform: Lovell made a rough alignment on the stars, Houston sent up a fresh reference orientation, and Collins confirmed it: "We got a good load in; it's your computer." Lovell fine-tuned the alignment. Then the uncertainty: Collins read up a procedure that would rebuild the W-matrix before the next sighting, and Houston asked the crew to send down the contents of the erasable memory so the ground team could check it bit by bit.
The woven rope had held firm. The estimate written in pencil had survived. With the platform realigned and fresh sightings to work from, the computer could weigh its answers again.
Apollo 8 went around the Moon and back. The computer knew where it was, more or less. But to get all the way down to the surface, the carbon-based component would have to lend a hand.