How to use pointAt() to point ground stations gimbals at different satellites at different time in satellite constellation to study link margin?
조회 수: 31 (최근 30일)
이전 댓글 표시
I'm trying to study link budget of ground stations and satellite constellation.
I've gone through the exapmle "https://in.mathworks.com/help/satcom/ug/multihop-satellite-communication.html". This example shows one ground station (GS1) pointing at one satellite (sat1) and another ground station (GS2) at another satellite (sat2), and then calculating link margin from GS1 to GS2.
Im trying to extend this example by using satellite constellation where a ground station can use the presently visible satellite and switch to next one after the crossing of the satellite.
I've tried it using the below code
sc = satelliteScenario(startTime, stopTime, sampleTime, 'AutoSimulate',true);
plotRaditationPattern = true;
% Add ground stations
gsMumbai = groundStation(sc, 'Name', 'BOM GS', 'Latitude', 19.0760, 'Longitude', 72.8777); % Mumbai Ground Station
ueBengaluru = groundStation(sc, 'Name', 'BLR UE', 'Latitude', 12.9716, 'Longitude', 77.5946); % User Equipment in Bengaluru
% Add LEO satellite constellation (Keplerian elements)
numSatellites = 40;
semiMajorAxis = 7000e3 * ones(1, numSatellites); % Approximate altitude for LEO
eccentricity = zeros(1, numSatellites);
argumentOfPeriapsis = 13*ones(1, numSatellites);
trueAnomaly = linspace(0, 360, numSatellites); % Distribute satellites around the orbit
inclination = 40 * ones(1, numSatellites); % Common inclination for constellations
rightAscensionOfAscendingNode = linspace(0, 360, numSatellites);
[accessIntervalsGS2GS, acessGS2GS] = getSource2TargetPaths(gsMumbai, ueBengaluru, satArray, 1,false);
disp('Ground station to Ground Station Access Intervals with max 1 hop:');
disp(accessIntervalsGS2GS);
sc.AutoSimulate = false;
restart(sc);
disp(sc.SimulationStatus)
% Iterate over the simulation time and dynamically point the gimbal at the correct satellite
while sc.SimulationTime <= sc.StopTime
currentSimTime = sc.SimulationTime; % Get the current simulation time
% Check the access intervals to find the satellite that is visible at this time
for i = 1:height(accessIntervalsGS2GS)
% Get the access interval start and end times
intervalStart = accessIntervalsGS2GS(i, 4);
intervalEnd = accessIntervalsGS2GS(i, 5);
% If the current simulation time is within the access interval
if currentSimTime >= intervalStart.Variables && currentSimTime <= intervalEnd.Variables
% Get the satellite associated with this access interval using acessGS2GS
satID = acessGS2GS(i).Sequence(2); % Source asset ID (Satellite ID)
% Find the corresponding satellite object in satArray using the ID
for j = 1:numel(satArray)
if satArray(j).ID == satID
% Point the gimbal at the satellite
pointAt(gimbalGSMumbaitx, satArray(j));
pointAt(gimbalUErx, satArray(j));
break; % Stop after pointing at the correct satellite
end
end
end
end
% Update the simulation time step
if (sc.SimulationStatus ~= "Completed") && (seconds(sc.StopTime - sc.SimulationTime) > sc.SampleTime)
disp(sc.SimulationTime)
advance(sc);
else
break;
end
end
% restart(sc);
sc.AutoSimulate = true;
[linksIntervalsGS2GS, linksGS2GS] = getSource2TargetPathLinks(gsMumbai, ueBengaluru, satArray, 1, false);
disp('Ground station to Ground Station Access Intervals with max 1 hops:');
disp(linksIntervalsGS2GS);
However the pointAt() function causes the ground stations to point only at the last satellite, so for whole simulation they are pointing at only 1 satellite.
How to dynamically point ground stations to the passing satellites at different times of the simulations.?
This should give us link margin between the two ground stations all the time whenver a satellite connects to both the ground stations.
댓글 수: 2
Aravind
2024년 10월 4일
The code you have provided fails to run as some of the variables and functions are not well defined. Could you please provide implementation details of the functions "getSource2TargetPaths" and "getSource2TargetPathLinks". Also, please provide the values for the missing variables like "startTime", "satArray", "stopTime", "sampleTime", etc. This will help in reproducing the issue so that I can try debugging it.
채택된 답변
Aravind
2024년 10월 30일 7:01
It seems you are encountering difficulties with the "pointAt" function in a loop, where you are adjusting the target at each simulation time step to point at the nearest satellite. I have managed to replicate the issue you are experiencing.
Upon reviewing your code, it appears the problem may stem from the repeated calls to the "pointAt" function within a loop. Since your goal is to dynamically change the satellites that the ground stations point to, you might consider using a "steeringtable" as a workaround. This will allow you to create a pointing schedule for the gimbals instead of repeatedly calling the "pointAt" function. More information can be found in the documentation here: https://www.mathworks.com/help/releases/R2022a/satcom/ref/matlabshared.satellitescenario.satellite.pointat.html#mw_a7e2d1e3-b588-465f-b127-28023bf685f4.
A "steeringtable" is a MATLAB "timetable" object containing the azimuth and elevation angles of the target that the gimbal is pointing to. You can use the table “accessIntervalsGS2GS” which is pre-calculated and contains the time interval and the target satellite, to populate the “steeringtable”. The azimuth and elevation angles of the satellite during that time interval can be calculated using the "aer" function. More details about the "aer" function can be found here: https://www.mathworks.com/help/releases/R2022a/satcom/ref/matlabshared.satellitescenario.satellite.aer.html.
By populating a "steeringtable," you can ensure that the ground station gimbals consistently point to the nearest satellite to establish a communication link. Once the "steeringtable" is created, you can pass it as an argument to the "pointAt" function, making the call only once rather than in a loop, thereby avoiding the previous issue.
Here are some documentation links and resources to help you get started with creating the "steeringtable":
- 1. MATLAB timetable: https://www.mathworks.com/help/releases/R2022a/matlab/ref/timetable.html
- 2. Overview of timetable in MATLAB: https://www.mathworks.com/help/releases/R2022a//matlab/timetables.html
- 3. A related MATLAB Answer where the "pointAt" function is used with a "timetable" object: https://www.mathworks.com/matlabcentral/answers/1943574-need-attitude-of-a-satellite-that-is-pointing-at-a-target
I hope this helps to resolve your issue.
댓글 수: 1
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Scenario Generation and Visualization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!