Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Space Flight Simulator > Orbiter SDK
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Orbiter SDK Orbiter software developers post your questions and answers about the SDK, the API interface, LUA, meshing, etc.

Reply
 
Thread Tools
Old 09-07-2016, 09:24 PM   #1
gattispilot
Addon Developer
 
gattispilot's Avatar
Default Touchdown points definition 2016

I hope some one can help me figure out how to define the touchdown points for 2016.

I have looked at the Delta Glider. I have a red cube at the touchdown points.


Code:
static const DWORD ntdvtx_geardown = 13;
static TOUCHDOWNVTX tdvtx_geardown[ntdvtx_geardown] = {
	{_V( 0   ,-2.57,10   ), 1e6, 1e5, 1.6, 0.1},
	{_V(-3.5 ,-2.57,-1   ), 1e6, 1e5, 3.0, 0.2},
	{_V( 3.5 ,-2.57,-1   ), 1e6, 1e5, 3.0, 0.2},
	{_V(-8.5 ,-0.3 ,-7.05), 1e7, 1e5, 3.0},
	{_V( 8.5 ,-0.3 ,-7.05), 1e7, 1e5, 3.0},
	{_V(-8.5 ,-0.4 ,-3   ), 1e7, 1e5, 3.0},
	{_V( 8.5 ,-0.4 ,-3   ), 1e7, 1e5, 3.0},
	{_V(-8.85, 2.3 ,-5.05), 1e7, 1e5, 3.0},
	{_V( 8.85, 2.3 ,-5.05), 1e7, 1e5, 3.0},
	{_V(-8.85, 2.3 ,-7.05), 1e7, 1e5, 3.0},
	{_V( 8.85, 2.3 ,-7.05), 1e7, 1e5, 3.0},
	{_V( 0   , 2   , 6.2 ), 1e7, 1e5, 3.0},
	{_V( 0   ,-0.6 ,10.65), 1e7, 1e5, 3.0}
};
ShuttleA



Code:
static const int ntdvtx = 16;
static TOUCHDOWNVTX tdvtx[ntdvtx] = {
	{_V(-3  ,-3.05, 12.5), 3.5e6, 3.5e5, 3},
	{_V(-3  ,-3.05,-13.5), 3e6,   3e5,   3},
	{_V( 3  ,-3.05,-13.5), 3e6,   3e5,   3},
	{_V( 3  ,-3.05, 12.5), 3.5e6, 3.5e5, 3},
	{_V(-7.7, 0   ,-0.4 ), 3e7,   3e6,   3},
	{_V( 7.7, 0   ,-0.4 ), 3e7,   3e6,   3},
	{_V(-1.5, 3   ,13.5 ), 3e7,   3e6,   3},
	{_V( 1.5, 3   ,13.5 ), 3e7,   3e6,   3},
	{_V(-1.3, 2.8 ,17   ), 3e7,   3e6,   3},
	{_V( 1.3, 2.8 ,17   ), 3e7,   3e6,   3},
	{_V(-1.8, 0   ,18.3 ), 3e7,   3e6,   3},
	{_V( 1.8, 0   ,18.3 ), 3e7,   3e6,   3},
	{_V(-1.9, 2.2 ,-13.8), 3e7,   3e6,   3},
	{_V( 1.9, 2.2 ,-13.8), 3e7,   3e6,   3},
	{_V(-3.3, 0   ,-14.9), 3e7,   3e6,   3},
	{_V( 3.3, 0   ,-14.9), 3e7,   3e6,   3}
};

So it looks like the touchdown points are also defining the shape of the vessel?

So with the older version it was 3 points. Center and left and right rear. It told rotation and direction.

But the Shuttle A has a rectangle of the pads touching the ground.


from the sdk:
Code:
 VECTOR3 pos collision point position (vessel frame)  double stiffness suspension stiffness coefficient  double damping suspension damping coefficient  double mu isotropic/lateral friction coefficient  double mu_lng longitudinal friction coefficient (only used for first 3 points)
So we get the vector 3 point. But the other values I don't understand.

Code:
17.57.3.327 voidVESSEL::SetTouchdownPoints( constVECTOR3&pt1, constVECTOR3&pt2, constVECTOR3&pt3 ) const
Defines the three points defining the vessel's ground contact plane.
Deprecated This method has been replaced by VESSEL::SetTouchdownPoints(const TOUCHDOWNVTX∗,DW← ORD)const Parameters pt1 touchdown point of nose wheel (or equivalent) pt2 touchdown point of left main wheel (or equivalent) pt3 touchdown point of right main wheel (or equivalent)
Note
The points are the positions at which the vessel's undercarriage (or equivalent) touches the surface, specified in local vessel coordinates. The order of points is significant since it defines the direction of the normal. The points should be specified such that the cross product pt3-pt1 x pt2-pt1 defines the horizon "up" direction for the landed vessel (given a left-handed coordinate system). Modifying the touchdown points during the simulation while the vessel is on the ground can result in jumps due to instantaneous position changes (infinite acceleration). To avoid this, the
touchdown points should be modified gradually by small amounts over time (proportional to simulation time steps). This method is retained only for backward compatibility. Vessels should now use Set← TouchdownPoints(const TOUCHDOWNVTX∗,DWORD)const to define a convex hull of touchdown points. The touchdown stiffness and damping parameters are guessed according to the vessel empty mass. Therefore, SetTouchdownPoints should be called after defining the empty vessel mass with SetEmptyMass.

Last edited by gattispilot; 09-08-2016 at 05:31 PM.
gattispilot is offline   Reply With Quote
Old 09-08-2016, 11:21 AM   #2
N_Molson
Addon Developer
 
N_Molson's Avatar

Default

For the little I know "touchdown points" are now defined as a bounding polygon, so that vessels can tip off, roll over and so on... For the other values, I'd bet it has to do with springs and friction ?
N_Molson is offline   Reply With Quote
Thanked by:
Old 09-08-2016, 12:13 PM   #3
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Thanks. I get that. But with 4 points how does it know which way is forward?

I assume that the higher the value more dampness and stiffness, right.

So if you want a vessel to not jump all over the place either increase the mass or have a high dampness and low stiffness?


Quote:
Originally Posted by N_Molson View Post
 For the little I know "touchdown points" are now defined as a bounding polygon, so that vessels can tip off, roll over and so on... For the other values, I'd bet it has to do with springs and friction ?
gattispilot is offline   Reply With Quote
Old 09-08-2016, 12:20 PM   #4
martins
Orbiter Founder
Default

Quote:
Originally Posted by N_Molson View Post
 For the little I know "touchdown points" are now defined as a bounding polygon, so that vessels can tip off, roll over and so on... For the other values, I'd bet it has to do with springs and friction ?
Exactly. Instead of just defining 3 touchdown points, you now describe the complete convex hull of the vessel, so that surface interactions are defined for any vessel orientation. The 3-point definition is only retained for backward compatibility, but it will not correctly define the surface interaction any more, since it describes the vessel as a flat triangle. You need at least 4 non-coplanar points to define a volume (tetrahedron). In practice, you should specify enough points to describe a convex polyhedron that provides a reasonable surface impact volume from all angles. (Don't use more points than necessary, to keep performance high. In particular _don't_ use all the vertices of your vessel mesh!)

The two values after the position are the stiffness parameter b and damping parameter a of the damped harmonic oscillator describing the surface interaction:

m \ddot x + a \dot x + b x = 0

The third parameter is the friction coefficient.
For the first 3 touchdown points you can define two separate friction coefficients: a longitudinal one (e.g. rolling landing gear) and a transversal one (movement perpendicular to the landing gear position).

Isn't that described in the API reference?
martins is offline   Reply With Quote
Old 09-08-2016, 12:20 PM   #5
jedidia
shoemaker without legs
 
jedidia's Avatar
Default

Quote:
Thanks. I get that. But with 4 points how does it know which way is forward?
Convention. Forward on a vessel is always Z+, and the "correct" plane parallel to the ground in landed state is computed from the first three touchdown points in the list.

Quote:
Isn't that described in the API reference?
Kind of... as far as I remember, it just says "damping", "longitudional friction" and "lateral friction" or something along those lines. Enough to get a rough idea what you're dealing with, but not enough to find the equations in question when you don't know them yet.

Last edited by jedidia; 09-08-2016 at 12:22 PM.
jedidia is offline   Reply With Quote
Old 09-08-2016, 12:36 PM   #6
martins
Orbiter Founder
Default

Quote:
Originally Posted by gattispilot View Post
 So if you want a vessel to not jump all over the place either increase the mass or have a high dampness and low stiffness?
Low stiffness makes the vessel jump more. It's the equivalent of a soft spring, so exerts a low force at large spring displacement.

However, be careful when increasing the stiffness. A higher stiffness also increases the eigenfrequency of the system, which can lead to numerical instabilities in particular at higher time accelerations (large forces even at small displacements).

Regarding damping: look up "critical damping" for computing damping values that return the spring to equilibrium fastest and don't induce oscillations.
martins is offline   Reply With Quote
Old 09-08-2016, 12:37 PM   #7
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

So for a car/Land based vessel. One could make the touch down points where the wheels touch and then go up to the top. So one could just make a rectangle/box of points.

Then for the values. If you wanted the car to hug the surface. make the dampness high and the stiff low?
gattispilot is offline   Reply With Quote
Old 09-08-2016, 01:21 PM   #8
martins
Orbiter Founder
Default

Quote:
Originally Posted by gattispilot View Post
 So for a car/Land based vessel. One could make the touch down points where the wheels touch and then go up to the top. So one could just make a rectangle/box of points.
There is one subtlety here: Orbiter treats the first 3 touchdown points specially. So even if you define a car with 4 wheel contact points in a rectangle, you should adhere to that pattern: Make a "virtual" contact p1 between the two front wheels. The two back wheels are contacts p2 and p3. Set points p4 and p5 to the actual front wheel positions. Add further points for describing the box volume.

Then apply the proper friction coefficients for the first 3 points. p1 should probably have double the friction coefficient of the back wheel since it simulates two wheels.
Points p4 and p5 can have friction coefficient 0, since they are only used for impact simulation. (Its probably best to lift p4 and p5 a bit compared to p1, to make sure p1 has ground contact on uneven ground).

Edit: Or just don't define the two front wheel points at all. That will make them sink into the ground a bit when the car is tilted, but this shouldn't happen in normal operation anyway, and it avoids some potential side effects.
Quote:
Then for the values. If you wanted the car to hug the surface. make the dampness high and the stiff low?
Make the damping critical.
martins is offline   Reply With Quote
Thanked by:
Old 09-08-2016, 01:34 PM   #9
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Thanks.

Not sure what you mean here.

Quote:
Originally Posted by martins View Post
 

Make the damping critical.

Ok I will add an image of vessel and points later
gattispilot is offline   Reply With Quote
Old 09-08-2016, 01:36 PM   #10
4throck
Enthusiast !
 
4throck's Avatar
Default

Just to add that on my experiments with SC4 + Orbiter 2016 and defining just 3 points, the order of the points is not trivial.

Depending on how you set those up, your ship will tend to flip on landing.

Makes sense, since some coordinate groups might give you a good "up" normal, but invert your "left/right" or "front/back" forces, flipping the ship.

So
LAND_PT1=(0,-12.1,9)
LAND_PT2=(-4,-12.1,-9)
LAND_PT3=(4,-12.1,-9)


is different from
LAND_PT1=(0,-12.1,9)
LAND_PT2=(4,-12.1,-9)
LAND_PT3=(-4,-12.1,-9)
4throck is offline   Reply With Quote
Thanked by:
Old 09-08-2016, 01:40 PM   #11
martins
Orbiter Founder
Default

This, however, is explained in the manual, I'm pretty sure. As regards to surface friction, Orbiter infers the forward direction from the first 3 contact points p1, p2, p3 as p1 - 0.5*(p2+p3) and the lateral direction as p3-p2.

So those three points indeed don't commute.
martins is offline   Reply With Quote
Thanked by:
Old 09-08-2016, 05:27 PM   #12
Ripley
Tutorial translator
 
Ripley's Avatar
Default typo in thread's title

Since the importance of this issue and for others to find it more easily, can a mod please edit the title?
For example, from "Tounchdown point definition 2016" to "Touchdown points definition 2016"?
Ripley is online now   Reply With Quote
Old 09-09-2016, 11:06 AM   #13
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

I fixed it. Thanks

---------- Post added at 04:17 PM ---------- Previous post was at 12:32 PM ----------

OK. so my ler here are the points.
Code:
static const int ntdvtx = 9;
static TOUCHDOWNVTX tdvtx[ntdvtx] = {
	{ _V(0, -2.166, 1.5), 1e6, 1e5, 1.6, 0.2 },
	{ _V(-2, -2.166, -2.6), 1e6, 1e5, 1.6, 0.1 },
	{ _V(2, -2.166, -2.6), 1e6, 1e5, 1.6, 0.1 },
	{ _V(-2, -2.164, 1.5), 1e6, 1e5, 1.6, 0 },
	{ _V(2, -2.164, 1.5), 1e6, 1e5, 1.6, 0 },
	{ _V(-2, 1.6, -2.6), 1e6, 1e5, 1.6, 0 },
	{ _V(2, 1.6, -2.6), 1e6, 1e5, 1.6, 0 },
	{ _V(-2, 1.6, 1.5), 1e6, 1e5, 1.6, 0 },
	{ _V(2, 1.6, 1.5), 1e6, 1e5, 1.6, 0 }
};
In the image the green dots are the first 3.


So at the start it is good. I throttle forward. Other than a slight deviation of forward it is ok. Til I hit a hill? And I flip a couple of times and lay on the side.



---------- Post added 09-09-16 at 06:06 AM ---------- Previous post was 09-08-16 at 04:17 PM ----------

I try on Earth at Canaveral pad 1. Seems there is a hill there?



What is odd is Guess it rolls down as I have applied some forward thrust to keep her in place.
gattispilot is offline   Reply With Quote
Thanked by:
Old 09-09-2016, 08:01 PM   #14
Donamy
Beta Tester


Default

maybe it needs more friction.
Donamy is offline   Reply With Quote
Thanked by:
Old 09-10-2016, 01:36 PM   #15
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Well I double friction.
Code:
static const int ntdvtx = 9;
static TOUCHDOWNVTX tdvtx[ntdvtx] = {
	{ _V(0, -2.166, 1.5), 1e6, 1e5, 3.2, 0.4 },
	{ _V(-2, -2.166, -2.6), 1e6, 1e5, 3.2, 0.2 },
	{ _V(2, -2.166, -2.6), 1e6, 1e5, 3.2, 0.2 },
	{ _V(-2, -2.164, 1.5), 1e6, 1e5, 3.2, 0 },
	{ _V(2, -2.164, 1.5), 1e6, 1e5, 3.2, 0 },
	{ _V(-2, 1.6, -2.6), 1e6, 1e5, 3.2, 0 },
	{ _V(2, 1.6, -2.6), 1e6, 1e5, 3.2, 0 },
	{ _V(-2, 1.6, 1.5), 1e6, 1e5, 3.2, 0 },
	{ _V(2, 1.6, 1.5), 1e6, 1e5, 3.2, 0 }
};
I know if is a Space simulator so maybe I am expecting too much for ground travel?

One thing I noticed the shadow seem to not be affected by the surface. Even though the wheels are covered you see the full shadow.


ouch. I started to climb a hill and it spun around and landed in the surface.
gattispilot is offline   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Space Flight Simulator > Orbiter SDK


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 02:56 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 - 2017, Jelsoft Enterprises Ltd.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.