Jump to content

[1.10] Pilot Assistant: Atmospheric piloting aids - 1.13.4c (2020-08-18)


zolotiyeruki

Recommended Posts

Original Credit: Crzyrndm

This mod was originally developed by Crzyrndm, and has been one of the few mods I've kept around.  Crzyrndm has moved on to other things, and given me permission to maintain the mod.  Most of the content of this first post is a copy from his original post.

Pilot Assistant

3 basic aids for use in atmospheric flight (that is, forwards, not upwards). Works with any atmospheric model so long as the craft has enough control authority to be controlled.

  • Heading Hold - craft will bank to a controlled angle and attempt to match heading with the target given
  • Altitude hold - craft will pitch to a controlled angle and climb/descend to the target altitude
  • Climb speed - craft will pitch to an angle that gives the desired ascent or descent rate in m/s
  • Yaw Control - Smooth co-ordinated turns and damping of yaw oscillations
  • Airspeed Control - Set an airspeed target and Pilot Assistant will manage the throttle to maintain that target
  • Keyboard adjustment of targets with bindings corresponding to standard vessel controls
  • Ingame binding list and rebinding tool

Each function is controlled by cascaded PID controllers with fully configurable gains and limits. These may need retuning to suit different craft depending on their aerodynamic stability.

Download

Get it here!

Also available via CKAN


Surface SAS and SAS Tuning

  • Surface SAS holds orientation relative to surface
  • Fully tweakable PID gains for stock SAS and Surface SAS
  • Pitch/Roll/Heading angles in Surface SAS can be set by hand
  • SSAS axis controls deactivate seperately under user input, so there is no listing to one side when you are just pitching up/down.

PID Information

  Reveal hidden contents

 


Pilot Assistant 101 - How to fight the wobble

There are two general causes for Pilot Assistant making your vehicle oscillate (wobble), over-reaction and under-reaction.

Over-reaction results in fast sharp oscillations, and typically happens when your craft has a lot of control authority (high speed, low altitude, lots of control surfaces). Under-reaction results in more of a slow "cartoon drunk" sway and occurs for all the opposite reasons.

The simple fix is to increase or decrease the amount of "reaction" Pilot Assistant has

  • First, identify the controller related to the axis that is misbehaving.
  • If you are having problems that look like over-reaction, increase the scalar term slowly (smaller craft may also want to decrease Kd)
  • If you are having problems that look like under-reaction, decrease the scalar term slowly (larger craft may also want to increase Kd)
  • Remember your control situation changes a lot as you fly. A typical SSTO will have you fighting over-compensation at low altitude and under-compensation at high altitudes
  • If problems persist, feel free to ask for advice

Keybindings

Since Pilot Assistant overrides many functions that would normally be dealt with through keyboard input, many applicable keys have been repurposed to make Pilot Assistant easier to use

  Reveal hidden contents

Jd2UHHR.png


  Reveal hidden contents

Version 1.12.2

* Fix for first launch contract never completing
* Fix for EVAing doing odd things to the controllable vessel list

Version 1.12.1
* Fix for nullrefs when uncontrollable vessels are created
* some changes to support RPM integration

Version 1.12.0
* Compatibility pass for KSP 1.0.5
* Fixed: Nullref spam after docking
* Fixed: Nullref spam if no controllable vessels are in physics range
* Fixed: Settings not always saving
* New Feature: speed control can now take direct control over the throttle allowing the % to be directly set and configurable modification rate using Alt/Fine Control

Version 1.11.8
* Fixed: plane dipping when using the set altitude button

Version 1.11.6 & Version 1.11.7
* Fixed: Loss of control under certain conditions when on EVA

Version 1.11.5
* Fixed: Uneditable heading target while control was not active
* Added: "Level" button to the bank control, sets target bank to zero
* Added: pitch mode to the vertical control
* Fixed: Heading value control now takes input again

Version 1.11.4.1
* Fixed inverted key controls for bank

Version 1.11.4
* Fixed: Assistant vertical control compensating in the wrong direction when setpoint was changed
* Fixed: NRE spam on docking
* Fixed: Non-functional windows with multiple loaded vessels
* Fixed: Several settings failing to load (NOTE: Your settings will be reset, I made some breaking changes at the same time)
* Fixed: Loading a scene with multiple vessels will leave the active vessel selected by default
* Improvement: Wing leveller upgraded to a bank angle control
* Improvement: Vessel forward axis determined dynamically to reduce impact of wobbly joints on control accuracy

Version 1.11.3
* minor fix to control input
* Throttle settings from speed control are permanent
* disabling vertical control with an atmosphere present causes a slow release of control input

Version 1.11.2
* SSAS surface heading target is back to being a direction lock
* direction lock for Pilot Assistant is now planet relative for improved accuracy

Version 1.11.1
* Fix for multi appearances in the stock toolbar
* Fix for null defaults

Version 1.11.0
* Multi vessel control

Version 1.10.1.1
* Fix for planes trying to fly upside down

Version 1.10.1
* SSAS roll control refined so it doesn't perform unnecessary spins
* All SSAS control calculations shifted to double format for increased precision (previously the resolution was limited to ~0.02 degrees)
* Integration of stock SAS modes into SSAS function (eg. prograde, normal, target, etc.)

Version 1.10.0
* Complete SSAS control rewrite. Significantly improved behaviour
* Tweaks to the drag resizing of the Pilot Assistant window
* Added heading # lock to Pilot Assistant modes

Version 1.9.3
* Fixed missing nullcheck

Version 1.9.2
* Toolbar mod support
* Improvements to Radar Altitude control mode
* Fixed size of drag sections not being saved correctly

Version 1.9.1
* Fixed initialisation issue
* Fixed flickering preset window

Version 1.9.0
* Configurable key bindings for pause, hdg/vert/throttle toggle actions

Version 1.8.1
* Fixed Pitch and Yaw flight controls remaining locked out under some circumstances
* Fixed unpausing activating all control systems
* Pilot Assistant scroll areas are now resizeable

Version 1.8.0
* Added Radar altitude mode to vertical control
* Fixed craft trim being affected while Pilot Assistant systems engaged
* Some UI changes

Version 1.7.1
* Fixed Mode switching causing control to activate

Version 1.7.0
* Cascaded speed controller into an acceleration controller
* Added acceleration control mode
* Changed mode handling to improve expandability
* Disabled pause keybinding (tab) in map view due to conflict with a KSP binding

Version 1.6.0
* Added tuning for the vector tracking SAS modes

Version 1.5.6
* Recompile that will hopefully prevent KSP CTD'ing for no apparent reason
* Fix for ghost ships...

Version 1.5.5
* Recompiled for KSP v1.0
* Quick hack to get around applauncher bug

Version 1.5.4
* SSAS pitch and yaw unlock is only synchronised if the bank angle is greater than 5 degrees. Single axis inputs below that threshold only unlock the axis the input is directed at

Version 1.5.3
* SSAS heading control locks to a direction (the same system as Assistant Heading control)
* Pilot Assistant Now lets raw heading and roll inputs through while landed with no alterations. Massive improvement in handling of takeoff/landing procedures
* Pilot Assistant dual heading displays now show the current target heading and the heading difference to make it easier to turn through a certain angle in polar regions
* Update buttons for SSAS now activate the associated axis
* Yaw input delay now defaults to zero. Can be changed in the options if needed.
* Input regions for Pilot Assistant no longer retain focus after commiting changes

Version 1.5.2
* Added configurable delay to heading alterations made via. Yaw Left/Right controls.
* Pilot Assistant transition logic improved. Engaging controls and toggling modes is significantly smoother
* Vertical speed measurement improved (again) as detailed here
* Split heading target input/readout into two fields. The left field displays the current setpoint, while the right field is for displaying the final target (NOTE: There is a slight error here. I meant to make the right hand field the target entry field as well).
* Direction lock now engages instantly for all methods of target entry. Entering manually previously did not lock for a noteable period of time.

Version 1.5.1
* Fixed bad calculation of vertical speed for Pilot Assistant if SSAS is armed

Version 1.5.0
* Heading control locks to a direction. NOTE: Target heading will change over time, particularly in polar regions
* Smoothed engagement of heading control based on current angle of bank
* Fixed vertical speed not being measured as zero at a constant altitude
* Fixed heading control to use prograde heading instead of craft heading in order to manage sideslip

Version 1.4.2
* Better integration of non-keyboard input sources (github user bssthu). NOTE: I can't test these changes as I have no analog input source
* Smoothed transfer between SSAS pitch control and Pilot Assistant Vertical Control

Version 1.4.1
* Fix for my (GUI) stupidity
* Fix bank controller calculating twice per physics frame (in real terms, Ki has been halved on the primary heading control)
* Fix for window default positions being stacked up in the top left corner.
* Fix for the scroll area's in the Asst window not resizing quite right. Forcibly removed the horizontal scrollbar.
* General optimising

Version 1.4.0
* Roll inputs have some impact while Pilot Assistant heading control is active * Tooltips added to all parameter inputs (mouse over the labels to see them)
* Fixed the flickering Assistant window that happened whenever you clicked it
* Added option to use seperate min and max limits in the Assistant for all controllers
* Added option to hide the tooltips in the Assistant options (works for SAS tooltips too)
* All Assistant options are now persistent (scenes, saves, KSP restarts. The selected options won't change)

Version 1.3.1
* Fix for control system freezes resulting from a misplaced clamp
* Minor GUI cleanup

Version 1.3
* SSAS pitch/roll/heading inputs now have update buttons, changes won't be made until commited
* All setpoint changes through commit buttons now use a gradual transfer scheme. This is tweakable on Pilot Assistant using the "Easing" parameter. Higher is more abrupt. Only applies to the controller recieving the commit (even though it's visible on all controllers)
* Window position is now persistent
* Integral limits are now single input for both upper and lower
* Fixed GUI leakage for the toolbar window
* Removed slide parameter from SSAS
* Added Delay parameter to SSAS. This is the time in 1/100ths of a second between you releasing the key and SSAS locking to the current attitude

Version 1.2.1
* Resolved AGX incompatibility
* Removed some log spam that found its way into 1.2

Version 1.2
* Added default update button
* Fixed default preset creation error with SSAS that was causing NAN control outputs

Version 1.1.3
* Fixed incomplete presets causing errors
* Updated AoA default over-ride to NEAR and added integral clamps
* Reduced Throttle sensitivity by 75%
* Hard clamped outputs returned to KSP as appropriate

Version 1.1.2
* Fixed SSAS axis activation issues where both pitch and heading had to be active.
* Pilot Assistant moved to post-Autopilot update event. Pilot assistant functions now override SAS or SSAS if they are active (so you can use the wing leveller and (S)SAS to hold pitch if you want). No more pause desynchs!!!
* Fixed Pilot Assistant targets being updated instantly when being typed in instead of requiring the update button to be clicked
* Fixed SAS presets being loaded from file in the incorrect order
* Removed all references to velocity from Pilot Assistant Throttle control (replaced with speed). Just a minor terminology issue.
* Fixed SSAS pitch being randomly clamped to +/- 80 degrees instead of +/- 90 degrees
* Added Modifier (LAlt) requirement to Asst function toggles

Version 1.1.1
* Fixed GUI style leakage
* Added Throttle controller to presets
* Added SAS mode to craft presets
* Added AoA default override patch for non-FAR users
* Added new keybindings for toggling Pilot Assistant functions

Version 1.1
* Added Controller support for SSAS and Pilot Assistant (Heading & VSpeed Only)
* Added Throttle/Velocity control to Pilot Assistant (no preset support yet)
* Added SSAS "Slide" to SSAS Presets

Version 1.0.4
* Fixed typo that was preventing the roll axis of SSAS relocking
* Added the "slide" modifier to the SSAS GUI

Versiont 1.0.3
* Squashed another​ nullref that was causing initialisation issues

Version 1.0.2
* Squashed another nullref that was preventing the stock SAS tuner initialising properly
* Removed a bunch of logging and other stuff that wasn't meant to make it public
* Fixed preset loader not triggering on inflight vessel switching
* Fixed SSAS not supporting inflight vessel switching

Version 1.0.1
* Fix for flight scene reloading causing all functionality to stop

Version 1.0
* Large scale code overhaul
* SSAS now uses a sliding engagement
* Presets are now associated with a specific craft name
* A "defaults.cfg" will be created on entering the flight scene for the first time. Change the tuning values here to alter your default settings
* Fix for integral windup issues when craft is uncontrollable
* Fix for incorrect SAS preset assignment

Version 0.9.6.2
* Fix for erroneous heading behaviour around planetary poles

Version 0.9.6.1
* Fix for Pilot assistant not correctly updating on unpausing
* WASD inputs are now locked out of Pilot Assistant while paused

Version 0.9.6.0
* SSAS activity for pitch/heading/roll can be activated and deactivated seperately
* No more being able to edit SSAS roll targets when it would cause issues
* Pilot Assitant moved to new Autopilot event

Version 0.9.5.0
* SSAS roll control overhauled. Now fully functional for any heading (no more spinning when travelling vertically)
* Stock SAS presets now saved correctly (previously roll and yaw were being switched on save)
* SSAS shifted to use new Autopilot event for updates
* All features verified to be 0.90 comlpiant

Version 0.9.4.0
* Integration of several features from a pull request. Robust window resizing, toggle buttons, and several other tweaks that make the GUI work and look better
* Interaction between Pilot Assistant, Surface SAS, and Stock SAS has been thoroughly overhauled. There should be no more issues with the modules becoming desynched and having multiple active at one time
* New keybind: Modifier + SAS Toggle. This keybind arms the SSAS and the next time the SAS toggle key is used, SSAS will be used instead of stock (and vice versa if disarming)
* SSAS indicator button now shows without needing to have the GUI open. The only requirement is that the system is armed
* SAS systems will switch to match the current GUI display when toggled. If you have the stock SAS panel open, SSAS will remain armed but all SAS toggles will use the Stock system


Version 0.9.3.0
* Currently activated presets persist when scene switching
* GUI should no longer be affected by other mod GUI's or certain section of the stock GUI
* SAS gain labels correctly take only a single line, resolving a window sizing issue

Version 0.9.2.0
* Craft attitude logic rewrite, shifting to a vector based system
* Hide UI is synched with KSP
* Messaging system fixes
* WASD keybinds do not function while Pilot Assistant is paused
* Heading target updates to current heading when switching from wing leveller to heading lock

Version 0.9.1.2 (0.9.1.1 wasn't recompiled)
* Remove divide by zero error that would result in blackscreen

Version 0.9.1
* GUI overhaul phase 2 - Colours, onscreen messages, more layout changes
* GUI now stays open between reverts, changing scenes and the like
* Added single sided output limits (one value for both +ve and -ve limits) for Pilot Assistant, most controllers now use them
* Fixed the heading/yaw interaction for co-ordinated turns. Yaw now chains off the main heading/bank controller to enforce a single solution for zero heading error

Version 0.9.0
* GUI overhaul phase 1 - Layout responsiveness increased

Version 0.8.3
* Corrected behavious of Surface SAS around 0/360 degrees heading and 180/-180 degrees of bank (it doesn't take the long way around any more...)
* Surface SAS engagement smoothing
* Surface SAS defaults are less forceful to help with smoother engagement
* Surface SAS activity indicator is now a button (with pretty colours no less )
* Surface SAS attitude +/- buttons behave better around the 0/360 and 180/-180 crossings
* Surface SAS attitude inputs are now clamped within sane ranges

Version 0.8.2
* SAS Presets work
* Default tuning updated

Version 0.8.1
* Improved Pilot Assistant/SAS interaction
* Fix for ground activation of modules with an active integral term causing unwanted jerks on takeoff
* Retrofitting the scalar tuning value seen in the SAS module to the PA tuning GUI
* Smoothing of the derivative term (now a rolling average with a factor of 0.5. ie: change = change / 2 + new_change / 2)

Version 0.8
* Added SAS module that holds a surface relative heading
* Added SAS tuning for both stock and the new SAS module
* Added Left alt hotkey to WASD control as a speed modifier. Holding alt down will change the target 10x faster than normal, or 10x slower if fine control is active
* Pilot Assistant presets are saved more often to

Version 0.7
* Added wing leveller mode
* Fine control now works on stock fine control mode (caps lock toggle, indicated by blue coloured pips in the bottom left)
* Tab pauses all control systems and returns full control to user
* (Modifier)-X activates wing leveller and sets target vertical speed to zero (level everything off) (Modifier is LAlt by default on windows)
* Fix for control systems not deactivating between flights
* All PID constants now always show atleast 1dp and up to 3sf (ie. 3 is displayed as 3.0, 3.333 would display as 3.33)
* Window now resizes more dynamically to fit available content

Version 0.6
* Added WASD controls for heading and vertical set points. Hold KSP Modifier key (LAlt on windows) to engage fine control
* Fixed rudder to follow heading setpoint correctly
* Fix for preset states not persisting correctly (delete will work now...)
* Complete code rebuild to increase modularity and allow for further expansion with less headaches

Version 0.5.0.1
* Fix for blank presets.cfg being created and breaking KSP loading
* Possible folder rename after local inconsistency was discovered that may have been causing all sorts of wierdness

Version 0.5
* Presets - Create, update, and delete (kind of. The delete function only works if you quit KSP without loading into flight again >.<. Easier just to remove from the presets.cfg atm)
* Added increment buttons to the PID tuning parameters. Increments are +10% and -9.1...% (x*1.1 and x/1.1 respectively. This means it comes back to the same value after incrementing and decrementing)
* Reset to default button in the preset's menu (defaults are not currently configurable, unsure if I want there to not be a backup so it's hardcoded)

Version 0.4
* Integrated yaw damper into the heading control system. Can now be used to add rudder input with some retuning. Default is still only yaw damping.
- For active rudder control: make Ki slightly > 0 and tweak the max yaw values to suit. Pure yaw damper is Kp/Ki/Kd all == 0
* More GUI cleanup and polishing
* Fixed to handle switching craft in flight appropriately
* Attempting to give non-numeric input to the PID parameters no longer generates a log error

Version 0.3
* Massive GUI cleanup
* Vertical control now defaults to vertical speed when activated and updates to the current vertical speed (no more jump on activation)
* Numerous little bug fixes

Version 0.2
*Pitch controller replaced by AoA (Angle of Attack) controller. The only difference you will see is that you can now limit target AoA's
*Yaw Damper added. Will be active while either heading or vertical velocity are in use.
*Fixed the altitude and AoA output limiters to display intuitive values (ie. max +ve climb rate uses a +ve value)

Notes:

  • For now, this is just a recompile for 1.10.  I've done a fair bit of software development, but I'm new to C# and to modding.
  • That said, this mod is quite solid as-is, and doesn't really need anything new IMO.
  • *That* said, if you find a bug, please let me know and I'll see if I can rustle up the time to track it down.

Distributed under CC BY-NC-SA 4.0 license

Source Code

Can be found here: https://github.com/zolotiyeruki/Pilot-Assistant

Edited by zolotiyeruki
Updated for KSP 1.10
Link to comment
Share on other sites

  • 4 weeks later...

Great! Lets check it out. I use atmospheric autopilot AND kramax autopilot, and I am still not happy. Lets see if this is the thing.

Wobble apparently is indeed a game thing and not a mod related thing, since it happens also with the other mods mentioned. Usually its worse when I forget to deactivate the command pod's reaction wheels.

Edited by Daniel Prates
Link to comment
Share on other sites

My understanding is that Kramax and AA and this mod actually share much of the same codebase, so it doesn't surprise me that you're seeing the same issue on all three.

There's one feature I'd like to see added to this mod:  set a pitch, and use the throttle to maintain a specific altitude or vertical speed.  Dunno if it's worth my time to pursue it though, since it's very much a corner case.

Edited by zolotiyeruki
Link to comment
Share on other sites

21 minutes ago, 4x4cheesecake said:

@zolotiyeruki I just noticed that the downloadable .zip does not contain the source code and I cannot find a separate link for it as well. Since it is required by the Add-on posting rules, I would kindly ask you to make the source code available, before a mod comes along and removes the download link ;)

Will do.  In order to submit it to CKAN, I'll need to update all the files on GitHub.  This release is just a recompile for 1.7, and none of the source has changed.  You can find it all here:

https://github.com/zolotiyeruki/Pilot-Assistant

Link to comment
Share on other sites

23 hours ago, zolotiyeruki said:

My understanding is that Kramax and AA and this mod actually share much of the same codebase, so it doesn't surprise me that you're seeing the same issue on all three.

There's one feature I'd like to see added to this mod:  set a pitch, and use the throttle to maintain a specific altitude or vertical speed.  Dunno if it's worth my time to pursue it though, since it's very much a corner case.

Actually when I said I was not happy, its not because of the wobble, but rather the GUI of each mod and how they are operated. AA has one excellent feature, which is the 'fly by wire' (in my mind I call it "always-trimmed flight" hehe). Kramax on the other hand has a better auto-level flight afaik.

Haven't tried yours yet, will test it and share some insights.

EDIT: just did. It's excellent. I will adopt it is my autopilot from now on. I will keep AA however, for the 'flybywire' function. 

Edited by Daniel Prates
Link to comment
Share on other sites

  • 4 months later...

Cool what someone take care of the (oldest?) pilot mod

On 6/3/2019 at 8:38 PM, zolotiyeruki said:

In order to submit it to CKAN, I'll need to update all the files on GitHub.

https://github.com/zolotiyeruki/Pilot-Assistant

CKAN uses not files in a github repo, but loaded on github repo "assets"
 

@HebaruSan  Could you add the continuation manually? Download link is

On 5/6/2019 at 2:48 PM, zolotiyeruki said:

 

Link to comment
Share on other sites

1 hour ago, flart said:

Could you add the continuation manually? Download link is

I'd rather do it "the right way" if possible, so future updates could be picked up automatically.

@zolotiyeruki, it's pretty easy. You should see a "Draft a new release" button here:

https://github.com/zolotiyeruki/Pilot-Assistant/releases

If you click it, it will let you enter a version number, title, and description, and attach your ZIP file. Then we could update this mod's CKAN listing to point to your repo, and any updates you make will be added automatically. 

Link to comment
Share on other sites

27 minutes ago, zolotiyeruki said:

What should the root directory for the zip file be?  Should the zip file contain the GameData directory, or the PilotAssistant directory that goes in the GameData directory?

Either way can work, but the current setup expects the files in GameData/Pilot Assistant. We can update it to use whatever you choose when we switch it to your repo.

Link to comment
Share on other sites

4 hours ago, zolotiyeruki said:

Alright, I've uploaded a zip file and created a release.  You can see it here.  Is there anything else you need me to do for CKAN?

 

https://github.com/zolotiyeruki/Pilot-Assistant/releases/tag/v1.13.4

Looks good, but you'll probably want to double check the .version file:

"KSP_VERSION":{"MAJOR":1,"MINOR":3,"PATCH":0}

Link to comment
Share on other sites

On 10/28/2019 at 12:31 PM, HebaruSan said:

Looks good, but you'll probably want to double check the .version file:

"KSP_VERSION":{"MAJOR":1,"MINOR":3,"PATCH":0}

Good catch.  Can you tell I'm new to this? :P

I've updated the .version file and re-uploaded the zip file.  Is there a way to kick off a new build attempt?

Edited by zolotiyeruki
Link to comment
Share on other sites

  • 2 weeks later...
14 minutes ago, zolotiyeruki said:

I've merged the change and re-uploaded the zip file.

The ZIP still contains the old .version file. I'm guessing it's the "re-uploaded" step that is having problems, since the GitHub API indicates the current file was uploaded a week ago:

https://api.github.com/repos/zolotiyeruki/Pilot-Assistant/releases

        "created_at": "2019-10-29T01:03:26Z",
        "updated_at": "2019-10-29T01:03:27Z",

 

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