sarbian

[1.7.x] Anatid Robotics / MuMech - MechJeb - Autopilot - [2.8.4] [14 June 2019]

Recommended Posts

11 hours ago, El Sancho said:

I teach English online, and much of my working day consists of waiting for students. So, given that my major was Political Science and some of this stuff goes waaaaayyyy over my head, I decided to look up this Jezewski's algorithm just on the basic principle of self-education. When I Googled it, I found to my amusement that the first results are related to "uterine contractions and fetal heartrate". Apparently this is the work of Janusz Jezewski, whereas the rocket-related stuff is the work of D.J. Jezewski. The rocket stuff does show up further down the page, but my initial reaction was along the lines of, "Ahhhh, Whiskey Tango Foxtrot, Jim?"

Heh yeah, bit of a long road from uterine contractions to optimal free space n-impulse trajectories:

https://arc.aiaa.org/doi/10.2514/3.4949

Matlab code which implements the analysis part of this is here:

https://www.mathworks.com/matlabcentral/fileexchange/39160-optimal-impulsive-orbital-transfer?s_tid=prof_contriblnk

primer.m, pviniz.m, pvector.m and stm.m seem to be the most relevant files.

Share this post


Link to post
Share on other sites
On 3/13/2019 at 9:12 PM, Jim DiGriz said:

In the "Attitude Adjustment" make sure you have "Hybrid Controller" selected, and set "MaxStoppingTime" to 10.

If you then start to notice that when docking, etc using RCS that it uses piles and piles of monoprop you'll need to set it back down to 2.

Difficult to autotune that one based on whatever anyone might be doing with any rocket, so you need to manually tweak that sometimes.

Just tried this with the "classic" ascent targeting the moon, and went through that exact process and it warped fine.

Thanks for the response, it send me looking for a mod conflict. Even though mechjeb wasn't the problem, it was instrumental in being able to debug the problem. Turned out to be in the mod Strategia. The "Attitude Adjustment" was already set like you indicated, but it was the ControlTorque indication that was really useful. Since it shows the total torque available with mechjeb engaged I could use it to figure out what configurations were glitching for me without having to launch to see the problem.

I'd have a rocket that the total torque from 3 reaction wheels was being reset to 1.5 instead of 60.5 that I got by adding torques from the part descriptions. Some rockets had problems, some didn't. In flight the problem manifested because the little pitch up mechjeb does at the end of the accent would use gimballed thrust and aerodynamic surfaces to start the rotation, then the motor would shut off and the nerfed reaction wheels couldn't arrest the pitch rate and get the nose down for the circularization burn. Instead of pitching up 5° I'd get 60° and had no time to bring it back down.

It was a pain to track down because I run around 110 mods and even once I isolated the mod, I couldn't reproduce my problem in sandbox or a new career. It was only a something about my current save causing the glitch. It took several nights to isolate the bug and then dig through the code for a mod I'd never looked at to figure out where it was buggered. I'm not a professional programmer I use F77 and C for work, so dealing with C# is also somewhat new.

I had a Strategia setting in my career that was supposed to boost the effectiveness of reaction wheels if an engineer was on board. It's something I set weeks ago and forgot about. And since then I hadn't done that many unmanned missions.The bug was setting all reaction wheels in a vessel to the effectiveness of the first reaction wheel in a vessel. If the first wheel it found was a manned capsule it usually had enough torque that the problem wasn't obvious, but if the first wheel was in a small probe core it nerfed any other reaction wheels in the booster. 

Share this post


Link to post
Share on other sites

Is it possible to create keybinds to open specific windows?

i.e. Instead of clicking the Menu Dropdown button, then selecting the radio button for each window, can I set the Landing window to open on, say mod+L, and the maneuver planner on, say mod+P, etc?

Share this post


Link to post
Share on other sites
Posted (edited)

I have little problem on 2.8.3: mj cant create advanced transfer between Jool's moon

screenshot283.png

Edited by AFF

Share this post


Link to post
Share on other sites
On 3/29/2019 at 1:01 PM, AFF said:

I have little problem on 2.8.3: mj cant create advanced transfer between Jool's moon

The GoodingSolver fixes in the dev builds should fix the "tearing" on the porkchop plot and might be related to the NRE spam but its impossible to say since there's no indication of what is NRE'ing in the logs.

Share this post


Link to post
Share on other sites
Posted (edited)

KSP v1.6.1, MJ latest dev release, KAC v3.10.0, plus 70+ other mods.

I've noticed recently that the automatic ability to warp to the next maneuver node (MN) has ceased to work.  I click on the Maneuver Planner's "Execute next node", the craft will reorient but it will not autowarp, no matter how long I wait or if I warp manually briefly (which had worked before).  I can warp manually to the MN, and the warp will be stopped at the appropriate alarm time by KAC, but the warp won't restart and the MN will be executed correctly provide I don't manually warp all the way to the MN (i.e. there is no autowarp between the KAC alarm time and the MN burn time which there had been before).

Is this a MJ or a KAC problem?

I will post a log file once I create a short one to cover this situation.

Edit: KSP Log File (yes, I know there are a few other errors but I can't find anything related to KAC or MJ)

Edited by Brigadier
Added log file

Share this post


Link to post
Share on other sites

@Brigadier I'm running the same versions of KAC and MJ with around 110 mods. As recently as this afternoon I haven't noticed any issues. The only time I've had issues auto warping was a noodle ship that never really settled down on the maneuver node using the Hybrid Controller. The ship would just start shaking and never settle down. Mechjeb Controller seemed to work better in this case.

Share this post


Link to post
Share on other sites
10 minutes ago, Tonka Crash said:

@Brigadier I'm running the same versions of KAC and MJ with around 110 mods. As recently as this afternoon I haven't noticed any issues. The only time I've had issues auto warping was a noodle ship that never really settled down on the maneuver node using the Hybrid Controller. The ship would just start shaking and never settle down. Mechjeb Controller seemed to work better in this case.

Thanks @Tonka Crash.  I have a log file but it shows nothing associated with KAC or MJ.

MJ reinstall??

Share this post


Link to post
Share on other sites
1 minute ago, Brigadier said:

Thanks @Tonka Crash.  I have a log file but it shows nothing associated with KAC or MJ.

MJ reinstall??

You can try resetting it to defaults before a reinstall.

Share this post


Link to post
Share on other sites
13 hours ago, Tonka Crash said:

@Brigadier I'm running the same versions of KAC and MJ with around 110 mods. As recently as this afternoon I haven't noticed any issues. The only time I've had issues auto warping was a noodle ship that never really settled down on the maneuver node using the Hybrid Controller. The ship would just start shaking and never settle down. Mechjeb Controller seemed to work better in this case.

Yeah noodles would probably never settle down their angular velocities.  Manually starting the warp should kick it off.

Share this post


Link to post
Share on other sites
16 hours ago, Tonka Crash said:

You can try resetting it to defaults before a reinstall.

Done and successful return to previous MJ behaviour.  What in the world might I have altered in Settings to affect that?  Nevermind, rhetorical question.

Thanks for the great advice.

Share this post


Link to post
Share on other sites
22 hours ago, Jim DiGriz said:

Yeah noodles would probably never settle down their angular velocities.  Manually starting the warp should kick it off.

This post is more an observation than a problem report, but it would be nice if something could be done. It seems that the Hybrid Controller has more problems with noodly ships that the MJ Attitude Controller or even the stock SAS

The following ship was giving me problems with MJ. Once it was fully assembled, engaging MJ in any mode would start it oscillating. The amplitude would increase until the ship shook itself apart. It was 100% consistent on load that it would oscillate to failure. For me it was either scrap the ship or figure out what was wrong. The ship didn't seem that outrageous compared to some of the stuff I've seen on these forums. The rings are single parts on a 3.75m hub. From two parts forward of the rings to the tail are 3.75m parts or larger. The forward section is mostly 2.5m. The reaction wheels are more dispersed around than I'd like, but this was really due to the ship being assembled in orbit and each module added usually added a reaction wheel. There are no docking ports between connections, I used USI Konstruction ports to connect parts together.

I tracked the problem to the Hybrid Attitude Controller being unstable for more flexible ships. Any corrections it put in would just amplify oscillations. I couldn't find any options to reverse the trend and actually damp out oscillations. Even for a steady turn it seemed to want to oscillate it's inputs rather than hold a steady value.The Hybrid Controller also seemed to pulse it's inputs rhythmically to excite the problem. Once an oscillation started switching to either the MJ Attitude Controller or even the stock SAS would damp out the oscillations. The ship behaved fine with the MJ Attitude Controller with stock values, even better if I bumped up the Tf max value to around 20.

ZKIf5Vy.png

I finally got the ship to work with the Hybrid Controller by autostrutting the hell out of it. There's also some KAS bracing between the aft tanks and the ring where it tended to snap apart. I had to triangulate the bracing with autostruts anchored to both the root in the nose and the heaviest part in the tail. I normally don't use heaviest as an anchor as it will shift as fuel burns off, but it was the only way to force the autostruts to be more distributed.

I've noticed problems with oscillations in other space stations going back a few months, but they were infrequent and reloading physics would usually damp it out. Next time I see it, I'll try swapping the attitude controller.

A07LUEl.png

Share this post


Link to post
Share on other sites

At some point in the future I might take a run at better auto-tuning quaternion-based PID controllers, but that kind of thing is literally an active area of research in the professional literature.

It is not a simple bugfix kind of problem.  And whatever changes you make to naive PID controllers it is a process of pushing bugs and tuning issues around that will never satisfy everyone.

The solution that you're going towards is likely the correct solution.  The way that KSP is designed to be a ragdoll rocket simulation is both one of its strengths and also entirely awful.  Mods like KerbalJointReinforcement try to address the problems that it creates.  I think you can also use editor extensions to set the default autostruts to grandparent part in the VAB (or you can convert them all with one click, I can't quite recall now -- but it definitely makes it easier to work with autostruts).  

Share this post


Link to post
Share on other sites

I needed to say it, Mechjeb is incredible!

Today I had my Muna station keeping station looking at the sun, while a tanker was auto-docking and a lander was auto-docking with the moving tanker. Just beautiful!

 

Thx

Share this post


Link to post
Share on other sites
2 hours ago, Tacombel said:

I needed to say it, Mechjeb is incredible!

Today I had my Muna station keeping station looking at the sun, while a tanker was auto-docking and a lander was auto-docking with the moving tanker. Just beautiful!

 

Thx

Wow, that's impressive!

In a way this makes me think of something I'm wrestling with right now - how to hook up various pieces on the Minmus surface in order to form a surface base too big to land in one piece. Related to this is also the issue of how to handle refueling. HOW can I land a rocket and somehow hook it up to a surface base that is mining and refining fuel. Minmus gravity is low enough that I can probably just jackass it together by using some RCS thrusters for lift. Who knows, if the component has enough lift, the Docking Autopilot might even work.

Then again, I suppose such discussions don't really belong in this forum; they are questions of how to use MJ, rather than reports of bugs in MJ. Hmm, is there a forum for discussion of the use of MechJeb?

Share this post


Link to post
Share on other sites

i'm using this mod for galileo's planet pack and and it doesnt show kerbin as gael and ive seen it work and i got it to show gael instead of kerbin when i did it in 1.3 but in 1.6.1 its not working.

Share this post


Link to post
Share on other sites
10 minutes ago, Jim123 said:

i'm using this mod for galileo's planet pack and and it doesnt show kerbin as gael and ive seen it work and i got it to show gael instead of kerbin when i did it in 1.3 but in 1.6.1 its not working.

I dodged that issue entirely by keeping Kerbin as my starting planet and Gael as a different planet.  In the Galileo Planet Pack there's a config for this (Gael as secondary, something like this).  There's a lot of hard-coding going on with both the GPP mod and the base game that makes it not play well with a handful of other mods, including MechJeb.

As a side note, I just kept going and really tweaked the GPP configs to basically merge the GPP planets with the base game.  The solar system got a little crowded, but there was always plenty to run around and explore.  If you tweak the parameters right, you can make Kerbin and Gael a binary system that revolves around each other in the course of a year.  Hint:  Offset the Gael orbit by a few fractions of a point and they'll glide around each other in a circle as they orbit Kerbol.

Share this post


Link to post
Share on other sites

I'm not sure if this was already addressed, but I can't seem to figure this out.  A long time ago I was able to tweak the config file to have all modules available at the start, then a few updates happened then I had to upgrade the control building fully in addition to the tweaks to get the modules.  Now I am only getting half of the modules at the start even after upgrading all the buildings.  I know there were a few updates to this mod so something had to have changed for this.  There are no errors or anything like that, in fact the game runs beautifully with the exception of this.  What do I have to do now to get all modules at the start?

Share this post


Link to post
Share on other sites
4 hours ago, meltedplasticarmyguy said:

I'm not sure if this was already addressed, but I can't seem to figure this out.  A long time ago I was able to tweak the config file to have all modules available at the start, then a few updates happened then I had to upgrade the control building fully in addition to the tweaks to get the modules.  Now I am only getting half of the modules at the start even after upgrading all the buildings.  I know there were a few updates to this mod so something had to have changed for this.  There are no errors or anything like that, in fact the game runs beautifully with the exception of this.  What do I have to do now to get all modules at the start?

There's a mod, very small, called "MechJebForAll". It puts MechJeb in all the capsules. Since nobody "flies" a booster, and they were essentially guided missiles anyway, that may be more realistic, It's a Module Manager file, there's a list of the tech-tree nodes where the MechJeb functions get turned on, and if you use "start" MechJeb is available for the whole tech tree.

The AR202 has the same switch-on list, plus some extra sections that pretty up the presentation of the effect in the Tech Tree

It doesn't feel like cheating to switch on Ascent Guidance at the start. On the other hand, the astronauts had to learn how to do rendezvous and docking. Buzz Aldrin wrote the book on that. 

Share this post


Link to post
Share on other sites
Posted (edited)

In case anyone is using the MJ dev branch on CKAN, 2.8.3-882 doesn't seem to be stable on 1.6 despite what CKAN says. Both node execution and auto-decoupling will fail to operate optimally, and log spam close to the following message will occur

[ERR 09:37:57.919] MechJeb module MechJebModuleStagingController threw an exception in OnUpdate: System.TypeLoadException: Could not load type 'ModuleDecouplerBase' from assembly 'MechJeb2'.

It does however work decently on 1.7

Edited by Eridan

Share this post


Link to post
Share on other sites
1 hour ago, Eridan said:

In case anyone is using the MJ dev branch on CKAN, 2.8.3-882 doesn't seem to be stable on 1.6 despite what CKAN says. Both node execution and auto-decoupling will fail to operate optimally, and log spam close to the following message will occur


[ERR 09:37:57.919] MechJeb module MechJebModuleStagingController threw an exception in OnUpdate: System.TypeLoadException: Could not load type 'ModuleDecouplerBase' from assembly 'MechJeb2'.

It does however work decently on 1.7

Can confirm that the latest dev build is working well under 1.7, I ran an entire Mun landing and return mission using most of the features today, including a romp around with a rover.

It did throw an exception error when I did a crash landing and the box got smashed, but it wasn't game breaking.

Share this post


Link to post
Share on other sites

It was build on 1.7. I did not expect it to break with 1.6

I'll see what I can do but I am 9600km from my home for 10 more days and fixing this from a phone is... perilous. 

Share this post


Link to post
Share on other sites
25 minutes ago, PolecatEZ said:

It did throw an exception error when I did a crash landing and the box got smashed, but it wasn't game breaking

If you have the exception around it is worth it to open an issue on github. Those are often missing null check and are not too hard to fix 

Share this post


Link to post
Share on other sites
1 hour ago, sarbian said:

It was build on 1.7. I did not expect it to break with 1.6

I'll see what I can do but I am 9600km from my home for 10 more days and fixing this from a phone is... perilous. 

I find that to be an......understatement.

Share this post


Link to post
Share on other sites
8 hours ago, Wolf Baginski said:

There's a mod, very small, called "MechJebForAll". It puts MechJeb in all the capsules. Since nobody "flies" a booster, and they were essentially guided missiles anyway, that may be more realistic, It's a Module Manager file, there's a list of the tech-tree nodes where the MechJeb functions get turned on, and if you use "start" MechJeb is available for the whole tech tree.

The AR202 has the same switch-on list, plus some extra sections that pretty up the presentation of the effect in the Tech Tree

It doesn't feel like cheating to switch on Ascent Guidance at the start. On the other hand, the astronauts had to learn how to do rendezvous and docking. Buzz Aldrin wrote the book on that. 

I'm not exactly sure what happened, but it's working now.  I downloaded the latest stable Dev build and did the usual routine of changing all the tech to "start" in the config file and upgrading the Communication building fully.  I know of "MJ for all", but I noticed that they were slow on updates a while back, maybe things have changed since then.  I'll give another look.

Share this post


Link to post
Share on other sites

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.