Jump to content

[0.21.x] KerbCom Avionics 0.3.0.6 Alpha (29 August) - now with video!


ZRM

Recommended Posts

Right, I haven't had a chance to spend any more time on it over the weekend, however now I have some targets for the immediate future of the plugin:

  • Provide accurate inertia tensor calculations to replace those given by the KSP API - this should remove the guesswork from the values entered for pitch, roll and yaw, and stop vessels from rotating slightly on axes other than the one you intended. For example I commonly find that yawing induces a slight rolling motion on unsymmetrical ships.
  • Improve the current solver with a matrix decomposition method (e.g. Singular Value Decomposition). This should improve performance and allow the GUI to give an idea of the responsiveness range and suitable default settings, as well as providing a compromise solution (i.e. clamp to max thrust) instead of no thrust when the old solver would have been "Out of Bounds".
  • Multithread the solver - even if the new solver is fast enough for large vessels to function adequately multithreading will decouple the system from the frame rate. For example, currently I get 15FPS for a vessel with 88 RCS ports if CRCS is active, and 120FPS (vsync) if it is not. Even if the new solver is just as slow, moving it out of the frame update thread will make its slowness affect the frame rate only slightly (and not at all in machines with an adequate number of cores).
  • Squash bugs. I currently know of a situation where loading a saved flight can cause CRCS to not notice all of the RCS ports as it loads. The current workaround is to simply disable then re-enable the CRCS, which reinitialises it. Then there is also the RCS FX glitch inherited from KSP, which hides the noticeable visual effect of the work done by CRCS to balance the ship and makes it appear as if some or all RCS ports are always firing. Currently this is easily worked around using a one time edit to your RCS block config file as mentioned in the README.
  • Improve the GUI, perhaps using sliders to adjust settings.

This list is not in any particular order. If you know of other pressing issues, please report them in this thread if they are not mentioned in adequate detail by someone else.

And here is my list of ideal features I wish to include later:

  • Somehow deal with wobbly ships and stations by using RCS to counteract wobble on a part-by-part basis. I would need to come up with a measure of wobble and a more complex solver for this.
  • Take control of the throttles of individual main engines as well to provide accurate course correction during ascent combining RCS and thrust vectoring as appropriate to launch unbalanced vessels like piggy-backed shuttles. This should allow my plugin to become the default fits-all RCS mode. You should never need to disable it then.
  • As an extension of the above, provide intuitive VTOL control and an ascent/landing autopilot for VTOLs. This should allow for rotating engines, similar to those seen in the film Prometheus.

I am open to any other ideas that stay within the scope of precision thrust control and balancing.

Also, if you are using this plugin, or have used it but are no longer using it, I would be glad for feedback to improve it.

BTW, it seems that the legal agreement for uploading to Space Port is very restrictive - Squad want sole rights to distribute plugins, i.e. you are not allowed to host an uploaded plugin anywhere else. For that reason I am not currently going to host this plugin on Space Port.

Link to comment
Share on other sites

I registered in the forums especially to say thanks for this awesome plug-in! I've been using it a lot on spaceplanes since they are really tricky to position RCS in a good way and they tend to waste tons of RCS for roll control, excellent results so far.

I noticed the small roll you described on a few SSTO planes, it is still ten times better to dock than stock controls. A suggestion that may or not be easier to implement is to remove authority of RCS thrusters from ASAS modules, the way ASAS works now it will just waste all the RCS over-correcting on medium+ crafts (especially if they wobble). This way it's easier to translate the ship while ASAS keep the heading with the pod/SAS torque.

Link to comment
Share on other sites

So, i try it on one ship of mine, and it won't work. with or without mechjeb. (2.0.7)

I play a lot with the values, and those keep me kinda bored. With you wanna replace for best the rcs from the KSP, those need to be automatic.

Is a tedious processe to have to predict the value for each axis. And even doing it, it not work at all.

That was my experience with it. I take off my Game.

If you reach the automatic set of forces, and make it work seamlessly, leaving to us the only on off button and all other functions automatic set, i will try it again.

But, nice try!

;)

Link to comment
Share on other sites

This is the most useful plugin I've seen in a while. Thanks, ZRM.
I registered in the forums especially to say thanks for this awesome plug-in! I've been using it a lot on spaceplanes since they are really tricky to position RCS in a good way and they tend to waste tons of RCS for roll control, excellent results so far.

I noticed the small roll you described on a few SSTO planes, it is still ten times better to dock than stock controls. A suggestion that may or not be easier to implement is to remove authority of RCS thrusters from ASAS modules, the way ASAS works now it will just waste all the RCS over-correcting on medium+ crafts (especially if they wobble). This way it's easier to translate the ship while ASAS keep the heading with the pod/SAS torque.

Thanks for the feedback! Glad to see the plugin has helped people.

@Huelander

Regarding your suggestion, I think it may be best to work with ASAS instead of against it. Flight control in the KSP API is uniform, regardless of whether it is Fly-By-Wire or the user that is creating the input. Reaction Control Systems work by responding to this global control input. So there is no clean way to stop ASAS controlling RCS without modifying the ASAS module itself. Instead, a much better solution in my opinion is to tune the ASAS parameters (known as PID), as done in real spacecraft. MechJeb 2 provides direct access to these during flight (under Attitude Adjustment), and the Tweakable Parameters mod can modify them per-craft in the VAB/SPH. You will need to look up what these parameters mean in order to tune them for your craft so that ASAS does not overshoot and oscillate around the desired direction, which is what causes the waste of RCS fuel.

Edit: Mind you, I could possibly extend the plugin to automatically tune ASAS, as in theory the only information required to optimise the PID is the maximum torque in each axis and the inertia tensor, which the plugin needs anyway.

Edited by ZRM
Link to comment
Share on other sites

So, i try it on one ship of mine, and it won't work. with or without mechjeb. (2.0.7)

I play a lot with the values, and those keep me kinda bored. With you wanna replace for best the rcs from the KSP, those need to be automatic.

Is a tedious processe to have to predict the value for each axis. And even doing it, it not work at all.

That was my experience with it. I take off my Game.

If you reach the automatic set of forces, and make it work seamlessly, leaving to us the only on off button and all other functions automatic set, i will try it again.

But, nice try!

;)

If you find no values work at all, then there's a good chance that your vessel is not suitable for the current use case of CRCS. CRCS needs RCS ports roughly equally distributed around the centre of mass so that it can provide net thrust/torque in any 6-DOF direction for use as a docking aid. It is not yet designed for balancing rockets during ascent, where you would often only have RCS near the top of the vessel, and thus unequally distributed. That's why there's a big disable button in the window and why CRCS is disabled by default.

However I do admit that the manual tuning is tedious. I am working on this.

Link to comment
Share on other sites

Thanks, I will try the Tweakable Parameters method since saving the setting for each ship sounds really good. If possible, this function in the plugin would be great as ASAS is really convenient for docking or holding a station still.

Link to comment
Share on other sites

I'm going to have to give this thing a test run tonight. It sounds like an AMAZING piece of work. I hate using mods like ORDA because they waste so much fuel, this will really help with my manual docking since I have a pension for building massive things in orbit.

Link to comment
Share on other sites

If you find no values work at all, then there's a good chance that your vessel is not suitable for the current use case of CRCS. CRCS needs RCS ports roughly equally distributed around the centre of mass so that it can provide net thrust/torque in any 6-DOF direction for use as a docking aid. It is not yet designed for balancing rockets during ascent, where you would often only have RCS near the top of the vessel, and thus unequally distributed. That's why there's a big disable button in the window and why CRCS is disabled by default.

However I do admit that the manual tuning is tedious. I am working on this.

Man, i did was you said on the first post. My original ship had only 4 of 4x RCS trusters on center of mass, but as you explain on first post, it need to be "around the center", so i put 4x4rcs on up and 4x4rcs on down (my ship take off and land vertically) i try to put at same distance from the center of mass, but because you claim the plugin as computer, i think it will balance accordingly. But didn't. If i raise the value, it turn off. So in lower values, it show a little trust, but on docking mode of mechjeb, the ship moves in the right angle, but keep losing in one of the 3 axis, going far and far away. Other thing i notice, is the 3th axis when i press "enter" it not "format the number " as happens on other two axis (3 first axis). Oh, i use Mac.

Link to comment
Share on other sites

Man, i did was you said on the first post. My original ship had only 4 of 4x RCS trusters on center of mass, but as you explain on first post, it need to be "around the center", so i put 4x4rcs on up and 4x4rcs on down (my ship take off and land vertically) i try to put at same distance from the center of mass, but because you claim the plugin as computer, i think it will balance accordingly. But didn't. If i raise the value, it turn off. So in lower values, it show a little trust, but on docking mode of mechjeb, the ship moves in the right angle, but keep losing in one of the 3 axis, going far and far away. Other thing i notice, is the 3th axis when i press "enter" it not "format the number " as happens on other two axis (3 first axis). Oh, i use Mac.

Hmm... Looks like the formatting problem may be the key. It indicates that the new value is not being set or even checked, as if the "enter" is not registering. Are you definitely using the latest (0.1.2a) version? Which box is it exactly? X, Y, Z, pitch, roll, yaw? I have heard of Unity incompatibility with Macs with a possibly similar issue. If it is that I should be able to fix it. BTW you are right, you should not need to worry about the distances between the thrusters.

Link to comment
Share on other sites

Hmm... Looks like the formatting problem may be the key. It indicates that the new value is not being set or even checked, as if the "enter" is not registering. Are you definitely using the latest (0.1.2a) version? Which box is it exactly? X, Y, Z, pitch, roll, yaw? I have heard of Unity incompatibility with Macs with a possibly similar issue. If it is that I should be able to fix it. BTW you are right, you should not need to worry about the distances between the thrusters.

It was the latest version, yes.

I don't remember if was x,y,z, pitch or roll, because i already uninstall it. But i know for shure that was the 3rd value from the 3 first. Unity work fine here. The game itself and the Unity for developersn, i install it i try it a little.

Let me know if you change or fix some, so i can try again...

;)

Link to comment
Share on other sites

BTW, it seems that the legal agreement for uploading to Space Port is very restrictive - Squad want sole rights to distribute plugins, i.e. you are not allowed to host an uploaded plugin anywhere else. For that reason I am not currently going to host this plugin on Space Port.

Their English is not very good, but I think that 1.i. is saying that they will not upload your mod to any other site. I do not think you are restricted from doing so. The entire 1. section is describing authorizations and restrictions that you are granting to them.

http://kerbalspaceprogram.com/commercial-package-submission-guidelines/

Link to comment
Share on other sites

Their English is not very good, but I think that 1.i. is saying that they will not upload your mod to any other site. I do not think you are restricted from doing so. The entire 1. section is describing authorizations and restrictions that you are granting to them.

http://kerbalspaceprogram.com/commercial-package-submission-guidelines/

I was looking at the bit just before that list:

Likewise, you grant us the exclusive right, during the term (stipulated in clause 2), in order to: ...

Which seems to me to mean that only SQUAD are allowed to do any of the things in that list, including

d) Place your products in websites, SQUAD advertisements and, in general, in any other communication means currently known or to be known.
which presumably includes hosting on other sites.

You may be right that they did not intend this, and I'm no legalese expert (IANAL), but I would like proper clarification before I upload.

Link to comment
Share on other sites

There's nothing to picture, really. You'll only feel the difference when actually using the plugin.

BTW, and ETA on this plugin being able to control off-axis engines?

Link to comment
Share on other sites

There's nothing to picture, really. You'll only feel the difference when actually using the plugin.

BTW, and ETA on this plugin being able to control off-axis engines?

You can see the varying intensity of RCS ports depending on their location, but that's not really worth a picture.

I agree engine thrust balancing is a very nice feature to have, but I am currently focussing on improving the usability and performance first as per the goals I set in post 27. The more control I give this plugin over your vessel, the more it needs to be fast and easy to use. And of course, the ETA for everything is When It's ReadyTM.

Edited by ZRM
Link to comment
Share on other sites

  • 5 weeks later...

[*] Improve the current solver with a matrix decomposition method (e.g. Singular Value Decomposition). This should improve performance and allow the GUI to give an idea of the responsiveness range and suitable default settings, as well as providing a compromise solution (i.e. clamp to max thrust) instead of no thrust when the old solver would have been "Out of Bounds".

[*] Multithread the solver - even if the new solver is fast enough for large vessels to function adequately multithreading will decouple the system from the frame rate. For example, currently I get 15FPS for a vessel with 88 RCS ports if CRCS is active, and 120FPS (vsync) if it is not. Even if the new solver is just as slow, moving it out of the frame update thread will make its slowness affect the frame rate only slightly (and not at all in machines with an adequate number of cores).

If you are doing all your own calculations, maybe you could do them less frequently by using Runge Kutta or similar rather than Euler?

Also perhaps you could cache expensive calculations. Record coefficients for each RCS thruster that you expect to give you 0 angular momentum in whatever direction, then just look at the change in angular momentum each frame, if it's above some error margin recaclulate.

Re. Feature requests, a fuel efficiency option would be neat. Have an option in the GUI somewhere and if clicked it will only fire the RCS ports that have a large moment about the axis (for rotation) or net thrust (for translation). Maybe rank all the thrusters against each other and pick only those with more than the mean (median? first quartile? would have to see what works). For translation it'd be simpler as you could fire only those that are at less than 45 degrees from your desired angle intentionally, then add enough using the other scheme to cancel rotation.

Edited by SchroedingersHat
Link to comment
Share on other sites

One of the primary reasons I use Hydrotech RCS is because it has an RCS scaling "throttle." Another excellent feature is that it's able to apply RCS thrust continuously and/or via main throttle. If you were to adopt these I think it would help the overall goal of the mod (more RCS control) and save me having so many darn mods. Basically I think RCS is crazy powerful and it becomes a chore to keep my impulses small during maneuvers. Having the RCS balanced, throttled, and toggle/momentary switchable would be the perfect storm of RCS control mods.

Link to comment
Share on other sites

If you are doing all your own calculations, maybe you could do them less frequently by using Runge Kutta or similar rather than Euler?

Also perhaps you could cache expensive calculations. Record coefficients for each RCS thruster that you expect to give you 0 angular momentum in whatever direction, then just look at the change in angular momentum each frame, if it's above some error margin recaclulate.

Re. Feature requests, a fuel efficiency option would be neat. Have an option in the GUI somewhere and if clicked it will only fire the RCS ports that have a large moment about the axis (for rotation) or net thrust (for translation). Maybe rank all the thrusters against each other and pick only those with more than the mean (median? first quartile? would have to see what works). For translation it'd be simpler as you could fire only those that are at less than 45 degrees from your desired angle intentionally, then add enough using the other scheme to cancel rotation.

One of the primary reasons I use Hydrotech RCS is because it has an RCS scaling "throttle." Another excellent feature is that it's able to apply RCS thrust continuously and/or via main throttle. If you were to adopt these I think it would help the overall goal of the mod (more RCS control) and save me having so many darn mods. Basically I think RCS is crazy powerful and it becomes a chore to keep my impulses small during maneuvers. Having the RCS balanced, throttled, and toggle/momentary switchable would be the perfect storm of RCS control mods.

Sorry for not yet linking it in this thread, but the dev thread should keep both of you up to speed with the current development progress and algorithms being used. As you can see in the most recent posts there, performance is no longer an issue due to my implementation of a different optimisation algorithm providing unparalleled performance. The new (unreleased, but nearing release) version also has an RCS strength slider for each direction/axis. This makes it ideal for easy precision maneuvering. The new version does not require any manual configuration in order to work. It automatically scales input based on the detected capabilities of the vessel. You can enable/disable it via action groups, and you can enable/disable angular control separately. This is useful for stopping ASAS from interfering with docking. Regarding efficiency, the new solver automatically finds the most fuel efficient solution for the desired thrust vector. If you find fuel usage is higher than desired, decrease the RCS strength. It will always find the most efficient solution for the specified strength and input.

The project is also expanding into engine thrust balancing, as it is essentially the same problem (balancing thrusts). This means that in the new version you need not worry about VTOLs or rotationally asymmetrical launch vehicles falling over.

Any chance of releasing the source code or better having it on github? I would love to help work on this with you as the default RCS system annoys me to no end.

I will PM you about this. Unfortunately the situation is currently not very straightforward.

Link to comment
Share on other sites

Unfortunately the situation is currently not very straightforward.
4.2 Addon licensing

All addons, plugins and similar works (such as code, textures or models) posted on the services as meant in 1.1 must be accompanied by the source code (if applicable) and a license in both the post and the download file. Any works derived from addons, plugins and similar works must attribute the original work and provide proof of rights to use the original work.

You really need to include the source for the plugin ZRM, sorry but it's the rules, I'll leave this thread up for now but it'll have to be added either here or in the zip soon.

If the plugin was a collaborative effort, get the required permissions and add them to the readme/license.

Link to comment
Share on other sites

This thread seems scarily dead. Please tell me it ain't so.

No, it's not dead, just waiting - waiting for me to finish the implementation of the engine balancing VTOL mode. I'm getting there. When that's done, there will (hopefully) be lots of inspirational images of VTOL SSTOs and other contraptions that you can achieve with this mod.

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