Jump to content

Help with understanding how wings work


Recommended Posts

Hi all,

I am trying to create a folding wing for a space probe, something that would fold up like a solar panel for compact storage, and then unfold to generate lift. I'm hoping an expert on wings like @NathanKell or a modder with experience creating wings can answer a few questions, as I've not created a wing in KSP before. Let's say for the sake of argument that the folded wing has lift characteristics equal to the Wing Connector Type C, and the unfolded wing has lift characteristics equal to the Wing Connector Type B. For reference, the Type B wing has the following PartModule:

	MODULE
	{
		name = ModuleLiftingSurface
		useInternalDragModel = True
		deflectionLiftCoeff = 2.0
		dragAtMaxAoA = 0.5
		dragAtMinAoA = 0.0
	}

And the Type C:

	MODULE
	{
		name = ModuleLiftingSurface
		useInternalDragModel = True
		deflectionLiftCoeff = 1
		dragAtMaxAoA = 0.25
		dragAtMinAoA = 0.0
	}

Notice that the Type C, which is half the size of the Type B, has half the lifting capability, which should give you an idea of how I want the folding wing to work.

Questions

1. If I change the ModuleLiftingSurface values at runtime so that the folded wing has parameters equal to the Type C, and the deployed with has parameters equal to the Type B, will KSP honor the changes and change the wing's lift?

2. Do I understand correctly that KSP calculates a wing's lift based upon its drag cube and ModuleLiftingSurface?

Now for the fun part, assuming my answer to question 2 is "yes." From what I can see in a parachute part, there are PartModules that appear to change the drag cube for the parachute. These are ModuleDragModifier modules. Here is an example from the Mk2-R radial chute:

	MODULE
	{
		name = ModuleDragModifier
		dragCubeName = SEMIDEPLOYED
		dragModifier = 1
	}
	MODULE
	{
		name = ModuleDragModifier
		dragCubeName = DEPLOYED
		dragModifier = 58
	}

Questions

3. How is dragModifier applied to the drag cube?

4. How would I go about switching the drag cube for the folding wing? The only thing I can think of is to use semiDeployedDragModifier.enabled = false; deployedDragModifier.enabled = true; How does KSP change the drag cube for parachutes?

So basically the idea of the folding wing is that, assuming that drag cubes play a part in calculating lift, the folded wing would have a small drag cube and lift capability, while the unfolded wing has the fully deployed drag cube and lift capability.

Also, can somebody point me to a post on what the values of a drag cube mean?

Thanks for your help! :)

Link to comment
Share on other sites

1. Yes.

2. Wings don't use drag cubes for drag. Note how the dragModel is set to none or override in those wing configs.

3. When PartDatabase.cfg is created, the dragModifier is multiplied into the drag terms of all cube faces.

4. If you use a ModuleAnimateGeneric to handle the animation, it's done for you. If you're writing your own animation module, implement IMultipleDragCubes and set the cube weights yourself. But remember, if you're making a wing, the 'drag' cube is really only relevant for thermo, not drag.

 

For an overview of drag cubes and their terms, see:

 

Link to comment
Share on other sites

Ohhhhh, so all I need to do for a folding wing is to 1) use ModuleAnimateGeneric to let the game calculate the drag profile, and 2) modify the deflectionLiftCoeff and the dragAtMaxAoA/dragAtMinAoA values? That would make things much easier. :)

And thanks for the reference on drag cubrs. :)

Edited by Angel-125
Link to comment
Share on other sites

@NathanKellWoot! My prototype deployable wing works!

Here is my prototype wing stowed:

tmqy6Jg.png

And here it is deployed:

mqH94Tg.png

With this test wing I have the deflectionLiftCoeff controlled independently of the animation; now it's just a matter of linking the two together, and of course creating a proper wing..

Thanks again! :)

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...