EEVblog Electronics Community Forum

General => General Technical Chat => Topic started by: andy3055 on April 15, 2021, 06:06:04 am

Title: Apollo moon landing
Post by: andy3055 on April 15, 2021, 06:06:04 am
For those who are interested in the Apollo moon landing, this is a fantastic talk/presentation about the guidance computer. Rightfully, it is described as "light years ahead!"

https://www.youtube.com/watch?v=VYI0Kf_1wqk (https://www.youtube.com/watch?v=VYI0Kf_1wqk)
Title: Re: Apollo moon landing
Post by: Microdoser on April 15, 2021, 10:34:06 am
I read Margaret talking about that image, and she said that when the press photographers were there they wanted to do that shot so they collected all the printout they could find and piled it up It is often misreported that it is just the Apollo source code.

I will play this video while I populate a test board today. Thanks for posting.

They still use some of the code she wrote in spacecraft today, it is so robust.
Title: Re: Apollo moon landing
Post by: TerraHertz on April 15, 2021, 02:47:55 pm
I'm relieved to hear that stack is mostly random printouts, not 'all Apollo code.'

I wonder if there is any photo of just the Apollo code prinout. I'd like to see how much it really is.
Or maybe the actual source code? Is it online anywhere?
Title: Re: Apollo moon landing
Post by: Mortymore on April 15, 2021, 03:03:49 pm
Just think about the amount of ROM memory that the AGC had: 36,864 words
"The AGC has a 16-bit word length, with 15 data bits and one parity bit"

https://en.wikipedia.org/wiki/Apollo_Guidance_Computer (https://en.wikipedia.org/wiki/Apollo_Guidance_Computer)

Now think how many lines of code could be written to fill a 36,864 words size memory, and imagine that put on paper.

In the pile of paper shown in the picture, may be all the versions of code produced and all the documentation used in the project, but certainly not only the code fitted in the AGC memory.

EDIT:  May be of interest

http://apollo.josefsipek.net/links.html (http://apollo.josefsipek.net/links.html)

https://www.youtube.com/watch?v=2KSahAoOLdU (https://www.youtube.com/watch?v=2KSahAoOLdU)
Title: Re: Apollo moon landing
Post by: Sal Ammoniac on April 15, 2021, 04:40:56 pm
Or maybe the actual source code? Is it online anywhere?

Yep. It's up on GitHub: https://github.com/chrislgarry/Apollo-11

The "Luminary" code is what flew on Apollo 11.
Title: Re: Apollo moon landing
Post by: floobydust on April 15, 2021, 06:53:40 pm
https://www.youtube.com/watch?v=mLEOZO1GwVc?t=834 (https://www.youtube.com/watch?v=mLEOZO1GwVc)

Tidbit about the Apollo S/W I found in an old interview with Edsger Dijkstra (https://en.wikipedia.org/wiki/Edsger_W._Dijkstra) 13:54
He was a Dutch computer scientist legend, winner of the Turing Award, U of Texas at Austin. A true legend for his contributions to computing science.
One of his many software philosophies: "quality, correctness and elegance", rather than half-ass it with the "...you can always try to make better versions later" approach.

1969 after the first moon landing, at a NATO conference on S/W Engineering, Dijkstra ran into Joel Aron "head of IBM's Federal Systems Division responsible for the software of the moonshot".
I was duly impressed that they got so many {40,000} lines of code correct.
I asked Joel "how do you do that?"
"Do what?"
"Getting that software right."
"Right???"
He said that in one of the calculations of the orbit of the lunar module, the moon had been defined as repelling instead of attracting. They had discovered that error by accident,  five days before launch. I went white and said "Wow! Those guys have been lucky!" 'Yes', Joel Aron agreed."

https://www.cs.utexas.edu/users/EWD/video.html (https://www.cs.utexas.edu/users/EWD/video.html) 300MB MPEG original
Title: Re: Apollo moon landing
Post by: Sal Ammoniac on April 15, 2021, 07:15:25 pm
They had discovered that error by accident,  five days before launch. I went white and said "Wow! Those guys have been lucky!" 'Yes', Joel Aron agreed."

I wonder how they fixed that? Unlike modern computers and embedded systems that store programs on easily changed media like disks and FLASH, the Apollo guidance computers stored code and read-only data on "core rope", which was a nonvolatile storage media created by threading many fine wires through ferrite cores. The work was done months in advance of a launch and could not be easily changed. I'm skeptical that anything, except perhaps parameters in writeable memory, was changed five days before launch.
Title: Re: Apollo moon landing
Post by: floobydust on April 15, 2021, 09:29:21 pm
So much testing was about the manufacturing and assembly, months ahead.
I agree it was discovered very late, but when do you pour the cement on software for a launch? They used a simulator to test the software, if it was 5 days then they were testing right to the end.

I'm not sure how difficult a firmware update would be - could you swap out a module?
They could flip a sign bit, say if the constant for the moon's gravity (https://en.wikipedia.org/wiki/Gravitation_of_the_Moon) was the wrong polarity. Or change an add/subtract operation if that was the error.
Title: Re: Apollo moon landing
Post by: Sal Ammoniac on April 15, 2021, 10:11:29 pm
I'm not sure how difficult a firmware update would be - could you swap out a module?

Very difficult. As I mentioned in my previous post, the firmware was stored on core ropes and these took months to manufacture. Even if the ropes could have been swapped out on the launch pad, there's absolutely no way they could have fabricated a new rope in only five days.

This video (starting at 20:45) describes the process of manufacturing core rope: https://youtu.be/ndvmFlg1WmE
Title: Re: Apollo moon landing
Post by: floobydust on April 16, 2021, 01:55:54 am
I checked and IBM did the Saturn V Instrument Guide. Guidance for the booster rocket and the 7 minute ride up and the trans-lunar injection.
It used erasable core memory, a read is destructive so you have to do a refresh after but the software was changeable without changing hardware.
Not sure how much of an error being out by 2x moon's gravity would affect the moon injection portion.
Title: Re: Apollo moon landing
Post by: Sal Ammoniac on April 16, 2021, 04:09:37 pm
Yes, IBM wrote the code for the Saturn V instrument unit (and not the Apollo guidance computers used in the command and lunar modules), but the quote in Reply #5 references the "orbit of the lunar module", which has nothing to do with any calculations made by the Saturn instrument unit.