Jump to content

Mystery of the migrating bases


taniwha

Recommended Posts

As anybody who has done anything on the ground in KSP has probably noticed, things like to slide around, even on perfectly flat ground (the flats of Minmus). Well, it turns out that besides KSP's dearth of part-ground friction, there's a perfectly legitimate reason for this...

I was driving a rover in a generally southerly direction on Minmus "flats" (JNSQ Minmus lowlands/basin, but still dead flat) somewhere north of the equator... at about 25m/s. As time went by, I noticed my speed slowly creep up... 25.5, 25.6, 25.7... I shrugged it off as some sort of PhysX integration error (all the while trying to imagine what sort of errors would add up that "quickly" (10s-100s of seconds per 0.1m/s), but with the thought of Minmus itself niggling at the back of my mind)) until I crossed the equator and noticed my speed dropping. Then it hit me...

The ground on Minmus may be perfectly "flat", but the energy space is not: Minmus is spinning. Thus, no matter where you are, there is a "phantom" force vector pointing out from the rotation axis perpendicular to the axis, maximum length and vertical (local) at the equator, 0 length and horizontal (local) at the poles.

From physics, we get a = ω2r where ω is the rotation speed in radians/second, r is the radius of rotation, and a is the acceleration in m/s2.

However on a sphere, r = R cos(L) where R is the sphere's radius and  L is the latitude of ones position on the sphere, so the resulting acceleration is ω2R cos(L).

But... the local vertical component of the acceleration is not very interesting (it simply makes the object "lighter"), thus the projection of the acceleration on the local horizontal plane is of interest: a sin(L). Thus the horizontal component of the acceleration is ω2R cos(L) sin(L) or ω2R sin(2 L)/2

Thus the horizontal acceleration towards the equator is at a maximum at 45 degrees latitude north or south. For Stock Minmus, this is about 0.7mm/s2, for JNSQ Minmus about 3mm/s2, 2.5cm/s2 for stock Kerbin (not that there's anywhere flat enough to worry about), and about 1.7cm/s2 for Earth.

While this won't help keep your bases from sliding, hopefully it will satisfy your need to know why they slide. Breaking Ground's friction pads might help (untested so I can't vouch for them), but there are mods that can help nail your base to the ground and stop everything from clustering on the equator given enough time.

[For the record, I drove about 1000km over the surface of JNSQ Minmus, over the course of 4 days real-time, as low as 2m/s in some nasty spots, and as high as about 33m/s on the flats, but usually around 7-13m/s. Analog input makes a world of difference when you need a 1km turning circle to not flip (25m/s on the flats)]

Oh, I forgot to mention: while doing one of my flats runs, I took note of KSP's logged velocities when it tries to autosave and the timestamps. The resulting acceleration was very close to the expected value for my latitude and heading.

Edited by taniwha
corrected earth acceleration again
Link to comment
Share on other sites

That's excellent testing you did.  I've been bashing my head against the ground for years trying to figure out what's wrong with my bases, and finally, here it is.  Could this be applied to a mod?  If a craft is on the ground, could a mod could add a force vector that's magnitude and direction is determined by your trigonometry?

Link to comment
Share on other sites

@Entropian It could, but a better solution would be to just "nail the base to the ground". Some mods do this directly, while Extraplanetary Launchpads (one of my mods) lets you include launch clamps in your base design. Even Breaking Ground's ground science parts do something like this.

The reason I recommend against applying a computed force is due to integration errors that would result in your base still sliding (though at a much reduced rate). Just having sufficient friction should apply that force, but I I have my doubts due to the way simulations work. Thus my recommendation to just nail the thing in place using PhysX tricks (joints and other constraints). Launch clamps create a joint between themselves and local space (thus why they do really weird things when the situation goes bad).

Link to comment
Share on other sites

@Popestar The gravity is pretty much irrelevant until it gets low enough (or rotation high enough) that your velocity due to body rotation approaches orbital velocity at the surface (there are some planet mods....). Minmus is significant not because of its gravity, but because of its perfectly flat hard surfaces: anywhere else, the acceleration due to rotation is swamped by other forces (gravity pulling down a hill, drag due to water or even air, etc etc).

Thus, this is very difficult to test in this way anywhere other than Minmus.

Thus, the only reason I figured this out was that I was accelerating and then decelerating on a surface that should have induced no acceleration at all and any bumps caused by the surface actually being faceted should average out thus not adding any significant velocity over several km of travel.

That said, there is a way to test this elsewhere: create a perfectly vertical tower (probably needs to be fairly all) that has a Kerbal Attachment System winch and a weight on the end of the winch. Place the tower at 45 degrees north or south (to get maximum effect) and note the deviation from vertical of your makeshift plumb bob. The tower would have to be quite rigid, of course.

Link to comment
Share on other sites

1 hour ago, Entropian said:

That's excellent testing you did.  I've been bashing my head against the ground for years trying to figure out what's wrong with my bases, and finally, here it is.  Could this be applied to a mod?  If a craft is on the ground, could a mod could add a force vector that's magnitude and direction is determined by your trigonometry?

Yes, it is called KSP-Recall, but as Tahiwha says, it sometimes fails to stop the phantom forces(but helps most of the time). ParkingBrake may also help for temporary things, they work together. Some hardcore solutions include placing launch clamp-based parts via KIS to pin the bases(pic related), building clamps with EPL and abusing AirPark mod.  Just hope Squad will stop this mathematical munacy now and forever and resulting new bugs will be fixable.tOShdJF.jpg

Link to comment
Share on other sites

8 hours ago, taniwha said:

While this won't help keep your bases from sliding, hopefully it will satisfy your need to know why they slide.

But why ground experiments flip over and still works underground (intresting for solar panels)? And cannot be picked up and set again?

Link to comment
Share on other sites

15 hours ago, taniwha said:

For Stock Minmus, this is about 0.7mm/s2, for JNSQ Minmus about 3mm/s2, 2.5cm/s2 for stock Kerbin (not that there's anywhere flat enough to worry about), and about 1.7cm/s2 for Earth.

So for Kerbin, if there were anywhere perfectly flat to the Kerbin sphere, we this would induce a slide as if it were a slope of 0.025m/s² ÷ 9.8m/s² = 2.5 meters per kilometre.   But a coefficient of friction of just 0.0025, if implemented accurately, would stop any sliding. 

On stock Minmus,  [edit: not 6, rather 0.7mm/s²÷0.5mm/s²=  1.4 meters per kilometre.]

Earth bulges a little at the middle because of this centrifugal force, and we define 'level' to mean flat to this bulging spheroid.

There is a whirligig  planet pack that takes this to an extreme.

I do not think think centrifugal force is a significant contribution to my bases sliding.

Edited by OHara
oops, wrong Minmus; see below
Link to comment
Share on other sites

1 hour ago, OHara said:

So for Kerbin, if there were anywhere perfectly flat to the Kerbin sphere, we this would induce a slide as if it were a slope of 0.025m/s² ÷ 9.8m/s² = 2.5 meters per kilometre.   But a coefficient of friction of just 0.0025, if implemented accurately, would stop any sliding. 

On stock Minmus, 6 meters per kilometre.

The math for Kerbin seems reasonable, but is out quite a bit for Minmus. Even taking local gravity into account, I get only 1.4m/km rather than 6 (.0007/.5*1000).

One would think that a bit of friction would do the job.

Link to comment
Share on other sites

This explains so much.  Many times on Val's epic rover journey I noticed that "everything seemed downhill", except for the times it mysteriously wasn't.

val-freedom.jpg

So I spent half my time letting val roll towards the equator, and half my time pushing her away from it.

Edited by Corona688
Link to comment
Share on other sites

Had some trouble with Earth's acceleration: the other day I'd gotten 3.4, then 1.7 when I wrote the post, did some back and forth on it, then found that in my original calculations for Earth I'd forgotten to divide by 2: 1.7 is the right number.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...