avatarDavid Goudet

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

3462

Abstract

mes slower than modern computers, ran a major computation loop every 2 seconds for <b>vehicle guidance</b>, and a minor loop 25 times a second for <b>attitude control</b>. The only remaining copies of this software are probably in the core memory of the Saturn V rockets on display at NASA sites.</p><h1 id="e43b">Orbit Insertion</h1><figure id="1cb3"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*x17c5l0oH0TBdXZQjiwo5A.png"><figcaption>Apollo rocket entering the orbit. Credit: NASA.</figcaption></figure><p id="4134">After circling the Earth one-and-a-half times, the third stage reignited for six minutes to send Apollo 11 on its way to the Moon.</p><p id="1048">This strategy is called <b>orbital spaceflight</b>, and it’s the best strategy to travel in space using the least propellant possible.</p><p id="0fcc">Let’s see it on an animation:</p><figure id="6d6b"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*J1edxz63muzywtB8g0yorA.gif"><figcaption>Hohmann Transfer to send a spaceship from Earth to Mars. Credit: NASA.</figcaption></figure><p id="cdd9">For the trip to the Moon, the orbits were like this:</p><figure id="502a"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*7effDWOhjTAYbBin.png"><figcaption>Apollo 11 Orbit. Wikimedia Commons.</figcaption></figure><p id="c061">Here’s where the Apollo Guidance Computer was the protagonist, correcting the orientation and acceleration of the spacecraft.</p><p id="6a7f">On Earth’s surface, it’s easy to know where is up and down, North and South, but in space, we need extra references to know where are we going. A common task for the astronauts was to point to a star to calibrate the gyroscopes connected to the computer.</p><figure id="ca6d"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*LvpgQmbH-bxDBgEm.jpg"><figcaption>Apollo Guidance Computer display and keyboard. Wikimedia Commons.</figcaption></figure><p id="df24">To operate the computer, the astronauts used the keyboard to enter a verb and a noun (e.g. <b>point</b> to star <b>27989</b>). In the image, you can see the two buttons for verb and noun.</p><p id="f42b">The programmers dedicated one of the Easter Eggs in the code to this with a quote from Shakespeare:</p><figure id="9c2c"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*oxzcFvu1HNGCQX_P-svz5A.png"><figcaption>Comments in the Apollo computer code. Credit: NASA.</figcaption></figure><p id="2354">There are extra references to Shakespeare in the<i> Lunar Landing Guidance Equations</i> file:</p><figure id="48f2"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*hboCy0VvMLSvsyrgzTOMEA.png"><figcaption>Comments on the Lunar Landing Guidance Equations file.</figcaption></figure><h1 id="72db">Landing the Eagle</h1><figure id="de37"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*golFwQYwcW9dOCcU1goIAQ.png"><figcaption>Lunar Module descending to the moon. Credit: NASA.</figcaption></figure><p id="4b97">The most famous story behind the Apollo Guidance Computer is about what happened when the astronauts were about to touch the Moon.</p><p id="4c34">In the words of Margaret Hamilton:</p><blockquote id="2f5a"><p>The computer (or rather the software in it) was smart enough to recognize that it was being asked to perform more tasks than it should be performing. It then sent out an alarm, which meant to the astronaut, ‘I’m overloaded with mo

Options

re tasks than I should be doing at this time and I’m going to keep only the more important tasks’; i.e., the ones needed for landing … Actually, the computer was programmed to do more than recognize error conditions. A complete set of recovery programs was incorporated into the software. The software’s action, in this case, was to eliminate lower priority tasks and re-establish the more important ones … If the computer hadn’t recognized this problem and taken recovery action, I doubt if Apollo 11 would have been the successful moon landing it was.</p></blockquote><p id="5f40">If you want to know more about this story, you can check <a href="https://youtu.be/kYCZPXSVvOQ">this video</a>. This example illustrates the importance of testing software against every probable outcome, <b>especially when you’re trying to protect astronauts from the scary depth of space</b>.</p><h1 id="1a5d">Burn Baby Burn</h1><figure id="f7d7"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*gaWDLgFIG8g0rvitoVeo4g.png"><figcaption>Lunar Module launching from the surface of the moon. Credit: NASA.</figcaption></figure><p id="712c">Burn Baby Burn is the name of one of the most famous routines of the AGC program. It is the Master Ignition Routine for the Lunar Module.</p><p id="51b0">The name is the engineers' own tribute to the people of the Los Angeles riots.</p><p id="3d71">The lines of code of the routine are not easily recognizable for modern developers because it’s assembler code, but in the comments, we can find more interesting Easter Eggs:</p><figure id="5018"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*hxo0cBkCYVnhoqvb6HBpOQ.png"><figcaption>Routine starting with “Hello There” and finishing with “Goodbye. Come again soon”.</figcaption></figure><p id="cca2">The jokes in the code did not replace the seriousness and importance of the situation. The 3 astronauts returned safely to Earth, and we all enjoyed one of the greatest milestones in our history.</p><p id="a86e">When I started programming, over 10 years ago, I felt the indescribable emotion of creation. Seeing a machine behave exactly as you programmed it is comparable to the thrill of driving a race car at high speeds.</p><p id="b433">I can’t imagine what it must have felt like for the Apollo programmers to see the majestic machine they programmed to deliver 2 astronauts to safety on the surface of another world. They were <b>exploiting the limit of the curiosity that makes us human</b>.</p><h1 id="a5b4">References</h1><p id="103a">· <a href="https://www.youtube.com/watch?v=PPLDZMjgaf8&amp;ab_channel=SciShow">Great Minds: Margaret Hamilton (Youtube)</a> · <a href="https://www.ibiblio.org/apollo/ForDummies.html">The Apollo Guidance Computer</a> · <a href="https://github.com/chrislgarry/Apollo-11/blob/master/Luminary099/BURN_BABY_BURN--MASTER_IGNITION_ROUTINE.agc">Burn Baby Burn on GitHub</a> · <a href="https://www.iop.org/explore-physics/moon/how-did-we-get-to-the-moon#gref">How did we get to the Moon?</a> · <a href="https://solarsystem.nasa.gov/basics/chapter4-1/">Basics of Space Flight</a> · <a href="https://github.com/chrislgarry/Apollo-11/issues/3">GitHub discussion related to Apollo 13</a> · <a href="https://abcnews.go.com/Technology/apollo-11s-source-code-tons-easter-eggs-including/story?id=40515222">Apollo 11’s Source Code Has Tons of Easter Eggs, Including an Ignition File Titled ‘Burn Baby Burn’</a></p></article></body>

The Code that took Astronauts to the Moon is full of Comedy and Heroism

MIT’s brightest engineers didn’t lose their sense of humor when taking us to the moon

No astronaut launches for space with their fingers crossed.

Chris Hadfield.

When astronaut Chris Hadfield said that, it is likely that he had not seen the code created by the programmers.

This is part of the code that controlled the Apollo Guidance Computer:

Funny comments in the code that took humanity to space.

The original code is public on GitHub, and modern programmers have discovered a lot of funny comments and very smart routines that saved the lives of the Astronauts.

Fasten your belt and come with me to discover what was it like to program the machine that took humanity to its more dangerous and adventurous trip.

Apollo Astronauts waiting to takeoff. Credit: NASA.

We choose to go to the moon in this decade and do the other things, not because they are easy, but because they are hard.

President John F. Kennedy. Moon Speech.

Among the people chosen for this challenge were the most brilliant scientists on the planet.

Margaret Hamilton, the director of the Software Engineering Division that developed the on-board flight software for NASA’s Apollo program, was known for her approach to preventing errors in software.

Margaret also looked like a cheerful person who allowed jokes in the code.

Margaret Hamilton inside the Apollo Command Module. Credit: MIT.

She’s probably proud that modern programmers continued this tradition on GitHub:

A smart and funny reference to the Apollo 13 error that made the mission fail (Comments on the code of the Apollo Computer on GitHub).
The best possible answer to the previous thread.

Take Off

We would need degrees in physics, math, mechanical engineering, and rocket science to understand the process used to put humans on the Moon. But I’ll show you the most important steps in simple words. Starting with the Take-Off.

Apollo 11 takes off. Credit: NASA.

The Launch Vehicle Digital Computer (LVDC) was a computer that provided the autopilot for the mighty Saturn V rocket from launch to Earth orbit insertion.

This computer, millions of times slower than modern computers, ran a major computation loop every 2 seconds for vehicle guidance, and a minor loop 25 times a second for attitude control. The only remaining copies of this software are probably in the core memory of the Saturn V rockets on display at NASA sites.

Orbit Insertion

Apollo rocket entering the orbit. Credit: NASA.

After circling the Earth one-and-a-half times, the third stage reignited for six minutes to send Apollo 11 on its way to the Moon.

This strategy is called orbital spaceflight, and it’s the best strategy to travel in space using the least propellant possible.

Let’s see it on an animation:

Hohmann Transfer to send a spaceship from Earth to Mars. Credit: NASA.

For the trip to the Moon, the orbits were like this:

Apollo 11 Orbit. Wikimedia Commons.

Here’s where the Apollo Guidance Computer was the protagonist, correcting the orientation and acceleration of the spacecraft.

On Earth’s surface, it’s easy to know where is up and down, North and South, but in space, we need extra references to know where are we going. A common task for the astronauts was to point to a star to calibrate the gyroscopes connected to the computer.

Apollo Guidance Computer display and keyboard. Wikimedia Commons.

To operate the computer, the astronauts used the keyboard to enter a verb and a noun (e.g. point to star 27989). In the image, you can see the two buttons for verb and noun.

The programmers dedicated one of the Easter Eggs in the code to this with a quote from Shakespeare:

Comments in the Apollo computer code. Credit: NASA.

There are extra references to Shakespeare in the Lunar Landing Guidance Equations file:

Comments on the Lunar Landing Guidance Equations file.

Landing the Eagle

Lunar Module descending to the moon. Credit: NASA.

The most famous story behind the Apollo Guidance Computer is about what happened when the astronauts were about to touch the Moon.

In the words of Margaret Hamilton:

The computer (or rather the software in it) was smart enough to recognize that it was being asked to perform more tasks than it should be performing. It then sent out an alarm, which meant to the astronaut, ‘I’m overloaded with more tasks than I should be doing at this time and I’m going to keep only the more important tasks’; i.e., the ones needed for landing … Actually, the computer was programmed to do more than recognize error conditions. A complete set of recovery programs was incorporated into the software. The software’s action, in this case, was to eliminate lower priority tasks and re-establish the more important ones … If the computer hadn’t recognized this problem and taken recovery action, I doubt if Apollo 11 would have been the successful moon landing it was.

If you want to know more about this story, you can check this video. This example illustrates the importance of testing software against every probable outcome, especially when you’re trying to protect astronauts from the scary depth of space.

Burn Baby Burn

Lunar Module launching from the surface of the moon. Credit: NASA.

Burn Baby Burn is the name of one of the most famous routines of the AGC program. It is the Master Ignition Routine for the Lunar Module.

The name is the engineers' own tribute to the people of the Los Angeles riots.

The lines of code of the routine are not easily recognizable for modern developers because it’s assembler code, but in the comments, we can find more interesting Easter Eggs:

Routine starting with “Hello There” and finishing with “Goodbye. Come again soon”.

The jokes in the code did not replace the seriousness and importance of the situation. The 3 astronauts returned safely to Earth, and we all enjoyed one of the greatest milestones in our history.

When I started programming, over 10 years ago, I felt the indescribable emotion of creation. Seeing a machine behave exactly as you programmed it is comparable to the thrill of driving a race car at high speeds.

I can’t imagine what it must have felt like for the Apollo programmers to see the majestic machine they programmed to deliver 2 astronauts to safety on the surface of another world. They were exploiting the limit of the curiosity that makes us human.

References

· Great Minds: Margaret Hamilton (Youtube) · The Apollo Guidance Computer · Burn Baby Burn on GitHub · How did we get to the Moon? · Basics of Space Flight · GitHub discussion related to Apollo 13 · Apollo 11’s Source Code Has Tons of Easter Eggs, Including an Ignition File Titled ‘Burn Baby Burn’

Programming
Technology
Software Engineering
NASA
Space
Recommended from ReadMedium