General Question Coding a parachute

sorindafabico

New member
Joined
Mar 23, 2011
Messages
1,231
Reaction score
1
Points
0
Location
Porto Alegre
I'm making a reentry veichle, it uses parachutes at its final flight stage to do a splashdown (animations are ok). I'm aware of the AddForce funcion, but I'm not really sure on how to use it (tried to set its value proportional to dynamic pressure, but had weird results and the best splashdown speed being about 40 m/s).

As I found nothing about it in samples directory, do you have any example using AddForce for parachutes?
 

BruceJohnJennerLawso

Dread Lord of the Idiots
Addon Developer
Joined
Apr 14, 2012
Messages
2,585
Reaction score
0
Points
36
I'm making a reentry veichle, it uses parachutes at its final flight stage to do a splashdown (animations are ok). I'm aware of the AddForce funcion, but I'm not really sure on how to use it (tried to set its value proportional to dynamic pressure, but had weird results and the best splashdown speed being about 40 m/s).

As I found nothing about it in samples directory, do you have any example using AddForce for parachutes?

40 m/s sounds painful :lol:. What are you making?
 

dgatsoulis

ele2png user
Donator
Joined
Dec 2, 2009
Messages
1,924
Reaction score
340
Points
98
Location
Sparta
I think the LandMod from the World of 2001 has a great model of a drogue chute and parachutes. The code is available in the Orbitersdk\Samples\2001LandMod\ once you download the addon from O-H.

Hope this helps
:cheers:
 

sorindafabico

New member
Joined
Mar 23, 2011
Messages
1,231
Reaction score
1
Points
0
Location
Porto Alegre
I think the LandMod from the World of 2001 has a great model of a drogue chute and parachutes. The code is available in the Orbitersdk\Samples\2001LandMod\ once you download the addon from O-H.

Hope this helps
:cheers:

I'll download World of 2001 and take a look. Thanks :thumbup:
 

dgatsoulis

ele2png user
Donator
Joined
Dec 2, 2009
Messages
1,924
Reaction score
340
Points
98
Location
Sparta
To save you some time:

You will find a scenario of the LandMod in action in $Orbiterroot\Scenarios\2001-A Space Odyssey\Mars\Cargo Missions\'Flinger' Missions\LandMod on Approach

Run it to see how it behaves.

For operation procedure read page 21 of $Orbiterroot\Add-on docs\World of 2001.pdf
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,588
Reaction score
2,312
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
You can better simulate parachutes by adding variable drag elements to the vessel aerodynamics. Orbiters SDK has a function for that. The advantage is, that you don't need to predict the velocity of your vessel in the future for telling the drag force during that period of time. Orbiter does that for you, you only need to define the product of drag coefficient and area.
 

francisdrake

Addon Developer
Addon Developer
Joined
Mar 23, 2008
Messages
1,060
Reaction score
864
Points
128
Website
francisdrakex.deviantart.com
Hi, below is the example I used for the chute of the CEV-Orion. It uses very basic vessel properites like CW and cross sections. Gives a touchdown speed of a few m/s.
Needs a minus-sign for the Pitch- and BankMomentScale so the vessel sinks bottom first.

Code:
void CEV::SetConfig4_Chute(void)
{
	SetSize (12);
	SetEmptyMass (8200);
	SetTrimScale (0);
	ClearAirfoilDefinitions();

	SetCW (2, 2, 1, 1);
	SetCrossSections (_V(26,26,2000));
	SetRotDrag (_V(0.5,0.5,0.3));

	SetPitchMomentScale(-2e-4);
	SetBankMomentScale (-2e-4);

	SetPMI (_V(9,9,3));

	SetTouchdownPoints(_V(0,-5,-6.9),_V(-3,-2,-6.9),_V(3,-2,-6.9));
	SetSurfaceFrictionCoeff (0.3, 0.3);

	ClearThrusterDefinitions();
	mode = 4;
	ReloadMeshes();
}
 

BruceJohnJennerLawso

Dread Lord of the Idiots
Addon Developer
Joined
Apr 14, 2012
Messages
2,585
Reaction score
0
Points
36
You can better simulate parachutes by adding variable drag elements to the vessel aerodynamics. Orbiters SDK has a function for that. The advantage is, that you don't need to predict the velocity of your vessel in the future for telling the drag force during that period of time. Orbiter does that for you, you only need to define the product of drag coefficient and area.

Apologies for the necropost, but I felt the need to bring the matter up again as neither of the solutions posted have worked. The changes in CS and CW were ineffective, probably due to being part legacy flight model.

The variable drag function works okay, & it would be excellent for a drogue chute, but It cant seem to get me slower than 28 m/s at landing.

Code:
	Para = Chutes;

	ClearVariableDragElements ();
	CreateVariableDragElement (&Para,((99999999e90)),_V(0,0,22));
	CreateVariableDragElement (&Para,((99999999e90)),_V(0,0,22));
	CreateVariableDragElement (&Para,((99999999e90)),_V(0,0,22));
	CreateVariableDragElement (&Para,((99999999e90)),_V(0,0,22));

I was wondering if anyone who has developed a similar capsule would be willing to comment? The list of manned capsules in Orbiter is somewhat short unfortunately.
 

sorindafabico

New member
Joined
Mar 23, 2011
Messages
1,231
Reaction score
1
Points
0
Location
Porto Alegre
I'm using AddForce and getting splashdown with 10 m/s, but with the odd effect of the chute behaving like a rocket if i point the vessel to the sky. Further refinement of the code needed, obviously :lol:
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,588
Reaction score
2,312
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
The variable drag function works okay, & it would be excellent for a drogue chute, but It cant seem to get me slower than 28 m/s at landing.

Have you tried it with more sane numbers? I wouldn't be surprised, if your 9E99 input parameter bursted the jackpot and made orbiters aerodynamics fail to converge.

The last time I used the variable drag elements for a parachute, I landed at 6 m/s...
 

BruceJohnJennerLawso

Dread Lord of the Idiots
Addon Developer
Joined
Apr 14, 2012
Messages
2,585
Reaction score
0
Points
36
Have you tried it with more sane numbers? I wouldn't be surprised, if your 9E99 input parameter bursted the jackpot and made orbiters aerodynamics fail to converge.

The last time I used the variable drag elements for a parachute, I landed at 6 m/s...

Nope, tried it with 1, 100, 0.001, nothing seems to be working. What really puzzles me is that the end result is so similar, regardless of what I put in as the factor value. Always decelerates to about 27-33 m/s, then floats down to the crash. My suspicion is that variable drag elements just wasn't created with this in mind, & isn't able to accept big enough values to to the job.

I'll have to take a look around the API for other options, but further help would be nice. Would you mind posting that code Urwumpe? (BTW space shuttle doesnt count :lol:)
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,588
Reaction score
2,312
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
i can post code once i have a notebook... only a matter of hours or days. currently operating by a Galaxy S3. Not sure if the example is on the external HDD but coding one is also no large job. I remember that the newer version of the aerodynamics API is needed, not the old simple functions.
 

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,271
Reaction score
3,244
Points
203
Location
Toulouse
CreateVariableDragElement (&Para,((99999999e90)),_V(0,0,22));

Correct me if I am wrong, but "99999999e90" is only a factor, no ? Can you post the definition of the concerned element ? 100 times 0 is still 0.
 

BruceJohnJennerLawso

Dread Lord of the Idiots
Addon Developer
Joined
Apr 14, 2012
Messages
2,585
Reaction score
0
Points
36
Correct me if I am wrong, but "99999999e90" is only a factor, no ? Can you post the definition of the concerned element ? 100 times 0 is still 0.

Code:
Para = Chutes
Clever little piece of code there. The variable drag function wanted a double variable instead of an integer, so I set them equal. Now that you mention it though, maybe if I set it to Para == Chutes...

Ill go see.

Edit: Nope, still getting nothing. What you said has made me wonder though, I'll have to rebuild my code with a double instead of an integer to see if that's whats causing it. Cant wait for a nice, soft splashdown.
 
Last edited:

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,271
Reaction score
3,244
Points
203
Location
Toulouse
The variable drag function wanted a double variable instead of an integer, so I set them equal. Now that you mention it though, maybe if I set it to Para == Chutes...

Caution ! Are you trying to convert an integer into a double ? Then you should use what is called a "cast", a simple "=" symbol is not enough. That would explain your problem.
 

BruceJohnJennerLawso

Dread Lord of the Idiots
Addon Developer
Joined
Apr 14, 2012
Messages
2,585
Reaction score
0
Points
36
Caution ! Are you trying to convert an integer into a double ? Then you should use what is called a "cast", a simple "=" symbol is not enough. That would explain your problem.

So Para = Chutes wouldn't cut it? Can you elaborate a bit? (example maybe...)
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,588
Reaction score
2,312
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
So Para = Chutes wouldn't cut it? Can you elaborate a bit? (example maybe...)

Generally speaking, you can convert easily from integer to double, but not the other way around.

I don't know any scenario in which "para = chutes" would result in para not being the floating point equivalent to chutes.

But are you setting para = chutes only once during vessel creation? Or once in every time-step?
 

BruceJohnJennerLawso

Dread Lord of the Idiots
Addon Developer
Joined
Apr 14, 2012
Messages
2,585
Reaction score
0
Points
36
Generally speaking, you can convert easily from integer to double, but not the other way around.

I don't know any scenario in which "para = chutes" would result in para not being the floating point equivalent to chutes.

But are you setting para = chutes only once during vessel creation? Or once in every time-step?

Every time step. I suppose it might be better to place it in a custom "chutes opening" function instead?
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,588
Reaction score
2,312
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Every time step. I suppose it might be better to place it in a custom "chutes opening" function instead?

Not really needed, but I recommend a state machine, which has the states:

Stored
Opening
Reefed
Unreefing
Deployed
Jettisoned

for example.

By gradually increasing the deployment of the parachutes, you can prevent large acceleration spikes and control issues.

Reefed is the initial deployed state of many large parachutes, with a band reducing the maximum diameter of the parachute for some time to let it stabilize and reduce the forces on the parachute. (Term comes from sailing: Reefing means reducing the area of the sail on a ship)
 
Top