EML-4 point station keeping

General help that does not fall into a more specific category

EML-4 point station keeping

Postby hornig » Fri Mar 15, 2013 2:29 pm

Hi there,

and another question. How do I station keeping around EML-4? my problem is, that the way I have currently done it is similar to your examples. but the "bean" formed orbit is to big. I just want to hover around the EML-4 with 1000 - 5000 km. I activated the influences of sun and moon and I can't make it go onto one of the potential lines forming those crazy orbits. I also used a simple phase space control but that pressed the satellite to the maximum allowed distance and let him fire all the time.

and another thing:
I placed my satellite on 0,0,0 on the libration point. I used a rotating coordinate frame for that and also told him to have 0 verlocity in all components. but it still leaves the point very fast. I suspect the change of distance between Earth and Moon is the case and the libration point also sneaks away and the satellite has no chance to get after it. How would you put the start parameter for velocity then that this sneaking phase is less big?

thanks, Andreas
hornig
 
Posts: 28
Joined: Fri Nov 30, 2012 3:16 pm

Re: EML-4 point station keeping

Postby hornig » Mon Mar 18, 2013 10:19 am

Hi there,

hmmmm, do I miss something important? I read, that station keeping for such an orbit with amplitudes of 3000km around L4 takes about 170 m/s delta v for one year.
I don't even come close to it with ALL my ideas how to do that. Whether I'm doing something completely wrong or they don't tell all their settings in those papers.

I currently have this veeery basic phase space control just checking displacement and the allowed velocity of the radius vector change.
the orbit doesn't look as bad as some of my ideas before, but it's still over the top.

What would you do to minimize the delta v needed for such a station keeping approach?

Thanks in advance,

Andreas

Code: Select all
%General Mission Analysis Tool(GMAT) Script
%Created: 2013-03-05 10:33:29


%----------------------------------------
%---------- Calculated Points
%----------------------------------------

Create LibrationPoint Libration1;
GMAT Libration1.Primary = Earth;
GMAT Libration1.Secondary = Luna;
GMAT Libration1.Point = L4;

Create Barycenter EMbarycenter;
GMAT EMbarycenter.BodyNames = {Earth, Luna};

%----------------------------------------
%---------- Spacecraft
%----------------------------------------

Create Spacecraft DefaultSC;
GMAT DefaultSC.DateFormat = TAIModJulian;
GMAT DefaultSC.Epoch = '21545';
GMAT DefaultSC.CoordinateSystem = EML4_rev;
GMAT DefaultSC.DisplayStateType = Cartesian;
GMAT DefaultSC.X = 7.021991383374466e-012;
GMAT DefaultSC.Y = 2.815783279428486e-011;
GMAT DefaultSC.Z = 2.204775860538122e-012;
GMAT DefaultSC.VX = 1.180014420794957e-017;
GMAT DefaultSC.VY = 1.117990740989744e-016;
GMAT DefaultSC.VZ = 1.334021316855695e-019;
GMAT DefaultSC.DryMass = 850;
GMAT DefaultSC.Cd = 2.2;
GMAT DefaultSC.Cr = 1.8;
GMAT DefaultSC.DragArea = 15;
GMAT DefaultSC.SRPArea = 1;
GMAT DefaultSC.Tanks = {FuelTank1};
GMAT DefaultSC.NAIFId = -123456789;
GMAT DefaultSC.NAIFIdReferenceFrame = -123456789;
GMAT DefaultSC.Id = 'SatId';
GMAT DefaultSC.Attitude = CoordinateSystemFixed;
GMAT DefaultSC.ModelFile = '../data/vehicle/models/aura.3ds';
GMAT DefaultSC.ModelOffsetX = 0;
GMAT DefaultSC.ModelOffsetY = 0;
GMAT DefaultSC.ModelOffsetZ = 0;
GMAT DefaultSC.ModelRotationX = 0;
GMAT DefaultSC.ModelRotationY = 0;
GMAT DefaultSC.ModelRotationZ = 0;
GMAT DefaultSC.ModelScale = 3;
GMAT DefaultSC.AttitudeDisplayStateType = 'Quaternion';
GMAT DefaultSC.AttitudeRateDisplayStateType = 'AngularVelocity';
GMAT DefaultSC.AttitudeCoordinateSystem = 'EarthMJ2000Eq';
GMAT DefaultSC.Q1 = 0;
GMAT DefaultSC.Q2 = 0;
GMAT DefaultSC.Q3 = 0;
GMAT DefaultSC.Q4 = 1;
GMAT DefaultSC.EulerAngleSequence = '321';
GMAT DefaultSC.AngularVelocityX = 0;
GMAT DefaultSC.AngularVelocityY = 0;
GMAT DefaultSC.AngularVelocityZ = 0;

%----------------------------------------
%---------- Hardware Components
%----------------------------------------

Create FuelTank FuelTank1;
GMAT FuelTank1.AllowNegativeFuelMass = true;
GMAT FuelTank1.FuelMass = 100;
GMAT FuelTank1.Pressure = 1500;
GMAT FuelTank1.Temperature = 20;
GMAT FuelTank1.RefTemperature = 20;
GMAT FuelTank1.Volume = 0.75;
GMAT FuelTank1.FuelDensity = 1260;
GMAT FuelTank1.PressureModel = PressureRegulated;
























































































































%----------------------------------------
%---------- ForceModels
%----------------------------------------

Create ForceModel DefaultProp_ForceModel;
GMAT DefaultProp_ForceModel.CentralBody = Earth;
GMAT DefaultProp_ForceModel.PrimaryBodies = {Earth};
GMAT DefaultProp_ForceModel.PointMasses = {Luna, Sun};
GMAT DefaultProp_ForceModel.Drag = None;
GMAT DefaultProp_ForceModel.SRP = Off;
GMAT DefaultProp_ForceModel.RelativisticCorrection = Off;
GMAT DefaultProp_ForceModel.ErrorControl = RSSStep;
GMAT DefaultProp_ForceModel.GravityField.Earth.Degree = 4;
GMAT DefaultProp_ForceModel.GravityField.Earth.Order = 4;
GMAT DefaultProp_ForceModel.GravityField.Earth.PotentialFile = 'JGM2.cof';
GMAT DefaultProp_ForceModel.GravityField.Earth.EarthTideModel = 'None';

Create ForceModel Propagator1_ForceModel;
GMAT Propagator1_ForceModel.CentralBody = Luna;
GMAT Propagator1_ForceModel.PrimaryBodies = {Luna};
GMAT Propagator1_ForceModel.PointMasses = {Earth, Sun};
GMAT Propagator1_ForceModel.Drag = None;
GMAT Propagator1_ForceModel.SRP = Off;
GMAT Propagator1_ForceModel.RelativisticCorrection = Off;
GMAT Propagator1_ForceModel.ErrorControl = RSSStep;
GMAT Propagator1_ForceModel.GravityField.Luna.Degree = 4;
GMAT Propagator1_ForceModel.GravityField.Luna.Order = 4;
GMAT Propagator1_ForceModel.GravityField.Luna.PotentialFile = 'LP165P.cof';

%----------------------------------------
%---------- Propagators
%----------------------------------------

Create Propagator DefaultProp;
GMAT DefaultProp.FM = DefaultProp_ForceModel;
GMAT DefaultProp.Type = RungeKutta89;
GMAT DefaultProp.InitialStepSize = 60;
GMAT DefaultProp.Accuracy = 9.999999999999999e-012;
GMAT DefaultProp.MinStep = 0.001;
GMAT DefaultProp.MaxStep = 2700;
GMAT DefaultProp.MaxStepAttempts = 50;
GMAT DefaultProp.StopIfAccuracyIsViolated = true;

Create Propagator Propagator1;
GMAT Propagator1.FM = Propagator1_ForceModel;
GMAT Propagator1.Type = RungeKutta89;
GMAT Propagator1.InitialStepSize = 60;
GMAT Propagator1.Accuracy = 9.999999999999999e-012;
GMAT Propagator1.MinStep = 0.001;
GMAT Propagator1.MaxStep = 2700;
GMAT Propagator1.MaxStepAttempts = 50;
GMAT Propagator1.StopIfAccuracyIsViolated = true;

%----------------------------------------
%---------- Burns
%----------------------------------------

Create ImpulsiveBurn DefaultIB;
GMAT DefaultIB.CoordinateSystem = EML4_rev;
GMAT DefaultIB.Element1 = 0;
GMAT DefaultIB.Element2 = 0;
GMAT DefaultIB.Element3 = 0;
GMAT DefaultIB.DecrementMass = true;
GMAT DefaultIB.Tank = {FuelTank1};
GMAT DefaultIB.Isp = 337;
GMAT DefaultIB.GravitationalAccel = 9.810000000000001;

Create ImpulsiveBurn ImpulsiveBurn1;
GMAT ImpulsiveBurn1.CoordinateSystem = Local;
GMAT ImpulsiveBurn1.Origin = Earth;
GMAT ImpulsiveBurn1.Axes = VNB;
GMAT ImpulsiveBurn1.Element1 = 0;
GMAT ImpulsiveBurn1.Element2 = 0;
GMAT ImpulsiveBurn1.Element3 = 0;
GMAT ImpulsiveBurn1.DecrementMass = false;
GMAT ImpulsiveBurn1.Isp = 300;
GMAT ImpulsiveBurn1.GravitationalAccel = 9.810000000000001;

Create ImpulsiveBurn ImpulsiveBurn2;
GMAT ImpulsiveBurn2.CoordinateSystem = Local;
GMAT ImpulsiveBurn2.Origin = Earth;
GMAT ImpulsiveBurn2.Axes = VNB;
GMAT ImpulsiveBurn2.Element1 = 0;
GMAT ImpulsiveBurn2.Element2 = 0;
GMAT ImpulsiveBurn2.Element3 = 0;
GMAT ImpulsiveBurn2.DecrementMass = false;
GMAT ImpulsiveBurn2.Isp = 300;
GMAT ImpulsiveBurn2.GravitationalAccel = 9.810000000000001;

Create ImpulsiveBurn ImpulsiveBurn3;
GMAT ImpulsiveBurn3.CoordinateSystem = Local;
GMAT ImpulsiveBurn3.Origin = Earth;
GMAT ImpulsiveBurn3.Axes = VNB;
GMAT ImpulsiveBurn3.Element1 = 0;
GMAT ImpulsiveBurn3.Element2 = 0;
GMAT ImpulsiveBurn3.Element3 = 0;
GMAT ImpulsiveBurn3.DecrementMass = false;
GMAT ImpulsiveBurn3.Isp = 300;
GMAT ImpulsiveBurn3.GravitationalAccel = 9.810000000000001;

Create ImpulsiveBurn ImpulsiveBurn4;
GMAT ImpulsiveBurn4.CoordinateSystem = Local;
GMAT ImpulsiveBurn4.Origin = Earth;
GMAT ImpulsiveBurn4.Axes = VNB;
GMAT ImpulsiveBurn4.Element1 = 0;
GMAT ImpulsiveBurn4.Element2 = 0;
GMAT ImpulsiveBurn4.Element3 = 0;
GMAT ImpulsiveBurn4.DecrementMass = false;
GMAT ImpulsiveBurn4.Isp = 300;
GMAT ImpulsiveBurn4.GravitationalAccel = 9.810000000000001;

Create ImpulsiveBurn ImpulsiveBurn5;
GMAT ImpulsiveBurn5.CoordinateSystem = Local;
GMAT ImpulsiveBurn5.Origin = Earth;
GMAT ImpulsiveBurn5.Axes = VNB;
GMAT ImpulsiveBurn5.Element1 = 0;
GMAT ImpulsiveBurn5.Element2 = 0;
GMAT ImpulsiveBurn5.Element3 = 0;
GMAT ImpulsiveBurn5.DecrementMass = false;
GMAT ImpulsiveBurn5.Isp = 300;
GMAT ImpulsiveBurn5.GravitationalAccel = 9.810000000000001;

Create FiniteBurn DefaultFB;

%----------------------------------------
%---------- Arrays, Variables, Strings
%----------------------------------------
Create Variable EML4_distance EML4_x EML4_y EML4_z I LunaPosX LunaPosY LunaPosZ RadialDistanceToMoon GammaAngle;
Create Variable EM_RMAG orbit_ecc EML4_x_dec dv_sum radius dt ElapsedSecs_b4 dr dr_dot EML4_distance_b4;
Create Variable box_r_dot_max box_r_dot_min box_r_max box_r_min test r pulse;
GMAT EML4_distance = 0;
GMAT EML4_x = 0;
GMAT EML4_y = 0;
GMAT EML4_z = 0;
GMAT LunaPosX = 0;
GMAT LunaPosY = 0;
GMAT LunaPosZ = 0;
GMAT RadialDistanceToMoon = 0;
GMAT GammaAngle = 0;
GMAT EM_RMAG = 0;
GMAT orbit_ecc = 0;
GMAT EML4_x_dec = 0;
GMAT dv_sum = 0;
GMAT radius = 0;
GMAT dt = 1;
GMAT ElapsedSecs_b4 = 0;
GMAT dr = 0;
GMAT dr_dot = 0;
GMAT EML4_distance_b4 = 0;
GMAT box_r_dot_max = 0.005;
GMAT box_r_dot_min = -0.008;
GMAT box_r_max = 2000;
GMAT box_r_min = -2000;
GMAT test = 0;
GMAT r = 0;
GMAT pulse = 0.0005;























































































































%----------------------------------------
%---------- Coordinate Systems
%----------------------------------------

Create CoordinateSystem EML4_rev;
GMAT EML4_rev.Origin = Libration1;
GMAT EML4_rev.Axes = ObjectReferenced;
GMAT EML4_rev.XAxis = R;
GMAT EML4_rev.ZAxis = N;
GMAT EML4_rev.Primary = EMbarycenter;
GMAT EML4_rev.Secondary = Libration1;

Create CoordinateSystem LunaMJ2000Ec;
GMAT LunaMJ2000Ec.Origin = Luna;
GMAT LunaMJ2000Ec.Axes = MJ2000Ec;

Create CoordinateSystem EMbary_coord;
GMAT EMbary_coord.Origin = EMbarycenter;
GMAT EMbary_coord.Axes = MJ2000Ec;

Create CoordinateSystem EML4_earth_rev;
GMAT EML4_earth_rev.Origin = Earth;
GMAT EML4_earth_rev.Axes = ObjectReferenced;
GMAT EML4_earth_rev.XAxis = R;
GMAT EML4_earth_rev.ZAxis = N;
GMAT EML4_earth_rev.Primary = Earth;
GMAT EML4_earth_rev.Secondary = Luna;

%----------------------------------------
%---------- Solvers
%----------------------------------------

Create DifferentialCorrector DefaultDC;
GMAT DefaultDC.ShowProgress = true;
GMAT DefaultDC.ReportStyle = Normal;
GMAT DefaultDC.ReportFile = 'DifferentialCorrectorDefaultDC.data';
GMAT DefaultDC.MaximumIterations = 60;
GMAT DefaultDC.DerivativeMethod = ForwardDifference;

Create DifferentialCorrector DC1;
GMAT DC1.ShowProgress = true;
GMAT DC1.ReportStyle = Normal;
GMAT DC1.ReportFile = 'DifferentialCorrectorDC1.data';
GMAT DC1.MaximumIterations = 10;
GMAT DC1.DerivativeMethod = ForwardDifference;

%----------------------------------------
%---------- Subscribers
%----------------------------------------

Create OrbitView DefaultOrbitView;
GMAT DefaultOrbitView.SolverIterations = Current;
GMAT DefaultOrbitView.UpperLeft = [ 0.04101221640488656 0.3903345724907063 ];
GMAT DefaultOrbitView.Size = [ 0.6239092495636999 0.5520446096654275 ];
GMAT DefaultOrbitView.RelativeZOrder = 16;
GMAT DefaultOrbitView.Add = {DefaultSC, Earth, Luna, EMbarycenter};
GMAT DefaultOrbitView.CoordinateSystem = EarthMJ2000Eq;
GMAT DefaultOrbitView.DrawObject = [ true true true true ];
GMAT DefaultOrbitView.OrbitColor = [ 255 32768 1743054 1743054 ];
GMAT DefaultOrbitView.TargetColor = [ 8421440 0 4227327 4227327 ];
GMAT DefaultOrbitView.DataCollectFrequency = 10;
GMAT DefaultOrbitView.UpdatePlotFrequency = 500;
GMAT DefaultOrbitView.NumPointsToRedraw = 0;
GMAT DefaultOrbitView.ShowPlot = true;
GMAT DefaultOrbitView.ViewPointReference = Earth;
GMAT DefaultOrbitView.ViewPointVector = [ 30000 0 0 ];
GMAT DefaultOrbitView.ViewDirection = Earth;
GMAT DefaultOrbitView.ViewScaleFactor = 1;
GMAT DefaultOrbitView.ViewUpCoordinateSystem = EarthMJ2000Eq;
GMAT DefaultOrbitView.ViewUpAxis = Z;
GMAT DefaultOrbitView.CelestialPlane = Off;
GMAT DefaultOrbitView.XYPlane = On;
GMAT DefaultOrbitView.WireFrame = Off;
GMAT DefaultOrbitView.Axes = On;
GMAT DefaultOrbitView.Grid = Off;
GMAT DefaultOrbitView.SunLine = Off;
GMAT DefaultOrbitView.UseInitialView = On;
GMAT DefaultOrbitView.StarCount = 7000;
GMAT DefaultOrbitView.EnableStars = Off;
GMAT DefaultOrbitView.EnableConstellations = On;

Create GroundTrackPlot DefaultGroundTrackPlot;
GMAT DefaultGroundTrackPlot.SolverIterations = Current;
GMAT DefaultGroundTrackPlot.UpperLeft = [ 0.3891797556719023 0.02230483271375465 ];
GMAT DefaultGroundTrackPlot.Size = [ 0.5820244328097731 0.6635687732342007 ];
GMAT DefaultGroundTrackPlot.RelativeZOrder = 11;
GMAT DefaultGroundTrackPlot.Add = {DefaultSC, Earth};
GMAT DefaultGroundTrackPlot.DataCollectFrequency = 1;
GMAT DefaultGroundTrackPlot.UpdatePlotFrequency = 50;
GMAT DefaultGroundTrackPlot.NumPointsToRedraw = 0;
GMAT DefaultGroundTrackPlot.ShowPlot = true;
GMAT DefaultGroundTrackPlot.CentralBody = Earth;
GMAT DefaultGroundTrackPlot.TextureMap = '../data/graphics/texture/ModifiedBlueMarble.jpg';

Create OrbitView OrbitView1;
GMAT OrbitView1.SolverIterations = Current;
GMAT OrbitView1.UpperLeft = [ 0.31239092495637 0.1524163568773234 ];
GMAT OrbitView1.Size = [ 0.4965095986038394 0.6895910780669146 ];
GMAT OrbitView1.RelativeZOrder = 248;
GMAT OrbitView1.Add = {DefaultSC, Earth, Luna, EMbarycenter};
GMAT OrbitView1.CoordinateSystem = EML4_rev;
GMAT OrbitView1.DrawObject = [ true true true true ];
GMAT OrbitView1.OrbitColor = [ 255 32768 1743054 1743054 ];
GMAT OrbitView1.TargetColor = [ 8421440 0 4227327 4227327 ];
GMAT OrbitView1.DataCollectFrequency = 10;
GMAT OrbitView1.UpdatePlotFrequency = 500;
GMAT OrbitView1.NumPointsToRedraw = 0;
GMAT OrbitView1.ShowPlot = true;
GMAT OrbitView1.ViewPointReference = Libration1;
GMAT OrbitView1.ViewPointVector = [ 0 0 1 ];
GMAT OrbitView1.ViewDirection = Libration1;
GMAT OrbitView1.ViewScaleFactor = 10000;
GMAT OrbitView1.ViewUpCoordinateSystem = EML4_rev;
GMAT OrbitView1.ViewUpAxis = Z;
GMAT OrbitView1.CelestialPlane = Off;
GMAT OrbitView1.XYPlane = On;
GMAT OrbitView1.WireFrame = Off;
GMAT OrbitView1.Axes = On;
GMAT OrbitView1.Grid = Off;
GMAT OrbitView1.SunLine = Off;
GMAT OrbitView1.UseInitialView = On;
GMAT OrbitView1.StarCount = 7000;
GMAT OrbitView1.EnableStars = Off;
GMAT OrbitView1.EnableConstellations = On;

Create ReportFile DefaultReportFile;
GMAT DefaultReportFile.SolverIterations = Current;
GMAT DefaultReportFile.UpperLeft = [ 0 0 ];
GMAT DefaultReportFile.Size = [ 0 0 ];
GMAT DefaultReportFile.RelativeZOrder = 0;
GMAT DefaultReportFile.Filename = 'DefaultReportFile.txt';
GMAT DefaultReportFile.Precision = 16;
GMAT DefaultReportFile.WriteHeaders = On;
GMAT DefaultReportFile.LeftJustify = On;
GMAT DefaultReportFile.ZeroFill = Off;
GMAT DefaultReportFile.ColumnWidth = 20;
GMAT DefaultReportFile.WriteReport = true;

Create XYPlot XYPlot1;
GMAT XYPlot1.SolverIterations = Current;
GMAT XYPlot1.UpperLeft = [ 0.1143106457242583 0.06505576208178439 ];
GMAT XYPlot1.Size = [ 0.5357766143106457 0.4944237918215613 ];
GMAT XYPlot1.RelativeZOrder = 31;
GMAT XYPlot1.XVariable = DefaultSC.ElapsedSecs;
GMAT XYPlot1.YVariables = {dr_dot};
GMAT XYPlot1.ShowGrid = true;
GMAT XYPlot1.ShowPlot = true;

Create XYPlot XYPlot2;
GMAT XYPlot2.SolverIterations = Current;
GMAT XYPlot2.UpperLeft = [ 0.1544502617801047 0.275092936802974 ];
GMAT XYPlot2.Size = [ 0.5924956369982548 0.4684014869888476 ];
GMAT XYPlot2.RelativeZOrder = 218;
GMAT XYPlot2.XVariable = DefaultSC.ElapsedSecs;
GMAT XYPlot2.YVariables = {DefaultSC.EML4_earth_rev.VX, DefaultSC.EML4_earth_rev.VY, DefaultSC.EML4_earth_rev.VZ};
GMAT XYPlot2.ShowGrid = true;
GMAT XYPlot2.ShowPlot = true;

Create OrbitView OrbitView2;
GMAT OrbitView2.SolverIterations = Current;
GMAT OrbitView2.UpperLeft = [ 0.162303664921466 0.3401486988847584 ];
GMAT OrbitView2.Size = [ 0.6675392670157068 0.5966542750929368 ];
GMAT OrbitView2.RelativeZOrder = 21;
GMAT OrbitView2.Add = {DefaultSC, Earth, Libration1, Luna};
GMAT OrbitView2.CoordinateSystem = EML4_earth_rev;
GMAT OrbitView2.DrawObject = [ true true true true ];
GMAT OrbitView2.OrbitColor = [ 255 32768 1743054 1743054 ];
GMAT OrbitView2.TargetColor = [ 8421440 0 4227327 4227327 ];
GMAT OrbitView2.DataCollectFrequency = 1;
GMAT OrbitView2.UpdatePlotFrequency = 50;
GMAT OrbitView2.NumPointsToRedraw = 0;
GMAT OrbitView2.ShowPlot = true;
GMAT OrbitView2.ViewPointReference = Earth;
GMAT OrbitView2.ViewPointVector = [ 0 0 120000 ];
GMAT OrbitView2.ViewDirection = Earth;
GMAT OrbitView2.ViewScaleFactor = 1;
GMAT OrbitView2.ViewUpCoordinateSystem = EarthMJ2000Eq;
GMAT OrbitView2.ViewUpAxis = X;
GMAT OrbitView2.CelestialPlane = Off;
GMAT OrbitView2.XYPlane = On;
GMAT OrbitView2.WireFrame = Off;
GMAT OrbitView2.Axes = On;
GMAT OrbitView2.Grid = Off;
GMAT OrbitView2.SunLine = Off;
GMAT OrbitView2.UseInitialView = On;
GMAT OrbitView2.StarCount = 7000;
GMAT OrbitView2.EnableStars = On;
GMAT OrbitView2.EnableConstellations = On;

Create XYPlot XYPlot3;
GMAT XYPlot3.SolverIterations = Current;
GMAT XYPlot3.UpperLeft = [ 0.06544502617801047 0.1133828996282528 ];
GMAT XYPlot3.Size = [ 0.4895287958115183 0.3884758364312267 ];
GMAT XYPlot3.RelativeZOrder = 222;
GMAT XYPlot3.XVariable = DefaultSC.A1ModJulian;
GMAT XYPlot3.YVariables = {dv_sum};
GMAT XYPlot3.ShowGrid = true;
GMAT XYPlot3.ShowPlot = true;

Create XYPlot XYPlot4;
GMAT XYPlot4.SolverIterations = Current;
GMAT XYPlot4.UpperLeft = [ 0.231239092495637 0.2695167286245353 ];
GMAT XYPlot4.Size = [ 0.7670157068062827 0.6431226765799256 ];
GMAT XYPlot4.RelativeZOrder = 36;
GMAT XYPlot4.XVariable = DefaultSC.A1ModJulian;
GMAT XYPlot4.YVariables = {r};
GMAT XYPlot4.ShowGrid = true;
GMAT XYPlot4.ShowPlot = true;


%----------------------------------------
%---------- Mission Sequence
%----------------------------------------

BeginMissionSequence;
While DefaultSC.ElapsedDays < 100
   BeginScript
      GMAT ElapsedSecs_b4 = DefaultSC.ElapsedSecs;
     
      GMAT EML4_x = DefaultSC.EML4_rev.X;
      GMAT EML4_y = DefaultSC.EML4_rev.Y;
      GMAT EML4_z = DefaultSC.EML4_rev.Z;
      GMAT EML4_distance_b4 = (EML4_x^2+EML4_y^2+EML4_z^2)^0.5;
   EndScript;
   Propagate DefaultProp(DefaultSC);
   BeginScript
      GMAT dt = DefaultSC.ElapsedSecs-ElapsedSecs_b4;
     
      GMAT EML4_x = DefaultSC.EML4_rev.X;
      GMAT EML4_y = DefaultSC.EML4_rev.Y;
      GMAT EML4_z = DefaultSC.EML4_rev.Z;
      GMAT EML4_distance = (EML4_x^2+EML4_y^2+EML4_z^2)^0.5;
      GMAT r = EML4_distance;
   EndScript;
   If DefaultSC.ElapsedDays > 0
      If DefaultSC.EML4_rev.X < box_r_max & dr_dot > box_r_dot_max & DefaultSC.EML4_rev.X > box_r_min | DefaultSC.EML4_rev.X > box_r_max | DefaultSC.EML4_rev.X < box_r_min
         BeginScript
            GMAT test = 0;
           
            GMAT DefaultSC.EML4_rev.VX = DefaultSC.EML4_rev.VX - DefaultSC.EML4_rev.X/(DefaultSC.EML4_rev.X^2+DefaultSC.EML4_rev.Y^2)^0.5*pulse;
            GMAT DefaultSC.EML4_rev.VY = DefaultSC.EML4_rev.VY - DefaultSC.EML4_rev.Y/(DefaultSC.EML4_rev.X^2+DefaultSC.EML4_rev.Y^2)^0.5*pulse;
           
            GMAT dv_sum = dv_sum +pulse;
         EndScript;
      EndIf;
      If dr_dot < box_r_dot_min
         BeginScript
            GMAT test = 0;
           
            GMAT DefaultSC.EML4_rev.VX = DefaultSC.EML4_rev.VX + DefaultSC.EML4_rev.X/(DefaultSC.EML4_rev.X^2+DefaultSC.EML4_rev.Y^2)^0.5*pulse;
            GMAT DefaultSC.EML4_rev.VY = DefaultSC.EML4_rev.VY + DefaultSC.EML4_rev.Y/(DefaultSC.EML4_rev.X^2+DefaultSC.EML4_rev.Y^2)^0.5*pulse;
           
            GMAT dv_sum = dv_sum +pulse;
         EndScript;
      EndIf;
   Else
   EndIf;
   BeginScript
      GMAT dr = EML4_distance - EML4_distance_b4;
      GMAT dr_dot = dr/dt;
   EndScript;
EndWhile;


please keep in mind that there are still variables inside I don't use. They're just leftovers from previous ideas. :)
hornig
 
Posts: 28
Joined: Fri Nov 30, 2012 3:16 pm

Re: EML-4 point station keeping

Postby hornig » Tue Nov 19, 2013 7:58 am

Hi,

thanks, but please keep in mind that this is a test script and it didn't make sense to me. that's why I haven't used it for my studies and relied on other sources.
So I also wait for someone with a better idea and version of this script :).

Best regards,

Andreas
hornig
 
Posts: 28
Joined: Fri Nov 30, 2012 3:16 pm


Return to General

Who is online

Users browsing this forum: No registered users and 6 guests

cron