Feedback #18706
[Feature Request] SAS controls to autocorrect for direction of flight
Description
Set up:
The attached save file (SAS Backwards Save.zip) puts you in control of a test ship entering Kerbin atmosphere from orbit with a retrograde descent. SAS is off, and you can manually control roll to keep it steady. When you turn SAS on, it's supposed to make course corrections to keep you steady.
Problem: Those corrections to roll are in the wrong way. As you build up speed, it continues to adjust in the wrong direction to stop your roll. While you can reverse the direction of control surfaces in design mode, there is no way to set an action group to do this in flight.
Expected result: SAS should either detect which direction the ship is moving and adjust control surfaces adequately, or there should be an action group option to reverse the control surfaces on parts that may affect Roll.
This bug was found while playing 1.4.2, but verified in 1.4.3 before posting.
History
#3 Updated by diomedea almost 6 years ago
- File screenshot1107.png screenshot1107.png added
This is actually a manifestation of an issue as old as Control Surfaces in KSP. I've checked against KSP 1.2.2 and it behaves the same.
The issue is about the placement of Control Surfaces in relation to the CoM of a vesel. When they are backwards (in relation to the velocity vector) all is fine, control works correctly on all axes. But when placed forward of the CoM, Control Surfaces work to keep pitch and yaw, but do in reverse about roll.
In the attached picture, please notice how the forces around Control Surfaces at the front (circled in orange) go in one direction, but those at the back (circled in green) go in the opposite way. SAS is actually trying to stop the roll movement, but its orders are used backwards.
#4 Updated by diomedea almost 6 years ago
- File screenshot1132.png screenshot1132.png added
- File screenshot1134.png screenshot1134.png added
Attached some more screenshots that better show the problem. Showing a plane with 4 control surfaces mounted atop (numbered 1-4 in purple):
- 1 is back of CoM, rotated forward (in relation to the velocity vector)
- 2 is back of CoM, rotated backwards
- 3 is ahead of CoM, rotated forward
- 4 is ahead of CoM, rotated backwards
In shot1132, command is full Roll CCW (highlighted green). As visible, two control surfaces at the tip of the wings (L, R in yellow) are providing the actuating forces in the correct directions. As with the Control Surfaces 1-4 under test:
- 1 and 3 provide a CCW force (seen leftwards from the top of the plane), which is correct;
- 2 and 4 provide a CW force, in the wrong direction.
In shot1134, command is full Yaw left (highlighted green). All Control Surfaces 1-4 are providing a force to the left, which effects the plane as follows:
- 1 and 2 being back of the CoM, the force effectively yaws the plane to the left;
- 3 and 4 being forward of the CoM, the force yaws the plane to the right, wrong direction.
#5 Updated by jclovis3 almost 6 years ago
So it would seem that even an option to reverse direction of controls with an action group would have the consequence of messing up pitch and yaw to fix the roll. The answer then would be a smarter SAS. We have to assume there will be navigation sensors that detect wind speed and direction, and that the programming in a stability system can use that data to make correct decisions about how to actuate the control surfaces. Either that, or make SAS refuse to engage if it detects unstable flying conditions like flying backwards, or a flat spin.
#6 Updated by diomedea almost 6 years ago
- File screenshot1146.png screenshot1146.png added
jclovis3 wrote:
So it would seem that even an option to reverse direction of controls with an action group would have the consequence of messing up pitch and yaw to fix the roll. The answer then would be a smarter SAS. We have to assume there will be navigation sensors that detect wind speed and direction, and that the programming in a stability system can use that data to make correct decisions about how to actuate the control surfaces. Either that, or make SAS refuse to engage if it detects unstable flying conditions like flying backwards, or a flat spin.
Is not a function of SAS to provide different input to the different actuators. This issue is specifically about Control Surfaces (CS): it is within ModuleControlSurface to compute, among all else, the vector of the airflow in relation to the CS and the displacement from CoM, then to transform based on those the required rotation (for the whole Vessel) computed by SAS into a deflection value. This for each single CS.
The question is rather, if this is to be considered a bug (in ModuleControlSurface), or the request for a feature able to autocorrect player errors in the use of CS (placing them backwards and expecting them to work in a retrograde attitude). As I wrote above, this is as old as CS were introduced: one may think it's time to improve, but is hardly a priority for developers until more important stuff is all dealt with.
Now let me provide also the analysis about pitch (screenshot1146):
- 1 and 3 (facing the airflow) are correct, their force rotates the plane to pitch up;
- 2 and 4 (backwards) provide a force in the opposite direction to what required.
#7 Updated by Squelch almost 6 years ago
- Tracker changed from Bug to Feedback
- Subject changed from SAS controls roll in wrong direction when flying retrograde through atmosphere to [Feature Request] SAS controls to autocorrect for direction of flight
The SAS control system was originally designed for orthodox flight conditions and not to automatically switch when conditions change.
This is clearly now a feature request. It is a good one, but is also complex and has many other consequences, so must be evaluated fully.
I have changed the tracker type and title to reflect this.