Jump to content

SAS Advanced - Critically-damped, Over-damped, Under-damped


Recommended Posts

I think this would be a good option, to be able to adjust the SAS to one of these 3 responses. Currently it seems like some sort of under-damped response, i'd like to be able to switch between these. You'd also save some RCS fuel if the SAS control was critically damped, I do believe.

http://fsinet.fsid.cvut.cz/en/U2052/node118.html

Link to comment
Share on other sites

It's underdamped when you have a heavy vessel with low torque. For a typical lightweight / low inertia vessel vector SAS is already heavily overdamped to the point of being non-functional (Mk1 pod, FLT-400, 909 => random vibrations). This all comes down to SAS having a static tuning that doesn't adjust to your vessel (it would be nice to have multiple tuings available, but I can see people FUBAR'ing something because they have no idea what they're doing).

If you want it to be behave differently, add or remove torque (or get a mod to re-tune it).

Edited by Crzyrndm
Link to comment
Share on other sites

It's underdamped when you have a heavy vessel with low torque. For a typical lightweight / low inertia vessel vector SAS is already heavily overdamped to the point of being non-functional (Mk1 pod, FLT-400, 909 => random vibrations). This all comes down to SAS having a static tuning that doesn't adjust to your vessel (it would be nice to have multiple tuings available, but I can see people FUBAR'ing something because they have no idea what they're doing).

If you want it to be behave differently, add or remove torque (or get a mod to re-tune it).

I'm not sure exactly how the game calculates the pitch/yaw/roll to apply. But most of the time I find my ship is wobbling back and forth even when it clearly has enough torque to null out all rotational velocity. But I think the main reason for the underdamped behavior is that whenever you stop hitting w/a/s/d/q/e, SAS tries to get you to the angle where you released the key(s). But obviously since you just released them and can't just stop on a dime (I would guess that all responses are actually underdamped you just can't see it) your ship has to kill that velocity and come back to the angle you were at when you released the key.

The problem to solve is this: whenever SAS is on, and the key is released, the autopilot applies max torque exactly opposite to that of your current rotational velocity. For example if you have 5m/s in rho, 6m/s in theta, and -9 m/s in phi, the autopilot applies max torque in the phi, a bit less in theta, and the least amount in rho, whatever values give you a vector 180 deg to the one you have (which is actually constantly changing so the math is a bit more complicated but still easily calculable). Then once your ship stops, the autopilot sets the initial angle to the one you are currently at, sets the final angle to whatever one you were at when you released the key. Then it just solves for the phi/theta/rho torque functions that give you a critically damped response with those initial and final conditions.

Link to comment
Share on other sites

Wobbling back and forth can result from both under and over damped behaviour because of the discrete nature of calculations (~40-50x per ingame second default IIRC). In an analog implementation, there is no way for the derivative response to become too strong, however the discrete nature of the controller, and a very coarse one at that, means over correction is an entirely possible (even common) result from excessive damping and most of the vector SAS behaviour can be attributed to it. Ofcourse, once vessels get a lot of inertia and the increasing torque doesn't match that, response shifts through critical and becomes underdamped. tl;dr The response you see depends on the vessel, selected SAS mode, and current conditions (running engines, atmosphere (with or without control surfaces), etc.)

RE: Where it locks onto, it's probably something similar to what I have done for SSAS. It would certainly explain some of the more vexing behaviours it has (roll vibrations causing it to "unlock" and slide) if it only used derivative response when the angular rate was above some setpoint (not an issue for me because the axes are treated completely separately :D).

Then it just solves for the phi/theta/rho torque functions that give you a critically damped response with those initial and final conditions.

Quite seriously: if you can derive the solution to that problem, then please do. Even if we drop body lift from the equations, it's not something that's a simple derivation. I know and understand how MJ does it's tuning now (torque/MoI ratio and inertia), but I'm always interested in a new approach

Link to comment
Share on other sites

Wobbling back and forth can result from both under and over damped behaviour because of the discrete nature of calculations (~40-50x per ingame second default IIRC). In an analog implementation, there is no way for the derivative response to become too strong, however the discrete nature of the controller, and a very coarse one at that, means over correction is an entirely possible (even common) result from excessive damping and most of the vector SAS behaviour can be attributed to it. Ofcourse, once vessels get a lot of inertia and the increasing torque doesn't match that, response shifts through critical and becomes underdamped. tl;dr The response you see depends on the vessel, selected SAS mode, and current conditions (running engines, atmosphere (with or without control surfaces), etc.)

RE: Where it locks onto, it's probably something similar to what I have done for SSAS. It would certainly explain some of the more vexing behaviours it has (roll vibrations causing it to "unlock" and slide) if it only used derivative response when the angular rate was above some setpoint (not an issue for me because the axes are treated completely separately :D).

Quite seriously: if you can derive the solution to that problem, then please do. Even if we drop body lift from the equations, it's not something that's a simple derivation. I know and understand how MJ does it's tuning now (torque/MoI ratio and inertia), but I'm always interested in a new approach

I originally was going to say in my last reply "simple solution", but I erased the word simple. And for non-rigid bodies it probably becomes a lot more complicated still. I was thinking for a rigid body with a definite center of mass in an analog world, as you've made me realize, but for KSP's non-rigid bodies and varying center of mass, I think it might get tangly. Maybe I had spoke too soon. I will think about it just for fun though.

Edited by Bug_
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...