Jump to content

How would I calculate a ships Angular Acceleration?


Recommended Posts

How would I calculate a ships maximum angular acceleration?

I was trying torque / the moi for each component of those vectors, but idk if I figured out torque wrong or something was wrong with the moi, but the roll acceleration came out to like 90000 something, the other ones were like 0.8 (the ship was in space and very simple with just a command pod, fuel thing, and engine).

When I checked out the moi the roll component was like 6E-05, whereas the other 2 were ~5.56. Does this seem reasonable? I wouldn't have expected the roll moi to be so ridiculously small compared to the other two?

Could anyone help me out?

Thanks

Edited by Xty
Link to comment
Share on other sites

MoI :

https://github.com/MuMech/MechJeb2/blob/master/MechJeb2/VesselState.cs#L538-L582

Torque from RCS :

https://github.com/MuMech/MechJeb2/blob/master/MechJeb2/VesselState.cs#L356-L374

And Reaction wheel

https://github.com/MuMech/MechJeb2/blob/master/MechJeb2/VesselState.cs#L419-L432

And other module can generate torque of course. And even more with mods.

With those you should get what you need.

As for the value it depends on the ship...

Link to comment
Share on other sites

"// KSP's calculation of the vessel's moment of inertia is broken."

Whew, I knew that roll MoI of 90000 seemed ridiculous, thank you.

I'm a few version behind in KSP, I wonder if they have fixed it in newer versions.

Trying out that MoI function got me way closer, but in testing calculating angular acceleration I'm still getting numbers that are slightly off for roll. Pitch and yaw seem good, but for my very simple ship, my function calculates the angular acceleration should be ~7.6 now, but when I actually test it out by rotating for X time then dividing the rotational velocity by the time spent rotating it comes out at ~9.4 pretty consistently.

Edited by Xty
Link to comment
Share on other sites

Unity set a limit on a rigid body angular velocity, so you may hit it when doing your test. I don't remember if KSP change it but unity default is 7 and you can check the current default in Physics.maxAngularVelocity and the current value for a part in its rigidbody.maxAngularVelocity.

Link to comment
Share on other sites

I did notice that there appears to be some kind of cap. I'm actually having the opposite problem though, the actual roll acceleration (~9.4) is higher than what I calculated through torque and the moi (~7.6), where as for pitch and yaw it's much closer (~.76 actual) (~.74 calculated through torque and moi).

Link to comment
Share on other sites

It has a command pod, a fuel tank, an engine, and an rcs thruster that I re-purposed to be the part I have my module attached to (idk why I used an rcs thruster for it but i did, maybe it was the part for a tutorial). But the engine and rcs thruster aren't running while I'm testing (at least they shouldn't be, rcs is off and has no fuel, engine is off and also has no fuel).

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