Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Addons > Addons
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Addons A repository for Orbiter addons contributed by users. Developers & members may announce new releases here and discuss any Orbiter addon.

Reply
 
Thread Tools
Old 07-09-2012, 06:33 PM   #16
Urwumpe
Donator
 
Urwumpe's Avatar

Exclamation

Quote:
Originally Posted by BruceJohnJennerLawso View Post
 Just a thought with regards to the "unintentional orbital insertion bug" caused by ground docking; couldnt we just create the spacecraft, dock everything together, then land, say on the moon, with a seperate landing gear craft attached to the core ship via an att point? That should work in theory right?
It would even be better in many aspects to use attachments for such situations than the docking port, but remember that attachments are also no docking ports, it is a completely different mechanism.

Attachments permit far more freedom in the application, but have more limitations in terms of what orbiter does for you: you have to define the behavior, orbiter only helps you with a standard interface between the vessels.

Docking ports are for connecting vessels in orbit in a comfortable and mildly realistic way.
Urwumpe is offline   Reply With Quote
Thanked by:
Old 07-09-2012, 06:58 PM   #17
N_Molson
Addon Developer
 
N_Molson's Avatar

Default

Attachements are a very powerful feature (I typically use them for multi-stage rockets), as long as, as said Urwumpe, you say everything to Orbiter (extra empty mass, extra fuel mass, extra aerodynamic drag, displacement of the CoG, etc etc...)

Docking, in my opinion, is interesting only in-flight "dynamic" situations. It is certainly possible to reproduce the docking behavior using attachments, it's just an useless pain when you just want to dock two vessels.

The way I see it, docking is a particular case of attachment, an handy shortcut Martins made available to us.
N_Molson is offline   Reply With Quote
Thanked by:
Old 07-09-2012, 07:07 PM   #18
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

I agree. But there are things you can do while docked but not attached. Transfer of Ummu for one.

I still not sure about the shadow tanks coding. I am going to add an elevator so the tank can be raised/lowered into the leg.
gattispilot is offline   Reply With Quote
Old 07-09-2012, 07:14 PM   #19
Urwumpe
Donator
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by gattispilot View Post
 I still not sure about the shadow tanks coding. I am going to add an elevator so the tank can be raised/lowered into the leg.
I see, you need enlightenment... let me just get same life back into my legs, and then I will explain things to you ...

When I am done, you will likely yell at me why I explained something that simple so complicated...
Urwumpe is offline   Reply With Quote
Old 07-09-2012, 08:57 PM   #20
Urwumpe
Donator
 
Urwumpe's Avatar

Default

Here you have the algorithm explained, it isn't really that complex.
Attached Thumbnails
External Fueltank system.png  

Last edited by Urwumpe; 07-09-2012 at 09:16 PM. Reason: Poor version of the drawing
Urwumpe is offline   Reply With Quote
Old 07-09-2012, 09:16 PM   #21
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

ok. Lets me see if I have this right:

Since there are 4 spaces for tank. I need 4 shadow tanks. so make 4 propellant resource for the shadow tanks.

How does one move the fuel from the shadows in the main?
Wouldn't you have to do this equally or a shift would occur?

So if a tank is attached then add fuel into shadow tank 1 which feeds into the main tank, right.
"
Make the "fuel tank vessel" with one standard propellant resource (config file should do it). every post step, you synchronize the level of the shadow tank in the eagle (which is just a copy of the tank in the fuel tank vessel) to the fuel tank vessels propellant resource (Same propellant mass in both tanks). Repeat this for all attached tanks and their shadow tanks in the Eagle."
gattispilot is offline   Reply With Quote
Old 07-09-2012, 09:21 PM   #22
Urwumpe
Donator
 
Urwumpe's Avatar

Default

Depends on how YOU want it, you need to implement it. You could refuel the main tank from all tanks equally, by calculating how much fuel you need to transfer every timestep and then divide this amount by the number of tanks. Or select the tanks you want manually, for example draining a tank faster to have only empty and almost full tanks after landing, for swapping more tanks during the stop without wasting fuel.

Important is doing this with SetPropellantMass() in Prestep.

PS: As far as I see it, the Eagle can carry 8 external fuel tanks, 2 per pod.
Urwumpe is offline   Reply With Quote
Old 07-09-2012, 09:28 PM   #23
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Ok. We are going with 4, 1 per leg pod. It is for the RCS engines and Hover and not main as they are Nuclear.

The red tank that goes in the leg pod is a UCGO vessel.


some code:
H:
Code:
		

const double MAX_FUEL = 6000.0;
const double MAX_CHEMICALFUEL = 0.0;

PROPELLANT_HANDLE ph_main;
PROPELLANT_HANDLE ph_shadow1;
PROPELLANT_HANDLE ph_shadow2;
PROPELLANT_HANDLE ph_shadow3;
PROPELLANT_HANDLE ph_shadow4;
PROPELLANT_HANDLE ph_mainchemical;//this is the combo of all shadow
cpp
Code:
	ph_main=CreatePropellantResource(MAX_FUEL);
	ph_mainchemical=CreatePropellantResource(0);
	ph_shadow1=CreatePropellantResource(shadow1);
	ph_shadow2=CreatePropellantResource(shadow2);
	ph_shadow3=CreatePropellantResource(shadow3);
	ph_shadow4=CreatePropellantResource(shadow4);
...

		th_main[i] = CreateThruster (_V(0,0,0), _V(0,0,1), MAX_MAIN_THRUST, ph_main, ISP_FUS);//1 of the 4 main


		th_hover[i] = CreateThruster (_V(0,0,0), _V(0,1,0), MAX_HOVER_THRUST, ph_mainchemical, ISP_QUI);


void EAGLEFUEL::clbkPostStep(double simt, double simdt, double mjd)
// if attached then add fuel
if (GetAttachmentStatus(FUEL1))(shadow1=(shadow1+5000));
if (GetAttachmentStatus(FUEL2))(shadow2=(shadow2+5000));
if (GetAttachmentStatus(FUEL3))(shadow3=(shadow3+5000));
if (GetAttachmentStatus(FUEL4))(shadow4=(shadow4+5000));
So when I run it using Fuel MFD I get :


6 tanks but even though a tank is attached it only shows fuel in 1

Last edited by gattispilot; 09-27-2012 at 11:13 PM.
gattispilot is offline   Reply With Quote
Old 07-10-2012, 09:48 PM   #24
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Not sure why no fuel is in the shadow tanks. I think I need to add all the shadow tanks into ph_mainchemical. But not sure how to change the level in the separate tank.
gattispilot is offline   Reply With Quote
Old 07-10-2012, 10:04 PM   #25
Urwumpe
Donator
 
Urwumpe's Avatar

Default

Because you increase in poststep the maximum amount of fuel possible in the tanks, not the actual amount of fuel.
Urwumpe is offline   Reply With Quote
Old 07-10-2012, 10:40 PM   #26
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Quote:
Originally Posted by Urwumpe View Post
 Because you increase in poststep the maximum amount of fuel possible in the tanks, not the actual amount of fuel.
But shouldn't there be fuel in the shadow tank since a tank is attached. Then I guess I moved fuel from it into the mainchemical tank
gattispilot is offline   Reply With Quote
Old 07-11-2012, 06:34 AM   #27
Urwumpe
Donator
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by gattispilot View Post
 But shouldn't there be fuel in the shadow tank since a tank is attached. Then I guess I moved fuel from it into the mainchemical tank
No, because you didn't set it to have fuel inside, you actually created it with ZERO propellant mass as maximum. Remember: Attachments do almost nothing. For example not automatically duplicating propellant masses.

Also, you just increase the variable with which you defined the propellant mass, but did not change the actual propellant resource by calling the SetMaxPropellantMass function.
Urwumpe is offline   Reply With Quote
Old 07-11-2012, 12:32 PM   #28
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Quote:
Originally Posted by Urwumpe View Post
 No, because you didn't set it to have fuel inside, you actually created it with ZERO propellant mass as maximum. Remember: Attachments do almost nothing. For example not automatically duplicating propellant masses.

Also, you just increase the variable with which you defined the propellant mass, but did not change the actual propellant resource by calling the SetMaxPropellantMass function.

Thanks

so if change this:
Code:
ph_mainchemical=CreatePropellantResource(3000);
that will set the max to 3000

SetMaxPropellantMass
So do I need to do this for the shadow tanks?

wouldn't this shadow3 be 5000 since a tank is attached to Fuel3 and shadow3 is the amount of propellant in shadow3
Code:
ph_shadow3=CreatePropellantResource(shadow3);
if (GetAttachmentStatus(FUEL3))(shadow3=(shadow3+5000));
gattispilot is offline   Reply With Quote
Old 07-11-2012, 01:04 PM   #29
Urwumpe
Donator
 
Urwumpe's Avatar

Default

Well, I would operate differently there:
  • I initialize all shadow tank handles with NULL
  • I create the tanks in Post-Creation or on attaching, when I know the parameters of the external tank
  • Before saving the orbiter default parameters in clbkSaveState, I would temporarily erase the tanks so they don't appear in the saved state, and recreate them again (in case it is just a Quicksave)
  • When detaching an external tank, I would delete the shadow tank as well and set its handle to NULL again.
  • Instead of just adding a constant mass to the vehicle when something is attached, I would set the propellant mass of the shadow tank to the propellant mass of the external tank vessel

Has the advantage that the scenario file is not showing the duplicates and it crashes when your logic is wrong, instead of just letting you have extra fuel.
Urwumpe is offline   Reply With Quote
Old 07-11-2012, 01:14 PM   #30
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Quote:
Originally Posted by Urwumpe View Post
 Well, I would operate differently there:
  • I initialize all shadow tank handles with NULL
  • I create the tanks in Post-Creation or on attaching, when I know the parameters of the external tank
  • Before saving the orbiter default parameters in clbkSaveState, I would temporarily erase the tanks so they don't appear in the saved state, and recreate them again (in case it is just a Quicksave)
  • When detaching an external tank, I would delete the shadow tank as well and set its handle to NULL again.
  • Instead of just adding a constant mass to the vehicle when something is attached, I would set the propellant mass of the shadow tank to the propellant mass of the external tank vessel

Has the advantage that the scenario file is not showing the duplicates and it crashes when your logic is wrong, instead of just letting you have extra fuel.
OK. The external tank propellant tank mass would be 5000. That is why it adds 5000.

So how can I change/read the external tank propellant mass. So if attached it fuels a shadow tank and the external tank propellant level goes down.
gattispilot is offline   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Addons > Addons


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 04:08 PM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2007 - 2012, Orbiter-Forum.com. All rights reserved.