Page 1 of 1

VNB switching

PostPosted: Tue Jan 14, 2014 10:03 pm
by chancwj
I've been playing with electric propulsion and trying to figure out how to switch the VNB coordinate system for thrust direction when transitioning out of the Earth's sphere of influence. Unfortunately the coordinate system is defined in the Thruster definition in the Hardware folder. There's no way to define the thrust coordinate system in the Burns folder. So in addition to defining separate Burns for near earth and deep space, you also have to create two different Thrusters, one with the Earth as the coordinate origin and the other with the Sun as origin.

Re: VNB switching

PostPosted: Wed Jan 15, 2014 1:53 pm
by jjkparker
If we allowed something like this, would it solve your issue?

Code: Select all
Create Thruster t
t.Origin = Earth


t.Origin = Sun

You're right that you can't do this right now, but it might be possible to allow it in the future. But I'm not the Thruster guy!


Re: VNB switching

PostPosted: Wed Jan 22, 2014 7:50 pm
by shughes
A more elegant, and realistic approach, and one we use for this, is to set the thruster in spacecraft body coordinates, and set spacecraft body to be in the system you want. You can change attitude at any point in the mission.

Here is pseudoscript.

Code: Select all
Create Spacecraft DefaultSC;
GMAT DefaultSC.Attitude = CoordinateSystemFixed;
GMAT DefaultSC.AttitudeCoordinateSystem = EarthVNB;

Create Thruster Thruster1;
GMAT Thruster1.CoordinateSystem = Local;
GMAT Thruster1.Axes = SpacecraftBody;

Create CoordinateSystem EarthVNB;
GMAT EarthVNB.Origin = DefaultSC;
GMAT EarthVNB.Axes = ObjectReferenced;
GMAT EarthVNB.XAxis = V;
GMAT EarthVNB.YAxis = N;
GMAT EarthVNB.Primary = Earth;
GMAT EarthVNB.Secondary = DefaultSC;

Create CoordinateSystem SunVBN;
GMAT SunVBN.Origin = DefaultSC;
GMAT SunVBN.Axes = ObjectReferenced;
GMAT SunVBN.XAxis = V;
GMAT SunVBN.YAxis = N;
GMAT SunVBN.Primary = Sun;
GMAT SunVBN.Secondary = DefaultSC;


GMAT DefaultSC.AttitudeCoordinateSystem = EarthVNB
%  Do maneuvers in Earth VNB
GMAT DefaultSC.AttitudeCoordinateSystem = SunVNB
%  Now do maneuvers in Sun VNB