How to modify CSM and LM state vectors

The Aviator

Active member
Joined
Jul 20, 2008
Messages
127
Reaction score
0
Points
31
Location
Venegono
Hello everyone,

after a hiatus lasting many years, in the last weeks I managed to (barely) successfully fly the entire Apollo 11 mission from 4 hours to lift-off to splashdown two times in a row using the last NASSP 8 beta.
As I'm getting more and more proficient in the procedures and intenterested in the internal functioning of the AGC, I would like to try to manually modify it's erasable memory to change the state vectors to simulate different things, like landing the Eagle in the same spot it landed in reality. Right now it goes to it's pre-planned landing spot flawlessly. I tried to perform the undocking without P47 on and not updating the state vectors via ground uplink from before undocking to after landing, but it didn't work.
I tried unsuccessfully to search for AGC state vectors memory addresses for Luminary and Colossus in several AGC related manuals, so now I have to ask you how to do it.
For example I would like to modify Eagle state vectors to make it land at the historical accurate Tranquillity base location. So if I understand I have to calculate them, convert them in octal values and insert them in the proper AGC registers as P27 does during an uplink.
Could you please explain how to do it or direct me to the documentation where it's explained how to do it?

Thank you for your help and for the incredible work you all guys are doing in making this piece of software a reality. Being able to fly these machines, even just in this simulation, is a childhood dream that comes true.
 

indy91

Addon Developer
Addon Developer
Joined
Oct 26, 2011
Messages
1,226
Reaction score
591
Points
128
First of all, congrats to being able to fly complete missions! That is not something everyone is able to do, especially with NASSP 8 still being in Beta.

In Luminary 99 the permanent LM state vector is in memory addresses 1626 to 1643 (variable names RRECTLEM, VRECTLEM and TETLEM in https://www.ibiblio.org/apollo/listings/Luminary099/ERASABLE_ASSIGNMENTS.agc.html). All double precision, three components for position and velocity vector respectively. For the scaling see: https://www.ibiblio.org/apollo/NARA-SW/R-567-sec2-rev8.pdf on PDF page 28.

One fairly simple trick you can do if you only want to introduce a downrange error is to modify the time tag of the state vector only and not the position or velocity vector. Apollo 11 mainly had a downrange error, so that would work quite well for your purpose. Speed in circular lunar orbit is roughly 1600 m/s, so if you modify the state vector time tag by 1 second you get a 1600 meters downrange error.

Maybe it helps to use our padload worksheets for the conversion. Go to Doc\Project Apollo - NASSP\GNC Tools and open "VAGC LM Pad Load Worksheet Luminary099.xls". In the Apollo 11 tab search for TLAND, which has the same scaling as TETLEM. In the blue cell you can enter a time tag in hours, and to the right you get the octal values in the green cells. 4322 and 17541 being the octals for TLAND in that example. But first you will need to convert the current TETLEM to hours I guess, you can kind of do that with the Excel sheet with trial and error by entering the value in hours. The TETLEM in the "Apollo 11 - 12 - Before PDI T+102h28min" scenario is:

EMEM1642 4311
EMEM1643 22774

for example. I hope that is enough to start working on this.

In the long run I can probably add an option to the state vector uplink page in the RTCC MFD to modify the state vector before it is getting uplinked. That would be a more convenient way for doing this.

Alternatively, NASSP user ggalfi has worked very hard to get an accurate simulation of the actual Apollo 11 landing working. He has modified a bunch of systems in the NASSP LM to get more accurate behavior for Eagle, the 1201/1202 alarms and more. Check it out here: https://www.orbiter-forum.com/threads/simulation-of-apollo-11-lunar-landing.37948/ It's basically a branched off version of NASSP right now, but hopefully a lot of the changes will end up in the main NASSP release. Maybe using his NASSP version is already doing what you want.
 

ggalfi

Well-known member
Joined
May 31, 2020
Messages
74
Reaction score
131
Points
48
Location
Budapest
As Indy has kindly mentioned, I had put in some efforts to recreate the circumstances of the Apollo 11 landing and to achieve that certainly I had to tweak not only the AGC's state vector but the LM's physical SV as well. The way how I changed the SV in AGC was very simple: I adjusted the vessel's physical SV either through Orbitersim's editor (you can use different reference frames, orbital elements or coordinates, etc.), then updated the AGC's SV through RTCC MFD as it is a very convenient tool for that. After the upload I restored the original vessel SV by resetting manually the RPOS and RVEL vectors in the scenario file. So I've never touched directly the EMEMs to change the stored SV. If you go to my github page ( https://github.com/ggalfi/NASSP ), you can download there an individual scenario file (Scenarios/Project Apollo - NASSP/WIP Scenarios/Apollo - Mission Scenarios/Apollo 11/Apollo 11 - GET102h32min 1min10sec to PDI.scn) where I've set all the parameters as close to historical values as I could. The scenario file was saved from my modified NASSP, so it is not guaranteed to run properly with the normal Orbiter2016 branch, however you may copy the entire set of EMEMs, times, and RPOS-RVEL values to your own before-PDI scenario file and then the AGC should steer the LM into a position after entering P64 that the LPD aims for the northern edge of West Crater.
 
Top