Jump to content

How do wheels work?


Recommended Posts

Hullo,

I have a very simple problem here. The TR-2L ruggedized rover wheel are, in my humble opinion, quite underpowered.  The XL wheels are just stupid big and really inconvenient, but the TR-2L which are much more reasonably sized aren't powerful enough to move anything bigger than a lander can except if you use a ton of them, at which point your craft starts looking ridiculous.

So I was thinking, well, easy, I'll just edit the config files to make them just slightly more powerful, maybe at the cost of more electric charge, so that they aren't completely useless. But turns out, the config file is a bit more complicated than I anticipated.

Basically I just want to give them more torque, but here's what the motor module in the .cfg looks like

Spoiler

MODULE
    {
        name = ModuleWheelMotor
        baseModuleIndex = 0
        
        wheelSpeedMax = 59//37 208 kph
        driveResponse = 2
        
        torqueCurve
        {
            key = 0 2.0 0 0
            key = 10 1.4 0 0//2.5 2.0 0 0
            key = 52 0.5 0 0//36 0.5 0 0
            key = 58 0 0 0//38 0 0 0
        }
        RESOURCE
        {
            name = ElectricCharge
            rate = 3.5//7
        }        
        idleDrain = 0.0//0.1////0.5
    }    

My first observation was that it looks a bit dirty. If I understand correctly everything after the // symbols are comments that just don't do anything and are probably old values that should have been cleaned up at some point?

Then I just wondered why the torqueCurve section looks so darn complicated. I guess I was wrong but I thought electric motors in the real world were supposed to have sort of a flat-ish torque curve... 

So I'm just guessing here, correct me if I'm wrong... If we take the second key, 10 is a speed (in m/s presumably), and 1.4 would be the motor torque at that speed, in newton-meters or something? What are the two zeroes after that, why are they always zero for every key and why are they even there?

And if I increase these values in the torqueCurve, will the Electric Charge consumption increase as well or do I need to change the rate under RESOURCE? In other words, is that rate per second or per newton-meter of torque?

Lastly, (but this is optionnal I guess I can figure that out on my own) rather than modifying the stock cfg I'd like to make a ModuleManager patch, but how do I target the specific keys under torqueCurve? Would this work

Spoiler

@PART[WheelMed]:AFTER[Squad]
{
    @MODULE[ModuleWheelMotor]
    {
        @torqueCurve
        {
            @key,0 = 0 3.0 0 0
            @key,1 = 10 2.0 0 0
            @key,2 = 52 0.75 0 0
        }
    }
}

Thanks in advance for any help you can provide!

Link to comment
Share on other sites

The various things you supposed all sound correct to me.  

I would not trust that variable torqueCurve is actually in Newton-meters, even though the player-maintained wiki says so.  The radius of the wheel is not defined and ultimately we need force on the ground, so those numbers could be simply the in Newtons. KSP uses an underlying package for its wheel physics, and the extra layer complicates wheels in KSP.  To the extent that you care about details, I recommend that you build test craft to measure directly.

I think the 'RESOURCE:rate' is expended as a simple on/off, so will not change if you increase torqueCurve.

The third and forth numbers are slopes coming into and coming out of each point.  So if 'torqueCurve' does actually have units of N-m, the four entries have units of m/s, N-m, N-m per (m/s), and N-m per (m/s).  You can find details on the forum page for the mod AmazingCurveEditor

Your Module-Manager patch looks correct.  You can check the file ModuleManger.ConfigCache to see the effective configurations after patching.  You might find it simpler to delete all the keys and then redefine them :

@torqueCurve {
    !key = delete
    key = 0 3.0 0 0
    key = 10 2.0 -0.2 -0.2
    key = 50 0.0 -0.05  0
}
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...