API Question ShiftCG

This is what I am trying to do. So press a key and the cruise mass drops thus changing the CoG. Then at another time press a key or automatic entry masses are dropped and now CoG is restored and capsule is level.

I know, I was already sure that you had been up to this. :lol:

But you mistake things there:

The capsule did not change the attitude when the ballast was dropped.
What was affected was the stable attitude during re-entry.

Without dropping one set of ballast, the AOA would be 0° and guided re-entry would be impossible.
 
So at the start I assume the AoA is 0. Just starting the Entry.

Then 1 set (cruise mass) dropped and then the AoA shifts as the CofG.

Then after the chute deploys the other set is dropped and the craft returns to 0 AofA.
right?

Or just Rcs to get the correct Aof A.
 
So at the start I assume the AoA is 0. Just starting the Entry.

Then 1 set (cruise mass) dropped and then the AoA shifts as the CofG.

Then after the chute deploys the other set is dropped and the craft returns to 0 AofA.
right?

Or just Rcs to get the correct Aof A.

Both. Without RCS, the capsule would tumble around the stable attitude and would be uncontrollable. The RCS is used for fine corrections. Without the CoG position, the RCS would be consuming much more fuel for holding AOA.
 
Ok. So back to the original question. So the capsule is 4.5M diameter. So should the CoG shift be (0,-2.25,0) And then stable any spin using RCs?

All SHIFTCG seems to do is visually move the mesh.

Should changing the CoG also change the Angle of Attack?
 
Should changing the CoG also change the Angle of Attack?

No. You would have to test it in free fall.

Without changing the CP the capsule will fall with 0° AOA.
With a change in CP the capsule will "fall" with the preset AOA.
 
What is CP?

So how do I change the CoG without the RCS? If the RCS is just to stablize it
 
What is CP?

So how do I change the CoG without the RCS? If the RCS is just to stablize it

Centre of pressure. It is the position where the aerodynamic forces attach to.
 
Thanks. How do I change the CP?

This is what I am trying to do:
 
Last edited:
Thanks. How do I change the CP?

This is what I am trying to do:

Try it with ShiftCG, if this doesn't work, there is a function like "EditAirfoil" or so.
 
Thanks. So if the capsule is falling towards the surface. If I shiftCG in the Y axis. Should the capsule tilt back? If it does then I can adjust the amount of ShiftCg to geta 16 degree change.
 
Thanks. So if the capsule is falling towards the surface. If I shiftCG in the Y axis. Should the capsule tilt back? If it does then I can adjust the amount of ShiftCg to geta 16 degree change.

Observe. If it does not tilt back... you need to manually shift the aerodynamic model with the meshes.
 
This is what I have in Space.
MSLSPACE_zpsesaxvmle.jpg


Then when I enter the atmosphere.
MSLAIR1_zps6okhkqnq.jpg


The pitch goes to -90. Aoa is 1.

ShiftCG just moves the mesh.

Not sure what to change?
 
Interesting.

Well I re orientated the mesh So now +Z is in the direction of the heat shield.
mslassembly1_zpsp7tnanin.jpg


But now when I try to enter the atmosphere. I can rcs to get a AOA of 25 but a pitch of -65.

ShiftCg does nothing except move the mesh
 
What aerodynamics are you using? Airfoils, or something else?
 
If you aim for an aerodynamic tilt, so the capsule can be steered during reentry, this needs the airfoils to be off-center. Below is an example I use for the Orion capsule. Note the negative signs, they required so the capsule enters ass-first.

Code:
void CEV::SetConfig2_Reentry(void)
{	SetSize (6);
	SetEmptyMass (CM_DRYMASS);
	SetPMI (_V(1,1,1));

	SetCrossSections (_V(24,28,19));
	SetWingAspect (1);
	SetWingEffectiveness (1);

	SetPitchMomentScale (-1e-4);

	SetBankMomentScale (-1e-4);
	SetRotDrag (_V(0.01,0.01,0.005));
	
	SetCameraOffset (_V(0,0,-1.8));
	SetTouchdownPoints(_V(0,-2,0),_V(-2,1,0),_V(2,1,0));
	SetSurfaceFrictionCoeff (0.2, 0.2);

	SetDockParams (_V(0,0,2.1), _V(0,0,1), _V(0,1,0));

	CreateAirfoil (LIFT_VERTICAL,   _V(0, 0.01,0.1), VLiftCoeff, 5.5, 0, 1.27);
	CreateAirfoil (LIFT_HORIZONTAL, _V(0, 0,  0.01), HLiftCoeff, 5.5, 0, 1.27);

	mode = 2;
	ReloadMeshes();
	SetThrusters2_Reentry();
}

And these are the corresponding VLift and HLift functions:

Code:
void VLiftCoeff (double aoa, double M, double Re, double *cl, double *cm, double *cd)
{
	static const double step = RAD*30.0;
	static const double istep = 1.0/step;
	static const int nabsc = 13;
//	Angle of attack	-180	-150	-120	-90		-60		-30		0		30	 60		90		120		150	  180
	static const double CL[nabsc] = {	0,	-0.12,	-0.1,	  0,	  0,	  0,	0,		0,	  0,	 0,		0.1,	0.12,	0};
	static const double CM[nabsc] = {	0,	-0.0002,-0.0004, -0.0004,-0.0003,-0.0002, 0, 0.0002, 0.0003, 0.0004, 0.0004,0.0002,	0};
	// lift and moment coefficients from -180 to 180 in 30 degree steps.

	aoa += PI;
	int idx = max (0, min (11, (int)(aoa*istep)));
	double d = aoa*istep - idx;
	*cl = CL[idx] + (CL[idx+1]-CL[idx])*d;
	*cm = ( CM[idx] + (CM[idx+1]-CM[idx])*d ) / 10;
	*cd = 0.25 + oapiGetInducedDrag (*cl, 1.27, 0.3);
}

// 2. horizontal lift component (vertical stabiliser and body)

void HLiftCoeff (double beta, double M, double Re, double *cl, double *cm, double *cd)
{
	static const double step = RAD*30;
	static const double istep = 1.0/step;
	static const int nabsc = 13;
	static const double CL[nabsc] = {	0,	-0.1,	-0.1,	  0,	  0,	  0,	0,		0,	  0,	 0,		0.1,	0.1,	0};

	beta += PI;
	int idx = max (0, min (11, (int)(beta*istep)));
	double d = beta*istep - idx;
	*cl = CL[idx] + (CL[idx+1]-CL[idx])*d;
	*cm = 0.0;
	*cd = 0.25 + oapiGetInducedDrag (*cl, 1.27, 0.3);
}
 
Now I am using Francisdrake's. Here is what I get when hitting the atmosphere
mslcapsule1_zpsxglz1lxz.jpg
 
I forgot to mention my capsule lift function is for a heads-down entry. Sorry, can't read too much in the screen shot, and I don't see a green lift vector.
Aside from this, could it be your capsule mesh is rotated by 90°?
 
Thanks. Yes. I think so. I believe the weight which are by those hatch should be on top/bottom rather than the side.

mslcapsuleorient1_zps8zncmqnr.jpg


mslcapsuleorient_zpsrlupazxg.jpg


Someone mention that the diagram may be different than orbiter also.

So I guess I need to change the airfoils?

I didn't see a lift arrow either?
 
Yes, you need to manually move the airfoils in exactly the opposite direction of ShiftCG.
 
Back
Top