Simple AGC

From Project Apollo - NASSP
Revision as of 16:45, 25 November 2006 by imported>Mark Grant (Started copying info from 'flying Saturn V' document)
Jump to navigation Jump to search

Project Apollo has its own implementation of the Apollo Guidance Computer (AGC) software in C++. Some of the real programs are simulated along with a number of programs which did not exist in the real AGC, but are useful in Orbiter.

Pre-Launch

When you first start up your scenario the AGC will spend about thirty seconds running through its self-test program on the DSKY, just like a PC does. On a real Saturn V this would check all the computer hardware, but since we can pretty much guarantee that your PC is going to multiply and divide correctly if it's managing to run Windows, here it just does the final stage, and tests the display by outputting a selection of test patterns.

If you get bored, just hit 10x time acceleration briefly. Once the lights have turned off, the computer goes into standby mode with displays blanked and just the STDBY light lit. If you start the engines it will automatically start up as they ignite.

However, if you prefer to do things the 'proper' way, press the PROG key on the DSKY to start the computer. VERB 37 will flash on the display: this is the 'change program' verb: the computer is currently idling in program 00, but suggesting that you enter a new program to run. So press 'NOUN', then 0, then 1, then ENTER.

Note that whenever you enter data into the DSKY you will have to enter initial zeros in this way if the data would not otherwise require you to enter a digit in a specific column. If you attempt to enter too many digits, or attempt to ENTER a VERB/NOUN combination that isn't supported, the OPR ERR light will light up. Press RSET to reset the error indication and continue.

If you are entering data into the DSKY when the computer wishes to display information, the KBD REL light will light up. If you're finished with the keypad then press the KEY REL button and the computer will now be able to use the display; otherwise, typically, it will display the information it wants to show you after you finish entering the data you're typing in.

VERB 37 NOUN 01 will run the initial IMU alignment program: in Orbiter in merely lights the NO ATT light briefly and then changes automatically to program 02, in a real Saturn V this would align the IMU to the appropriate angles that have been entered into the computer and then switch to program 02.

Program 02 is the pre-launch setup program. You can use this to check the planned orbit from the scenario file, update the orbit and launch times, or simply ignore it and the computer will use the scenario values.

The program will start with a flashing VERB 06 NOUN 29. This shows the launch azimuth in hundredths of a degree on the top line of the display, and allows you to change it from the historically correct value if you choose.

To update the information on these lines you need to change the displayed values, then press PROG to enter them into the AGC. To update the first line, use VERB 21 ENTER, for the second VERB 22 ENTER , for the third VERB 23 ENTER. To update the first and second in sequence use VERB 24 ENTER, for all three use VERB 25 ENTER.

When you enter data the DSKY will blank the appropriate line. Press '+' or '-' to begin data entry (octal entry is not yet supported), then type in the digits, with preceding zeros when required. Once you type in all five digits, the value will be saved ready to be passed to the AGC. Note that if you make a mistake while entering the number, you can press CLR to clear the entry and try again. So, you can use VERB 21 ENTER to change the azimuth value, then press PROG to accept the value being displayed. Alternatively, if you're happy with the value, use VERB 33 ENTER to 'proceed without data': the computer will then use the displayed azimuth value for the launch.

Either way, the computer will respond with a flashing VERB 06 NOUN 44, displaying the desired apogee and perigee in tens of meters. Again, update them if desired, or use VERB 33 ENTER to continue.

The computer will respond with a flashing VERB 06 NOUN 33, displaying the time to liftoff: hours on the first line, minutes on the second line, and hundredths of a second on the third line.

If you wish to change your launch time, update the values on the display, then press PROG to load them into the computer. If you want to monitor the launch time, enter VERB 16 ENTER, which will switch to updating the countdown time roughly twice per second.

Launch

So you're ready to launch. When the countdown reaches zero the AGC will start the engines, automatically switch to program 11 and activate the autopilot. If for some reason this should fail, then you can press VERB 75 ENTER or VERB 37 NOUN 11 ENTER to start the program manually: of course unless there's a horrid bug, this isn't going to happen :).

The program will switch to VERB 16 NOUN 62: Verb 06 and 16 are two which are very useful to know: Verb 06 means 'display the information for this noun', and can be used to check the current value of various internal variables. Verb 16 is the same, except rather than show just the value at the time you press ENTER, it will update automatically roughly twice per second.

Different Nouns will display different information. Noun 62 will display three lines on the DKSY, the first is the velocity relative to Earth in meters per second, the second is the vertical velocity in meters per second, and the third is the altitude in kilometers.

To monitor the orbit information, either press VERB 82 ENTER or VERB 16 NOUN 44 ENTER (note that if either the Verb or Noun you wish to execute is already displayed, there's no need to type it in again: if, for example, the display was showing VERB 16 NOUN 62, you could just press NOUN 44 ENTER to switch). Noun 44 again displays three lines. The first is the apogee altitude in kilometers, the second the perigee altitude in kilometers, and the third is approximately the time in minutes and seconds to freefall to 300,000 feet if the engines were shut down: the latter is useful in planning aborts, as 300,000 feet is approximately the level where re-entry heating begins. If you haven't yet achieved a trajectory that will take you above 300,000 feet, or are moving too fast to return to that altitude, it will display 59:59.

Note that a real Apollo capsule wouldn't use SI units: instead, velocity would be measured in feet per second and altitudes in nautical miles. The code does have an option to switch to realistic units, but currently there's no way to enable that: it will be an option in the future for those who really want to do it the 'proper' way :).

If, at some point, you feel like flying manually, then enter VERB 46 ENTER. This will toggle the autopilot state each time you enter it.

Finally, when you reach orbit and the SIVB stage shuts down, the computer will disable the autopilot and prompt you to switch programs with a flashing VERB 37 again. You might as well enter NOUN 00 ENTER to switch to the idle program, to disable the computer for the time being.

Generic programs and data

Program 06 is the AGC standby program. Enter VERB 37 NOUN 06 ENTER to switch to program 06. It will then flash VERB 50 NOUN 25: this is a generic message from the computer telling you to perform a checklist action... the appropriate action will be displayed on the first line. In this case it is '00062', which means 'press the PROG key to put the AGC into standby'. Press that key and the displays will be blanked and the STDBY light come on. Press the PROG key again to bring the AGC out of standby.

Noun 38 shows the time since the AGC was booted. Noun 73 shows the altitude, velocity and angle of attack, the latter in hundredths of a degree.

Program Alarms

If an error occurs in a program, it will light the PROG light on the DSKY and raise a program alarm. In some cases this will abort the program that's running, in others it will continue but you should consider corrective action. If you don't care, then just press RSET to clear the light and the record of the alarms.

To display the program alarms, use VERB 05 NOUN 09. This shows three lines: the first is the first alarm to occur since pressing RSET was pressed, the second is the second alarm to occur since RSET was pressed, and the third is the most recent alarm. If more than three alarms occur after pressing RSET, any others are lost.

Program Checksums

VERB 91 will display the program bank checksums. In NASSP this is absolutely useless (in fact the checksums are pseudo-random as I haven't found the real checksum numbers yet), but in a real Apollo this was an important tool for verifying that the correct programs were loaded into the AGC core memory. The first line is the checksum, the second line is the bank number and the third is more checksum: to be valid, the first checksum must be equal to the bank number or negative bank number (in octal), and the second checksum gives more information. To display more banks, use VERB 33 ENTER to cycle through them.

Displaying Erasable Memory

'Erasable Memory' was the AGC equivalent of modern RAM. The program was stored in fixed core memory, while data which might change (e.g. Current time, landing site location) was stored in erasable memory. Of course this meant that the astronauts needed a way to examine and change the memory.

To examine memory locations, use VERB 01 NOUN 02 ENTER. This will switch the R2 display to octal (base-8) and blank the R1 display, while flashing the verb and noun display to remind you that you need to do something. Enter a memory location in R1, and press PROG. The value of the erasable memory location will be displayed in R2, and the program will blank R1 again so you can enter a new memory location.

If, instead, you want to monitor a memory location as the data changes, use VERB 01 NOUN 02. As above, enter a memory address in R1 and press PROG. Rather than give you the option of entering another location, the verb and noun display will stop flashing and R2 will be continually updated with the contents of the memory location. Location (octal) 00025 is a good one to use, as it simulates the 10 millisecond timer on the real AGC.

Of course, since the memory is just simulated, this doesn't really help a huge amount. However, you can view various variables that control the AGC operation if you know how the program works, and will be able to change the program's operation by changing those variables.

To update an erasable memory location, use VERB 21 NOUN 02. Enter the address in R1 (in Octal) and the data in R2. Press PRO to update the erasable memory.