Boris-Barboris / AtmosphereAutopilot

Plugin for Kerbal Space Program
GNU General Public License v3.0
48 stars 16 forks source link

Added FPA vertical mode to Cruise Controller #35

Closed T2Fat2Fly closed 2 years ago

T2Fat2Fly commented 2 years ago

FPA vertical mode

The issue

Currently there are two vertical modes in the Cruise Controller: the altitude mode and the vertical speed mode. Which I think is really lacking is the flight path angle (aka FPA) mode. It tells autopilot to hold constant climb/descent angle instead of constant vertical speed. So the craft's speed vector will always point to the same place regardless of speed changes.

Solution

I added an "FPA" mode along side the vertical speed mode. The original vertical speed mode has beed abbreviated to "V/S". The abbreviate is commonly used across the industry. When FPA mode is active, it will treat the input field as vertical angle (degree) related to the horizon. When switching between V/S and FPA mode, the field will be automatically converted between vertical speed (m/s) and angle (degree) based on current horizontal speed.

Result

Squad stock craft "Gull" and FAR stock craft "FAR Firehound MS" is used for example.

Craft holding 10° FPA at different speed: pic1 pic2

After FPA is set and glide slope is established, the aircraft flies towards runway happily even while decelerating rapidly: pic3 pic4 pic5

Vertical speed and FPA converting based on current horizontal velocity: pic6

Boris-Barboris commented 2 years ago

Looks good but the first thing they'll ask is to separate edit fields of V/S and FPA, so they can edit the setpoint before activating the mode. And I would agree with them. Reduce "Altitude" button's width so we can nicely fit all three boxes in a row.

T2Fat2Fly commented 2 years ago

Looks good but the first thing they'll ask is to separate edit fields of V/S and FPA, so they can edit the setpoint before activating the mode. And I would agree with them. Reduce "Altitude" button's width so we can nicely fit all three boxes in a row.

Personally I don't think it is required. Before the activation of either V/S or FPA, the field can serves as the setpoint for either mode, since no conversion will take place. This is how things work on real world autopilots too. The space on the panel is much tighter than what we have on our computer screen. 😂

The field serves as V/S setpoint: pic1

The field serves as FPA setpoint: pic2

T2Fat2Fly commented 1 year ago

Hi Boris, Just a heads up. I've made improvements to the FPA code in my branch which should be applied before a new release. Shall I file another PR, or reopen this PR for the new changes (and future changes)? I'm still unfimiliar to how GitHub PRs work and maybe I should check my code more carefully before I file any of these :(

Boris-Barboris commented 1 year ago

New PR, yes.

T2Fat2Fly commented 1 year ago

New PR, yes.

Ok I'll file one final PR for the improvements for each component just before a release. Please notify me when you feel ready for one. 😉