Jump to content

[Plugin/Parts] Kerbal Foundries - Continuation [Latest: 1.9g]


Gaalidas

Recommended Posts

49 minutes ago, damerell said:

Is that perhaps an artefact of the very high rolling resistance in the KF plugin?

Nope, I've stripped all of that out. Even to the point of forcing the brakeTorque to 0 every physics frame... can't figure it out.

Link to comment
Share on other sites

On 4/16/2016 at 9:30 AM, lo-fi said:

I've no idea what the pogo was about... Anyway, I've got the plugin working fine with wheels in 1.1, which gives me a good basis for experimenting with suspension, grip and all that sort of stuff. I quite like Squad's idea of adaptive suspension, so I'm going to pursue my own method. I'm crossing fingers the new colliders will allow on-the-fly spring and damper updates, which would open up a load of cool possibilities. Tracks are not playing ball so far - getting a nasty explosion and Collision Enhancer Punched Through Terrain messages the moment physics starts.

 

EDIT: alright, tracks are working. We have the classic problem of runaway RPM caused by the correct grip models now being implemented, which I think I can see a neat way to fix. This is all detail stuff, though. TRACKS WORK IN 1.1, BABY!!! I used the long tracks for testing, as these have the most wheel colliders in a single part. I have to say, I really like what I'm seeing in the new colliders.

Woohoo! Those tracks were my favorite part of my mod, and indeed that module was the only part I used. Glad to hear they weren't too tricky to get going.

Link to comment
Share on other sites

On 4/16/2016 at 9:30 AM, lo-fi said:

I've no idea what the pogo was about... Anyway, I've got the plugin working fine with wheels in 1.1, which gives me a good basis for experimenting with suspension, grip and all that sort of stuff. I quite like Squad's idea of adaptive suspension, so I'm going to pursue my own method. I'm crossing fingers the new colliders will allow on-the-fly spring and damper updates, which would open up a load of cool possibilities. Tracks are not playing ball so far - getting a nasty explosion and Collision Enhancer Punched Through Terrain messages the moment physics starts.

 

EDIT: alright, tracks are working. We have the classic problem of runaway RPM caused by the correct grip models now being implemented, which I think I can see a neat way to fix. This is all detail stuff, though. TRACKS WORK IN 1.1, BABY!!! I used the long tracks for testing, as these have the most wheel colliders in a single part. I have to say, I really like what I'm seeing in the new colliders.

you cant see this right now, but i'm doing my best Mr. Burns steeple-fingered 'egggcelent' impression.

Link to comment
Share on other sites

I'm off to Whitby (as lo-fi will appreciate, deep in LNER-land) for a long weekend but I'm looking forward to seeing what's what when I get back, having decided to procrastinate until 1.1 dropped.

Link to comment
Share on other sites

 

38 minutes ago, TK421d said:

you cant see this right now, but i'm doing my best Mr. Burns steeple-fingered 'egggcelent' impression.

Lol. A lot of work to do, but I'm hacking away at it here and there when I get time. Appreciating the encouragement and enthusiasm :)

19 minutes ago, damerell said:

I'm off to Whitby (as lo-fi will appreciate, deep in LNER-land) for a long weekend but I'm looking forward to seeing what's what when I get back, having decided to procrastinate until 1.1 dropped.

Ah, very nice. I've not been to the Moors - I really should put that right. I'll be spending quite a bit of the summer in Dereham with 9466 on the Mid Norfolk, which I'm rather looking forward to. For those that don't know, we're talking steam engines - another one of my many hobbies.

When you return, I'd appreciate some help getting some sensible torque/rolling resistance curves if you're willing? No hurry, as I need to get everything behaving sanely first anyway.

Link to comment
Share on other sites

2 minutes ago, War Eagle 1 said:

Why is there no download link on the OP even for the 1.0.5 release

Read the thread a couple of pages back and don't be so darn rude.

Edited by lo-fi
Link to comment
Share on other sites

1 minute ago, War Eagle 1 said:

Wasn't trying to be rude. 

In Lo-fi's defense. You did ask twice.... Go check Spacedock it's up there. A 3rd party put it there and all of the KF Guru's let it be for now until the official release is ready.

(also I know you were asking for 1.0.5 but be careful saying anything about downloads or updates for the next few weeks. All the devs are getting hammered with 1.1 request.... Which is now banned per forum rules)

1 hour ago, lo-fi said:

......For those that don't know, we're talking steam engines.....

Worked on a lot of engines and mechanical.... Never had the privilege of stickin my Cotten picked hands in a steamer. Some amazing engineering though considering the era they are from. So is it mostly trains? Or do you also tend to play with tractors and the like?

Link to comment
Share on other sites

1 minute ago, V8jester said:

In Lo-fi's defense. You did ask twice.... Go check Spacedock it's up there. A 3rd party put it there and all of the KF Guru's let it be for now until the official release is ready.

(also I know you were asking for 1.0.5 but be careful saying anything about downloads or updates for the next few weeks. All the devs are getting hammered with 1.1 request.... Which is now banned per forum rules)

I asked twice because no one responded and i asked yesterday so when i saw he replied to other people i thought id try to catch him and ask again.

I only asked because I did no know where i could get it as it wasn't mentioned in the OP but yeah i get it.
Cant wait for this to be 1.1 though
Hope they are able to get around the clipping of wheels limitation 

Link to comment
Share on other sites

I have an ancient Land Rover I tinker with, but I will get myself a tractor one day :wink:  I do love the steamers, there's just something about them. We're lucky we have so many preserved here!

Link to comment
Share on other sites

2 minutes ago, lo-fi said:

I have an ancient Land Rover I tinker with, but I will get myself a tractor one day :wink:  I do love the steamers, there's just something about them. We're lucky we have so many preserved here!

You said steam machine a while back and I thought you were building yourself a computer to run Steam on.... Oh the brain of a millennial.

Link to comment
Share on other sites

1 minute ago, martinezfg11 said:

You said steam machine a while back and I thought you were building yourself a computer to run Steam on.... Oh the brain of a millennial.

Hehe. Understandable, it's a loooong way from steam engines to KSP modding. I like to have a broad skill set.

https://www.facebook.com/GWR-Hawksworth-Large-Pannier-Tank-9466-202746429748847/#

As far as KF goes, I'm currently experimenting with using naked U5 wheel colliders - which do have their quirks in KSP - and getting the Edy's Vehicle Physics wrapper working. 

Link to comment
Share on other sites

5 hours ago, lo-fi said:

When you return, I'd appreciate some help getting some sensible torque/rolling resistance curves if you're willing? No hurry, as I need to get everything behaving sanely first anyway.

With pleasure, but I think my basic idea is a large electric traction motor can be mostly specified for KSP with two figures: max torque (really in Nm in the new world of Unity 5, and I suggest making it per part not per wheel collider) and max power. Power (in W) is (torque * ground speed / wheel radius) - or torque * revolutions (in radians/second) if that's more convenient - and the energy charge drain per second should be proportional to that based on your favourite guess for how many Joules there are in an EC (but the same proportion for every part, probably).

That means there's a ground speed at which the engine operates at both max torque and max power. Calculate that once for each part; each tick, if ground speed is below that then apply max torque and calculate the (lower) power requirement; if it's above that, use max power and calculate the lower torque generation. There's no floatcurve for torque here at all.

Two wrinkles. There probably wants to be a minimum speed for power calculations of 0.1 m/s or so - sitting and grinding the engine without getting anywhere will drain power from internal losses in the motor. The rev limit should still exist, applying an absolute upper maximum limit to speed.

Rolling resistance is more complicated. For a given load it tends to be a constant force), hence taking power proportional to speed. The late David Mackay's Beyond Hot Air has some useful rules of thumb here, one of which is that in motor cars it is proportional to 100 Newtons per tonne of the vehicle... but of course these are motor cars on asphalt. Rolling resistance is going to be higher on rough ground - and you might say higher still with tracks, but the difference between tracked and wheeled RR is much less on rough ground where wheels suffer more. It's also interesting that even given cars' relatively poor RR, air resistance is the larger term above about 16mph; on an airless earth-like body (eg Tylo) you could get up to the rev limit on the flat with ease.

I think in U5 it's going to be straightforward to determine the actual weight (not mass) each part is bearing. I suggest assigning each part a max design load, probably directly proportional to the part's mass. If the weight on the part is exactly equal to the design load, drag is 0.08 times the weight on the part, 0.1 times if the part is tracked [1]. This does then want a floatcurve or similar; near the design load, changes in weight will change RR in direct proportion. Below half the design load, the curve will start to flatten out so that 0 weight there's still some drag (perhaps, conveniently, equal to the drag due to the part's weight alone on Kerbin, so eg a 50kg wheel weighs 500N on Kerbin so will always apply at least 40N of rolling resistance against the direction of motion); above the design load the curve should become more steep so losses spike when the part is overloaded. The calculated force can then be divided by the wheel radius to get the anti-torque to be subtracted from the engine output.

This max design load is closely related to the suspension defaults and maximum values.

[1] This is based on a total thumb in the air guess based on various figures for offroad rolling resistance which varies wildly based on the nature of the surface in question. Short of querying the biome and making things slower in Deserts than on Plains, I don't think we want to get into that.

However, these values also might be slightly better on parts with larger wheels. We might notice above that all our calculations favour tiny wheels - you can get up to your maximum power at a lower speed (and indeed this is because the same torque makes for more force on the ground). Larger wheels give a smoother ride, which is why the safety bicycle wasn't really feasible until the pneumatic tyre; an Ordinary's huge wheel gives a reasonable ride even with solid tyres.

Parts with tiny wheels would also tend to have tiny suspension travel (and hence design load) but of course the real respect in which they lose out will be the maximum speed their rev limit implies.

I'm afraid this turned into a bit of a saga. Sorry. However, I don't think any of it is really a call for immediate action, more assembling all my thoughts in one place.

Link to comment
Share on other sites

Long post completely justified there! Certainly saved me a lot of research, and we're on the same page about the torque calculation needing to be tied to rpm, not vehicle speed.

Link to comment
Share on other sites

I disagree about having a hard capped rev limit. A soft cap where the power peters off into near uselessness is better.

 

 

Perhaps, would it be possible to code it such that applying torque in the opposite direction is artificially much stronger than in the forward one? I find hill descents with the tracks rather tricky over about 5-10m/s because the torque produced at that speed is so low that the vehicle often gains speed anyway. That makes me have to hit the actual brake button, which is effectively pulling the emergency brake, and can cause frontflips.

Edited by Kenobi McCormick
Link to comment
Share on other sites

There is a hard limit in any system where work in equals works absorbed, so that's essentially what will happen. This will be a lot lower than the freewheel limit, as with any electric motor.

 

The current torque model is an odd one, and that's a fair point about reverse torque (in this context applying torque against the current direction of rotation) being very weak. I'm not sure I've ever actually tried this with an electric motor, or certainly not deliberately. What I do know - and this is something cleverly leveraged in new electric cars and hybrids - is that an electric motor used as a generator is a very effective brake. In other words, there is a precedent for this, and it's called regenerative braking. Given that we're in a space program situation, and every watt counts, it makes sense to have energy recovery from braking. Perhaps a nice tech tree upgrade for each part, if we can work than in (I've no idea how the tech tree actually works).

Link to comment
Share on other sites

Ohhhh...salivating in anticipation.  

Thanks to lo-fi and everyone else working on Foundries who put in so much work on some of the best ground vehicle parts available.  Great work as always...

Link to comment
Share on other sites

On 4/21/2016 at 11:01 AM, lo-fi said:

There is a hard limit in any system where work in equals works absorbed, so that's essentially what will happen. This will be a lot lower than the freewheel limit, as with any electric motor.

 

The current torque model is an odd one, and that's a fair point about reverse torque (in this context applying torque against the current direction of rotation) being very weak. I'm not sure I've ever actually tried this with an electric motor, or certainly not deliberately. What I do know - and this is something cleverly leveraged in new electric cars and hybrids - is that an electric motor used as a generator is a very effective brake. In other words, there is a precedent for this, and it's called regenerative braking. Given that we're in a space program situation, and every watt counts, it makes sense to have energy recovery from braking. Perhaps a nice tech tree upgrade for each part, if we can work than in (I've no idea how the tech tree actually works).

The main thing I'm getting to regarding the caps is user tweaking. With a hard cap it's a bit harder to up the top speed of the tracks should someone so desire. With the soft cap, as released, top speed remains unchanged, but changing one variable in part.cfg would let someone adjust the speed to their preferences. The soft cap would shift upwards on its own, as a function of the new torque curve. I was always fairly happy with the long tracks, which I used most often, but the short ones with three road wheels and the skidsteer micro-rover bogies always felt waaaayyyyy too slow to me. I wanted them to have speed parity with the big ones, but never did get their speed upped accordingly. The hard cap also means using reverse to slow down is outright impossible when you crest the coded in top speed, a region where using Squad's brake button is an almost guaranteed frontflip.

 

 

I quite like the idea of regenerative braking being used to give these things a bit more stopping power. Another point of using reverse as brakes is, for me and many others, analog inputs let us apply partial braking. MechJeb will do this as well if you're using its cruise control module. With regenerative braking there'd be enough force on hand at any speed to do this(IIRC this gets stronger the faster you're turning the drive motor) and you'd be able to recharge quite a bit if not all of your batteries cruising down slopes. I quite like the idea.

 

You could go poke Sarbian regarding adding regen braking as a later tech tree add-on. MechJeb splits its modules across the entire tech tree without needing a million part.cfgs for each node. Honestly, though, with how late we get rover parts in general, I'm fine with it just being the default state. By the time we've got tracks, the ability to put them into space, the ability to feed their voracious appetite for EC, we're already technologically advanced enough that knowing the principle is a foregone conclusion. Even for Kerbals. Except Jeb, he doesn't know what brakes are.

Edited by Kenobi McCormick
Link to comment
Share on other sites

On 4/20/2016 at 11:59 AM, lo-fi said:

 

Lol. A lot of work to do, but I'm hacking away at it here and there when I get time. Appreciating the encouragement and enthusiasm :)

Ah, very nice. I've not been to the Moors - I really should put that right. I'll be spending quite a bit of the summer in Dereham with 9466 on the Mid Norfolk, which I'm rather looking forward to. For those that don't know, we're talking steam engines - another one of my many hobbies.

When you return, I'd appreciate some help getting some sensible torque/rolling resistance curves if you're willing? No hurry, as I need to get everything behaving sanely first anyway.

Ah, I miss Norfork steam. I havent been to Thetford in ages.

 

I love hearing of the progress on the tacks and such. I can't wait to get my crawl on with my rovers. :D

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...