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

Comms expansion #209

Open
wants to merge 36 commits into
base: main
Choose a base branch
from
Open

Comms expansion #209

wants to merge 36 commits into from

Conversation

timsmitdelft
Copy link
Collaborator

@timsmitdelft timsmitdelft commented Feb 7, 2024

Description

Summary of changes

  • Added link budget modelling for communication, optical and radio.

    • Added models for transmitters, receivers and links
    • Integrated transmitters and receivers into existing SpacecraftActors and GroundstationActors
    • Integrated links into existing PASEOS instances.
    • Currently limited to BPSK for radio and OOK for optical.
    • Optical also has a set wavelength of 1550 nm.
  • Added Python notebooks to test/show satellite to ground (radio) and intersatellite (optical)

  • Still working on a bug where the notebooks throw a circular reference error on imports.

Resolved Issues

How Has This Been Tested?

Calculations have been tested by comparing hand calculations with papers and SMAD.
Software models have been tested by creating unit tests.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@timsmitdelft timsmitdelft changed the title Comms expansion WIP: Comms expansion Feb 7, 2024
@timsmitdelft timsmitdelft marked this pull request as draft February 7, 2024 14:21
Copy link

github-actions bot commented Feb 8, 2024

Overall Coverage

Coverage Report
FileStmtsMissCoverMissing
paseos
   __init__.py33197%51
   paseos.py1441292%68–69, 147–148, 205, 220, 238, 248, 267, 298, 306–309
paseos/activities
   activity_manager.py43393%46, 74, 157
   activity_processor.py58198%121
   activity_runner.py621084%80–84, 104–113, 122–125
paseos/actors
   actor_builder.py2283286%27–33, 36, 225–227, 255–257, 304–313, 340–351, 496, 699, 731, 743–747, 755–756, 765–766
   base_actor.py1612386%97, 117, 136, 146, 159, 170, 202, 218, 265, 306–308, 338, 347, 364, 386, 392–395, 401, 418, 474
   ground_station_actor.py15380%47–53
   spacecraft_actor.py61198%124
paseos/central_body
   central_body.py65592%68, 177–178, 186–187
   is_in_line_of_sight.py441273%79–96, 140, 161
   mesh_between_points.py35294%64, 72
   sphere_between_points.py26869%35–38, 48–51, 63–64
paseos/communication
   get_communication_window.py23291%41, 67
   link_budget_calc.py271063%24–42, 85, 89–90
   link_model.py841879%169, 179, 188–194, 202, 210, 214–217, 221, 225, 229, 233
   receiver_model.py24388%62–63, 73
   transmitter_model.py36294%91, 105
paseos/geometric_model
   geometric_model.py281643%32–38, 47–79, 92–93, 101–102
paseos/power
   charge_model.py16194%49
   discharge_model.py7271%22, 34
paseos/tests
   activity_test.py57395%90, 93–94
   communication_test.py158994%646–654
   communication_window_test.py49198%176
   eclipse_test.py10190%20
   gain_calc_test.py18194%30
   import_test.py6183%13
   init_test.py8188%16
   line_of_sight_test.py62494%143–146
   mesh_test.py119397%118, 136, 144
   thermal_model_test.py30197%61
   visualization_test.py18194%28
paseos/utils
   check_cfg.py611870%31, 40, 46, 60–62, 67, 70–72, 75–77, 80–82, 98, 103
   operations_monitor.py74495%95, 131–134
paseos/visualization
   animation.py18667%27–30, 35, 44
   plot.py9367%29–32
   space_animation.py2152389%108–109, 124, 147–148, 182, 206–213, 219, 329, 352–354, 359, 368–369, 373, 409, 415–416, 447, 461–472
TOTAL264824791% 

Tests Skipped Failures Errors Time
46 0 💤 0 ❌ 0 🔥 1m 0s ⏱️

@GabrieleMeoni
Copy link
Collaborator

@gomezzz. I cannot ask for your review, but it would be good if you could also take a look at this PR.

Copy link
Collaborator

@gomezzz gomezzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments :) Overall quite nice!

Two main concerns for me atm:

  1. Please add a minimal example to the README.MD on how to use this
  2. See the longer comment in one of the models, you are using a lot of different classes that are very similar. I would suggest to simplify that

paseos/__init__.py Outdated Show resolved Hide resolved
paseos/actors/base_actor.py Show resolved Hide resolved
paseos/actors/base_actor.py Outdated Show resolved Hide resolved
paseos/tests/communication_test.py Outdated Show resolved Hide resolved
paseos/tests/link_budget_test.py Outdated Show resolved Hide resolved
paseos/utils/gain_calc.py Outdated Show resolved Hide resolved
paseos/utils/link_budget_calc.py Outdated Show resolved Hide resolved
paseos/utils/link_budget_calc.py Outdated Show resolved Hide resolved
"""Helper function to track comms status"""
conv_values = []
for val in values:
status = ["No signal", "Ground only", "CommSat only", "Ground + Sat"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

status shall be implemented as enum, not as string.

paseos/communication/link_model.py Show resolved Hide resolved
), "An optical receiver is required for this optical link."

logger.debug("Initializing optical link model.")
self.required_BER = 10e-3
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 10-3? I would have this value as user-defined value. In addition, this is typically linked with the maximum data-rate that you can have.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For optical this the BER for which the equation to determine bitrate is valid. It was quite difficult to find an equation where the bitrate could be calculated from. The one I could find so far is only valid for BER 10E-3 and a wavelength of 1550 nm.

Comment on lines 51 to 54
self.required_BER = 10e-3

self.modulation_scheme = "OOK"
self.required_s_n_margin = 3 # in dB
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is S_N_margin linked to the desired BER? If yes, we should avoid the definition of two related constants.


self.total_channel_loss = self.get_path_loss(slant_range)

self.signal_at_receiver = self.transmitter.EIRP - self.total_channel_loss
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are those values on a logarithmic scale? If yes, please, specify it in the names (e.g., EIRP_dB or something like that).


self.total_channel_loss = self.get_path_loss(slant_range)

self.signal_at_receiver = self.transmitter.EIRP - self.total_channel_loss
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these are in logarithmic scales, that means the loss of your signal will reduce your power to 0 dB. The effect of that depends on the noise power. If the noise power is higher than 0 dB, then you will have a terrible Bit Error Rate.

Comment on lines 51 to 56
self.required_BER = 10e-5
self.frequency = frequency # in Hz
self.modulation_scheme = "BPSK"
self.zenith_atmospheric_attenuation = 0.5 # in dB
self.required_s_n_ratio = 9.6 # in dB
self.required_s_n_margin = 3 # in dB
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, I would let the user specify margins and the other parameters.

@timsmitdelft
Copy link
Collaborator Author

Opened issue #210 for some possible improvements in the future.

@timsmitdelft timsmitdelft changed the title WIP: Comms expansion Comms expansion Feb 26, 2024
@timsmitdelft timsmitdelft marked this pull request as ready for review February 26, 2024 11:54
@gomezzz gomezzz removed their request for review September 12, 2024 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Future functionalities for communication handler
3 participants