<<

The Guidance Architecture and Operation Frank O'Brien The Apollo Guidance Computer

Architecture and Operation

Published in association with Praxis Publishing Chichester, UK Mr Frank O'Brien West Windsor New Jersey USA

SPRINGER±PRAXIS BOOKS IN SPACE EXPLORATION SUBJECT ADVISORY EDITOR: John Mason, M.B.E., B.Sc., M.Sc., Ph.D.

ISBN 978-1-4419-0876-6 Springer Berlin Heidelberg New York

Springer is a part of Springer Science + Business Media (springer.com)

Library of Congress Control Number: 2009936113

Apart from any fair dealing for the purposes of research or private study, or criticism or review, as permitted under the Copyright, Designs and Patents Act 1988, this publication may only be reproduced, stored or transmitted, in any form or by any means, with the prior permission in writing of the publishers, or in the case of reprographic reproduction in accordance with the terms of licences issued by the Copyright Licensing Agency. Enquiries concerning reproduction outside those terms should be sent to the publishers.

# Copyright, 2010 Praxis Publishing Ltd., Chichester, UK.

The use of general descriptive names, registered names, trademarks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use.

Cover design: Jim Wilkie Copy Editor: David M. Harland Typesetting: BookEns Ltd, Royston, Herts., UK

Printed in Germany on acid-free paper Contents

List of figures ...... ix Author's preface...... xiii Acknowledgments...... xvii

0 The state of the art ...... 1 From whence we came: early computing ...... 1 Outside the computer room: early computing in aviation and space ..... 2 Computing in manned spacecraft ...... 3 Defining computer ``power'' ...... 4 The evolution of computing ...... 7 Technology acquisition: consumers vs the industry ...... 8

1 The AGC hardware ...... 11 Introduction ...... 11 Overview of Chapter 1 ...... 15 Physical characteristics of the AGC ...... 16 Properties of number systems ...... 18 Double precision numbers...... 27 FIGMENT ...... 29 Instructions: the basic units of computer operation ...... 29 Memory management ...... 31 A tour of low core and the central registers ...... 37 Keeping time in the AGC: timers and clocks ...... 47 Counters ± CDUS (X, Y, Z, OPTS, OPTT) and PIPAS (X, Y, Z) ...... 51 Radar, engine and crew interfaces...... 55 Memory addressing and banking in the AGC ...... 59 processing ...... 68 The instruction set ...... 70 Communicating with the outside world: the I/O system ...... 87 vi Apollo Guidance Computer

2 The Executive and Interpreter ...... 99 Introduction to the Executive ...... 99 Scheduling: preemptive and cooperative multiprogramming ...... 101 The Executive ...... 103 The astronaut interface: the display and keyboard ...... 123 Telemetry uplink...... 140 Synchronous I/O processing and T4RUPT ...... 143 High level languages and the Interpreter ...... 150 The Interpreter ...... 160

3 The basics of guidance and navigation ...... 199 Hardware unique to solving guidance and navigation problems ...... 199 The important questions in guidance and navigation...... 209 Question 1: Which way is up? ...... 209 Question 2: Where am I? ...... 217 Question 3: Which way am I going? ...... 222

4 Mission programs and operations ...... 231 Introduction ...... 231 Launch from Earth...... 231 The lunar landing ...... 245 Lunar orbit rendezvous...... 287 The digital autopilot ...... 312 Erasable memory programs...... 334 AGC data uplink and downlink ...... 337 Command Module entry...... 341 Computer problems during and ...... 358

Epilogue ...... 365

Appendixes ...... 369 A: AGC instruction set ...... 369 B: AGC interrupt vectors ...... 371 C: Layout of the special and control registers ...... 372 D: Command Module I/O channels ...... 373 E: Lunar Module I/O channels ...... 379 F: Interpreter instruction set ...... 386 G: Command Module programs (Major Modes)...... 391 H: Command Module routines ...... 392 I: Command Module verbs ...... 393 J: Command Module nouns ...... 395 K: Command Module program alarms ...... 401 L: Lunar Module programs (Major Modes) ...... 403 M: Lunar Module routines ...... 404 N: Lunar Module verbs ...... 405 Contents vii

O: Lunar Module nouns ...... 407 P: Lunar Module program alarms...... 412 Q: Command Module and Lunar Module downlists ...... 415 R: AGC navigation star catalog ...... 417 S: Configuring the CSM and LM DAP (Routine 03) ...... 418

Glossary of terms and abbreviations ...... 421 Bibliography ...... 423 Illustration credits ...... 427 Index...... 431 To my mother and father

Mom is no longer with us, but I know that future explorers will use her star in Heaven to guide them safely home. List of figures

1 Apollo Guidance Computer and DSKY ...... 17 2 AGC component locations ...... 18 3 Numeric representation in the AGC word...... 20 4 Fractional powers of 2 ...... 23 5 Integer vs fractional representation ...... 24 6 Negation of one and two's complement ...... 28 7 AGC instruction format ...... 30 8 Core memory ...... 35 9 Schematic of core rope ...... 36 10 Flight version of core rope ...... 37 11 Arithmetic examples in modified one's complement ...... 40 12 Logical and cyclical shifts ...... 46 13 Inertial Measurement Unit ...... 51 14 Codes for radar data source selection ...... 57 15 LM tapemeters: altitude and altitude rate ...... 59 16 Erasable storage and bits 10 and 9 ...... 61 17 Erasable storage banking ...... 62 18 Fixed storage and bits 12 and 11 ...... 63 19 Fixed storage banking...... 63 20 View of both erasable and fixed storage ...... 64 21 Instruction format including the quarter code ...... 72 22 AND, OR and XOR logical operations ...... 77 23 The TS instruction and overflow processing ...... 79 24 Summing five entries in a table ...... 85 25 Instructions created from special cases of existing instructions ...... 86 26 Characteristics of registers and I/O channels ...... 90 27 The AGC and its I/O devices and interfaces ...... 91 28 I/O instruction format ...... 92 29 I/O channel usage ...... 93 x Apollo Guidance Computer

30 Core Set layout...... 105 31 Core Sets and job scheduling ...... 106 32 Vector area layout ...... 107 33 Allocated Core Sets and VAC areas ...... 108 34 Waitlist tables...... 115 35 Addition of a new waitlist task ...... 116 36 Restart and phase tables ...... 118 37 The +phase / ±phase tables ...... 120 38 Display and keyboard...... 124 39 Diagram of the DSKY ...... 126 40 Noun tables ...... 139 41 Data in INLINK register ...... 141 42 Sample Verb 71 in uplink ...... 142 43 LM rendezvous radar at top of ascent stage ...... 146 44 Summing a table of numbers in the computer ...... 150 45 Expressions in tree structures ...... 153 46 Unary and trigonometric functions ...... 154 47 Tree representing E=mc2 ...... 154 48 Quadratic equation tree ...... 155 49 Labeled quadratic equation tree ...... 157 50 Interpreter half-memories ...... 162 51 Generic interpretive instruction format ...... 164 52 Multipurpose Accumulator and datatype modes ...... 168 53 Interpretive instruction directly operating on an ...... 170 54 Indexing into the star catalog table ...... 171 55 Inaccessible right-hand instruction ...... 172 56 One instruction, GOTO in right-hand position ...... 172 57 Two instructions, GOTO in right-hand position ...... 172 58 Orientation of vector space on the surface of the Earth...... 174 59 Flagword operand format ...... 181 60 Scalar and vector short shift formats ...... 182 61 Long shift address word format ...... 183 62 STORE instruction format ...... 187 63 Uses of the STORE instruction and STADR ...... 189 64 Computed GOTO example ...... 193 65 Schematic of the Inertial Measurement Unit ...... 200 66 Body axes on the CM and LM ...... 201 67 Gimbal lock ...... 201 68 Schematic of a sextant ...... 203 69 Command Module optics systems ...... 205 70 LM Alignment Optical Telescope ...... 206 71 Star sighting through the AOT ...... 208 72 Basic reference coordinate system (Earth centered) ...... 211 73 CSM coordinate system ...... 213 74 LM coordinate system ...... 215 Figures xi

75 Two stars creating a fixed orientation in space ...... 217 76 Cislunar navigation sighting ...... 219 77 View of horizon and star through the sextant ...... 220 78 Conic sections defined by planes intersecting a cone ...... 224 79 Launch monitor cue card ...... 236 80 TLI cue card...... 242 81 Descent profile with braking, approach and landing phases ...... 245 82 Lunar Module DSKY...... 247 83 Engine gauges and tape instruments ...... 248 84 Landing point designator in commander's window ...... 250 85 Commander's cross-pointer and attitude indicator ...... 251 86 AGS data entry and display assembly...... 252 87 Prep for undocking ...... 253 88 Update from MSFN 1 ...... 254 89 AGS initialization and alignment ...... 255 90 Data Entry and Display Assembly ...... 255 91 DPS throttle check ...... 256 92 Actual vs commanded thrust meter...... 256 93 CDR thrust/translational controller assembly ...... 257 94 Approach to landing site...... 257 95 Rendezvous radar checkout ...... 258 96 No PDI+12 abort data card ...... 259 97 IMU fine alignment 1 ...... 260 98 Configure communications for LOS ...... 260 99 LMP's communications panel ...... 261 100 LPD calibration ...... 261 101 AGS gyro calibration ...... 262 102 Tracking attitude for CSM CIRC burn...... 263 103 DPS pressurization and checkout ...... 264 104 Explosive devices panel ...... 265 105 DPS temperature and pressure ...... 265 106 Landing radar checkout ...... 265 107 Rendezvous and landing radar panel...... 266 108 Update from MSFN 2 ...... 267 109 Orbital Rate Display ± Earth and Lunar (ORDEAL) ...... 267 110 LPD altitude determination check...... 268 111 LPD altitude determination chart ...... 269 112 IMU fine alignment 2, and configuring comm for LOS...... 269 113 AGS alignment ...... 270 114 P63 ignition algorithm check...... 271 115 Pre-PDI environmental control system checkout ...... 271 116 Oxygen control module...... 272 117 Pre-PDI setting check...... 273 118 Abort Stage and AELD circuit breakers ...... 273 119 Electrical power system battery monitoring and selection ...... 274 xii Apollo Guidance Computer

120 Update from MSFN 3 ...... 274 121 PDI rules/altitude check cue card ...... 275 122 Abort rules cue card ...... 275 123 Mission rules cue card ...... 276 124 AGS alignment ...... 277 125 Powered Descent Initiation ...... 277 126 Lunar terrain model ...... 279 127 P63 descent monitoring cue card...... 280 128 DEDA addresses cue card...... 281 129 P64 approach phase cue card ...... 282 130 Commander's rate-of-descent switch ...... 283 131 P66 and lunar contact...... 283 132 Cross-pointer display for the LMP ...... 284 133 CDR's and LMP's lunar contact lights ...... 285 134 Isaac Newton's cannonball experiment ...... 288 135 Orbital planes ...... 289 136 Polar plot from LM rendezvous procedures manual...... 293 137 Coelliptic rendezvous ...... 295 138 LM ascent cue card ...... 298 139 Direct rendezvous maneuvers ...... 307 140 Alternate LM active rendezvous techniques...... 311 141 Generic phase plane ...... 316 142 DAP phase-plane decision areas ...... 318 143 CSM and LM moment of inertia ...... 320 144 Rotational coupling in the CSM ...... 321 145 LM thruster configuration ...... 326 146 Non-orthogonal axis for U, V in the Lunar Module ...... 328 147 Starting and ending attitude and the rotation axis...... 330 148 Downlist word format ...... 339 149 Command Module entry corridor ...... 344 150 Entry maneuvering footprint...... 344 151 Entry Monitor System panel...... 346 152 EMS scroll strip ...... 347 153 View from CM of Earth's horizon prior to entry ...... 352 154 Entry program number and altitude ...... 353 155 Entry altitude and range profile ...... 356 156 Abort and Abort Stage pushbuttons in the LM ...... 362 Author's preface

Much of the story of mankind's first voyage to the moon centers on its engineering achievements. The sheer physical size of the vehicles and facilities not only dwarfed the previous generation of manned spacecraft, but still represents one of the greatest engineering achievements in history. But size alone is hardly the most valid metric for such an endeavor. Almost every conceivable figure of merit, whether pressures, temperatures, flow rates or stresses (and the list goes on) pushed the limits of the possible. But the magnitude of raw power overshadows equally impressive engineering at the other end of the spectrum. This book focuses on very different technologies, each with a unique set of attributes: fantastically small, breathtakingly precise, and in the most impressive feat of all, completely invisible to the eye. The , with its 3,300 tons of structure and propellant would be helpless without a brain to give it a purpose. That brain, in the form of a small computer, guided the spacecraft and its precious human cargo to a new world, and home again. In the 1960s, the Apollo Guidance Computer defined the state of the art in , reliability and real-time computer control. However, the journey from a laboratory bench to a flight-ready system can only be described as tortuous, as the evolving requirements for a lunar mission forced nearly continuous redesigns. With so much time and effort already invested in an existing design, starting over with a new ``clean sheet of paper'' architecture was never an option. As a result, the AGC grew like a newlyweds'house. Over time, the happy couple'sfamily grows, and so too must their house. Never willing to tear it down and begin anew, the house becomes a collection of architectural contradictions, with a blind hallway or two and plumbing that makes little sense. Still, the house is quite functional, with each iteration representing the best ideas at the time. Some aspects of the AGC were truly revolutionary for their time. The exclusive use of integrated circuits in the ushered in a new era of computing, the novel memory design stored large amounts of data in a small space, and the human interface allowed real-time interaction with software. Other characteristics were like the newlyweds'house; the accumulated changes made the design awkward and inefficient. Finally, the severe lack of memory perpetually challenged the developers during the entire life of the project. xiv Apollo Guidance Computer

The Apollo Guidance Computer: Architecture and Operation presents the three major organizational levels of the AGC. First, the programmers'view of the AGC, known as the hardware architecture, is described in detail. This section discusses the key processor components and how they interact with each other. Importantly, the balance between power, flexibility and the limitations of the hardware is made evident by the designers'struggle to extend the capabilities of the system. The final design is full of exceptions and special cases, but is especially notable for its elegant solutions for optimizing every bit in memory. Understanding these constraints sheds much light on the decisions affecting the other parts of the system, from the Executive software to the operating procedures. Efficiently running all the programs that are necessary for a complex spacecraft like Apollo demands a sophisticated operating system. The second section is devoted to the operating system software, known as the Executive, and a powerful execution environment called the Interpreter. All of the computer resources used by the mission programs were managed by the Executive. The Executive oversaw all of the processing necessary for an interactive, real-time computing environment: namely scheduling mission programs for execution,1 accepting commands from the crew and displaying its results, and recovering from any errors that occur. Complex programming logic used in the mission programs required equally sophisticated capabilities that were unavailable in the hardware. A novel and compact language was designed which, by reflecting the problem to be solved, greatly reduced the workload on the programmer. This language was processed by a program called the Interpreter, which created the illusion of an entirely new and highly capable . Slow, but rich with features, the Interpreter simplified the programming effort needed for the mission programs and greatly reduced their memory requirements. The third and final section leaves the hardware and Executive behind to enter the world of mission software and its operation. Each mission phase, whether leaving Earth, landing on the Moon or performing a navigating sighting requires a variety of programs in the AGC. In turn, the execution of these programs must be coordinated with the operation of other spacecraft systems to satisfy a mission requirement. Properly covering each mission phase requires placing the AGC's operation into a larger perspective, by including the operation of selected spacecraft systems in the discussion. Each Apollo mission built on the experiences of its predecessors, so there is no ``typical'' mission to use as an example. Procedures and techniques reached their highest level of refinement in the latter missions ± Apollo 15, 16 and 17 ± so many of the descriptions will reflect these flights. It is also worth noting what is not included in this book. With few exceptions,

1 When discussing the wide variety of software used in computer systems, it is useful to separate their function into two distinct areas: ``Executive software'' or ``operating system software'', manages the resources and services of the computer. ``Applications software'' or ``mission programs'' focus on solving a particular problem for the user, whether it is calculating a payroll or the trajectory to the Moon. Author's preface xv there is no description of the underlying circuitry and chip technology, as the internal architecture of the AGC is invisible to both the programmer and the astronauts. To discuss both computer science and spaceflight in a single volume is a bold step in itself; to expand it to include would run the danger of overwhelming the reader. Also, despite its extensive treatment of the AGC hardware, Executive and Interpreter, this book is not intended to be an AGC programming tutorial. Including material on programming techniques, especially necessary for novice readers, followed by the obligatory problem exercises would move this book far from its intended scope. Finally, descriptions of the architectural evolution of the hardware and software are consciously avoided. Specifically, the book reflects the Block II configuration of the AGC, which was used in all manned Apollo flights. The compressed timeline to achieve a manned lunar landing meant there were several concurrent development projects at any one time, and a description of every variant would result in a hopelessly complex account. Apollo Guidance Computer: Architecture and Operation is intended to be the essential reference for both spaceflight historians and those with computer or engineering backgrounds. Bringing those disciplines together into a single work is not just an interesting academic exercise; it offers a new way to understand the mission design . Both the design decisions and the compromises made during the AGC's development directly influenced the overall operation of the Apollo spacecraft. Once defined, the spacecraft's operational capabilities became the principal driver in creating mission objectives and procedures. By understanding the AGC's capabilities and constraints, the reader will gain important insights into how the lunar missions assumed their final form. Acknowledgments

Award ceremonies in the entertainment industry are often criticized for their endless series of thank-yous, often without recognizing that memorable works are rarely created in a vacuum. Writing a book is little different, and I drew upon the knowledge and guidance of a several people to whom I'll always be indebted: Eric Jones and David Woods, the editors of the Apollo Lunar Surface Journal and the Apollo Flight Journal. Their work has resulted in the canonical reference on the Apollo missions for historians and researchers. While the encyclopedic documenta- tion and annotation of the missions is impressive, even more so was their use of a fledgling Internet to assemble a group of highly motivated people from all over the world to contribute their expertise. With assignments ranging from researching obscure spacecraft systems to the essential but mundane task of proofreading, the Apollo Journals are a true collaborative effort. Gentlemen, it has been a privilege working with both of you. David Harland has chronicled mankind's greatest adventure in a series of highly readable books. Much to my surprise, he felt that writing a book on the Apollo Guidance Computer was a worthy idea. Though I was initially skeptical, both he and David Woods felt that my work on the Apollo Journals could be expanded considerably. In addition to planting the seed for this work in my mind, David Harland also undertook the role of editing my manuscript. His suggestions and comments on my manuscript, especially in the early versions, have made it a far better work. John O'Neill, retired Director of Space Operations at NASA, who lavished a young Frank O'Brien with all things Apollo. I devoured every scrap of information he passed along to me, using it to follow along with the missions as they were happening. It is not an exaggeration to say that this book is a direct result of that generosity. Joshua Stoff of the Cradle of Aviation Museum, Uniondale, NY, and Paul Fjeld, for allowing me to work with and learn from them. What they have created at the Cradle of Aviation will bring tears of joy to your eyes. Fred Carl of the Infoage Science/History Learning Center, Wall, NJ, who supported my work in creating their AGC exhibit and using it as part of their community outreach. xviii Apollo Guidance Computer

I had the special opportunity of spending time with Eldon Hall, chief engineer for the AGC at the MIT Instrumentation Laboratory, and Hugh Blair-Smith, one of the principal architects of the AGC. Their explanations provided much needed insights, and were given with admirable patience and wit. Independently, Julian Webb and Ron Burkey have created AGC emulators that run actual Lunar Module software. Ron has extended the scope of his work to include the Lunar Module's Abort Guidance Computer and an extensive collection of documentation. Their emulators and the archived references were especially valuable for my research. I especially have to thank Clive Horwood and his staff at Praxis for their help in bringing this book to life. Finally, none of this could have been accomplished without the support of family and friends, especially my wonderful wife Stacey.

Frank O'Brien January 2010