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 10-16-2016, 12:40 PM   #76
Urwumpe
Certain Super User
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by gattispilot View Post
 It works good.
Yes, because those touch down points have no dampers. If I understand martins correctly, the ALT and AROT lines represent the assumed stable state when the spacecraft came to rest. Leave rest when ALT and AROT are nonsense, and the simulation goes wild.
Urwumpe is offline   Reply With Quote
Thanked by:
Old 10-16-2016, 01:00 PM   #77
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

oK. So something must be wrong with those values? I got them from the DG.
Code:
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},

Whats odd is with this vessel it seems where ever I place it I am about 3-4 degrees below horizon

Last edited by gattispilot; 10-16-2016 at 01:15 PM.
gattispilot is offline   Reply With Quote
Old 10-16-2016, 01:34 PM   #78
Urwumpe
Certain Super User
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by gattispilot View Post
 oK. So something must be wrong with those values? I got them from the DG.
No, wrong is your scenario file entry for it.
Urwumpe is offline   Reply With Quote
Old 10-16-2016, 01:59 PM   #79
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Ok. So what is the fix,
Quote:
Originally Posted by Urwumpe View Post
 No, wrong is your scenario file entry for it.
gattispilot is offline   Reply With Quote
Old 10-16-2016, 02:16 PM   #80
mike-c
Orbinaut
Default

Quote:
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},
again...
try xchange tdvtx_geardown[1].pos.x
and tdvtx_geardown[2].pos.x

this would be wrong with the legacy-touchdown model, but solved it, when i had the same type of misalignment.
mike-c is offline   Reply With Quote
Old 10-16-2016, 06:08 PM   #81
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Ok I did this:
Code:
static TOUCHDOWNVTX tdvtx[ntdvtx] = {
	{ _V(0, .001, 1.5), 1e6, 1e5, 1.6, 0.1 },
	{ _V(2, .001, -2.6), 1e6, 1e5, 3,.2 },
	{ _V(-2, .001, -2.6), 1e6, 1e5, 3, .2 }//,
};
And when I apply thrust I sink thru the ground and spin
gattispilot is offline   Reply With Quote
Old 10-16-2016, 06:59 PM   #82
mike-c
Orbinaut
Default oops


honestly it worked for me, see here:
Click image for larger version

Name:	z-up.jpg
Views:	17
Size:	34.7 KB
ID:	14865
stands not moving

Code:
;Touchdownpoints = 0 4.4 -13.88  3.81 -2.2 -13.88  -3.81 -2.2 -13.88 internal added a Default 4th point
BEGIN_TD
0 4.4 -13.88 1e8 1e6 3
3.81 -2.2 -13.88 1e8 1e6 3
-3.81 -2.2 -13.88 1e8 1e6 3
0 0 10.0 1e8 1e6 3
...-
END_TD
In xy-plane an even sided triangle.
in a (CoreBooster).cfg, where the latter is a custom Syntax for .cfg
does it matter if the vessel stands z-up?

Last edited by mike-c; 10-16-2016 at 07:10 PM. Reason: spelling
mike-c is offline   Reply With Quote
Old 10-16-2016, 07:01 PM   #83
mike-c
Orbinaut
Default

Oh, you absolutly need at least 4!! Points

Code:
static TOUCHDOWNVTX tdvtx[ntdvtx] = {
	{ _V(0, .001, 1.5), 1e6, 1e5, 1.6, 0.1 },
	{ _V(2, .001, -2.6), 1e6, 1e5, 3,.2 },
	{ _V(-2, .001, -2.6), 1e6, 1e5, 3, .2 },
	{_V(0.0, 1.5, 0.0), 1e6, 1e5, 3}
}; 

//or better:

static TOUCHDOWNVTX tdvtx[ntdvtx] = {
	{ _V(0, .001, 1.5), 1e6, 1e5, 1.6, 0.1 },
	{ _V(2, .001, -2.6), 1e6, 1e5, 3,.2 },
	{ _V(-2, .001, -2.6), 1e6, 1e5, 3, .2 },
	{ _V(-2, 1.5, -2.6), 1e6, 1e5, 3, .2 } 		//not sure, if the order matters here
	{ _V(0, 1.5, 1.5), 1e6, 1e5, 1.6, 0.1 },
	{ _V(2, 1.5, -2.6), 1e6, 1e5, 3,.2 },
};

Last edited by mike-c; 10-16-2016 at 08:44 PM. Reason: complet
mike-c is offline   Reply With Quote
Thanked by:
Old 10-16-2016, 11:50 PM   #84
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

thanks. I did this:
Code:
static const int ntdvtx = 6;
static TOUCHDOWNVTX tdvtx[ntdvtx] = {
	{ _V(0, .001, 1.5), 1e6, 1e5, 1.6, 0.1 },
	{ _V(2, .001, -2.6), 1e6, 1e5, 3, .2 },
	{ _V(-2, .001, -2.6), 1e6, 1e5, 3, .2 },
	{ _V(-2, 1.5, -2.6), 1e6, 1e5, 3, .2 }, 		//not sure, if the order matters here
	{ _V(0, 1.5, 1.5), 1e6, 1e5, 1.6, 0.1 },
	{ _V(2, 1.5, -2.6), 1e6, 1e5, 3, .2 },
};
but when i move to a pad I get this. Apply thrust and I drop below the surface
gattispilot is offline   Reply With Quote
Old 10-17-2016, 11:53 AM   #85
mike-c
Orbinaut
Default

One thing too looks strange in that picture. Where is your COG (center of gravity), meters in front of the vessel? If so, it must tipover

Ok, i make a ninimal vessel and try myself with theese touchdowns.

Last edited by mike-c; 10-17-2016 at 11:53 AM. Reason: spelling
mike-c is offline   Reply With Quote
Old 10-17-2016, 11:58 AM   #86
martins
Orbiter Founder
Default

Quote:
Originally Posted by gattispilot View Post
 thanks. I did this:
Code:
static const int ntdvtx = 6;
static TOUCHDOWNVTX tdvtx[ntdvtx] = {
	{ _V(0, .001, 1.5), 1e6, 1e5, 1.6, 0.1 },
	{ _V(2, .001, -2.6), 1e6, 1e5, 3, .2 },
	{ _V(-2, .001, -2.6), 1e6, 1e5, 3, .2 },
	{ _V(-2, 1.5, -2.6), 1e6, 1e5, 3, .2 }, 		//not sure, if the order matters here
	{ _V(0, 1.5, 1.5), 1e6, 1e5, 1.6, 0.1 },
	{ _V(2, 1.5, -2.6), 1e6, 1e5, 3, .2 },
};
but when i move to a pad I get this. Apply thrust and I drop below the surface
There appear to be multiple problems with your touchdown definitions and your scenario parameters.

Isn't that crawler supposed to be huge? According to your touchdown points, its 4x4x1.5 meters. Surely that can't be right?

Didn't you want to implement critical damping? How come the spring parameters are still the same as the DG? At least you should adjust them to your crawler mass, which presumably is much larger than a DG.

This can also be the reason why your crawler sinks below the surface on activation. Simply calculate the expected displacement at equilibrium (equate the spring forces to the gravitational force) and see if it is consistent with what you see in the simulation.

Did you check out the definition of a damped harmonic oscillator? Do you understand how the spring parameters in the touchdown definitions relate to the parameters in the differential equation? The first parameter (stiffness) is called 'k' in the wikipedia entry. The second parameter (damping) is called 'c'. This should really be all that's required to understand the crawler's behaviour on the ground.

If the crawler orientation is wrong when idle (which I assume is shown in your picture) then this indicates wrong ALT and AROT parameters in the scenario, as I tried to explain a few pages before. I still don't understand where you get those from. Did you try my suggestion of dropping the crawler to the ground and let Orbiter compute those parameters itself? You can do that on the state vector tab of the scenario editor. Or if you insist, you can also do it via orbital elements, by using a degenerate orbit with zero semi-minor axis and apoapsis a few meters above the ground (although that will probably give you a substantial horizontal velocity, so I wouldn't recommend that method).

Anyway, this is really all the advice I can offer. I'll leave you to it. Good luck.
martins is offline   Reply With Quote
Old 10-18-2016, 10:37 AM   #87
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Ok. I will take a look. So using the state tab how can I raise the vessel and let drop? I am not sure about where AROT and ALT get formed either?

---------- Post added at 11:40 AM ---------- Previous post was at 07:15 AM ----------

Ok here are the points for the SSu crawler which is basically the same size:
Code:
static const DWORD ntdvtx = 4;
static TOUCHDOWNVTX tdvtx[4] = {
	{ _V(0, .001, 20), 1e5, 1e2, 0.5, 0.005 },
	{ _V(-15, .001, -20), 1e5, 1e2, 0.5, 0.005 },
	{ _V(15, .001, -20), 1e5, 1e2, 0.5, 0.005 },
	{ _V(0, 5, 0), 1e5, 1e2, 0.5 }// new point just to make a closed shape (more are not needed as the crawler is unlikely to get upside down)
};
Not sure about changing the state tab Y values to get the vessel above the ground to drop to see how it lands

---------- Post added 10-18-16 at 05:37 AM ---------- Previous post was 10-17-16 at 11:40 AM ----------

Well I placed the crawler at a good spot. Then when i applied thrust it sank below the ground. When i placed it at a pad it is tilted and below the surface.

Code:
CRAWLER:SLSCRAWLER
  STATUS Landed Earth
  POS -80.6041650 28.6038680
  HEADING 182.28
  ALT -0.186
  AROT -118.434 -2.196 171.746
  AFCMODE 7
  PRPLEVEL 0:0.999811
  NAVFREQ 0 0
END
When I raise the crawler it just drops thru the ground and spins under neath.





Code:
static const int ntdvtx = 4;
static TOUCHDOWNVTX tdvtx[ntdvtx] = {
	{ _V(0, .001, 20), 1e5, 1e2, 0.5, 0.005 },
	{ _V(-15, .001, -20), 1e5, 1e2, 0.5, 0.005 },
	{ _V(15, .001, -20), 1e5, 1e2, 0.5, 0.005 },
	{ _V(0, 5, 0), 1e5, 1e2, 0.5 }// new point just to make a closed shape (more are not needed as the crawler is unlikely to get upside down)
};

Last edited by gattispilot; 10-17-2016 at 02:53 PM. Reason: grammar
gattispilot is offline   Reply With Quote
Old 10-18-2016, 11:45 AM   #88
martins
Orbiter Founder
Default

Ok, I'll bite one last time, since this might be of general interest to other addon progammers as well.

We start with the description of the damped harmonic oscillator (see wikipedia article for more detail):

m \ddot{x} = -c \dot{x} - kx + F_{ext}

where m=mass, k=stiffness, c=damping, F_{ext} are external forces, and x is the touchdown point displacement. k and c are the suspension parameters defined in the touchdown point description.

Now, how much should you expect the suspension to compress at equilibrium on the ground? In that case of course,

F_{ext} = -mg,\; \ddot{x} = 0,\; \dot{x} = 0

so we end up simply with

x = -\frac{mg}{k}

Now, for the crawler standing upright, we have not just one but three active springs. And given your definitions the loads are unevenly distributed, with the front point effectively taking up half the crawler's weight, and the back points a quarter each. So,

x_{front} = -\frac{mg}{2k_{front}}, \qquad x_{back} = -\frac{mg}{4k_{back}}

Presumably you want x_{front} = x_{back}, so you should adjust k_{front} and k_{back} accordingly.

You may be tempted to make k large to avoid any compression, but that is not a good idea. Not only is it unrealistic, but it also leads to numerical instability, because
  • it produces changes on smaller time scales, which become difficult to capture with a given step interval. The eigenfrequency (in the undamped case) is given by \omega_0 = \sqrt{k/m}
  • Small numerical errors in x lead to large forces kx, catapulting the crawler skywards.
My recommendation would be to aim at something like

x_\mathrm{equilibrium} = -0.5

in the first instance, and then play around with that. If you don't want the crawler to actually sink into the ground, (and since in the particular case of the crawler it is probably expected to be in equilibrium at all times), you could simply compensate by setting the touchdown points at x_{equilibrium} below the actual mesh position (in other words, you assume that the suspension compression is already represented by the mesh).

Once you have reasonable values for k, you can find the values for c that lead to critical damping:

c = 2 \sqrt{mk}

Personally, I would probably go for slight underdamping, but just play around with it.

Quote:
Not sure about changing the state tab Y values to get the vessel above the ground to drop to see how it lands
Why do you use cartesian coordinates for this? With polar coordinates, you can manipulate the altitude directly. Also use a rotating frame so that you can easily zero out the velocity relative to the ground.

Edit: One more thing: Since your crawler is presumably designed to occasionally carry payload around, this will have an influence on the value of m to use. Either you design the suspension according to the crawler+ max. payload mass, or you implement an automatic or adjustable suspension that can be stiffened to account for the additional weight without scraping the floor. (And if the payload is not centered above the crawler's CoG, that makes things even more interesting.)
martins is offline   Reply With Quote
Old 10-18-2016, 04:25 PM   #89
Hlynkacg
Aspiring rocket scientist
 
Hlynkacg's Avatar


Default

Quote:
Originally Posted by martins View Post
 Ok, I'll bite one last time, since this might be of general interest to other addon progammers as well.
It very much was, I was actually about to post my own request for clarification but that just about covers every question I had. Thank you Professor.
Hlynkacg is offline   Reply With Quote
Thanked by:
Old 11-05-2016, 10:58 AM   #90
jedidia
shoemaker without legs
 
jedidia's Avatar
Default

I can't help but notice that, while otherwise rock solid, my touchdown point arrangement freaks out under time acceleration (vessel immediately starts spinning wildly, even just at 10x) in that interim when touchdown points are being compressed but the vessel isn't in landed state yet, or has just left it (landing and takeoff, in other words).

I notice no such issue with the DG Mk4 and Shuttle-A, so it's got to be something I'm doing. Trouble is, I don't know what it could be. Any ideas what might cause such behavior? The thing is a tailsitter, but that should hardly matter as long as the the first 3 vertices are in the right order, right?

---------- Post added at 11:58 AM ---------- Previous post was at 01:00 AM ----------

Alright, seems like my damping values are slightly too high, so under timeaccel the unloading of the springs throws the vessel into a heavy spin because of the large timestep.

This'll get tricky to balance for a dynamic system like IMS. Here I go to do some more math...
jedidia 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 03:57 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.