sarbian

[1.1.x] Gimbal Trim v1.1.1 (2016-07-03) - For when you don't really want to go that way

Recommended Posts

This is a module that is here to add the one missing feature of the stock gimbal : trim.

You just put the module GimbalTrim next to a ModuleGimbal in a part and make sure to set the gimbalTransformName if the gimbal does not use the stock one.

The future : 

  • AutoTriming (like my old mod did).
  • Mode that keeps the trimming inside the gimbal default limits.

GimbalTrim.png

Config :

MODULE
{
    name = GimbalTrim	
    
    gimbalTransformName = thrustTransform // name of the transform used by the gimbal module
    
    trimRange = 30   // the range allowed for the trim (if you want all the value to be the same)
    trimRangeXP = 30 // The range in the positive direction on the X axis
    trimRangeYP = 30 // The range in the positive direction on the Y axis  
    trimRangeXN = 30 // The range in the negative direction on the X axis   
    trimRangeYN = 30 // The range in the negative direction on the Y axis    
     
    useTrimResponseSpeed = false
    trimResponseSpeed = 60	

    limitToGimbalRange = false
}

Licence : MIT

Source : https://github.com/sarbian/GimbalTrim

Download : GimbalTrim-1.1.1.0.zip

Change log :

  • v1.1 
    • Fix the typo in useTrimResponseSpeed
    • Fix the handling of engine in front of the CoM or rotated
    • Add the limitToGimbalRange option. This avoids the engine to move out of its gimbal range when using trim. If you have an engine with a -10 +10 X gimbal range and you trim it by +5 degree you will get a -15 +5 range. This is more realistic that the default mode but lower your control range when you trim.
    • AVC file
  • v1.1.1
    • Fixing the engine rotation was actually not a good idea

 

Edited by sarbian

Share this post


Link to post
Share on other sites

Does this also auto trim the gimbal to keep it pointed through CoM when flying?

Share this post


Link to post
Share on other sites

As I said in the post : not yet but it is planned.

Share this post


Link to post
Share on other sites
18 minutes ago, sarbian said:

As I said in the post : not yet but it is planned.

Oh my bad... my mind parsed out the "The future" section. I feel dumb now.

Share this post


Link to post
Share on other sites

Asymmetric-lifter aficionados, shuttle-style and otherwise, praise and thank you, Sarbian!

No more must we fly like clumsy savages, mashing the S key to haul the rocket into line by brute force! Gimbal trim: an elegant tool for a more civilized age.

Share this post


Link to post
Share on other sites

After a quick search I find many gimbalTransformName's in my games *.cfg files:

gimbalTransformName = ARI_exaust
gimbalTransformName = Bell
gimbalTransformName = Cylinder
gimbalTransformName = Cylinder_008
gimbalTransformName = EngineGimbal
gimbalTransformName = EngineGimbal_L
gimbalTransformName = EngineGimbal_R
gimbalTransformName = Engine_Cluster
gimbalTransformName = FanCore
gimbalTransformName = Gimbal
gimbalTransformName = GimbalBone
gimbalTransformName = Nozzle
gimbalTransformName = NozzleTransform
gimbalTransformName = Nozzles
gimbalTransformName = OP_C_LfOxEngine_Nozzle
gimbalTransformName = OP_ChB_Mp_Engine
gimbalTransformName = Obj_Gimbal
gimbalTransformName = SRBBell
gimbalTransformName = TBP_nozzle
gimbalTransformName = TT
gimbalTransformName = ThrustTransform
gimbalTransformName = engine
gimbalTransformName = gimbal
gimbalTransformName = gimbalBone
gimbalTransformName = gimbalTransform
gimbalTransformName = gimbal_point
gimbalTransformName = main
gimbalTransformName = nebula_exaust
gimbalTransformName = newThrustTransform
gimbalTransformName = nozzle
gimbalTransformName = nozzle_transform
gimbalTransformName = obj_gimbal
gimbalTransformName = thrustTransform
gimbalTransformName = thrust_transform
gimbalTransformName = turbonozzle
gimbalTransformName = turbothrust

So whats next? Make a MM patch for Gimbal Trim for all of it?

 

 

Share this post


Link to post
Share on other sites
1 hour ago, Kolago said:

After a quick search I find many gimbalTransformName's in my games *.cfg files:

gimbalTransformName = ARI_exaust
gimbalTransformName = Bell
gimbalTransformName = Cylinder
gimbalTransformName = Cylinder_008
gimbalTransformName = EngineGimbal
gimbalTransformName = EngineGimbal_L
gimbalTransformName = EngineGimbal_R
gimbalTransformName = Engine_Cluster
gimbalTransformName = FanCore
gimbalTransformName = Gimbal
gimbalTransformName = GimbalBone
gimbalTransformName = Nozzle
gimbalTransformName = NozzleTransform
gimbalTransformName = Nozzles
gimbalTransformName = OP_C_LfOxEngine_Nozzle
gimbalTransformName = OP_ChB_Mp_Engine
gimbalTransformName = Obj_Gimbal
gimbalTransformName = SRBBell
gimbalTransformName = TBP_nozzle
gimbalTransformName = TT
gimbalTransformName = ThrustTransform
gimbalTransformName = engine
gimbalTransformName = gimbal
gimbalTransformName = gimbalBone
gimbalTransformName = gimbalTransform
gimbalTransformName = gimbal_point
gimbalTransformName = main
gimbalTransformName = nebula_exaust
gimbalTransformName = newThrustTransform
gimbalTransformName = nozzle
gimbalTransformName = nozzle_transform
gimbalTransformName = obj_gimbal
gimbalTransformName = thrustTransform
gimbalTransformName = thrust_transform
gimbalTransformName = turbonozzle
gimbalTransformName = turbothrust

So whats next? Make a MM patch for Gimbal Trim for all of it?

 

 

I think the intention is that you add the module on a part-by-part basis. You can use a MM patch for this, but you'd want a separate entry (if you are a coding noob like myself) for each part you want to gimbal, with the correct transform name 

Edited by MrMeeb
I got shown up by a coding master

Share this post


Link to post
Share on other sites

Or use advanced MM magic :

@PART[*]:HAS[@MODULE[ModuleGimbal]:HAS[#gimbalTransformName[*]],!MODULE[GimbalTrim]]
{    
    MODULE
    {
        name = GimbalTrim
        limitToGimbalRange = true
        gimbalTransformName = #$../MODULE[ModuleGimbal]/gimbalTransformName$
    }
}

@PART[*]:HAS[@MODULE[ModuleGimbal]:HAS[~gimbalTransformName[]],!MODULE[GimbalTrim]]
{    
    MODULE
    {
        name = GimbalTrim
        limitToGimbalRange = true
    }
}

 

Edited by sarbian

Share this post


Link to post
Share on other sites

v1.1 :

  • Fix the typo in useTrimResponseSpeed
  • Fix the handling of engine in front of the CoM or rotated
  • Add the limitToGimbalRange option. This avoids the engine to move out of its gimbal range when using trim. If you have an engine with a -10 +10 X gimbal range and you trim it by +5 degree you will get a -15 +5 range. This is more realistic that the default mode but lower your control range when you trim.
  • AVC file

Download : GimbalTrim-1.1.0.0.zip

Share this post


Link to post
Share on other sites

And ... 1.1.1 : Fixing the engine rotation was actually not a good idea :)

Download : GimbalTrim-1.1.1.0.zip

 

Share this post


Link to post
Share on other sites

quick question, is this something that can be fixed on my end or do I need to ask the mod creator?

I tried with the stock cluster and it worked fine, but these mod parts are acting all weird

(btw, on my first attempt I've set the ranges to the original limits for these parts, and the result was the same, so I exaggerated to show it better)

Edited by JoseEduardo

Share this post


Link to post
Share on other sites
10 minutes ago, JoseEduardo said:

quick question, is this something that can be fixed on my end or do I need to ask the mod creator?

hum, a bit hard to explain but it does that because this is the way I coded it. The X/Y gimbal direction depends on how the model is made. I should add a setting that turn them in pitch/yaw instead (each mode has its use...)

Share this post


Link to post
Share on other sites

Very very useful.

Really looking forward to seeing this released with auto trimming, I've been missing the functionality of KM_Gimbal for shuttle engines.

Thanks sarbian!

Share this post


Link to post
Share on other sites

At risk of angering the modding gods, I ask... what would it take to get this wonderful and incredibly useful mod working in KSP 1.3? Might it be this mysterious recompile spoken of by some? Or is some other kind of sorcery required?

I can sacrifice a small animal or two if that will help. Burnt offering, maybe. Let me know.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now