SDK Question Touchdown points definition 2016

mike-c

Member
Joined
Jun 30, 2015
Messages
82
Reaction score
0
Points
6
imagine your vessel. it stands on the Touchdown-points right?

what happens, if you deploy a landing gear. the wheels move ...
down!
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
Ok using Fred's formula. I get this for my msl rover

Code:
static TOUCHDOWNVTX tdvtx[ntdvtx] = {
    { _V(0, .001, 1.5), 5883, 4142, 3.2, 0.8 },
    { _V(-2, .001, -2.6), 5883, 4142, 3.2, 0.4 },
    { _V(2, .001, -2.6), 5883, 4142, 3.2, 0.4 }

It moves great. That is it doesn't flip over.
tYA1c2F.jpg


But it seems to pitch down on the pad.

3KPa4yY.jpg


And if I raise the touchdown y values it lowers the vessel.


So is there a level area for testing of touchdown poinjts?
 

Ripley

Tutorial translator
Donator
Joined
Sep 12, 2010
Messages
3,133
Reaction score
407
Points
123
Location
Rome
Website
www.tuttovola.org
gattispilot, when you finally solve your touchdown pioints issues, I'll open one of the good bottles I keep for those special occasions!

:cheers:
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,842
Reaction score
2,105
Points
203
Location
between the planets
But it seems to pitch down on the pad.

I can't see your screenshots from behind the school firewall, but your code tells me that all your points have the same stiffness and damping.

But if you have, for example, two points to the rear left and right, and one point to the front center, then the one in the front is carrying more mass than the two rear points, since they can distribute the mass among each other. Ergo, the front point must have a higher stiffness.

And if I raise the touchdown y values it lowers the vessel.

Of course. You're essentially raising the wheels when you do that.
 

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
gattispilot, when you finally solve your touchdown pioints issues, I'll open one of the good bottles I keep for those special occasions!

:cheers:

Sounds like one of those reasons to heat up the big pot of chili :stirpot:
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
Of course. You're essentially raising the wheels when you do that.
Oh!!
Thanks.

So you are not raising the bottom of the mesh?

Ok on the rover.

This gives me about 0 pitch:
Code:
static TOUCHDOWNVTX tdvtx[ntdvtx] = {
    { _V(0, .001, 1.5), 13883, 12142, 3.2, 0.8 },
    { _V(-2, .001, -2.6), 5883, 4142, 3.2, 0.4 },
    { _V(2, .001, -2.6), 5883, 4142, 3.2, 0.4 }

Up on the slscrawler it uses the old style of touchdown points and it is pitched down when raised up.

And as mentioned earlier We need a way to tell the suspension to compress/extent according to the terrain
 

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 you are not raising the bottom of the mesh?

No. Remember what I already tried to explain you: The mesh is only for beauty. It generally serves no purpose, is a user interface in the best case.

The CoG of a vessel is the reference for everything. When you lower your wheels, you increase the distance between CoG and touchdown points = The vessel raises.

Takes some thinking to get into the different frames of reference. When you stand on the ground and look at the crawler, you see it differently than the crawler operator.
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,842
Reaction score
2,105
Points
203
Location
between the planets
So you are not raising the bottom of the mesh?

No. The 0,0,0 coordinate of the mesh will by default be placed on your CoG. There's methods to offset that if you need to, but usually you don't.

And as everything else, the touchdown points also are relative to the CoG, but not really connected to anything else. You can move the mesh without affecting them. You can move the touchdown points without affecting your thruster positions. You can move your thrusters without affecting your dockports. And so on.
In effect, what you're doing when you move CoG, is move everything else. But if you move any of the other parts in relation to the CoG, all the other things remain unaffected.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
We think it is a tounchdown issue.
This vessel is good when Landed. I can placed it using scn editor.

But it you drop the vessel it just spins around.

Code:
static const DWORD ntdvtx_geardown = 3;
static TOUCHDOWNVTX tdvtx_geardown[ntdvtx_geardown] = {
	{ _V(0, 9.4, 22), 26150800, 18409627, 1.6, 0.1 },
	{ _V(-20, 9.4, -22), 26150800, 18409627, 3.0, 0.2 },
	{ _V(20, 9.4, -22), 26150800, 18409627, 3.0, 0.2 }
};
Code:
void SLSTOWER2::clbkSetClassCaps(FILEHANDLE cfg)
//void SLSTOWER2::SetTransporter()
{
	// physical specs
	SetSize(60);
	//SetEmptyMass(1170000000000000000);3,730,000
	SetEmptyMass(4000000);
	SetCW(0.3, 0.3, 0.6, 0.9);
	SetWingAspect(0.1);
	SetWingEffectiveness(0.1);
	SetCrossSections(_V(950,838.24,1080));
	SetRotDrag(_V(0.1, 0.1, 0.1));
	if (GetFlightModel() >= 1) {
		SetPitchMomentScale(1e-4);
		SetBankMomentScale(1e-4);
	}
	SetPMI(_V(.88, .99, .84));
	SetTrimScale(0.05);
	SetCameraOffset(_V(0, 1.2, 0));
	SetTouchdownPoints(tdvtx_geardown, ntdvtx_geardown);
e2VKaal.jpg
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,666
Reaction score
100
Points
78
Just a very quick note: if you used my formula then 26.150.800 should maybe be 2.615.080 for the stiffness? And damping goes along
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
Thanks I will adjust. Of course the tower doesn't have springs,....

But I haven't tried releasing ucgo cargo and seeing what it does.
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,666
Reaction score
100
Points
78
Thanks I will adjust. Of course the tower doesn't have springs,....

But I haven't tried releasing ucgo cargo and seeing what it does.

Every object in orbiter now has springs: it's the way orbiter simulates ground contact, for everything
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
Well I guess Dan will need to keep that in mind when Ummu for 2016 comes out.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
Ok. I want to see if I have it correct. There are 3 points of contact just has before. The additional contacts are for collison detection,.... right?

So like a car or Shuttle A where you would have 4 points of contact. How would you push up on the vessel to represent the spring force of the 4 point?
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,842
Reaction score
2,105
Points
203
Location
between the planets
Can somebody tell me how I calculate exact load distribution of asymetrically placed points?

Let's say I have 3 touchdown points at asymetric locations relative to the CoG, how do I calculate appropriate stiffness values so that the thing ends up in level?

---------- Post added at 05:15 PM ---------- Previous post was at 03:18 PM ----------

Never mind, hobbled something together by distributing mass proportional to distance from CoG that seems to work reasonably well. Here it is in case somebody else has use for it:

EDIT: Had a bug in a line, fixed now.

Code:
/**
* \brief Creates the default triangle of attachment points for this vessels landing gear.
* If there is no hullshape, the points created by orbiter will be used.
* \note There must be at least 3 landing gears on the vessel for this method to work!
* \returns A vector with size 3.
* \note Assumes that the ground-contact plane is perpendicular to the y-axis, does not work for other arrangements!
*/
void setDefaultTdStiffness(TOUCHDOWNVTX *IN_OUT_tdarray, double displacement)
{
	vector<double> proportional_loads(3);
	double proportional_sum = 0.0;
	//calculate proportional loads
	for (UINT i = 0; i < 3; ++i)
	{
		double propdist_from_cog = (abs(IN_OUT_tdarray[i].pos.x) + abs(IN_OUT_tdarray[i].pos.z));
		//guard against division by zero
		if (propdist_from_cog == 0)
		{
			proportional_loads[i] = 1;
		}
		else
		{
			proportional_loads[i] = 1 / propdist_from_cog;
		}
		proportional_sum += proportional_loads[i];
	}
	
	//normalise the proportional loads so the total sum is 1, calculate the effective load and the required stiffness.
	//we'll take a default damping value for now.
	double mass = vessel->GetMass() * 2;
	double normaliser = 1 / proportional_sum;
	for (UINT i = 0; i < 3; ++i)
	{
		double effective_load = (proportional_loads[i] * normaliser) * mass;
		double stiffness = effective_load / displacement;
		IN_OUT_tdarray[i].stiffness = stiffness;
		IN_OUT_tdarray[i].damping = TD_DAMPING;
	}
}
 
Last edited:

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
I am going to try on a vessel. But what does your TD points code look like?
 

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,448
Reaction score
462
Points
83
Website
orbit.medphys.ucl.ac.uk
Code:
double propdist_from_cog = (abs(IN_OUT_tdarray[i].pos.x) + abs(IN_OUT_tdarray[i].pos.z));

I haven't looked at the code closely enough yet to fully understand it, but the above line stuck me as odd. I would have expected

Code:
double propdist_from_cog = hypot(IN_OUT_tdarray[i].pos.x, IN_OUT_tdarray[i].pos.z));
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,842
Reaction score
2,105
Points
203
Location
between the planets
I haven't looked at the code closely enough yet to fully understand it, but the above line stuck me as odd. I would have expected

Since I only need the proportional distances, that struck me as a waste of cycles... :p
 

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,448
Reaction score
462
Points
83
Website
orbit.medphys.ucl.ac.uk
Since I only need the proportional distances, that struck me as a waste of cycles... :p

You mean you are only interested in approximate results? However, since the difference can run up to a factor of 2^0.5 when |x|=|z|, the loss of accuracy could be quite significant.

Another thing: Your code seems to assume that the load is a function of distance from the projected CoG _only_, but that isn't true. If you have three points with the same proportional distances, but two of them close together, then their loads will be lower than that of the third point.

I did think about this problem, but never managed to come up with an analytic solution. It quickly gets difficult, in particular if there are more than 3 points involved. I suspect that there may not be a closed solution, and you have to resort to an iterative optimisation using a numerical model for the spring compressions.
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,842
Reaction score
2,105
Points
203
Location
between the planets
You mean you are only interested in approximate results? However, since the difference can run up to a factor of 2^0.5 when |x|=|z|, the loss of accuracy could be quite significant.

I'm not sure I follow... I need the distances proportional to each other. Is a+b not proportional to sqrt(a^2 + b^2)?

Another thing: Your code seems to assume that the load is a function of distance from the projected CoG _only_, but that isn't true. If you have three points with the same proportional distances, but two of them close together, then their loads will be lower than that of the third point.

Huh, yes, that is certainly true. darn.
On the other hand, the whole computation is only used for a hack to provide scenario editor with something reasonable to place the vessel. It's not actually used during normal operation, since there the landing gears are represented by actual touchdown points, so I guess it's close enough in most situations. Will have to keep an eye on it, though...
 
Top