Jump to content

Rotating solar panels (Unity configuration)


Raknark

Recommended Posts

Hi, since there does not seem to be any information as how to make rotating solar panels I decided to give it a shot.

First, the important definitions:

MODULE

{

name = ModuleDeployableSolarPanel

sunTracking = true

raycastTransformName = suncatcher

pivotName = solarPivot

isBreakable = false

resourceName = ElectricCharge

chargeRate = 0.75

powerCurve

{

key = 206000000000 0 0 0

key = 13599840256 1 0 0

key = 68773560320 0.5 0 0

key = 0 10 0 0

}

}

sunTrackting : does the solar panel track the sun? (true/false)

raycastTransformName : name of the object in Unity that acts as the solar panel face.

when "suntrakting" is enabled the "pivotName" object will rotate to optimize the amount of sunlight that hits this object.

PivotName : name of the object in Unity that will rotate so that the optimal amount of sunlight hits the "raycastTransformName" object.

IsBreakable : can the panels break? breakpoint is the "pivotName" object (true/false)

resourceName : name of the resource that the part generate, in the case of solar panels this is of course "Electriccharge"

chargeRate : maximum chargeRate when the panels directly face the sun.

powerCurve : how the angle towards the sun influence the chargeRate. (I have no idea how the values actually influence this.)

Here is my test solar panel in Unity that I used to figure this out.

mxXWB9X.png

1. base 2. solarPivot 3. suncatcher 4.global axis

(4) I used the global x axis as my attachment point (node_attach =0,0,0,1,0,0)

(1&2)The solarPivot object will rotate around the local y axis. I am not sure if it is the “base†or “solarPivots†y-axis, so in order to be sure I lined up the local y axis of both objects.

(3) I used a plane for the “suncatcher†object, since the raycast transformation function will also include the back of the “suncatcher†object if it is a mesh object. This means that if you use a mesh object sometimes your solar panel will face away from the sun but still be considered to be in the optimal position.

Test panel in action.

08h5ctU.png

Link to comment
Share on other sites

Wow this is great, I've been trying to figure out solar panels myself but wasn't having much luck.

Have you tied creating all of that with a deploy and retract animation as well? I got stuck trying to figure that out as my test panel wouldn't trigger as being open after animating.

Link to comment
Share on other sites

Mwahahaa! you are my new favourite person. I had given up working this out and have been working on other projects until now,

I have a solar anim / deployable, so I will hook up my model with your data tomorrow and report back the results. Thx to Hoojiwana for the heads up on this epic mod info release!

The TARDIS may have to wait!

Link to comment
Share on other sites

powerCurve
{
key = 206000000000 0 0 0
key = 13599840256 1 0 0
key = 68773560320 0.5 0 0
key = 0 10 0 0
}

The numbers in the key mean altitude from the sun, chargerate multiplier, unknown and unknown.

So the first number is the altitude panels produce no power, the second number is Kerbins altitude, the third is Jools, and the first is the surface of the Sun.

Link to comment
Share on other sites

  • 5 weeks later...
There any info out there on how to set this up for deployable panels? I'm trying to make panels that fold out from a tank and then sun track...

That's simple. You animate the panels folding out, and then use the animation module for part configurations, and then add the sun tracking.

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 months later...

is there a way to change the power curve to something more realistic? I would like to send probes to eeloo with more difficulty then it takes now. I've also found out that the lowest altitude froms one end of the powercurve (if you go lower it the e/s stays the same and the hihger altitude is the minimum.

Link to comment
Share on other sites

  • 1 month later...

i gave a try making some Solar panel, everything is fine (suncatching, pivot, extend) but one thing:

when retracting the pivot rotation instanlty jump to the extend anim end value without taking care of the current suncatching orient and then the anim play correctly but this orient "warp" is kinda annoying.

Anyone got a clue about this, i tried many things in hierachy both blender and unity and not been able to fix that yet.

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 months later...
  • 2 months later...
how do you make the suncatcher and which axis should you use to point out the capture direction?

Any part of mesh will work - no need for extra planes or empties. Local Z+ of what you signed as a suncatcher is what actually will face the sun.

is there any way to asign 2 pivots in the same module?

You may look at Kosmos Pack "Balka" part. Two modules with different pivots work well. Currently doing the same for my own part pack.

Edited by Dr. Jet
Link to comment
Share on other sites

  • 1 month later...

Could you make the raycast use reaction wheels to keep a whole satellite facing the sun? Im intending to mod a solar thermal power plant, basically it will produce thermal power.A huge mirror will reflect sunlight onto a heat exchanger, the exchanger heats up which then will propel a generator. Efficiency of solar thermal is higher by a factor of 5 than with photovoltaic solutions. But I need to figure a way to keep the mirror aligned with the sun.

Link to comment
Share on other sites

  • 3 weeks later...
Have you tied creating all of that with a deploy and retract animation as well? I got stuck trying to figure that out as my test panel wouldn't trigger as being open after animating.

Did anyone know the answer to this question? I'm having this same trouble as well.

Link to comment
Share on other sites

Did anyone know the answer to this question? I'm having this same trouble as well.

What your trouble is exactly?

1) Model your... er... model in Blender and add deployment animation

2) Import to Unity (animation MUST be imported as "Legacy") and orient/assign all parts/empties needed

3) Export to KSP

4) ???

5) PROFIT!

Link to comment
Share on other sites

Could you make the raycast use reaction wheels to keep a whole satellite facing the sun? Im intending to mod a solar thermal power plant, basically it will produce thermal power.A huge mirror will reflect sunlight onto a heat exchanger, the exchanger heats up which then will propel a generator. Efficiency of solar thermal is higher by a factor of 5 than with photovoltaic solutions. But I need to figure a way to keep the mirror aligned with the sun.

Set up ModuleDeployableSolarPanel as a fixed panel with a raycast transform for the direction on the model that needs to be pointed at the sun. Then create a plugin that looks at the same raycast transform and autopilots the ship to point it at the sun.

Link to comment
Share on other sites

  • 7 months later...
  • 3 weeks later...
Local Z+ of what you signed as a suncatcher is what actually will face the sun.

This doesnt seem to always be the case, I have no idea what is going on with my current solar panels I'm making but it doesnt seem to matter what the local orientation of the raycasttransform is they just want to face side on to the sun constantly and it looks silly, made some solar panels the other day and didn't have any problems like this at all and as you say they faced Z+ towards the sun without any complaint

Yep confirmed it doesnt matter what my raycasttransform's local direction is these panels just always face side on to the sun (I have tried with local x,y and z of the panel i used as the suncatcher facing outward, as well as making an empty in unity and parenting it to one of the panels and changing its local orientation, no luck), driving me a wee bit nuts now I cannot see quite why this is happening...

Solved the problem (well Nertea did), local Z+ of the pivot will try to face the sun, so it needs to rotate along the Y axis to face its Z+ at the sun

Edited by Squiggsy
Link to comment
Share on other sites

  • 6 months later...
Now all I need is a way to limit the angles at which the solar panel can turn, so that if the solar panel unfolds close to the base, it won't clip through it (This obviously doesn't apply to most solar panels, but it does apply to the design I was thinking of)
Link to comment
Share on other sites

  • 3 months later...
  • 1 year later...

Doubt that the unity setup has changed in the last year, but I still can't get it working:

Idc1L7Y.jpg

mount points to the y-axis, config is as follows:

MODULE
	{
		name = ModuleDeployableSolarPanel
		retractable = true
		animationName = Deploy
		//secondaryTransformName = mount
		raycastTransformName = panel 5
		pivotName = mount //local y points to _base
		isBreakable = false
		resourceName = ElectricCharge
		chargeRate = 2.64
	}

Yet it keeps rotating around the z axis. (and the animation starts deployed but I can probably fix that, seen that problem before)

It's keeping me puzzled as to what is the proper way to align these, any help greatly appreciated.

C.

 

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