Jump to content

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


ZRM

Recommended Posts

I wonder what you'll do with this mod once .21 comes out? The ASAS is supposed to be much improved.

I am eagerly awaiting the arrival of decent ASAS. Though it will not be able to balance engines, if that's what you are implying. When 0.21 comes out I will probably have to update the mod to deal with any changes in the API, but not much else should change. Obviously, the new ASAS will make everything easier to fly level, including VTOLs using my mod.

Edited by ZRM
Link to comment
Share on other sites

If I get some time (Which may be a while, I have a backlog of work with EL and OC to do) I may see if I can help you out with the UI.

Or it may be worth looking at a library I have been working on - I have everything you need in there to save and load settings between flights on a per-ship and global basis, so whatever settings the window were on get saved to global (So new ships can use last settings) but each ship has it's own settings saved in the savegame.

Link to comment
Share on other sites

What's the difference between stock, linear, and auto-trim?

EDIT: also, is there a way to choose which engines it controlls? I'm trying to make a pod-racer, and it throttles down my drive engines instead of just controlling the VTOLs.

Edited by Retsof
Link to comment
Share on other sites

If I get some time (Which may be a while, I have a backlog of work with EL and OC to do) I may see if I can help you out with the UI.

Or it may be worth looking at a library I have been working on - I have everything you need in there to save and load settings between flights on a per-ship and global basis, so whatever settings the window were on get saved to global (So new ships can use last settings) but each ship has it's own settings saved in the savegame.

That library does look like a neat idea, but I think I have already duplicated most of the effort as I believe I have implemented the per-vessel GUI state, persistence and context menu opening/closing correctly, also with action groups. I'm only lacking window position saving and global persistence, which at this stage are not exactly critical, though I admit per-ship settings are useful. Perhaps it would be easier to incorporate that feature, rather than switch everything to your library.

Though if you have any overall suggestions for the UI (I have some ideas relating to robust, intuitive editing of numeric text fields), I would be glad for the assistance, however I think it is best to discuss this in the development thread.

Link to comment
Share on other sites

What's the difference between stock, linear, and auto-trim?

EDIT: also, is there a way to choose which engines it controlls? I'm trying to make a pod-racer, and it throttles down my drive engines instead of just controlling the VTOLs.

I designed the GUI to hopefully answer your first question. If you click the "Help" button on the avionics control panel window, it goes into help mode to help explain each mode. If these explanations are not enough for you, I am here to explain anything that is left out.

As for your second question, there is not currently a way to select engines the plugin controls. I do not plan to change this. If you think about it, leaving engines uncontrolled by the plugin would mean it can no longer balance all the forces on the vessel, leading to instability and explosions, thus making its entire purpose pointless. Instead, I plan to make additional modes that allow your pod racer (for example) to work as expected, but with all engine thrusts still balanced correctly. This would mean that your VTOL engines would compensate for any torque induced by your main engines to keep the craft stable. Doing what you suggest instead would likely make the craft fall over.

Link to comment
Share on other sites

Very interesting mod. I'd wondered why nobody had made a plugin that could tweak RCS port strengths to prevent unwanted rotation during translation... and here it is.

I hope they put something like this in career mode, near the higher end of the tech tree.

Link to comment
Share on other sites

I designed the GUI to hopefully answer your first question. If you click the "Help" button on the avionics control panel window, it goes into help mode to help explain each mode. If these explanations are not enough for you, I am here to explain anything that is left out.

As for your second question, there is not currently a way to select engines the plugin controls. I do not plan to change this. If you think about it, leaving engines uncontrolled by the plugin would mean it can no longer balance all the forces on the vessel, leading to instability and explosions, thus making its entire purpose pointless. Instead, I plan to make additional modes that allow your pod racer (for example) to work as expected, but with all engine thrusts still balanced correctly. This would mean that your VTOL engines would compensate for any torque induced by your main engines to keep the craft stable. Doing what you suggest instead would likely make the craft fall over.

Ah, yeah, uhm, I found the help button after I asked. :blush: And nice to know those other modes are planned.

Link to comment
Share on other sites

I had a play with this today but unfortunately it seems fairly useless for a space-faring VTOL.

As I mentioned before, without a top-facing control point (Which basically makes it a rocket not a VTOL anyway), you cannot accurately perform de-orbit burns or other maneuvers requiring you to burn retrograde because you cannot see the retrograde indicator and thus cannot "pickle the olive" (keep your -w- indicator inside the retrograde indicator).

Also, I tended to encounter quite a lot of "Infeasible State" and "Internal error" issues when trying - in this case the engines cut out completely.

For these tests, I used the sample craft but edited the craft file to use rocket versions of the B9 parts. I Hyperedited to Duna and attempted to land from a 60km orbit.

The engine cut out seems to happen when your thrust vector is not in line with pro/retrograde - I guess the code is mainly trying to keep you hovering? When you pitch right up I guess it is thinking that thrusting at this angle is not helping keep you up, so it cuts out? It's hard to comment on what is going wrong when I do not really know the rules the system is meant to be obeying.

Link to comment
Share on other sites

I had a play with this today but unfortunately it seems fairly useless for a space-faring VTOL.

As I mentioned before, without a top-facing control point (Which basically makes it a rocket not a VTOL anyway), you cannot accurately perform de-orbit burns or other maneuvers requiring you to burn retrograde because you cannot see the retrograde indicator and thus cannot "pickle the olive" (keep your -w- indicator inside the retrograde indicator).

Also, I tended to encounter quite a lot of "Infeasible State" and "Internal error" issues when trying - in this case the engines cut out completely.

For these tests, I used the sample craft but edited the craft file to use rocket versions of the B9 parts. I Hyperedited to Duna and attempted to land from a 60km orbit.

The engine cut out seems to happen when your thrust vector is not in line with pro/retrograde - I guess the code is mainly trying to keep you hovering? When you pitch right up I guess it is thinking that thrusting at this angle is not helping keep you up, so it cuts out? It's hard to comment on what is going wrong when I do not really know the rules the system is meant to be obeying.

Regarding the need for a reoriented navball, I will look into this for the next release.

I have been noticing a lot of numerical stability (accuracy) issues with the current solver when trying to apply it to more complex problems like gimballing. When one invocation of the solver relies on an inaccurate result of a previous invocation for a constraint, this often causes the constraint to be impossible, hence the errors and infeasible state messages. These problems do occur on simpler problems, like the example craft, however they do so much less frequently. I am currently trying to write a new solver that is much more stable. The current solver is a very naive implementation of the Primal Simplex Method. The next one will be a much more robust Bartels-Golub Revised Simplex Method. I am also working on contingency plans for the possibility of the solver failing occasionally, such as extrapolation of previous results.

The engine balancing mode in fact has no concept of the orientation the craft is in relative to anything. The pro/retrograde problem may be an illusion, or it may be related to moving reference frames for the calculations causing numerical instability. The mode does not try to keep you upright or hovering - its only task is to stop unwanted rotation when thrust is applied, regardless of the vessel's orientation. It really is trying to do exactly what its name suggests - automatic trimming of engine thrusts. This is also explained in the help info for the mode.

TLDR: The problems you are experiencing are due to the poor accuracy of the current solver in some situations, not anything related to the logic using the solver.

Link to comment
Share on other sites

Just been thinking about how things might work in an ideal situation...

I think in order to get the most from your code, I think what we need is to be able to set some engines as "RCS Only". Any engine that is set to "RCS only" ignores throttle setting and can be used for attitude control no matter what the current throttle setting is.

This would also allow us to work around the current lack of gimbal support by placing extra small engines for attitude control, allowing us to mount the main VTOL engines centrally and perpendicular, which would make normal non-VTOL mode work properly (Which was one thing hampering my attempts to land a VTOL craft on Duna).

Link to comment
Share on other sites

Just been thinking about how things might work in an ideal situation...

I think in order to get the most from your code, I think what we need is to be able to set some engines as "RCS Only". Any engine that is set to "RCS only" ignores throttle setting and can be used for attitude control no matter what the current throttle setting is.

This would also allow us to work around the current lack of gimbal support by placing extra small engines for attitude control, allowing us to mount the main VTOL engines centrally and perpendicular, which would make normal non-VTOL mode work properly (Which was one thing hampering my attempts to land a VTOL craft on Duna).

IMO, the "ideal situation" is to have gimbal support, which is why I am currently working on improving the solver so that it can cope with more complex problems.

If we pretend gimbal support is impossible, then the ideal solution would be to allow the engine balancer to make use of RCS ports and pod reaction wheels for attitude control. In a lot of cases you would then not even need gimbals or attitude control engines. Also, instead of designating small engines for attitude control, it may be better (especially from an implementation standpoint) to make dedicated powerful "RCS" block parts that combust liquid fuel + oxidiser. This would then be vaguely similar to how real VTOLs work. Harrier VTOL jets used nozzles that direct exhaust gas piped from the main engine.

Link to comment
Share on other sites

Thanks for clearing that up.

I suppose that is one solution, but then you have to go down the path of making a part...

It sounds much simpler to me to use the system you already use to attach the menu to mechjeb/pods to attach a button to each engine that sets it as an RCS thruster.

Same effect as what you propose, but should be a lot quicker to implement.

Surely even with gimbal support, you would need this, as unless you had 90deg gimbal main engines, you could not change attitude without applying translation in a direction you did not want to?

Link to comment
Share on other sites

Thanks for clearing that up.

I suppose that is one solution, but then you have to go down the path of making a part...

It sounds much simpler to me to use the system you already use to attach the menu to mechjeb/pods to attach a button to each engine that sets it as an RCS thruster.

Same effect as what you propose, but should be a lot quicker to implement.

Surely even with gimbal support, you would need this, as unless you had 90deg gimbal main engines, you could not change attitude without applying translation in a direction you did not want to?

I am assuming that all attitude control done by engines occurs when under active translation thrust (in fact the current engine mode relies on this). If this is the case, limited (e.g. 10 degrees) gimbal support is definitely enough to control rotation in every axis for most crafts with more than one engine roughly pointing in the same direction. Attitude control with no overall thrust vector applied is in the realm of RCS control.

The current mode actually makes no guarantees on translational thrust in components perpendicular to the main thrust direction other than that they are minimised. So pathological VTOL designs may result in drifting to the left or right, or more commonly forwards or backwards. The example craft has a slight tendency to move forwards, for example. You can counter this by pitching up slightly.

Link to comment
Share on other sites

Whilst I understand that the main aim of the mod is for sub-orbital VTOLs, I think that for the work involved (Which I perceive to be low, please correct me if I am wrong), allowing any engine to function as an RCS thruster opens so many doors that it would be reticent not to do it.

If it really is a quick job, then this allows sub-orbital users to not need to mount main engines at a slant (or include an extra RCS system), plus allows both the sub-orbital and orbital users to perform rotation independent of translation.

Plus, surely it could allow VTOL craft to be more efficient. If you need to maintain a hover, and perform a rotation, not all of the power of the main engines can be devoted to lift.

Sounds like a win/win to me...

Edited by evilC
Link to comment
Share on other sites

ZRM - this is a great mod. I do have a question/suggestion. Is it possible for you to add in the ability to remove or ignore engines in the engine control mode? It would be nice to have a VTOL lander that also has a separate set of OMS type engines to move around the orbit but that screws up the solver since they are included - thus the thrust vector isn't vertical.

Link to comment
Share on other sites

ZRM - this is a great mod. I do have a question/suggestion. Is it possible for you to add in the ability to remove or ignore engines in the engine control mode? It would be nice to have a VTOL lander that also has a separate set of OMS type engines to move around the orbit but that screws up the solver since they are included - thus the thrust vector isn't vertical.

Simple solution to that - turn off engines you are not using. Put them in action groups. If they are not enabled, the solver does not use them.

Link to comment
Share on other sites

Occasionally it doesn't seem to be doing it's job even though the GUI says "Nominal". I'm also seeing "Internal Error 01" - what does this mean?

Internal Error 01 occurs in a particular situation where the results of the maths the solver calculates contradict each other. This happens due to numerical instability from floating point arithmetic errors. I am currently working on an improved solver that should be much more numerically stable. So then you should in theory hardly ever see that message. Also, if you find that the balancing modes are not working perfectly (i.e. some drifting still occurs), it is likely due to numerical instability. Again, this should be fixed when I finish the next version of the solver.

Link to comment
Share on other sites

  • 2 weeks later...
Hmmm. I have now managed to reproduce this, though it only happens sometimes, and only on certain RCS blocks (I have never seen it on the stock RCS block, which is what I used for testing). It also seems that if it occurs on one RCS block, it will also occur on all of the other RCS blocks it is in symmetry with.

I have no idea why this happens.

You can replace ModuleRCS in configs with MyRCSModule (search and replace) to fix this as a workaround.

Edit: Now I have added the workaround to the OP.

Hi there, I'm loving this mod, it's making landing a lander so much easier. I am suffering with the always on rcs port, and I'm not clear on where I should be doing the above, as in which .cfg file should I be changing.

A little guidance would be much appreciated.

Link to comment
Share on other sites

Hi there, I'm loving this mod, it's making landing a lander so much easier. I am suffering with the always on rcs port, and I'm not clear on where I should be doing the above, as in which .cfg file should I be changing.

A little guidance would be much appreciated.

So, according to the OP,

FX Glitch workaround:

If you experience the issue where RCS FX animation is broken and is active all the time, edit RCS part configs so that the module

ModuleRCS
{
...
}

is renamed to

MyRCSModule
{
...
}

Basically you just need to find the config file relating to the RCS thruster block part that you are having the problems with (for example I tend to get this on KW and B9 RCS blocks especially), and replace all occurrences (there should be only one per cfg) of "ModuleRCS" with "MyRCSModule" (without quotes). You can do this easily for all RCS parts if you have a utility that can find and replace through an entire directory. Notepad++ does this especially well. Just do a search and replace for ModuleRCS to MyRCSModule on all files in GameData. Make sure to back up your old part cfgs. After this edit the FX glitch should be permanently gone.

Link to comment
Share on other sites

Is it going to be updated for 0.21?

It seems to work, though I can't move even a few meters without flipping my ship.

And since I did not use this in the past I can't tell if it's working as intended or not.

Hope this mods keeps being update, looks very promising.

Link to comment
Share on other sites

Is it going to be updated for 0.21?

It seems to work, though I can't move even a few meters without flipping my ship.

And since I did not use this in the past I can't tell if it's working as intended or not.

Hope this mods keeps being update, looks very promising.

Link to comment
Share on other sites

Is it going to be updated for 0.21?

It seems to work, though I can't move even a few meters without flipping my ship.

And since I did not use this in the past I can't tell if it's working as intended or not.

Hope this mods keeps being update, looks very promising.

Yes, it will be updated and I am working on new features for the next update. Check the development thread for progress updates.

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