P63, P64, and P66: The Three Programs That Landed on the Moon
The AGC software sequence that guided the Lunar Module from orbital velocity to touchdown—braking, approach, and the final manual phase that put Armstrong in control
The Lunar Module’s descent engine ignited at an altitude of roughly 50,000 feet, traveling nearly horizontal at about 5,560 feet per second. Twelve minutes later, the engine shut down with the LM on the lunar surface, velocity zero. In between, the Apollo Guidance Computer ran three programs in sequence: P63 for the braking phase, P64 for the approach phase, and P66 for the final manual descent. Each program had a different job, a different control philosophy, and a different relationship between the computer and the human being sitting in the left-hand seat.
P63 was all computer. P64 gave the commander a targeting tool. P66 gave him the stick. Together, they represented a carefully choreographed handoff from autonomous guidance to manual control—a transition designed so that the machine did what machines do best (compute optimal trajectories) and the human did what humans do best (look out the window and decide where to land).
Powered Descent Initiation: Lighting the Engine
Before the descent programs ran, the LM had to be in the right place at the right time. The Command Module and Lunar Module orbited the Moon together at approximately 60 nautical miles altitude. After separation, the LM performed a Descent Orbit Insertion burn (DOI) using Program 40 (the thrusting program) to lower its perilune—the low point of its orbit—to about 50,000 feet. The LM then coasted to this low point, which was located roughly 260 nautical miles uprange from the planned landing site.
At Powered Descent Initiation (PDI), the crew keyed VERB 37 ENTER 63 ENTER to start Program 63. The AGC had already been loaded with the targeting parameters—the latitude and longitude of the landing site, the desired approach geometry, the PDI time—uplinked from Mission Control and verified by the crew. P63 commanded the Descent Propulsion System engine to ignite at 10% thrust for 26 seconds (to allow the combustion chamber to stabilize and to settle the propellants in their tanks), then ramped to full throttle.
The descent engine was a throttleable engine—the only one in the Apollo stack with that capability. Built by TRW, it could operate from about 10% to 100% of its maximum thrust of approximately 9,870 pounds-force. The engine used Aerozine 50 fuel and nitrogen tetroxide oxidizer, a hypergolic combination that ignited on contact. No igniter, no spark plug—the propellants burned the instant they met. Throttleability was achieved by varying the flow rate of propellants into the combustion chamber through mechanically actuated flow-control valves.
The AGC controlled the throttle. During P63, the computer commanded the thrust level needed to follow the optimal braking trajectory, continuously adjusting based on accelerometer readings and the guidance equations.
P63: The Braking Phase
P63’s job was simple in concept and staggering in execution: slow the LM from orbital velocity to near-hover over the landing site. This meant killing roughly 5,500 feet per second of horizontal velocity and managing the descent from 50,000 feet to approximately 7,000 feet altitude—all while using as little propellant as possible, because every pound of fuel burned during braking was a pound unavailable for hover, landing, and the abort margin.
The guidance algorithm running during P63 was the POWERED FLIGHT GUIDANCE routine, written by George Cherry and his team at MIT. It solved what’s called a “gravity turn” or “fuel-optimal braking” problem: given the current position and velocity, compute the thrust direction and magnitude that will bring the vehicle to a specified target state (position, velocity, and time) at the end of the phase, using the least propellant.
The algorithm worked by solving the guidance equations every two seconds. At each computation cycle, the AGC measured the current state vector (position and velocity from the IMU accelerometers and the onboard navigation), compared it to the desired state at the end of the braking phase, and computed a “thrust direction” command—the direction the engine bell should point. The digital autopilot then rotated the LM to align the engine with this commanded direction.
During most of P63, the LM flew nearly engine-first, with the descent engine pointed roughly in the direction of travel, decelerating against its orbital motion. The astronauts were on their backs relative to the engine thrust, looking up at the black lunar sky. They couldn’t see the surface. The windows faced upward and forward. The computer was flying blind relative to terrain, but it knew exactly where it was in three-dimensional space, and it knew where the landing site was, and the guidance equations connected the two.
At about 45,000 feet altitude—roughly five minutes into the burn—the LM began what the flight controllers called “pitchover.” The guidance algorithm progressively tilted the LM from nearly horizontal to increasingly vertical as it approached the landing site. This served two purposes: it directed more of the engine thrust downward to arrest the descent rate, and it gradually brought the surface into view through the commander’s window.
The throttle profile during P63 was not constant. The engine ran at full thrust for the initial deceleration, then the AGC throttled it down as the LM approached the braking-phase target conditions. This throttle modulation was continuous and automatic—the crew monitored but didn’t intervene unless something went wrong.
The Transition: High Gate
At approximately 7,000 feet altitude and 300 feet per second forward velocity, the AGC detected that the braking phase targets had been achieved and automatically transitioned from P63 to P64. This transition point was called “High Gate”—the metaphorical gateway between the automated braking trajectory and the approach phase where the crew got their first good look at the landing site.
The transition was seamless from the software perspective. P63’s guidance routine handed off to P64’s guidance routine, and the targeting philosophy changed. P63 aimed at a point in space defined by the braking trajectory. P64 aimed at a point on the lunar surface—the landing site itself.
The crew heard nothing, felt nothing. The DSKY’s PROG display changed from 63 to 64. The computer’s relationship to the landing shifted from “get us in the neighborhood” to “show us the spot.”
P64: The Approach Phase and the Landing Point Designator
P64 was where the commander first entered the control loop—not by grabbing the stick, but by looking through a window. The approach phase flew the LM on a trajectory that was steep enough for the commander to see the landing site through his forward-facing window, and P64 gave him a tool to evaluate and change the target: the Landing Point Designator.
The LPD was a set of angle markings scribed directly onto the commander’s window—a simple graduated scale etched into the glass. Every two seconds, the AGC computed the line-of-sight angle from the LM to the current targeted landing point and displayed this angle on the DSKY as a two-digit number. The commander looked through his window and found the LPD graduation mark corresponding to the displayed number. Whatever he saw at that angle on the lunar surface below—that’s where the computer was going to land.
If the commander didn’t like what he saw—a boulder field, a crater, a slope that looked too steep—he clicked the attitude hand controller to redesignate the landing point. Each click of the hand controller along the longitudinal axis moved the targeted landing point roughly 2 degrees further downrange (forward clicks) or closer (aft clicks). Lateral clicks moved the target left or right. The AGC recalculated the trajectory in real time, retargeting the guidance solution to the new landing point. Two seconds later, the new LPD angle appeared on the DSKY, and the commander could look again to confirm.
This was a simple human-computer interface that solved a profound problem. The AGC had no terrain sensors. It had no cameras, no radar imaging, no way to evaluate the suitability of a landing site. It only knew coordinates. The human eye, looking out a window, could instantly assess terrain that no 1960s sensor could evaluate—and the LPD gave that human eye a direct connection to the guidance computer’s targeting.
The redesignation process cost fuel. Every time the commander moved the landing point, the guidance equations recomputed a new trajectory that required attitude changes and thrust adjustments. Extensive redesignation could eat into the fuel margin. The crew trained extensively on the LPD to develop the judgment for when a redesignation was worth the cost and when the original site was acceptable.
During P64, the descent engine was throttled by the AGC to follow the approach trajectory. The computer managed thrust, attitude, and descent rate automatically. The commander’s only input was the landing point redesignation. The LM Pilot, in the right seat, monitored altitude and descent rate from the DSKY and called out the numbers. Mission Control, watching telemetry, tracked the fuel remaining against the predicted consumption.
Low Gate and the Transition to P66
At approximately 500 feet altitude and about 20 feet per second forward velocity, the LM reached “Low Gate.” At this point the commander could either let the computer continue flying (P64 would guide all the way to touchdown if allowed) or take manual control by switching to P66.
Every Apollo commander who landed on the Moon switched to P66. The training culture, the test pilot ethos, and the practical reality of final landing site assessment all favored manual control in the last phase. You don’t land a spacecraft on another world by watching a computer do it—not when you can see a boulder directly under the targeted touchdown point and the computer can’t.
The transition to P66 happened when the astronaut clicked the attitude controller while in P64 below a threshold altitude, or Mission Control could call for it. The PROG display changed to 66. The control philosophy changed fundamentally.
P66: Rate of Descent
P66 gave the commander direct manual control of the LM’s attitude—pitch, roll, and yaw—through the hand controllers, while the AGC maintained a computer-controlled rate of descent. The commander flew the vehicle laterally by tilting it in any direction, as the descent engine was fixed and thrust vectoring was achieved by tilting the entire spacecraft. Want to fly left? Tilt left. The horizontal component of the engine’s thrust vector moves you left. Want to stop moving left? Tilt back to vertical.
The rate-of-descent function was the AGC’s contribution during P66. The computer held a commanded descent rate—initially set to the descent rate at the moment of P66 entry—and throttled the engine to maintain it. The commander could change this rate by clicking the attitude controller’s thrust/translation knob: each click incremented or decremented the commanded descent rate by 1 foot per second. Click down: descend faster. Click up: descend slower, or even climb.
This was a clean division of labor. The human controlled where. The computer controlled how fast. The commander could focus entirely on looking out the window, evaluating the terrain, and maneuvering over a suitable landing spot without worrying about managing the throttle. The AGC handled the descent rate so the commander could handle the landing.
During P66, the LM Pilot called out altitude and descent rate readings from the DSKY: “Sixty feet, down two and a half. Forty feet, down two and a half. Picking up some dust. Thirty feet, two and a half down.” These callouts gave the commander a continuous audio stream of the numbers he couldn’t read while looking out the window.
The Contact Light and Engine Shutdown
Dangling below the Lunar Module’s footpads were 67-inch-long probes—lightweight fiberglass rods that extended beneath three of the four landing legs. When any probe touched the lunar surface, it completed an electrical circuit that illuminated the CONTACT light on the instrument panel.
The procedure at contact was immediate: the crew shut down the descent engine by pressing the ENGINE STOP button. They did not wait for the LM to settle onto the surface under engine power. The reason was practical and dangerous: if the engine bell, which extended below the footpads, struck the surface while still firing, the resulting pressure buildup could damage or destroy the engine, potentially spraying hypergolic propellants around the base of the LM. The clearance between the engine bell and the surface was only about 15 inches at nominal footpad compression.
On Apollo 11, Buzz Aldrin called “Contact light” and Armstrong shut down the engine essentially simultaneously. The LM dropped the last few feet to the surface under lunar gravity—a gentle 5.3 feet per second squared, about one-sixth of Earth gravity. The landing gear’s crushable aluminum honeycomb struts absorbed the impact.
The AGC continued running after touchdown. P66 terminated, and the crew would shortly initiate the post-landing checklist, which included configuring the AGC for lunar surface operations. But the descent programs—P63, P64, P66—were done. The software that had been guiding the LM for twelve minutes, from the moment of engine ignition through braking, approach, and the final manual descent, had accomplished its purpose. The numbers the guidance equations had been chasing—horizontal velocity zero, vertical velocity zero, altitude zero—were now physical reality.
Apollo 11: When the Programs Met Reality
Neil Armstrong’s landing at Tranquility Base is the canonical demonstration of the P63/P64/P66 sequence—and of why P66 existed at all.
During P63, the 1202 and 1201 Executive overflow alarms fired as the rendezvous radar stole processor cycles. The guidance equations kept running. Mission Control called GO. P63 did its job, decelerating the LM and transitioning to P64 at High Gate.
During P64, Armstrong looked through the window at the LPD angle and saw the computer was targeting a landing zone on the near side of West Crater—a 600-foot-diameter crater surrounded by a boulder field. The rocks were the size of automobiles. Armstrong began redesignating the landing point, clicking the hand controller to move the target further downrange, past the crater and the boulders.
The redesignations cost fuel. Each click changed the trajectory and the guidance solution. Mission Control watched the fuel quantity decrement faster than the nominal timeline predicted. Charlie Duke, the CapCom, began calling fuel remaining: “Sixty seconds”—sixty seconds of fuel remaining before a mandatory abort decision. Armstrong was still flying, still looking for a clear spot.
He switched to P66, taking manual control. He tilted the LM to translate downrange, flying over the boulder field at an altitude of roughly 100 feet. The LM was nearly level, moving forward at several feet per second, descending slowly. Armstrong scanned the surface through the window. He found a clear area between craters—a relatively smooth patch of regolith—and began nulling his horizontal velocity to settle into it.
“Thirty seconds,” Duke called. Thirty seconds of fuel before an abort. Armstrong was now in a hover, easing the LM down at about 3 feet per second. Dust began to blow across the surface, obscuring the ground. Armstrong kept descending by feel and instruments. Aldrin called the numbers. “Contact light.” Engine stop.
The entire P66 manual phase lasted about 90 seconds. Armstrong burned the fuel margin to its edge—post-flight analysis estimated roughly 25 seconds of fuel remaining at shutdown. The guidance software performed flawlessly. The Executive weathered its alarms. P63 hit its targets. P64 showed Armstrong the boulder field. P66 gave him the control to avoid it. The sequence did exactly what it was designed to do: get the machine close, then let the human finish the job.
Twelve Minutes of Software
The powered descent sequence was the most complex, most time-critical, most consequential software operation the AGC performed. The guidance equations ran in the Executive at high priority, computing new thrust commands every two seconds. The Digital Autopilot ran as a combination of Executive jobs and Waitlist tasks, translating guidance commands into RCS jet firings and engine gimbal adjustments at millisecond precision. The display routines updated the DSKY for the crew. The Landing Point Designator calculations converted hand controller clicks into trajectory changes. The descent engine throttle commands went out through the output channels.
All of this ran on 36,864 words of rope memory and 2,048 words of erasable memory, at roughly 1 MHz. The guidance algorithm was solved every two seconds—not because two seconds was ideal, but because that was as fast as the AGC could reliably complete the computation given its processing speed and the other demands on the machine.
Six times, Apollo commanders flew the P63-P64-P66 sequence to a successful lunar landing. Each time, the software performed as designed. Each time, the commander took manual control in P66 and put the LM down on a spot he chose with his own eyes. The programs didn’t land on the Moon—they brought the spacecraft to the point where a human being could.