Vessel BepiColombo

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,708
Reaction score
2,683
Points
203
Location
Dallas, TX
Ixpwpke.jpg


So on the shield it has an attachment point that rotates. Not sure what speed though. But it should rotate at 15rpm and then press a key and the then detach with a bit of z force, right?
Code:
if (ROTATE==1) {//equals 1 if you want to rotate else 0
		

		 ANGULAR_VEL = 2 * PI * (.25);


		
	}
	if (ROTATE == 0)ANGULAR_VEL = 0;
	xp1 = arm1_tip[1] - arm1_tip[0]; normalise(xp1);
	xr1 = arm1_tip[2] - arm1_tip[0]; normalise(xr1);
	double phi = ANGULAR_VEL * simt;
	ROT = _V(sin(phi), cos(phi), 0);
	SetAttachmentParams(VStar, _V(0, .085, -1), ROT, _V(0, 0, 1));
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,708
Reaction score
2,683
Points
203
Location
Dallas, TX
So this is what I have.
https://drive.google.com/open?id=1lhQ8fWAm4Bg4TiVSnZavs2xuQssuRXTb

ikN5quk.jpg

The scn is the assembly after launch so panels,.... are stored.

Keys are 1 deploy shields.
2 lock/track solar shields. Must be deployed

Shield 1 starts spinning MMO and 2 detach
MMO 3,4,5 operate antenna and masts

The MPO and MMO use reaction wheels (Shift+Numberpad) Thanks BrainJ for this


One issue was/is the MMO. The heatshield rotates it via attachment point. But when it dettached it fell thru the shield rather than projecting forward. And not sure what keeps the mmo spinning?
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,708
Reaction score
2,683
Points
203
Location
Dallas, TX
So this is what I have code wise for the Heatshield:
Code:
MMO = CreateAttachment(false, _V(0, .085, - 1), _V(0, 1, 0), _V(0, 0, 1), "MMO", false);
Code:
void BepiShield::clbkPostStep(double simt, double simdt, double mjd)
{
	

	if (ROTATE==1) {//equals 1 if you want to rotate else 0
		

		 ANGULAR_VEL = 2 * PI * (.15);


		
	}
	if (ROTATE == 0)ANGULAR_VEL = 0;
	xp1 = arm1_tip[1] - arm1_tip[0]; normalise(xp1);
	xr1 = arm1_tip[2] - arm1_tip[0]; normalise(xr1);
	double phi = ANGULAR_VEL * simt;
	ROT = _V(sin(phi), cos(phi), 0);
	SetAttachmentParams(MMO, _V(0, .085, -1), ROT, _V(0, 0, 1));
	


	



}

Code:
if (key == OAPI_KEY_1)
{
	if (ROTATE == 0)ROTATE = 1;
	else ROTATE = 0;
	return 1;
}
if (key == OAPI_KEY_2)
{
	DetachChild(MMO,2);
	return 1;
}

So how do I get the MMO to go straight away from the Heatshield. It goes down thru the shield. and what maintains the rotation on the MMO?

I think I can make it docked and attached not sure if that will work

I think on the MMO spinning I need some force to maintain the spin, right?
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,616
Reaction score
2,337
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
I think your coordinate system is odd... do you really use ROT as direction vector there?

Also, I think you need to set the state of the detached vessel to the correct rotation because Orbiter does not know that the attachment rotates.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,708
Reaction score
2,683
Points
203
Location
Dallas, TX
I think your coordinate system is odd... do you really use ROT as direction vector there?





So should the Rotation remain the same but changed the Direction?


Also, I think you need to set the state of the detached vessel to the correct rotation because Orbiter does not know that the attachment rotates.


Makes sense not sure how to do that though.



Do you think the MMO regulates the rotation rate or it just take the spin from the launch device?

---------- Post added at 03:28 PM ---------- Previous post was at 08:40 AM ----------

Fixed the rotation of direction:
Code:
if (ROTATE == 0)ANGULAR_VEL = 0;
	xp1 = arm1_tip[1] - arm1_tip[0]; normalise(xp1);
	xr1 = arm1_tip[2] - arm1_tip[0]; normalise(xr1);
	double phi = ANGULAR_VEL * simt;
	DIR = _V(sin(phi), cos(phi), 0);
	SetAttachmentParams(MMO, _V(0, .085, -1), DIR, _V(0, 0, 1));

So how to get the MMO to rotate once released also?
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,616
Reaction score
2,337
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Do you think the MMO regulates the rotation rate or it just take the spin from the launch device?


Both. Also you should make sure the PMI is correct and you set a nutuationDamper... AFAIR Orbiter supports this since 2010.



Any spin stabilized satellite must make sure its rotation rate is controlled - if it can vary too much, attitude control will get hard. But for saving fuel, they are usually spun up by the launch device.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,708
Reaction score
2,683
Points
203
Location
Dallas, TX
Thanks
Code:
void MMO::clbkSetClassCaps(FILEHANDLE cfg)
{
	// physical specs
	SetSize(2);
	SetEmptyMass(255);//5456
	SetCW(0.3, 0.3, 0.6, 0.9);
	SetWingAspect(0.1);
	SetWingEffectiveness(0.1);
	SetCrossSections(_V(1.67,2.20,2.79));
	SetRotDrag(_V(0.1, 0.1, 0.1));
	if (GetFlightModel() >= 1) {
		SetPitchMomentScale(1e-4);
		SetBankMomentScale(1e-4);
	}
	SetPMI(_V(.27, 1.28, 1.39));

Looked up nutuation damper
https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19730016786.pdf

But how to add into orbiter
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,708
Reaction score
2,683
Points
203
Location
Dallas, TX
Will look at sdk. But if like an reaction wheel. I have code for that.

---------- Post added 11-29-18 at 05:10 AM ---------- Previous post was 11-28-18 at 06:26 PM ----------

So if like a reaction wheel.
Code:
VECTOR3 avel = _V(0, 0, 0);
	GetAngularVel(avel);
	double dt = oapiGetSimStep();
	double drot = RAD * 2 * dt;

	if (KEYMOD_SHIFT(kstate))
	{
		if (KEYDOWN(kstate, OAPI_KEY_NUMPAD2))
		{
			if (avel.x < RAD * 10)
			{
				avel.x = avel.x + drot;
				if (avel.x > RAD * 10) avel.x = RAD * 10;
			}
		}

I have been back going over mass and thrust.

From the factsheet
MTM mass:1100kg
MPO mass 1200kg
MPOSIF mass 145kg (125=20 spin device)
MMO 255KG

1400 fuel mass. But not sure if that divided between MTM and MPO. Both have thrusters.

MPO:
https://www.cosmos.esa.int/web/bepicolombo/mpo

has 4 22N and 4 10K plus 4 reaction wheels


https://nssdc.gsfc.nasa.gov/nmc/spacecraft/display.action?id=BEPICLMBO

Here it mentions a single 4000N thruster on the Solar-Electric Propulsion Module (SEPM)
which is the MTM
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,708
Reaction score
2,683
Points
203
Location
Dallas, TX
Thanks to Brian Now the MMO spins on release:
Code:
void MMO::clbkPreStep(double SimT, double SimDT, double MJD) {


	if (!GetAttachmentStatus(MMOSHIELD) && (mmo_rot ==0))//not released and not starting spinning
{
		//GetStatus();
		VESSELSTATUS2 vs;
		memset(&vs, 0, sizeof(vs));
		vs.version = 2;
		GetStatusEx(&vs);
		vs.vrot.z = PI / 2 + vs.vrot.z;

		GlobalRot(_V(0, 0, 0.3), vel_offset);
		vs.rvel = vs.rvel + vel_offset;
		DefSetStateEx(&vs);
		mmo_rot = 1;//released
		solp_status = 0;//operate the HGA
	}
}
Code:
MMOSHIELD = CreateAttachment(true, _V(0, 0, -.488), _V(0, 1, 0), _V(0, 0, 1), "mmo", true);
But it needs to project forward and centers from the shield.

I assume the MMO uses reaction wheels? to keep it in orbit


Got her onto a rocket:
z5sEB8h.jpg
 
Last edited:

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,708
Reaction score
2,683
Points
203
Location
Dallas, TX
So another project I am working on.

So I decided to go with just Docking the MMO. Then when undocked it starts spinning.
But I get weird results and ctd when reloading:

Code:
mpo:Bepi_MPO
  SOLP 4 0.2500 0 0.0000 0.0000
  PANELEXT 1 1.0000
  MAGNET 1 0.0000
  MAGNET1 0 0.0000
  HGA 0 0.0000
  STATUS Orbiting Earth
  RPOS -4453935.200 -6177.744 -5396944.491
  RVEL 5822.7164 11.5400 -4811.1642
  AROT -67.137 66.216 -178.474
  VROT 0.4115 -0.7876 0.5748
  AFCMODE 7
  PRPLEVEL 0:1.000000
  DOCKINFO 0:0,mtm
  NAVFREQ 0 0
  XPDR 0
END
MOSIF:Bepi_MOSIF
  STATUS Orbiting Earth
  RPOS -4453936.912 -6178.715 -5396944.304
  RVEL 5822.7164 11.5400 -4811.1642
  AROT -67.137 66.216 1.526
  VROT -0.4115 0.7876 0.5748
  ATTACHED 0:0,mpo
  AFCMODE 7
  DOCKINFO 0:0,mmo
  NAVFREQ 0 0
END
mmo:Bepi_MMO
  SOLP 4 0.2500 3 0.2500 
  MAGNET 1 1.0000
  MAGNET1 1 1.0000
  MED_HGA 0 0.0000
  STATUS Orbiting Earth
  RPOS -4453936.798 -6179.306 -5396943.382
  RVEL 5822.6823 11.5302 -4811.1649
  AROT -1.815 52.254 -140.630
  VROT -0.2823 -0.6463 -0.2653
  AFCMODE 7
  DOCKINFO 0:0,MOSIF
  NAVFREQ 0 0
  XPDR 0
END
Code:
ClassName = BEPISHIELD
;Module = BEPISHIELD

Meshname = BepiColombo\MOSIF
Mass = 125
Size = 10.0
;COG_OverGround = 1
TouchdownPoints = 0 -5.5 1 -1 -5.5 -1 1 -5.5 -1

BEGIN_DOCKLIST
 0 .085 -.663  0 1 0  0 0 1
END_DOCKLIST


BEGIN_ATTACHMENT
P -.2 .2 -1.123  0 1 0  0 0 1 XS ; to MPO
END_ATTACHMENT
and dock info for MMO:
hDockMMO = CreateDock(_V(0, 0, -.488), _V(0, 1, 0), _V(0, 0, 1));

The reason I switched was I could spin the attachment and MMO but when releashed it didn't go straight out along z axis

---------- Post added at 03:04 PM ---------- Previous post was at 04:58 AM ----------

Confused:(

I have the MOSHIP attached and so the MMO will dock to it.

I made a simple cfg for it.

dock for heat shield

BEGIN_DOCKLIST
0 .085 -.663 0 1 0 0 0 1
END_DOCKLIST


Dock for MMO
BEGIN_DOCKLIST
0 0 -.488 0 1 0 0 0 -1
END_DOCKLIST


I get a ctd when reloading after docked?

---------- Post added 12-03-18 at 04:48 AM ---------- Previous post was 12-02-18 at 03:04 PM ----------

So I redid the arrangements and used attachment points fot MTM to MPO and MOSIF. The dock the MMO.

But when I dock it moves away. In the scn it is still docked and a ctd when reloading.
MOSIF
Code:
ClassName = BEPISHIELD
;Module = BEPISHIELD

Meshname = BepiColombo\MOSIF
Mass = 125
Size = 10.0
;COG_OverGround = 1
TouchdownPoints = 0 -5.5 1 -1 -5.5 -1 1 -5.5 -1

BEGIN_DOCKLIST
 0 .085 -.663  0 0 1  0 1 0
END_DOCKLIST


BEGIN_ATTACHMENT
P -.2 .2 -1.123  0 1 0  0 0 1 XS ; to MPO
END_ATTACHMENT
MMO cfg:
Code:
ClassName = BEPI_MMO
;Module = BEPISHIELD

Meshname = BepiColombo\\Bepi_MMO4
Mass = 125
Size = 10.0
;COG_OverGround = 1
TouchdownPoints = 0 -5.5 1 -1 -5.5 -1 1 -5.5 -1

BEGIN_DOCKLIST
 0 0 -.488  0 0 -1  0 1 0
 END_DOCKLIST


SCN
Code:
BEGIN_SHIPS
mtm:Bepi_MTM
  PANEL1 1 0.0000
  SOLP 0 0.2500 3 0.2500
  PANELEXT 0 0.0000
  PANELEND 0 0.0000
  eng_conf 1 
  STATUS Orbiting Earth
  RPOS -3516918.267 -4282.293 -6050300.790
  RVEL 6526.6420 13.4553 -3799.7976
  AROT 26.119 -51.749 -168.265
  VROT 0.7937 0.5445 0.4060
  RCSMODE 2
  AFCMODE 7
  PRPLEVEL 0:0.999992
  NAVFREQ 0 0
  XPDR 0
END
mpo:Bepi_MPO
  SOLP 4 0.2500 0 0.0000 0.0000
  PANELEXT 1 1.0000
  MAGNET 1 0.0000
  MAGNET1 0 0.0000
  HGA 0 0.0000
  STATUS Orbiting Earth
  RPOS -3516916.767 -4282.002 -6050299.529
  RVEL 6526.6420 13.4553 -3799.7976
  AROT 26.119 -51.749 11.735
  VROT -0.7937 -0.5445 0.4060
  ATTACHED 0:0,mtm
  AFCMODE 7
  PRPLEVEL 0:1.000000
  NAVFREQ 0 0
  XPDR 0
END
MOSIF:Bepi_MOSIF
  STATUS Orbiting Earth
  RPOS -3516915.327 -4281.203 -6050298.436
  RVEL 6526.6420 13.4553 -3799.7976
  AROT 26.119 -51.749 -168.265
  VROT 0.7937 0.5445 0.4060
  ATTACHED 0:0,mpo
  AFCMODE 7
  DOCKINFO 0:0,mmotest
  NAVFREQ 0 0
END
mmotest:Bepi_MMOtest
  STATUS Orbiting Earth
  RPOS -3516916.030 -4280.167 -6050298.674
  RVEL 6526.6414 13.4559 -3799.7976
  AROT 39.746 -46.747 177.569
  VROT 0.3693 0.3070 0.2328
  AFCMODE 7
  DOCKINFO 0:0,MOSIF
  NAVFREQ 0 0
END
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,708
Reaction score
2,683
Points
203
Location
Dallas, TX
No clue. If the heatshield (mosif) is docked to the MMO no issues. But if I attach the shield to another vessel the mmo becomes undock.
Code:
Meshname = BepiColombo\MOSIF
Mass = 125
Size = 10.0
;COG_OverGround = 1
TouchdownPoints = 0 -5.5 1 -1 -5.5 -1 1 -5.5 -1

BEGIN_DOCKLIST
 0 .085 -.663  0 0 1  0 1 0
END_DOCKLIST


BEGIN_ATTACHMENT
P -.2 .2 -1.123  0 1 0  0 0 1 XS ; to MPO
END_ATTACHMENT
Code:
Meshname = BepiColombo\\Bepi_MMO4
Mass = 125
Size = 10.0
;COG_OverGround = 1
TouchdownPoints = 0 -5.5 1 -1 -5.5 -1 1 -5.5 -1

BEGIN_DOCKLIST
 0 0 -.488  0 0 -1  0 1 0
END_DOCKLIST
and the scn shows it docked:
Code:
mtm:Bepi_MTM
  PANEL1 1 0.0000
  SOLP 4 0.2500 0 0.0000
  PANELEXT 1 1.0000
  PANELEND 1 0.0000
  eng_conf 0 
  STATUS Orbiting Earth
  RPOS -4454219.572 -6179.108 -5396711.213
  RVEL 5822.4319 11.5251 -4811.4682
  AROT 4.139 58.244 -130.050
  VROT -0.4532 -0.7948 0.5211
  AFCMODE 7
  PRPLEVEL 0:1.000000
  NAVFREQ 0 0
  XPDR 0
END
MOSIF:Bepi_MOSIF
  STATUS Orbiting Earth
  RPOS -4454219.436 -6179.114 -5396711.630
  RVEL 5822.4319 11.5251 -4811.4682
  AROT -175.861 -58.244 130.050
  VROT -0.4532 0.7948 -0.5211
  ATTACHED 0:0,mtm
  AFCMODE 7
  DOCKINFO 0:0,mmotest
  NAVFREQ 0 0
END
mmotest:Bepi_MMOtest
  STATUS Orbiting Earth
  RPOS -4454219.155 -6179.937 -5396710.076
  RVEL 5822.4321 11.5249 -4811.4681
  AROT -40.808 44.881 -174.602
  VROT -0.1411 -0.0300 0.0120
  AFCMODE 7
  DOCKINFO 0:0,MOSIF
  NAVFREQ 0 0
END

Here in the image it shows docked but you can see isn't aligned and moves away
SeWz2ah.jpg
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
You can force spinning on release using states.
For MMO you will need "released" and "active" states.

On creation, if undefined, you can make MMO default to "released".
If that's the case, you add rotation and immediately change the status to "active".

You also need to handle states in reading and writing scenarios, but it's all IF logic, nothing complicated.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,708
Reaction score
2,683
Points
203
Location
Dallas, TX
Thanks. I had the MMo if undocked then start spinning. The reason I went with dock versus attachments was when docked it went forward away from the ship.

With attachment it when up thru the shield when detached.

But now I have the issue of the dock.
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
When my docking scenarios get messed up (and they do), I start fresh with a DG and add one vessel at a time.
It's the only way to find out where the problem is.
The numbers always look fine to me... so I've given up looking at them.

For rotation, you can fake it by animating the entire mesh ;)
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,708
Reaction score
2,683
Points
203
Location
Dallas, TX
Thanks. Yes I added a dg and docked with the mmo no problem. Dock with the shield no problem. It is when the shield attaches then it becomes undock but docked.


So make a parent for all animations and rotate at 15 RPm?

---------- Post added at 07:39 PM ---------- Previous post was at 09:37 AM ----------

So here is the MOSIF and MMO docked not issues:
eiM1qai.jpg

I then create the MPO and no issue until I attach the MOSIF to the MPO
and rotate the two. It shows the MMO still docked.
qbNTBGd.jpg
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,708
Reaction score
2,683
Points
203
Location
Dallas, TX
idQStPt.jpg


So the dock is good. But if I attach the shield to another vessel then the MMO flows away.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,708
Reaction score
2,683
Points
203
Location
Dallas, TX
So I am out of ideas. For some reason I can not dock and attach. I would use dock but because of the size of the different vessels.

I made simple cfg to remove my dll

Code:
Meshname = BepiColombo\Bepi_MPO6
Mass = 125
Size = 10.0

BEGIN_ATTACHMENT
P 0 .30 -1.170    0 1 0   0 0 -1
END_ATTACHMENT

BEGIN_DOCKLIST
 .197 .127 1  0 0 1  0 1 0
END_DOCKLIST

and MMO
Code:
Meshname = BepiColombo\\Bepi_MMO5
Mass = 125
Size = 10.0
;COG_OverGround = 1
TouchdownPoints = 0 -5.5 1 -1 -5.5 -1 1 -5.5 -1

BEGIN_DOCKLIST
 0 0 -.488  0 0 -1  0 1 0
END_DOCKLIST

So it docks good until I attach the MPO to anything.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,708
Reaction score
2,683
Points
203
Location
Dallas, TX
So going to use attachments. But I have an issue. When I release the MMO it does rotate but it release up thru the shield. I want it to move forward.

release from MOSIF
Code:
if (key == OAPI_KEY_2)
{
	//DetachChild(MMO,2);
	OBJHANDLE hChild = GetAttachmentStatus(MMO);
	DetachChild(MMO, 1.0);
	if (oapiIsVessel(hChild)) {
		VESSEL *vChild = oapiGetVesselInterface(hChild);
		VECTOR3 avel;
		avel.data[0] = 0;
		avel.data[1] = 0;
		avel.data[2] = 66 * RAD;
		vChild->SetAngularVel(avel);
	}
	return 1;
}

Code:
MMO = CreateAttachment(false, _V(.4, -.1, - 1.123), _V(0, 1, 0), _V(0, 0, -1), "MMO", false);
And the MMO has this as an attachment.
Code:
MMOSHIELD = CreateAttachment(true, _V(.4, .04, -.9), _V(0, -1, 0), _V(0, 0, -1), "mmo", true);
F9fhYJB.jpg
 
Last edited:

Majid

Active member
Joined
Oct 31, 2014
Messages
156
Reaction score
27
Points
43
You can DetachChild with 0 m/s as second argument to have 0 m/s release velocity, then before you set the angular velocity use DefSetState to set your relative velocity to the desired value.
 
Top