KSP-RO / ROSolar

7 stars 9 forks source link

Static Solar Panel resized to small size results in physics mass different from stated part mass and thus incorrect dV of craft as calculated in MechJeb #18

Open SAOBunk opened 8 months ago

SAOBunk commented 8 months ago

A Static Solar Panel resized to 0.14x0.2m, having an area of 0.028 m^2 and using the 11.2kg/m^2 stated for a TL0, should result in a panel mass of 0.3136kg. Checking the .craft file shows that part mass is saved with a couple extra grams at 0.3360kg, a minor difference: (EDIT: TL0 panels are 12kg/m^2, and their mass is thus actually correct at 0.3360kg.) image

A test craft with 8 of these panels has the following stats in the hangar: image

However, when firing the R103 SRB from a 200x200km orbit, the resulting 200x1572km orbit does not match MechJeb's expended dV value: image This change in apoapsis shows the craft only achieved 359.8 m/s of dV. image

Performing the same experiment with a panelless craft of the same mass does result in the expected orbit and dV expenditure. image image image

This leads me to suspect that there is an issue with the part mass of very small solar panels when in a flight scene, leading to incorrect dV of craft. Strangely, the solar panel part mass of the craft in save of a KCT simulation seems to be correct: image

Both craft were created in an up-to-date express install of RO and RP-1. Solar Panel dV tester nopanel.txt Solar Panel dV tester.txt

Enlarging the panels' size to instead be 0.5x0.2m, results in a 1.2kg panel. However, the orbit achieved after performing the same test burn as before results in an orbit that is no different, even though the craft should have become heavier. image image

This suggests there's some issue where the panels somehow have a minimum mass in the physics simulation that is not reflected in their actual part configuration data, resulting in miscalculated dV values and thus failed missions.

SAOBunk commented 8 months ago

Some further testing suggests the minimum mass the solar panel can have for the physics sim is 2kg.

lpgagnon commented 8 months ago

previous discussion of what seems to be the same issue https://discord.com/channels/319857228905447436/319857228905447436/985972007797674004

SAOBunk commented 8 months ago

The issue is not present when Principia has been installed

siimav commented 7 months ago

So what is happening here is that KSP internally forces a minimum mass of 2kg on part RigidBodies. Thus the issue isn't limited to ROSolar and any physical part will trigger the discrepancy between calculated and actual dv.

Weirdly though, decreasing partRBMassMin in PhysicsGlobals to 1kg doesn't help at all. However what does work is overriding minimumRBMass at part level to a smaller value.