You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code is making wrong assumptions that are compounded by bad stock code. The first problem is that gimbalRange is irrelevant to how long it takes the gimbal to reach maximum deflection. It actually takes the same amount of time no matter how far it has to gimbal.
Because of the way lerp works, the default speed of 10 means that gimbaling happens in 5 frames (1/10th of a second)
It also means that the gimbal rate is not constant. Highest rate is on the first frame. Assuming gimbal range of 10, that looks something like:
Removing gimbalRange from MJ's handling will help, but I'm not sure what the answer is to ModuleGimbal's implementation. lerp shouldn't be used the way they're using it. (using the current value to lerp FROM guarantees the rate can't be constant and multiplying a clamped value by speed means it's converging on its goal a lot sooner than we think it is)
The text was updated successfully, but these errors were encountered:
I don't see a lot in MJ that depends on the torqueReactionSpeed other than the old MJ PID, but this is definitely useful information to have about how gimbal response works in KSP since there's some deficiencies in the "bettercontroller" that i think could get fixed by adjustments to take into account gimbal repsonse (which it entirely ignores). By knowing what KSP does I can probably simulate the response speed delays in matlab/simulink and get some PID scheduling out of it. Unfortunately, I'm hacking on PVG stuff right now and burned out on PID things awhile back and need some time to pass before I start wanting to scratch that itch again. This is definitely good research though.
Looking at how MJ factors in gimbalResponseSpeed into torqueReactionSpeed6
MechJeb2/MechJeb2/VesselState.cs
Line 1081 in 7ebb844
This code is making wrong assumptions that are compounded by bad stock code. The first problem is that gimbalRange is irrelevant to how long it takes the gimbal to reach maximum deflection. It actually takes the same amount of time no matter how far it has to gimbal.
ModuleGimbal does: lerp(current pos, goal pos, gimbalResponseSpeed * fixedDeltaTime)
Because of the way lerp works, the default speed of 10 means that gimbaling happens in 5 frames (1/10th of a second)
It also means that the gimbal rate is not constant. Highest rate is on the first frame. Assuming gimbal range of 10, that looks something like:
Frame 1 = 2 (100 deg/sec)
Frame 2 = 5.2 (80 deg/sec)
Frame 3 = 8.08 (48 deg/sec)
Frame 4 = 9.616 (19.2 deg/sec)
Frame 5 = 10 (3.84 deg/sec)
Removing gimbalRange from MJ's handling will help, but I'm not sure what the answer is to ModuleGimbal's implementation. lerp shouldn't be used the way they're using it. (using the current value to lerp FROM guarantees the rate can't be constant and multiplying a clamped value by speed means it's converging on its goal a lot sooner than we think it is)
The text was updated successfully, but these errors were encountered: