Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialization of a new Sim starting from a specific snapshot of the previous one. #315

Closed
lucapizzuto99 opened this issue Jun 11, 2024 · 3 comments
Assignees
Labels
Support User Support

Comments

@lucapizzuto99
Copy link

lucapizzuto99 commented Jun 11, 2024

Hello everyone,

I am working with NOS3 to try to initialize a new simulation, that is a new spacecraft, given the orbital conditions and the TM of the originally simulated spacecraft at a time t1.
The idea is, retrieve the orbital position, attitude and TM of the s/c at t1, and use those values to modify the cfg files of another simulation, so that it is like it starts exactly at t1.
For what I tested so far, the main files appear to be the cfg/InOut/SC_NOS3.txt along with cfg/InOut/Orb_LEO.txt and of course cfg/Sc_full_config.xml. However, the majority of the parameters and config values appear to be constants, and the only way I found to modify the starting orbital position and attitude is to modify the True Anomaly value in the Orb_LEO.txt file.

My question is: is there another way to accomplish this? And will the TM of the subsystems be updated accordingly, based on the new orbital position?

As a concluding note, it would be nice to have a way to start the sim with all the subsystems enabled. I tried to do this manually but I encountered problems in the fsw during the uart_flash:

"GENERIC_STAR_TRACKER_CommandDevice - uart_write_port returned -2, expected 9".

Thank you in advance for your help!

@jlucas9 jlucas9 self-assigned this Jun 19, 2024
@jlucas9 jlucas9 added the Support User Support label Jun 19, 2024
@jlucas9
Copy link
Contributor

jlucas9 commented Jun 19, 2024

Hi @lucapizzuto99,

I think you're on the right path here and would need to modify the configuration files (primarily the 42 ones) and then launch everything again to resume. Presently we don't have a means to save the state of the entire environment and launch it again so it would assume you just turned on, like a full power reset of the entire spacecraft, at that location and time and continue.

If 42 is launched with the new location and time, the rest of the sims will receive updated values and translate those into there own messages as you'd expect, assuming they're configured to reference environmental data that is.

Starting with all subsystems enabled - that's a great idea. I've created a new branch nos3#315 to update the relative time sequence (RTS) commands to do this for you. A brief walkthrough of bootup now:

  • Spacecraft turns on
  • RTS1 (Power on reset) automatically fires
    • Enables data storage (DS) to save telemetry to files
    • Enables debug port so we can view what's going on in the ground software as if we're plugged into the spacecraft
    • Enable RTS3-64 so that they can be used
    • Enables the limit checker (LC) application to perform fault detection and correction, note that none is presently configured
    • Call RTS3
  • RTS 3 (Safe mode)
    • Enable coarse sun sensors (CSS)
    • Enable fine sun sensors (FSS)
    • Enable inertial measurement unit (IMU)
    • Enable magnetometer (MAG)
    • Enable torquers
    • Enable GPS
    • Set ADS to SUNSAFE_MODE

Let me know if you have any other questions!

@lucapizzuto99
Copy link
Author

Hi @jlucas9,

Thank you so much for your support and quick reply! Starting with all subsystems enabled works as expected. Regarding the initialization of a new sim starting from a previous state, everything works as well, with the exception of the IMU whose linear acceleration values are a bit off, even if the S/C has the same state vector and attitude. I will explore this a bit more.

Thank you again!

jlucas9 added a commit that referenced this issue Jun 26, 2024
[#315] Created RTS3 (safe mode) and edited RTS1 run safe mode;
@jlucas9
Copy link
Contributor

jlucas9 commented Jun 26, 2024

Merged into dev! Feel free to re-open or create a new issue as you see anything off!

@jlucas9 jlucas9 closed this as completed Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support User Support
Projects
Status: Done
Development

No branches or pull requests

3 participants
@jlucas9 @lucapizzuto99 and others