Board index FlightGear Development Spaceflight

LEO targeting

Discussion about development and usage of spacecraft

Re: LEO targeting

Postby Thorsten » Wed Sep 25, 2019 9:53 am

I've never tried it with Orbiter, but I actually coded the position definition under the assumption that Orbiter users might easily interface with the program in that way - so I'm glad if this actually works.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: LEO targeting

Postby GinGin » Thu Sep 26, 2019 8:40 am

Me neither.
I will try it tonight for the deorbit thing.
It is indeed really easy to feed it with lat Lon and speed. Never thought to that before .
GinGin
 
Posts: 1580
Joined: Wed Jul 05, 2017 11:41 am
Location: Paris
Callsign: Gingin

Re: LEO targeting

Postby Thorsten » Thu Sep 26, 2019 8:44 am

Currently it takes total velocity and upward velocity (and course) - does Orbiter provide that,, or would horizontal velocity be the better option?

(Well, the difference is probably academic, come to think of it...)
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: LEO targeting

Postby GinGin » Thu Sep 26, 2019 8:51 am

It should be ok.
There is a mfd giving Orbital speed or Relative speed, and vertical speed , lat Lon, and heading.
So that seems perfect :)
GinGin
 
Posts: 1580
Joined: Wed Jul 05, 2017 11:41 am
Location: Paris
Callsign: Gingin

Re: LEO targeting

Postby GinGin » Thu Sep 26, 2019 7:01 pm

I tried with Position instead of State vector, and it is giving me weird things.

I did like you said, position considered like time zero and I put in tig the time of ignition after time zero ( here 43 mn after the shuttle was in the specified position)

Maybe I am doing something wrong ?
Or it is not supposed to work the same way than when fed with state vector ?


Code: Select all
input

config

units SI
time_format MET
gravity_model spherical
earth_model spherical
burn_model constant
plot2d_resolution 200
fit_max_iterations 1000
fit verbose

position
lat 23.517
lon -44.838
alt 354500
heading 137
vup -4.25
vtot 7696.0



landing_site
name KSC




burn_peg4
name Deorbit
tig 000/00:43:00.0
thetaT 130
H 65.8
c1 14992
c2 -0.6017
ops 3





output

list
position entry_interface

plot2d
file shuttle_deorbit.dat   
x time
y altitude

end
GinGin
 
Posts: 1580
Joined: Wed Jul 05, 2017 11:41 am
Location: Paris
Callsign: Gingin

Re: LEO targeting

Postby Thorsten » Thu Sep 26, 2019 9:13 pm

Please define 'weird things' - are we looking at an unit conversion problem, something else,...?
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: LEO targeting

Postby GinGin » Thu Sep 26, 2019 9:34 pm

3 iterations and calculator stops ( whatever the parameters I put in Peg4)

Position datas come from there
Almost circular Orbit abeam KSC

Image


Could you try to run the config line I Put?

Also, I don't really know if the TIG I put is valid with the position data, as we don't specify a time like with the state vector ( But I understood it was time zero with position)
I will try to compare in FG with state vector and position from a same scenario, see if it converges towards same results
GinGin
 
Posts: 1580
Joined: Wed Jul 05, 2017 11:41 am
Location: Paris
Callsign: Gingin

Re: LEO targeting

Postby Thorsten » Fri Sep 27, 2019 6:57 am

Maybe I am doing something wrong ?


You've selecting SI units but assume that the PEG-4 parameters still are imperial units - the fit can neither accomodate a height of 65 m nor a c1 of 14992 m/s which is why it fails. If you convert these parameters into meters and m/s, it converges nicely.

How a time offset is parsed I have to check...

Edit: Seems MET is not parsed inside a position declaration, that is not the intended behavior and I'll make a fix available.

Until then, you can edit parser.cxx to look for the block

Code: Select all
      else if (block == "state_vector")
         {
         if (key == "met")
            {
            if (options.time_format_flag == 0)
               {
               options.initial_met = atof (element.c_str());
               }
            else if (options.time_format_flag == 1)
               {
               options.initial_met = converter.parse_time(element);
               }
            }

         }



and insert

Code: Select all
      else if (block == "position")
         {
         if (key == "met")
            {
            if (options.time_format_flag == 0)
               {
               options.initial_met = atof (element.c_str());
               }
            else if (options.time_format_flag == 1)
               {
               options.initial_met = converter.parse_time(element);
               }
            }

         }


right below, this seems to work
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: LEO targeting

Postby GinGin » Fri Sep 27, 2019 10:57 am

Perfect Thorsten, Thanks.
Indeed for the unit, I naively thought Peg4 was always in Imperial.

I am using Tig from position zero, like a base time, it is working perfectly so far.
And your addition for a MET coupled with the initial position will be even handier.

Here in Orbiter:


https://www.orbiter-forum.com/showthread.php?p=598433#post598433
GinGin
 
Posts: 1580
Joined: Wed Jul 05, 2017 11:41 am
Location: Paris
Callsign: Gingin

Re: LEO targeting

Postby Thorsten » Sat Sep 28, 2019 4:11 pm

I've posted the code of a 0.42 bugfix release.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: LEO targeting

Postby GinGin » Sat Sep 28, 2019 9:54 pm

Thanks
GinGin
 
Posts: 1580
Joined: Wed Jul 05, 2017 11:41 am
Location: Paris
Callsign: Gingin

Re: LEO targeting

Postby Ad106 » Thu Oct 29, 2020 11:17 am

Guys,

I'm trying to experiment with the Leo Targeting tool, but stuck at the first hurdle. Can anyone explain in plain language how to actually run the tool.

I'm running a command from the windows command line...no idea if this is correct? For example:

C:\>leo_targeting\leo_targeting test.cfg
Reading test.cfg for configuration.
Unable to open file test.cfg !

But it gives me a the 'unable to open test.cfg'

If anyone could take me back to step one? I'm an experienced pilot and flight simmer, but simple coding stuff eludes me. Thanks.

I should add, my end goal is to create PEG-4 targets for Shuttle insertion and de-orbit. The shuttle sim is amazing.
Last edited by Ad106 on Thu Oct 29, 2020 11:23 am, edited 1 time in total.
Ad106
 
Posts: 12
Joined: Thu Oct 29, 2020 11:11 am

Re: LEO targeting

Postby Johan G » Thu Oct 29, 2020 11:22 am

First a quick question: Have you at least skimmed through the tutorials (see link in first post)?
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6629
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: LEO targeting

Postby Ad106 » Thu Oct 29, 2020 11:24 am

Yeah, I've been through the tutorial. But how do I 'run' the program? I create a test file as in tutorial.
Ad106
 
Posts: 12
Joined: Thu Oct 29, 2020 11:11 am

Re: LEO targeting

Postby GinGin » Thu Oct 29, 2020 1:29 pm

I'm trying to experiment with the Leo Targeting tool, but stuck at the first hurdle. Can anyone explain in plain language how to actually run the tool



Hello.
I will go through a short tuto then :)

First, leo_targeting file.
It should look like that ( I put it on the desktop)
PEG 4 is a personnal file, should not be there.

Image


Then within the config file, you should have several config files and the leo_targeting application .exe

Image



You need to fire the cmd tool ( not in administrator), and navigate to the location where is your leo_targeting .exe with the "cd" command

desktop/leo_targeting/config in the example

Image



Then we run the program.
In red, the name of .exe we want to run.
In green, the name of the config file we want te be run within the previous program

Image



If it converged, you will see something like that

Image




my end goal is to create PEG-4 targets for Shuttle insertion and de-orbit.


You should then be interested with the last dev version, where it is really handy to use real PEG 4 values ( for Orbit/deorbit and AOA) as the MECO target is well in par with real one

https://sourceforge.net/p/fgspaceshuttledev/code/ci/development/tree/



Some value for Orbit PEG 4 with last dev version to put in the config file

Code: Select all
launch_site
name KSC
lat 0.0
lon 0.0


burn_peg4
name OMS2
tig  APOGEE
thetaT   315
H APOGEE height wanted
c1 0.0
c2 0.0
ops 1




I copy/paste an answer I made to @Gomendio in flight topic, it might be more usefull there

PEG 4 is only available and usefull for Orbit Insertion (OPS1) and Deorbit (OPS3)
The page here is quite helpful for the handling of the soft
http://www.science-and-fiction.org/science/leo_05.html

It is better to use the external soft, allowing much more iterations ( only 30 in the sim to avoid overstressing the cpu)
But if you have a good computer, I can show which line to modify to allow more in sim iterations, and avoid exporting the state vector into a config file.

For example, if you take the last dev version with iss scenario ( 2 mn before countdown for ISS window), you end up in Orbit with a very close to real parameters.
You can use those parameters for PEG 4 and a good insertion.

Image

I played just with The Ht ( height ) paramter to have a higher targeted apsis
You see that the PEG 4solution converges and give some PEG 7 parameters, ready to be fired at next apogee.
you can try those kind of parameters for OPS 1insertion, though a good PEG prograde burn ( DVx) at the Apogee is as good.

Image

Which gives a good insertion, ready for Rendez Vous phasing and a small out of plane burn to reduce Relative Inclination ( which will vary anyway with nodal precession)

Image



For OPS3, same problem.
Better to be on an almost circular Orbit, deorbit burn forecasted 45 mn before Landing Site, and standard OPS 3 deorbit parameters for a 150 Nm circular Orbit

Image


If you use those paramters for the scenario in the launcher, you should be good for a PEG 4 OPS 3 try
(Scenario that goes with the tutorial http://wiki.flightgear.org/Flying_the_Shuttle_-_Deorbit_Preparation_Advanced)

Code: Select all
#Deorbit for KSC// one Orbit before
--aircraft=SpaceShuttle-mission
--lat=28.0
--lon=-60.0 
--heading=138.0
 


We got some pretty decent solution
Though it is far better to do it with the LEO tool, much more accurate for reentry range and Perigee at Entry Interface ( two examples below)

Image

Image
GinGin
 
Posts: 1580
Joined: Wed Jul 05, 2017 11:41 am
Location: Paris
Callsign: Gingin

PreviousNext

Return to Spaceflight

Who is online

Users browsing this forum: No registered users and 5 guests