The Computer Hack That Saved Apollo 14

Video Statistics and Information

Video
Captions Word Cloud
Captions
oh it's Scott Manley here now if you've been following my channel for any length of time you'll know that in addition to my hobby of being an Internet space explorer I also have a day job working in computer software development I've done this for like a couple of decades and every now and then you'll have one of those moments where the website is down everything's crashing and you're the one person that can fix it it is an incredibly high stakes environment and you know where everyone is basically relying on you but it is nothing compared to what happened on Apollo 14 Apollo 14 is the greatest tech support call in the history of computers on February 5th 1971 Alan Shepard and Edgar Mitchell were orbiting the moon inside Antares they are lunar excursion module and while they were going through the pre descent checklist it was discovered that the abort switch was occasionally sending the abort signal to the systems on board the spacecraft there was a short somewhere in the physical switch they could get rid of the signal by tapping the panel but it would occasionally come back this was a real problem because if this signal was triggered during the descent it would tell the computer to cancel the descent and begin the abort sequence and get them back into a safe orbit if this happened during the descent it would basically ruin the entire mission so they had to be sure this didn't happen Mission Control started working the problem and they got the person that knew the Apollo guidance computer best on to the problem supposed on ales they had to wake him up in the middle of the night to solve this problem any couple of hours now I've actually seen a couple of other articles on this and they always talk about how Don figured out how to reprogram the computer and save the mission and this is what we call lies to children is glossing over the actual details first of all you couldn't reprogram the Apollo guidance computer all the program op codes were run from read-only memory the memory literally had the program woven onto it at the factory and couldn't be changed in flight it did however have two killer words of erasable storage now the Apollo guidance computer used 15 bit memory locations which is kind of interesting because of course we have 8-bit memory locations and most computers 16-bit would be the next logical step up and they did actually have 16 bits internally but one of the bits was taken away as a parity bit for checking the integrity of the data and it was not accessible to software so the actual solution would involve modifying data inside these two killer words of memory in such a way that the software running would do the right thing but would still ignore the abort message the Apollo guidance computer would have several routines that would periodically check input status one of these the abort monitor routine would periodically check the abort signal which is basically a bit that was set in memory and if this bit was set it would then execute the abort routine replaced the existing descent routine with the abort routine now you wouldn't want this to run at any random time for example you might be sitting on the surface of the Moon and you don't want the abort system to activate so elsewhere it could be locked out by setting a bit cold let abort right let abort happened this was again a single bit that was written into memory and read and written by various parts of the software so logically if you could disable this bit it would actually stop the abort from triggering when you didn't need it to so back at Mission Control they came up with a sequence of commands to the computer that would make this happen now they couldn't just send this up from Mission Control that the astronauts had to actually type it in themselves so a procedure was sent up and the astronauts had to type this in on the disk key that is the display keyboard right so the sequence of commands were verb 25 known seven one zero five four zero zero zero that is all very cryptic but actually it's pretty easy to step through so verb 25 is a to command known seven tells the Lord command to use three different parameters which correspond to the first one is the address that's 1:05 the second parameter is the bitmask so that's four zero zero that's the eighth bit because this is an octal and zero means set that it's bit in that register to zero so it's really easy they're just going in and they're flipping the bit to zero to make sure that they abort let abort flag isn't set and therefore when they abort monitor routine checks it out it won't trigger the abort now plugging all these numbers in could take a few seconds and that man that this simple solution was also a risky one while the flag could be disabled there were certain events that would rename and one important piece of code amusingly named burn baby burn by a quarter with a sense of humor was responsible for igniting the engine and it would also reenable the let abort flag so in the seconds it would take to punch in this command sequence into the computer the abort system could activate if the switch closed momentarily and this would have to be done during one of the times when the crew was most busy managing the spacecraft if an abort did get initiated early on it was possible they could capture and shut down the procedure and come around for another orbit but it was risky and they didn't really want to do it this way with this procedure explained to the crew their orbit carried the spacecraft to the far side of the moon signal was lost and they were in the dark for 50 minutes but back on earth Don Ailes and his team continued working the problem now when the abort monitor routine normally would find both the abort flag and the LED abort flag set its job would be to switch over the computer from running the descent routines which would be programmed 63 to one of the abort routines which would be programmed 71 or programmed 70 so Don's great idea was to convince the computer there was actually running the abort routine already there for the abort monitor routine you wouldn't switch into those modes because it was already running it wouldn't want to restart code that was already running so after they came around the far side of the moon a new procedure was radioed up to the crew first of all they would align the spacecraft for descent and four minutes before the engine was due to fire they would go in and they would change the state of the computer to make it look like a running program number 71 so this was done by changing the memory location mode register right this is done by verb 21 for Lord known one for address which is one zero one zero and value which is one zero seven one zero seven of course is 71 when you convert it from octal to decimals so the computer major mode would be set to make it look like it was running the abort sequence now they would then go through their usual pre descent checklists the engine would fire and then they would be doing a bunch of other stuff now from that point on they would have to then get the computer back into the correct state so they could then go in and they could reset the let abort flag and then they could reset the mode register but the problem is that the mode register was actually checked by a few other things it wasn't just checked by the abort guidance routine the descent routines we our sorry the ignition routines would check it and if it was set if it was an abort mode then it would not set all the memory state required for descent one thing was called the zoom flag so the zoom flag would have to be set manually because it wasn't available and secondly because the zoom flag wasn't set the engine wouldn't throttle up to 100% thrust so the changes to the procedure was at 26 seconds after the engine ignition the crew would manually throttle the engine up to maximum right secondly they were then at that point that would be their cue to start typing things in so they would change the zoom flag first and that would be another single bit being set so that be a verb 25 and Gnome seven memory location was one zero one and the bit was two zero zero that's the seventh bit and value one to enable it Bingle that got them they're steering that got them the throttle control back the next step was to then reset the let abort flag so that is again verb 25 known seven location one zero five bit four zero zero and set that to zero bingo now the led abort flag is disabled and finally switched the major mode back from 71 to 63 so verb 21 known one address 1010 and 77 or 77 right because 7 7 is 63 in octal right so finally that got the computer into the correct state for handling the dissent but with the violette abort flag disabled and therefore dawn had saved the mission in the greatest tech support call ever right now that wasn't everything there was a couple of other things to consider one was that if they really did have to handle on abort there was two ways they could go about it one is they could reset the LAN abort flag by typing all that in or they could just use the secondary abort computer which was available on board the apollo apollo landers many people forget that was a second computer on board the lunar module that would handle just abort it was simpler than the full guidance computer but it was there for only one situation for when the main computer was having troubles and they needed a backup to get back into orbit so in the end Apollo 14 made its landing successfully thanks to a computer nerd who dug into the code crafted a hack at short notice and saved a mission which had taken years of effort and billions of dollars and that of course is why this is the greatest tech support call in computer history I'm Scott Manley fly safe [Music] [Music] you [Music]
Info
Channel: Scott Manley
Views: 859,461
Rating: 4.9073977 out of 5
Keywords: apollo 14, computer hack, troubleshooting, apollo, saturn 5, saturn V, antares, alan shepard
Id: wSSmNUl9Snw
Channel Id: undefined
Length: 11min 22sec (682 seconds)
Published: Thu Aug 31 2017
Reddit Comments

Super neat video. I can't imagine figuring that out on the fly without time to test.

👍︎︎ 3 👤︎︎ u/plorraine 📅︎︎ Aug 31 2017 🗫︎ replies

Imagine entering those commands, seat of your pants, on a collision for lunar regolith. Doesn't even sound fun in KSP.

👍︎︎ 2 👤︎︎ u/DrOzark 📅︎︎ Sep 01 2017 🗫︎ replies

Um, hope I didn't miss anything, we didn't really have time to properly test.

👍︎︎ 3 👤︎︎ u/peaceloverockroll 📅︎︎ Sep 01 2017 🗫︎ replies
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.