Jump to content

[1.9-1.10] Throttle Controlled Avionics


allista

Recommended Posts

Would it be possible to make two different PID based on size, trust, what not? 
Like what works for a smaller craft doesn't work for the much bigger ones, and maybe what works for the bigger ones doesn't work for the smaller crafts. If you find what works, you could make it switchable. 

Sorry, most likely not helpful.. 

Link to comment
Share on other sites

1 hour ago, AwkwardNoah said:

[...]

turns out that all the pods in KSP have TCA turned off in them and I can't figure out how to get it working.

[...]

You have to unlock "module" in the tech tree for the various features to work. Or you may not have installed the mod correctly and a file is missing...

Link to comment
Share on other sites

well without specifics I can direct you to a very good "class" on PID.  most of it you will know already obviously.  but there is good info in there, and may help.  especially in the later videos.   however I would recommend starting with video 1 and just watch them all.  he has many videos on controller design but this series specifically is for PID.  I really recommend going to his youtube channel, and look at his videos.  if he does not speak too fast for you to understand he is a very good instructor.  I know he talks very fast, but your English is very good, so maybe you can follow him.

 

 

Edited by Bit Fiddler
Link to comment
Share on other sites

17 hours ago, Boris-Barboris said:

I'd recommend wasting a week and writing yourself a sandbox. Simple matlab\watever script is faster to work with than KSP. Implement one axis of rotation, write out a couple of cases you want to check your controller on (small, medium, heavy craft, jets or rockets), look at the plot, tweak, iterate. Trial and error is the way to go, the trick is to minimize iteration count, period and environment complexity.

On the controller itself, well, PIDs are fine, the easiest and well-tested approach is gain scheduling - instead of woodoo coefficients you interpolate a big table of gains, tested for each test craft (will get trickier if table dimension is high, but your case seems to have one dimension - ratio of max torque to axis MOI). You can make two tables - for jets and for rockets. Then maybe some global gain around 0.5 to ease the fact that you omitted aero forces (don't even go there, trust me on this). I've seen a formula somewhere in RPC thread for analythical PD gains from desired overshoot margin, but I don't think it will help you - you need PID, unless you're cascading and already have good angular acceleration controller.

Thank you for the advices! When I first began to develop this controller I did made a sandbox. But then things got too complicated: in some cases what worked in the sandbox did not in the game, so I needed to make it more and more complex to mirror KSP's inner working. In the end I figured I don't want to spend so much time for reimplementing KSP code in python, especially when each game update could break it. So now I'm somewhere in-between: I gather statistics in-game, plot it, feed into several models and try to figure out what causes yet another excitation (the main problem with this controller).

The idea of gain scheduling, though it seems harder to implement, is very appealing. To be honest, if not for your post, I, for the lack of knowledge, would've started to fit a simple neural network there; either to tune PID, or instead of the PID itself :confused:

And cascading is also a thing to consider...

8 hours ago, Bit Fiddler said:

well without specifics I can direct you to a very good "class" on PID.  most of it you will know already obviously.  but there is good info in there, and may help.  especially in the later videos.   however I would recommend starting with video 1 and just watch them all.  he has many videos on controller design but this series specifically is for PID.  I really recommend going to his youtube channel, and look at his videos.  if he does not speak too fast for you to understand he is a very good instructor.  I know he talks very fast, but your English is very good, so maybe you can follow him.

Thanks! I will of course watch from the beginning; if my university taught me anything, it's the value of systematic learning.

Edited by allista
Link to comment
Share on other sites

19 hours ago, allista said:

In the end I figured I don't want to spend so much time for reimplementing KSP code in python, especially when each game update could break it

It always backfires. I don't think there is any risk of updates breaking something. The only thing there is to brake is jet throttle dynamics, which stayed the same as long as i can remember. And it's not like it's hard to fix after update.

NN is a capricious, unreliable, untunable overkill, wich will require well-crafted sandbox anyways, and a big pile of crutches on top of it. At least for attitude. Higher order stuff, especially hybrids, may actually be helpful, but I have yet to come up with anything good.

Spoiler

aoa_preview.png

 

Edited by Boris-Barboris
Link to comment
Share on other sites

On 11/6/2016 at 1:58 PM, Galenmacil said:

You have to unlock "module" in the tech tree for the various features to work. Or you may not have installed the mod correctly and a file is missing...

is there a file or some readme to tell you how to install it

if not can you explain it to me, thanks

Link to comment
Share on other sites

4 hours ago, DeepSlayLP said:

Is this mod compatible with KSP v.1.2.1? I might be oblivious that this question was already asked

Yes it is.

28 minutes ago, AwkwardNoah said:

is there a file or some readme to tell you how to install it

if not can you explain it to me, thanks

Be sure you have the latest version (as of this writing, that would be TCA 3.2.5).

Open the archive and, like most other mods out there, copy the folders (in that case, "000_AT_Utils" and "ThrottleControllerAvionics") to your KSP "Gamedata" folder. You also need Module Manager which is a separate download. If you do this, you will get all the file you need for proper operation of TCA. In game, you should see the "TCA" button on the toolbar somewhere. If not, something is wrong.

I am not an expert myself on the use of TCA. I use it only as thrust balancer for VTOL application but it can do much more than that. The important thing is to unlock the various TCA module on the tech tree in career mode to have it work.

Edited by Galenmacil
Link to comment
Share on other sites

On 11/7/2016 at 4:12 PM, Galenmacil said:

Yes it is.

Be sure you have the latest version (as of this writing, that would be TCA 3.2.5).

Open the archive and, like most other mods out there, copy the folders (in that case, "000_AT_Utils" and "ThrottleControllerAvionics") to your KSP "Gamedata" folder. You also need Module Manager which is a separate download. If you do this, you will get all the file you need for proper operation of TCA. In game, you should see the "TCA" button on the toolbar somewhere. If not, something is wrong.

I am not an expert myself on the use of TCA. I use it only as thrust balancer for VTOL application but it can do much more than that. The important thing is to unlock the various TCA module on the tech tree in career mode to have it work.

 

Turns out this problem is on my side, turns out all the files in the GameData got locked out from me and I couldn't even move them

Something happened with my computer that is related to KSP

Link to comment
Share on other sites

I have had this happen sooooo many times since KSP 1.2.1 installed  basically a directory says it cant be removed because it no longer exists. and other weird crap.  the fix is to open "CMD.EXE" as an administrator and use the console to delete the files and or directories...     "RMDIR /s XXXXXXXXXXX" or "RD /s XXXXXXXXXX" will remove a full directory without the need to delete all the files and subdirectories under it.

Link to comment
Share on other sites

17 hours ago, AwkwardNoah said:

Turns out this problem is on my side, turns out all the files in the GameData got locked out from me and I couldn't even move them

Something happened with my computer that is related to KSP

Are you running Windows? If yes, this is probably related to the file system security steams. Basically, you will need to "regain access" to the KSP file. You can do that via the "Security" tab when you right click and select properties. Yes, this can get complicated real quick. Like bit Fiddler said, you could erase the KSP folder but this is not guaranteed to fix the problem if the drive itself is set to propagate security streams to it's "child". Like I said, this can get complicated. PM if you need more help. :D

Link to comment
Share on other sites

You can disable T-SAS by clicking on the currently active T-SAS mode button. Unless the "Auto" mode is on, in which case some autopilot is using T-SAS, and you need to disable all autopilots running. TCA autopilots cannot use stock SAS.

Link to comment
Share on other sites

TCA v3.3.0 for KSP 1.2.1 (2016.11.13)

ChangeLog:

  Hide contents
  • In-Editor engines balancing with visualization to help building balanced crafts:
    • The thrust limiters of balanced engines are set automatically, so you can see the projected in-flight performance of an engine directly in the right-click menu.
    • The TCA Editor UI now has a "Balanced: N%" indicator at the bottom that shows the thrust limiter of the most down-throttled engine. And the "HL" button to highlight engines according to their efficacy (0% magenta > 50% yellow > 99% cyan > 100% no highliting).
    • When you pick up an engine and move it, trying to attach to a ship, TCA rebalances and indicates the results (as descrived above) in real time; so you can easily achive decent initial balancing.
    • Note, that only the initial (wet) mass is used for balancing. For now.
  • Waypoints:
    • Implemented full, one-way integration with Stock/WaypointManager waypoints: Stock waypoints may be viewed as a list in TCA window and added to the navigation path (one by one or all at once). Note, that only the navigatable waypoints on current planet are shown in the list.
    • Implemented scenario-wide repository of navigation paths.
    • Implemented full waypoint editing + altitude change by mouse.
      • Including Name, Altitude, Latitude and Longitude, Land and Pause states.
      • Added Edit button to waypoint list. A currently edited waypoint is highlited by size and color.
    • Implemented waypoints sorting in the navigation path using ^ (up) button.
    • Cosmetics:
      • Waypoints added by mouse use sequential numbers in names: "Waypoint 1", "Waypoint 2"...
      • Coordinates are now displayed as N/S, E/W instead of counterintuitive angle between 0-360 deg.
      • Displaying vertical distance to the next waypoint in the List.
      • A waypoint set to "Land" is highlighted with size.
  • Improved Landing from Orbit:
    • Before the main deceleration burn the autopilot now scans the surface around the target in search of a flat patch to land on. If it is found, the target is automatically corrected, which saves the fuel later, as the need to fly around after deceleration and physically search where to land is almost completely eliminated.
    • The time a ship will need to turn from almost-horizontal to vertical orientation during deceleration is now taken into account during landing trajectory calculation. This prevents crashes of very bulky ships.
    • Corrected calculations of the amount of the fuel needed for powered landing. Fuel shortage should not come as a surprize anymore.
  • Improved VTOL Assist:
    • Improved support for very small vessels.
    • Landing gear is not deployed if a user/autopilot does not intend to land (checked by desired altitude and engines' state).
    • The deployment time of the landing gear/wheels is now taken into account; and Assist overrides vertical velocity and holds the ship's descend (if needed) untill the gear is deployed.
    • After landing it smoothly corrects ship's attitude to place it on a tilted surface (if the ship have enough control authority).
  • Improved the way Radar + Altitude Control + Point Navigation work together:
    • Ships are allowd to fly through holes in scenery if they're small enough.
    • Altitude Control and Point Navigator now properly take into account target's altitude.
    • Point Navigator also takes into account the value of altitude ahead (as calculated by Radar).
    • Changed the meaning of Waypoint's Pause button: now the ship Stops first, then pauses the game.
    • And if both Land and Pause are toggled, the ship will first land, then pause the game.
  • Improved Maneuver Autopilot:
    • Now it correctly catches the moment when the control authority becomes too low to pursue that last bit of dV.
    • Added in-flight engines' prebalancing to correctly calculate maximum thrust on unbalanced ships.
  • Improved Bearing Control and Attitude Control performance.
  • Added CPS (Collision Prevention System) and H-Translation (Use RCS for horizontal speed corrections) toggles to "advanced" and TCA Editor UI.
  • When the game is paused TCA will not process keyboard events. No more disabling TCA while typing in a savegame name.
  • Many bugfixes.
Link to comment
Share on other sites

Hello.

 

I just installed TCA v3.2.3 (as I am still running KSP v1.1.3) and can't seem to get it to work.

The Y keyboard key doesn't toggle anything when in-flight, the TCA button doesn't appear in Blizzy's Toolbar (nor is it in the list of buttons that I could add to the Toolbar), and it doesn't appear in the stock toolbar either.

Instead, I get a new icon in the stock toolbar that I've never noticed before, which does nothing when pressed. I have highlighted this button with a red arrow in this screenshot. It looks like (backwards R) M2.

Interestingly, I note the TCA parts are displayed in the Tech Tree within the R&D screen. 

Do you have any suggestions on how to get this to run? I believe I have installed it correctly: the folder "ThrottleControlledAvionics" is within \GameData\; I also have ModuleManager v2.6.25 installed.

 

 

 

While I'm here, I may as well ask...

I was impressed with the landing autopilot demonstrated in the OP videos. I would like something that is as precise as TCA is when going from orbit to landed on a planet with an atmosphere (e.g. I'd like to do a precise landing near KSC from orbit). MechJeb isn't capable of landing within a few hundred kilometres of where I want to be...

1. I note your video shows the deorbit burn bringing the periapsis down to below 0. However, with Deadly Re-entry installed, if the periapsis is brought below roughly 30km, then the entry speed is too high and you overheat and blow up. How does TCA handle Deadly Re-entry when landing?

2. Is TCA's landing autopilot able to handle Ferram Aerospace Research (FAR)? Or does this only work on stock aerodynamics and stock heating?

 

Thanks! :-)

Edited by DavidHunter
Link to comment
Share on other sites

36 minutes ago, DavidHunter said:

Hello.

I just installed TCA v3.2.3 (as I am still running KSP v1.1.3) and can't seem to get it to work.

The Y keyboard key doesn't toggle anything when in-flight, the TCA button doesn't appear in Blizzy's Toolbar (nor is it in the list of buttons that I could add to the Toolbar), and it doesn't appear in the stock toolbar either.

Instead, I get a new icon in the stock toolbar that I've never noticed before, which does nothing when pressed. I have highlighted this button with a red arrow in this screenshot. It looks like (backwards R) M2.

Interestingly, I note the TCA parts are displayed in the Tech Tree within the R&D screen. 

Do you have any suggestions on how to get this to run? I believe I have installed it correctly: the folder "ThrottleControlledAvionics" is within \GameData\; I also have ModuleManager v2.6.25 installed.

 

While I'm here, I may as well ask...

I was impressed with the landing autopilot demonstrated in the OP videos. I would like something that is as precise as TCA is when going from orbit to landed on a planet with an atmosphere (e.g. I'd like to do a precise landing near KSC from orbit). MechJeb isn't capable of landing within a few hundred kilometres of where I want to be...

1. I note your video shows the deorbit burn bringing the periapsis down to below 0. However, with Deadly Re-entry installed, if the periapsis is brought below roughly 30km, then the entry speed is too high and you overheat and blow up. How does TCA handle Deadly Re-entry when landing?

2. Is TCA's landing autopilot able to handle Ferram Aerospace Research (FAR)? Or does this only work on stock aerodynamics and stock heating?

Thanks! :-)

I don't know what mod this icon belongs to.

If there's no TCA icon in any of the toolbars, TCA is not installed properly, because even when TCA is inactive the "TCA MAN" icon should always be visible in all scenes. So you're probably missing the AT_Utils. Try to download and reinstall the mod from SpaceDock: http://spacedock.info/mod/198/Throttle Controlled Avionics/download/3.2.3

If that won't help, I will need to see the logs to know what's happening.

 

If I'm not mistaken, in the OP video the landing was performed on an  island on Kerbin. So if you have enough fuel and control authority, TCA should land you within 100m of the target, whether it  is on Mun, Duna or Kerbin. If you're trying to land a standard rocket lander (no RCS, single engine, parachutes) TCA will do its best, but in that case safety goes first, so don't expect too much accuracy. And I should emphasize, that in the course of several last versions the Deorbit Autopilot was greatly improved (as was the game itself, by the way :wink:). So I strongly recommend you to upgrade at last.

I never tested it with DR, but the solution to this would be simply to land from low orbit (as it's supposed to be done anyway). In that case you wouldn't have much vertical velocity upon deorbiting, and the deorbit burn itself will kill much of the horizontal velocity.

In my tests TCA flies (and lands) with FAR pretty well; the same landing as shown in this video was performed with FAR many times with the same result. That's because TCA relies more on real-time adaptation than on pre-calculated solutions.

Edited by allista
Link to comment
Share on other sites

38 minutes ago, BrutalRIP said:

I believe it's from routine mission manager

Well spotted. I saw that mod ages ago; didn't think I had installed it, but apparently I did! :D 

1 hour ago, allista said:

I don't know what mod this icon belongs to.

If there's no TCA icon in any of the toolbars, TCA is not installed properly, because even when TCA is inactive the "TCA MAN" icon should always be visible in all scenes. So you're probably missing the AT_Utils. Try to download and reinstall the mod from SpaceDock: http://spacedock.info/mod/198/Throttle Controlled Avionics/download/3.2.3

If that won't help, I will need to see the logs to know what's happening.

 

If I'm not mistaken, in the OP video the landing was performed on an  island on Kerbin. So if you have enough fuel and control authority, TCA should land you within 100m of the target, whether it  is on Mun, Duna or Kerbin. If you're trying to land a standard rocket lander (no RCS, single engine, parachutes) TCA will do its best, but in that case safety goes first, so don't expect too much accuracy. And I should emphasize, that in the course of several last versions the Deorbit Autopilot was greatly improved (as was the game itself, by the way :wink:). So I strongly recommend you to upgrade at last.

I never tested it with DR, but the solution to this would be simply to land from low orbit (as it's supposed to be done anyway). In that case you wouldn't have much vertical velocity upon deorbiting, and the deorbit burn itself will kill much of the horizontal velocity.

In my tests TCA flies (and lands) with FAR pretty well; the same landing as shown in this video was performed with FAR many times with the same result. That's because TCA relies more on real-time adaptation than on pre-calculated solutions.

Ok, I'll give that SpaceDock version a try tomorrow. I was going off the GitHub version earlier.

Thanks, Allista. :)

Update: tested the SpaceDock version and all is working fine now. Thanks again!

Edited by DavidHunter
Link to comment
Share on other sites

Hello Folks. 

Did a fresh KSP install last night, and obviously I also added a few mods that I have not tried before, to my already inadvisable collection. 

-New game (career/sandbox). 

-Load a very basic version of VTOL aircraft that used to work last time I played in 1.2

-Start TCA as usual, seems to be working. As soon as the craft leaves the runway, the game glitches, the whole Kerbin disappears and I'm left with the skybox and still somewhat responsive GUI. Reverting to launch leaves me with transparent airplane parts. 

Obviously it's not related to TCA, but rather to my horrid GameData folder. 

Is this ... a known incompatibility, or should I start painstakingly removing mods one by one?

Thank you. 

Link to comment
Share on other sites

1 hour ago, Kakorrhaphiophobia said:

Is this ... a known incompatibility, or should I start painstakingly removing mods one by one?

Got a bunch of other mods, including beta(pre-release) version of IR and kOS. Not having described issue.

I'm afraid that your best bet is painstakingly removing mods one by one, or uploading output log that could give some clue what could caused it. Probably both.

Link to comment
Share on other sites

Hey @allista!

I fear some pest-control is needed, got a persisting gamecrash. And the cause seems to be this:

[EXC 20:35:32.824] ArgumentException: Getting control 1's position in a group with only 1 controls when doing Repaint
Aborting
        UnityEngine.GUILayoutGroup.GetNext ()
        UnityEngine.GUILayoutUtility.BeginLayoutGroup (UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options, System.Type layoutType)
        UnityEngine.GUILayout.BeginHorizontal (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options)
        UnityEngine.GUILayout.BeginHorizontal (UnityEngine.GUILayoutOption[] options)
        ThrottleControlledAvionics.NavigationPanel.WaypointList ()
        ThrottleControlledAvionics.TCAGui.DrawMainWindow (Int32 windowID)
        UnityEngine.GUILayout+LayoutedWindow.DoWindow (Int32 windowID)
        UnityEngine.GUI.CallWindowDelegate (UnityEngine.WindowFunction func, Int32 id, UnityEngine.GUISkin _skin, Int32 forceRect, Single width, Single height, UnityEngine.GUIStyle style)
[ERR 20:35:32.824] GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced)

If you need more info, just ask. And if this is not TCA related, just throw it back :wink:

Link to comment
Share on other sites

On 14/11/2016 at 8:57 PM, Kakorrhaphiophobia said:

Hello Folks. 

Did a fresh KSP install last night, and obviously I also added a few mods that I have not tried before, to my already inadvisable collection. 

-New game (career/sandbox). 

-Load a very basic version of VTOL aircraft that used to work last time I played in 1.2

-Start TCA as usual, seems to be working. As soon as the craft leaves the runway, the game glitches, the whole Kerbin disappears and I'm left with the skybox and still somewhat responsive GUI. Reverting to launch leaves me with transparent airplane parts. 

Obviously it's not related to TCA, but rather to my horrid GameData folder. 

Is this ... a known incompatibility, or should I start painstakingly removing mods one by one?

Thank you. 

i had the same problem and found (in my case) that this mod: 

conflicts with TAC. I'll post a log file later.

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