Spacecraft Orientation Problem: Velocity != planes

Post requests, images, descriptions and reports about work in progress here.
Topic author
Stuffer
Posts: 67
Joined: 03.12.2008
With us: 15 years 11 months
Location: Stuttgart, Germany

Spacecraft Orientation Problem: Velocity != planes

Post #1by Stuffer » 13.05.2009, 19:30

Hi all,

I have a problem concerning the orientation of my spacecraft.
As you can see in the pictures the velocity vector neither is normal the yz plane nor within the xz plane.

Image

Image.

And I'm not able to figure out why it is like that or how I can fix that problem.

Does anyone have an idea?

here's the SSC file I use for this:

Code: Select all

"mySatellite" "Sol/Earth"

{

   Class "spacecraft"

#   OrbitFrame { BodyFixed { Center "Sol/Earth" }}

   Mesh "mySatellite.cmod"
   MeshCenter [-15 50 75]
#   Texture "solpanel.jpg"
   Emissive true
   Radius  1000 #0.0007
   Beginning "2006 06 07 15:20:00"

     EllipticalOrbit
   {
#   Epoch  2453445.28885625
   Period  1
   SemiMajorAxis  7877.661
#   Eccentricity  0.0008874
   Inclination  90 #97.4274
   AscendingNode 0# 324.0722
   ArgOfPericenter 0 #124.2127
   MeanAnomaly  0 #235.9981
   }
     
   Obliquity  90 #97.4274        = Inclination
     EquatorAscendingNode 90 # = AscendingNode
#     RotationOffset  180.0
     
   Orientation  [ 90 0 0 1 ]
   RotationPeriod 0 #23.9344
   Albedo 0.05
}


I need the velocity vector to be normal to the yz-plane (RotationPeriod=0) to get a proper pointing and behavior. (Fixed pointing to earth's centre, fixed pointing to the sun or any star).

Thanks for any help.
Stuffer
Win XP Pro x Core2Duo 2,1GHz x 2 GB RAM x NVidia Quadro FX 1500 256 MB

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Re: Spacecraft Orientation Problem: Velocity != planes

Post #2by selden » 13.05.2009, 20:42

RotationPeriod = 0 means infinite rotation velocity. That's certainly going to mess things up.

[edit]
If you don't want it to rotate (or to rotate very, very slowly), then you need something like
RotationPeriod 1e32
or FixedRotation.
[/edit]
Selden

Topic author
Stuffer
Posts: 67
Joined: 03.12.2008
With us: 15 years 11 months
Location: Stuttgart, Germany

Re: Spacecraft Orientation Problem: Velocity != planes

Post #3by Stuffer » 13.05.2009, 20:53

hm, thanks Selden.

but commenting it out or giving it a value != 0 doesn't change this behavior! I need the velocity to be in the rotation plane --> normal to the z-axis.
I can't imagine why this doesn't work since the body axes seem to be in the right way. Could this be a model problem anyway?

Are all the values I can specify changing the rotation about the z-axis only?
Stuffer
Win XP Pro x Core2Duo 2,1GHz x 2 GB RAM x NVidia Quadro FX 1500 256 MB

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Re: Spacecraft Orientation Problem: Velocity != planes

Post #4by selden » 13.05.2009, 20:56

What is it that you're actually trying to accomplish?

Are you perhaps trying to have one axis of the satellite aligned with the Earth in some way and the solar panels pointed toward the Sun as best they can in spite of the Earth-oriented alignment?

If that's what you're trying to do, I had a mostly-private conversation with ChuftCaptain about something similar tp that. I'll see if I can find it.
Selden

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Re: Spacecraft Orientation Problem: Velocity != planes

Post #5by chris » 13.05.2009, 20:56

selden wrote:RotationPeriod = 0 means infinite rotation velocity. That's certainly going to mess things up.

If you want the satellite to not rotate (within its reference frame), then you should use a FixedRotation instead of a UniformRotation. You may be able to use just the default parameters, in which case you can replace all of this:

Code: Select all

   Obliquity  90 #97.4274        = Inclination
     EquatorAscendingNode 90 # = AscendingNode
#     RotationOffset  180.0
    RotationPeriod 0


with this:

Code: Select all

FixedRotation { }


--Chris

Topic author
Stuffer
Posts: 67
Joined: 03.12.2008
With us: 15 years 11 months
Location: Stuttgart, Germany

Re: Spacecraft Orientation Problem: Velocity != planes

Post #6by Stuffer » 13.05.2009, 21:03

No, I do not want to have it not rotating.

In fact I would like it to point to Earth's center all around its orbit in this case.
Another behavior is that it's fixing a point on earth's surface.
Furthermore I want it to always point to the sun with its solar panels.

Of course these are different scenarios.

When I observe its behavior for some time the velocity vector aligns with the y-axis for a short period. Is it possible that this a reference frame problem?

Thank you very much to both of you.

edit: what I'm trying to accomplish for example is that the antenna points to the earth whereas the solar panels are aligned along the velocity vector meaning one of the body axis should have the same or opposite direction as the vel. vector has. z-axis (rotation axis) normal to velocity. In this case I would need a RotationPeriod of 23.9344 about z.

Stuffer
Win XP Pro x Core2Duo 2,1GHz x 2 GB RAM x NVidia Quadro FX 1500 256 MB

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Re: Spacecraft Orientation Problem: Velocity != planes

Post #7by chris » 13.05.2009, 21:39

Stuffer wrote:No, I do not want to have it not rotating.

...

edit: what I'm trying to accomplish for example is that the antenna points to the earth whereas the solar panels are aligned along the velocity vector meaning one of the body axis should have the same or opposite direction as the vel. vector has. z-axis (rotation axis) normal to velocity. In this case I would need a RotationPeriod of 23.9344 about z.

You can accomplish this most easily by setting up an appropriate reference frame for the spacecraft and keeping the spacecraft fixed within that frame. Assuming that the antenna points along the +y axis and the solar panels are normal to +x:

Code: Select all

BodyFrame {
    TwoVector {
        Primary {
            Axis "y"
            RelativePosition {
                Target "Sol/Earth"
                Observer "Sol/Earth/mySatellite"
            }
        }
        Secondary {
            Axis "x"
            RelativeVelocity {
                Target "Sol/Earth"
                Observer "Sol/Earth/mySatellite"
            }
        }
    }
}


--Chris

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Re: Spacecraft Orientation Problem: Velocity != planes

Post #8by selden » 13.05.2009, 21:52

I've usually used the TwoVector frame to accomplish something like what you describe.


Here's an example:

Code: Select all

"MySatellite" "Sol/Earth"
{
   Class "spacecraft"
   NormalizeMesh false
   MeshScale 1
   Mesh "satellite.3ds"
   Radius 100

   EllipticalOrbit { SemiMajorAxis 10000 Period 1 Inclination 45}

    BodyFrame       { BodyFixed     { Center "Sol/Earth" } }
    FixedRotation   { }

}
# Orient satellite so it always points toward the Earth
# with fixed orientation relative to orbit

Modify "MySatellite" "Sol/Earth"
{
    BodyFrame
    {
        TwoVector
        {
            Center "Sol/Earth/MySatellite"
            Primary   
            {
                Axis "-y"
      RelativePosition {Target "Sol/Earth"}
            }
            Secondary   
            {
                Axis "x"
      RelativeVelocity {Target "Sol/Earth"}
            }
        }
    }
}


I used Modify because MySatellite needs to be defined before the TwoVector's Center can be specified.
I suspect there's a better way to write this Frame definition.

(Chris, I tried to eliminate the Center and make the TwoVector part of the MySatellite definition, but the satellite doesn't actually get drawn when I do that. Right now I dunno if I made a typo or if its a bug in Celestia.)

If the solar panels are a separate model, they can be oriented relative to the satellite and as nearly face-on to the Sun as the satellite's orbital geometry allows.

Code: Select all

# specify location of 1st solar panel relative to satellite body

"panel_1" "Sol/Earth/MySatellite"
{
   Class "component"
   NormalizeMesh false
   MeshScale 1
   Mesh "solar_panel_left.3ds"
   Radius 100


    OrbitFrame       { BodyFixed { Center "Sol/Earth/MySatellite" }}
    FixedPosition [ 0 10 -5 ]

    BodyFrame       { BodyFixed  { Center "Sol/Earth/MySatellite" }}
    FixedRotation   { MeridianAngle -90 }
}

# Orient panel relative to satellite
# and orient front of panel toward sun

Modify "panel_1" "Sol/Earth/MySatellite"
{
    BodyFrame
    {
        TwoVector
        {
            Center "Sol/Earth/MySatellite/panel_1"
            Primary   
            {
                Axis "y"
      ConstantVector {
          Vector [ 0 0 1]
          Frame { BodyFixed { Center "Sol/Earth/MySatellite" }}
          }
            }
            Secondary   
            {
                Axis "-z"
      RelativePosition {Target "Sol"}
            }
        }
    }

}


And here's what the bodyframe and velocity vectors look like:
my_satellite.jpg


More information about Frames is available in the Celestia WikiBook. http://en.wikibooks.org/wiki/Celestia
Selden

Topic author
Stuffer
Posts: 67
Joined: 03.12.2008
With us: 15 years 11 months
Location: Stuttgart, Germany

Re: Spacecraft Orientation Problem: Velocity != planes

Post #9by Stuffer » 13.05.2009, 22:37

Chris, Selden,
Actually I wouldn't call it "most easily" :P.

Thanks very much to both of you, anyway.

At least my satellite is now pointing to the center of the earth.

Unfortunately the velocity vector is still not in line with (in my case) the y-axis. It still changes its direction relative to the y-axis along the orbit. It's within the xz-plane though.

Thanks
Stuffer
Win XP Pro x Core2Duo 2,1GHz x 2 GB RAM x NVidia Quadro FX 1500 256 MB

Topic author
Stuffer
Posts: 67
Joined: 03.12.2008
With us: 15 years 11 months
Location: Stuttgart, Germany

Re: Spacecraft Orientation Problem: Velocity != planes

Post #10by Stuffer » 13.05.2009, 22:54

I tried to do the same thing replacing RealtivePosition with "Sol" to achieve a target pointing towards sun.

why is it that my satellite always points to the sun with the specified axis, but after half of an orbit it makes a quick (meaning during only a small part of the orbit) rotation about this axis through about 180 degrees? And on the other side of earth it rotates through about 180 degrees again.

And despite FixedRotation{} rotates little through the whole orbit.

Thanks
Stuffer

edit: already fixed the sun/ rotating probelm
Win XP Pro x Core2Duo 2,1GHz x 2 GB RAM x NVidia Quadro FX 1500 256 MB

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Re: Spacecraft Orientation Problem: Velocity != planes

Post #11by chris » 13.05.2009, 23:57

Stuffer wrote:edit: already fixed the sun/ rotating probelm

Good to hear this. So what problem remains? Just orienting the model correctly with respect to its body axes?

--Chris

Topic author
Stuffer
Posts: 67
Joined: 03.12.2008
With us: 15 years 11 months
Location: Stuttgart, Germany

Re: Spacecraft Orientation Problem: Velocity != planes

Post #12by Stuffer » 14.05.2009, 00:09

That the velocity vector is still not fixed related to the body axis.
I observed it for some time and I think the point is that the satellite doesn't follow a circular orbit around earth but it seems to me that it's kind of a sinuous line.
But I'm not clear about why this happens. I only used Selden's SSC where the EllipticalOrbit is a circular orbit (SemiMajorAxis 10000).

edit: Actually it performs kind of an '8' and doesn't orbit around(!) earth at all.
Win XP Pro x Core2Duo 2,1GHz x 2 GB RAM x NVidia Quadro FX 1500 256 MB

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Re: Spacecraft Orientation Problem: Velocity != planes

Post #13by chris » 14.05.2009, 00:15

Stuffer wrote:That the velocity vector is still not fixed related to the body axis.
I observed it for some time and I think the point is that the satellite doesn't follow a circular orbit around earth but it seems to me that it's kind of a sinuous line.
But I'm not clear about why this happens. I only used Selden's SSC where the EllipticalOrbit is a circular orbit (SemiMajorAxis 10000).

edit: Actually it performs kind of an '8' and doesn't orbit around(!) earth at all.

Please post the satellite definition then so I can take a look...

--Chris

Topic author
Stuffer
Posts: 67
Joined: 03.12.2008
With us: 15 years 11 months
Location: Stuttgart, Germany

Re: Spacecraft Orientation Problem: Velocity != planes

Post #14by Stuffer » 14.05.2009, 00:37

here it is:

Code: Select all

    "MySatellite" "Sol/Earth"
    {
       Class "spacecraft"
       NormalizeMesh false
       MeshScale 1
       Mesh "flyinglaptop.cmod"
       MeshCenter [-15 50 75]
   Radius 1000

   Emissive true

       EllipticalOrbit { SemiMajorAxis 10000 Period 1 Inclination 45}

        BodyFrame       { BodyFixed     { Center "Sol/Earth" } }
        FixedRotation   { }


   Orientation  [ 90 0 0 1 ]

    }
    # Orient satellite so it always points toward the Earth
    # with fixed orientation relative to orbit

    Modify "MySatellite" "Sol/Earth"
    {
        BodyFrame
        {
            TwoVector
            {
                Center "Sol/Earth/MySatellite"
                Primary   
                {
                    Axis "x"
          RelativePosition {Target "Sol/Earth"}
                }
                Secondary   
                {
                    Axis "y"
          RelativeVelocity {Target "Sol/Earth"}
                }
            }
        }
    }


thanks in advance
Stuffer
Win XP Pro x Core2Duo 2,1GHz x 2 GB RAM x NVidia Quadro FX 1500 256 MB

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Re: Spacecraft Orientation Problem: Velocity != planes

Post #15by chris » 14.05.2009, 01:12

Stuffer wrote:here it is:
thanks in advance

It's working fine for me (though I'm using a different model, of course.) The y-axis points exactly opposite to the velocity vector and the x-axis points at Earth. Which version of Celestia are you using?

--Chris

Topic author
Stuffer
Posts: 67
Joined: 03.12.2008
With us: 15 years 11 months
Location: Stuttgart, Germany

Re: Spacecraft Orientation Problem: Velocity != planes

Post #16by Stuffer » 14.05.2009, 01:15

I think I was mistaken by the sinuous line. Probably it was working properly but I looked at it with a wrong expectation.
I changed inclination and now it's as I expect it to be again. Sorry for misleading.

But the vel. vector problem still remains.
edit: it's going back and forth with the body axis as kind of a base line. Like a periodic swinging.

I'm currently using 1.5.1

Does this cause the difference?

Stuffer
Win XP Pro x Core2Duo 2,1GHz x 2 GB RAM x NVidia Quadro FX 1500 256 MB

Topic author
Stuffer
Posts: 67
Joined: 03.12.2008
With us: 15 years 11 months
Location: Stuttgart, Germany

Re: Spacecraft Orientation Problem: Velocity != planes

Post #17by Stuffer » 14.05.2009, 01:24

can I define a place on earth's surface as target for the provided function? With long/lat?
For a target pointing mode, e.g. for observation reasons.
Win XP Pro x Core2Duo 2,1GHz x 2 GB RAM x NVidia Quadro FX 1500 256 MB

Avatar
Chuft-Captain
Posts: 1779
Joined: 18.12.2005
With us: 18 years 11 months

Re: Spacecraft Orientation Problem: Velocity != planes

Post #18by Chuft-Captain » 14.05.2009, 06:38

If you already have the Earth selected (and Location display enabled) then it's possible to use the ENTER menu to select any of the "locations" already defined for Earth.
I think you then should be able to track it as for any other selected object.
(I would assume this is also possible in a script )
EDIT: I forgot to mention that you can of course define your own "Locations" as well.

If this fails, you can always place an object at the required position using an SSC definition and then select that object.

CC
"Is a planetary surface the right place for an expanding technological civilization?"
-- Gerard K. O'Neill (1969)

CATALOG SYNTAX HIGHLIGHTING TOOLS LAGRANGE POINTS

BrianJ
Posts: 63
Joined: 17.07.2008
With us: 16 years 4 months

Re: Spacecraft Orientation Problem: Velocity != planes

Post #19by BrianJ » 15.05.2009, 15:16

Hi,
sorry to jump in on this thread but I'm having a similar problem regarding spacecraft orientation.

Quick question: Can the "Two Vector frame" be used with a sampled orbit (.xyz file)?

I want my spacecraft to point it's Solar Panels(y-axis)toward the sun, while it's x-axis points along the velocity vector (although x-axis orientation is for convenience/testing purposes)

The orbit .xyz file is referenced to the Earth (works fine).

Here's what I have in my .ssc file:

Code: Select all

"Herschel" "Sol/Earth"
{
   Class      "spacecraft"
   Mesh      "herschel.3ds"
   Radius      0.004
   Beginning      "2009 05 14 13:42:00"
   Ending      "2014 02 06 13:42:00"
   SampledOrbit   "herschel.xyz"
}

Modify "Herschel" "Sol/Earth"
{
BodyFrame {
TwoVector {
Center "Sol/Earth/Herschel"
           Primary    {
                  Axis "y"
                  RelativePosition { Target "Sol" }
              }

         Secondary {
                  Axis "x"
                  RelativeVelocity { Target "Sol" }
              }
       }
   }
}


The orientation starts off OK (see first image) but after two years simulated time it has drifted off considerably (see second image)

1st image http://img198.imageshack.us/img198/6607/cel1.jpg
2nd image http://img198.imageshack.us/img198/1740/cel2.jpg

Although I note that the Sun always remains exactly in the spacecraft x-y plane (just not always on the y-axis!).

Any suggestions as to how I can maintain the y-axis pointing at the Sun?

Many thanks,
Brian

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Re: Spacecraft Orientation Problem: Velocity != planes

Post #20by selden » 15.05.2009, 15:44

The position of the object (OrbitFrame + xyz trajectory) is handled separately from the orientation of the object (BodyFrame TwoVector + FixedRotation).
Selden


Return to “Add-on development”