Jump to content

[1.12.x] Anatid Robotics / MuMech - MechJeb - Autopilot - [2.14.1] [1st April 2022]


sarbian
 Share

Recommended Posts

On 6/24/2018 at 2:59 AM, Starwaster said:

That's the fault of so-called Smart RCS which tampers with actuation settings and its functions are not optional.

If it's set to using RCS for rotation then every single RCS part is set to allow all rotations even if they were user-disabled.

If it's set to not use RCS for rotation then all RCS parts are changed to disable all rotations.

Was there ever a fix for this? I have RCS rotation controls disabled by default using a community patch, but whether I disable them via mm patch or manually, Mechjeb reenables them. FWIW, I have Smart RCS set to disable rotation, but if I turn RCS on while Maneuver Planner has control, it uses RCS for rotation until I turn the controls off manually a second time.

@sarbian, I would happily help to diagnose this. My cats know more about code than I do, but I can set up a test installation with just Mechjeb or anything else you'd like. My last log was from a 6+ hour play session, so I haven't included it, but if you'd like I will run an "in and out" session to log the problem and post it. 

Link to comment
Share on other sites

On 2/23/2022 at 7:51 AM, eightiesboi said:

@sarbian, I would happily help to diagnose this. My cats know more about code than I do, but I can set up a test installation with just Mechjeb or anything else you'd like. My last log was from a 6+ hour play session, so I haven't included it, but if you'd like I will run an "in and out" session to log the problem and post it. 

There is no need to diagnose anything. SmartRCS disable rotation or translation by changing the RCS config. It does not save the original config and so it can not restore it when switched off.  Saving the conf is not trivial, but far from impossible.  The main issue is people willing to code it. I am not among those people.

Link to comment
Share on other sites

On 2/23/2022 at 1:51 AM, eightiesboi said:

Was there ever a fix for this? I have RCS rotation controls disabled by default using a community patch, but whether I disable them via mm patch or manually, Mechjeb reenables them. FWIW, I have Smart RCS set to disable rotation, but if I turn RCS on while Maneuver Planner has control, it uses RCS for rotation until I turn the controls off manually a second time.

@sarbian, I would happily help to diagnose this. My cats know more about code than I do, but I can set up a test installation with just Mechjeb or anything else you'd like. My last log was from a 6+ hour play session, so I haven't included it, but if you'd like I will run an "in and out" session to log the problem and post it. 

I think the solution was not to use smart rotation....  Honestly I don't remember what I do about it for myself. I'll look into it

Link to comment
Share on other sites

7 minutes ago, Starwaster said:

I think the solution was not to use smart rotation....  Honestly I don't remember what I do about it for myself. I'll look into it

For what it's worth, here's a short video clip so what I am describing is clear. You can see on the left that SmartRCS has "Use RCS for rotation" unchecked. On the right you can see that Yaw, Pitch, and Roll are all set to "Off" on my RCS Thruster Block. When I roll the ship, everything is fine until I stop rolling (with SAS on) and the reaction wheels kick in. Then RCS toggles rapidly between on and off until the ship stops rolling, and then stays on. Same with a pitching movement. 

Video clip: https://1drv.ms/v/s!AoyHZiRU1jT-z5Fwsq8fCkZdBpqGwA?e=zFmOBF

I threw the logs in the same folder, just for fun, but I captured this during a play session, not in my (clean) test environment: https://1drv.ms/u/s!AoyHZiRU1jT-z5FvLjmi4BIhDEw8eA?e=ycPw5k

I'd appreciate any suggestions anyone might have.

 

Link to comment
Share on other sites

19 hours ago, eightiesboi said:

For what it's worth, here's a short video clip so what I am describing is clear. You can see on the left that SmartRCS has "Use RCS for rotation" unchecked. On the right you can see that Yaw, Pitch, and Roll are all set to "Off" on my RCS Thruster Block. When I roll the ship, everything is fine until I stop rolling (with SAS on) and the reaction wheels kick in. Then RCS toggles rapidly between on and off until the ship stops rolling, and then stays on. Same with a pitching movement. 

Video clip: https://1drv.ms/v/s!AoyHZiRU1jT-z5Fwsq8fCkZdBpqGwA?e=zFmOBF

I threw the logs in the same folder, just for fun, but I captured this during a play session, not in my (clean) test environment: https://1drv.ms/u/s!AoyHZiRU1jT-z5FvLjmi4BIhDEw8eA?e=ycPw5k

I'd appreciate any suggestions anyone might have.

 

I never find that I need to roll quickly in space, so rarely use RCS for rolls and rely on reaction wheels for that.  Most cases I see are that RCS is mostly only necessary for pitch, yaw, and translations.   I think you may have too much control authority for the roll so the MJ PID is overshooting.  You can adjust the PID values iirc (I haven't used MJ in awhile since getting more up to speed in kOS) but it would probably be easier to disable the roll actuation toggles in the part pop-up window on your thrusters.  But if your reaction wheels aren't enough to roll, and the RCS is too much, then adjusting down the overall thrust limiter of your thrusters in the part pop-up window could help; especially if the roll thrusters are separate linear thrusters, then it would be a no-brainer

Link to comment
Share on other sites

4 minutes ago, darthgently said:

I never find that I need to roll quickly in space, so rarely use RCS for rolls and rely on reaction wheels for that.  Most cases I see are that RCS is mostly only necessary for pitch, yaw, and translations.   I think you may have too much control authority for the roll so the MJ PID is overshooting.  You can adjust the PID values iirc (I haven't used MJ in awhile since getting more up to speed in kOS) but it would probably be easier to disable the roll actuation toggles in the part pop-up window on your thrusters.  But if your reaction wheels aren't enough to roll, and the RCS is too much, then adjusting down the overall thrust limiter of your thrusters in the part pop-up window could help; especially if the roll thrusters are separate linear thrusters, then it would be a no-brainer

Hi! I appreciate your response, but I think you may have misunderstood my issue. I am not trying to use RCS for rotation. I am trying *not* to use RCS for rotation. RCS rotation (roll/pitch/yaw) is disabled (by me, intentionally), both in the actuator settings and in the Mechjeb settings. However, Mechjeb appears to be rapidly toggling it on and off, and then leaving it on. 

Edited by eightiesboi
Clarification
Link to comment
Share on other sites

7 minutes ago, eightiesboi said:

I am trying *not* to use RCS for rotation. RCS rotation (roll/pitch/yaw) is disabled (by me, intentionally), both in the actuator settings and in the Mechjeb settings. However, Mechjeb appears to be rapidly toggling it on and off, and then leaving it on. 

Just an outside the box thought for a sec. Build using single direction RCS units. You can either leave ones for roll completely off or otherwise set them to zero thrust limited when you don't want them used. As they are individual they don't need to use the method that mechjeb seems to be overiding. The modern KSP variants mean you can also use ones with only 2 nozelles for forward and backward so as to reduce parts.

Link to comment
Share on other sites

1 minute ago, ColdJ said:

Just an outside the box thought for a sec. Build using single direction RCS units. You can either leave ones for roll completely off or otherwise set them to zero thrust limited when you don't want them used. As they are individual they don't need to use the method that mechjeb seems to be overiding. The modern KSP variants mean you can also use ones with only 2 nozelles for forward and backward so as to reduce parts.

That's a good idea, but it doesn't work. The single direction RCS has the same toggles and suffers from the same issue. Here's another video that shows what I am talking about, and I apologize for getting your name wrong (I called you ColdP instead of ColdJ!). Notice that in this case, I was yawing, not pitching or rolling. Any rotation seems to reactivate the disabled settings.

https://1drv.ms/u/s!AoyHZiRU1jT-z5F036PL2GuwB1B3Uw?e=A6Cq4P

 

Link to comment
Share on other sites

4 minutes ago, eightiesboi said:

Any rotation seems to reactivate the disabled settings.

Just to be clear, are you saying that if you set the thrust limiter to allowing no thrust whatsoever (using the slider, not the rcs actuation toggle)That mechjeb can change the slider and bring it back up?

Also what happens if you only have RSC that point forward and backwards, it can push and pull and yaw on a flat plane but you would need the reaction wheels to roll?

Link to comment
Share on other sites

4 minutes ago, ColdJ said:

Just to be clear, are you saying that if you set the thrust limiter to allowing no thrust whatsoever (using the slider, not the rcs actuation toggle)That mechjeb can change the slider and bring it back up?

Also what happens if you only have RSC that point forward and backwards, it can push and pull and yaw on a flat plane but you would need the reaction wheels to roll?

No, that's not what I am saying. If I set the thrust to zero or individually disable the RCS in the PAW,  then Mechjeb doesn't change it. However, means I also can't use them when I need to use the RCS without turning them all back on individually (in the case of disabling them) or touch the thrust slider for at least one thruster in a symmetry group. 

As far as having RCS that only point forward and backwards, yes, Mechjeb will enable them and use them for rotation control, but pitch and yaw only though (obviously, roll is not a factor). So that doesn't help me and takes away the main thing I use RCS for, fine translation control. 

My problem is exactly what sarbian said:

On 2/25/2022 at 12:25 PM, sarbian said:

There is no need to diagnose anything. SmartRCS disable rotation or translation by changing the RCS config. It does not save the original config and so it can not restore it when switched off.  Saving the conf is not trivial, but far from impossible.  The main issue is people willing to code it. I am not among those people.

I guess one fix for me would be if I could disable the SmartRCS module itself, but I don't see a way to do that in the config files that I can touch. I am fine disabling rotation on RCS through an MM patch myself. I mean, that's what I already have done, but Mechjeb wants it to be on. :lol:

One also possible fix might be (if I understood what sarbian said) to set the default so that SmartRCS (when set to disable rotation) defaults to toggling rotation off, instead of defaults to toggling it back on. I don't know. In the end, Mechjeb is very useful and still worth it even if keeps turning my RCS rotation back on. 

Link to comment
Share on other sites

On 2/26/2022 at 9:10 PM, eightiesboi said:

No, that's not what I am saying. If I set the thrust to zero or individually disable the RCS in the PAW,  then Mechjeb doesn't change it. However, means I also can't use them when I need to use the RCS without turning them all back on individually (in the case of disabling them) or touch the thrust slider for at least one thruster in a symmetry group. 

As far as having RCS that only point forward and backwards, yes, Mechjeb will enable them and use them for rotation control, but pitch and yaw only though (obviously, roll is not a factor). So that doesn't help me and takes away the main thing I use RCS for, fine translation control. 

My problem is exactly what sarbian said:

I guess one fix for me would be if I could disable the SmartRCS module itself, but I don't see a way to do that in the config files that I can touch. I am fine disabling rotation on RCS through an MM patch myself. I mean, that's what I already have done, but Mechjeb wants it to be on. :lol:

One also possible fix might be (if I understood what sarbian said) to set the default so that SmartRCS (when set to disable rotation) defaults to toggling rotation off, instead of defaults to toggling it back on. I don't know. In the end, Mechjeb is very useful and still worth it even if keeps turning my RCS rotation back on. 

I control all my RCS via kerboscript in kOS.  The more you get into strange situations, like docking via a side port, or an aft port to a craft landed on Minmus, the more you realize that roll/pitch/yaw and all the translations get completely turned around when you control from a controlpoint not in line with the normal controlpoint.  At which point you realize the solution is a programming solution.  What drives me nuts is that kOS *cannot* read or alter the "Caps Lock" KSP RCS "fine"/"coarse" control which always makes for fun when trying to code a nice thrust limit and actuation toggle solution based on calculated thruster torques and craft angular moments and angular velocities.  I can see why anyone coding a "smart RCS" would at some point have to put a fence around it and close the gate on further development.  It is an endless problem that will always need more that new thing some new user is trying to do with their craft requires

Edited by darthgently
Link to comment
Share on other sites

Love and appreciation for the work as always!

Getting back to KSP after a bit of a break, now that my preferred mods are all updated.  I do recall some lingering issues with the Advanced SAS when controlling vessels in-atmosphere or with very low rotation rates outside the atmosphere last I checked, though.  I'll try to post about them if I notice them again (although I normally just use Atmosphere Autopilot for really finicky spaceplanes instead...)

Wanted to say, hope this mod won't be abandoned/frozen!  There's always more ways to improve something like this, when time permits- and KSP has lots more development potential for mods - so people need not treat it as dead (SQUAD could release another DLC, too, to keep funding up for more free updates, if they would give their focus on KSP2 a rest for a moment- as it looks to be hitting countless development delays...)

Anyways, thanks and appreciation!  Hope all is well!

Edited by Northstar1989
Link to comment
Share on other sites

On 2/26/2022 at 7:51 PM, eightiesboi said:

Hi! I appreciate your response, but I think you may have misunderstood my issue. I am not trying to use RCS for rotation. I am trying *not* to use RCS for rotation. RCS rotation (roll/pitch/yaw) is disabled (by me, intentionally), both in the actuator settings and in the Mechjeb settings. However, Mechjeb appears to be rapidly toggling it on and off, and then leaving it on. 

So I started up KSP and loaded up a craft because it's been long enough that I really don't remember what SmartRCS does (other than the post of mine you quoted)

Apparently I don't have that problem anymore and I don't remember what I did to eliminate it. I'm using a custom MJ2 branch because I didn't like certain changes that were made and also to test out certain ideas that I had been thinking of submitting but never did.

Anyway, I suspect that I hacked on SmartRCS to prevent it from making changes to my RCS at all (I probably just literally am not allowing it to touch my RCS at all)

I'm still looking to see where in the code I did that. 

Edited by Starwaster
Link to comment
Share on other sites

3 minutes ago, Starwaster said:

So I started up KSP and loaded up a craft because it's been long enough that I really don't remember what SmartRCS does (other than the post of mine you quoted)

Apparently I don't have that problem anymore and I don't remember what I did to eliminate it. I'm using a custom MJ2 branch because I didn't like certain changes that were made and also to test out certain ideas that I had been thinking of submitting but never did.

Anyway, I suspect that I hacked on SmartRCS to prevent it from making changes to my RCS at all (I probably just literally am not allowing it to touch my RCS at all)

I'm still looking to see where in the code I did that. 

If you find it and you don't mind sharing, that would be fantastic!

Link to comment
Share on other sites

20 minutes ago, eightiesboi said:

If you find it and you don't mind sharing, that would be fantastic!

Found it.

I commented out the entire section referenced below. I probably commented rather than outright remove because I wasn't sure I wasn't totally screwing something up, but the impact was such that I stopped ever thinking about it for four years until you reminded me.

So the effect apparently wasn't exactly catastrophic.

https://github.com/MuMech/MechJeb2/blob/34a8654ccba60d46f745c8fd4e8bf46f0800daa7/MechJeb2/MechJebModuleThrustController.cs#L825-L841

Edited by Starwaster
Link to comment
Share on other sites

31 minutes ago, Starwaster said:

Found it.

I commented out the entire section referenced below. I probably commented rather than outright remove because I wasn't sure I wasn't totally screwing something up, but the impact was such that I stopped ever thinking about it for four years until you reminded me.

So the effect apparently wasn't exactly catastrophic.

https://github.com/MuMech/MechJeb2/blob/34a8654ccba60d46f745c8fd4e8bf46f0800daa7/MechJeb2/MechJebModuleThrustController.cs#L825-L841

First, I am definitely not a coder, but I don't see why that little snippet of code exists.  It does seem like the likely culprit. I don't have the tools installed to compile the code right now, but maybe I will download them this weekend, comment out that section, and then see if it kills my problem without causing any new ones.

Thanks, Starwaster.  :)

Link to comment
Share on other sites

  • 3 weeks later...

Hello there,

I´m having some weird behaviour using mechjeb.

Trajectories way off course, unable to do a simple maneuvre, mechjeb struggles to find the "blue direction point" it goes there to half the way, then starts to go back, and stays there or goes again to the direction point just for to pass it, and stay doing circles going nowhere...

I have used mechjeb on this install for months, no problems until now.

As for new mods installed, (about two weeks ago) Hessenberg, Hooligans labs, TCA, REO (realism enviromental overhaul)  and upgraded  versions of principia and kopernicus

Ksp 1.10.1  RO/RSS/principia mechjeb 2.12.3, I downgrade to mechjeb 2.11 , same behaviour

log  https://www.mediafire.com/file/2n40xpniax9aq6g/KSP.log/file

Any hep is appreciated

 

thanks

Edited by Makrom
correction of game version
Link to comment
Share on other sites

11 minutes ago, Makrom said:

Hello there,

I´m having some weird behaviour using mechjeb.

Trajectories way off course, unable to do a simple maneuvre, mechjeb struggles to find the "blue direction point" it goes there to half the way, then starts to go back, and stays there or goes again to the direction point just for to pass it, and stay doing circles going nowhere...

I have used mechjeb on this install for months, no problems until now.

As for new mods installed, (about two weeks ago) Hessenberg, Hooligans labs, TCA, REO (realism enviromental overhaul)  and upgraded  versions of principia and kopernicus

Ksp 1.11 RO/RSS/principia mechjeb 2.12.3, I downgrade to mechjeb 2.11 , same behaviour

log  https://www.mediafire.com/file/2n40xpniax9aq6g/KSP.log/file

Any hep is appreciated

 

thanks

Probs the joints messing up. kjr tends to ruin precise trajectories which programs struggle to adapt to as robots are very literal in terms of understanding things.

7 minutes ago, TheLoneOne said:

Probs the joints messing up. kjr tends to ruin precise trajectories which programs struggle to adapt to as robots are very literal in terms of understanding things.

Also if your doing rss and RO of course there’s gonna be bugs like this. Ksp’s game engine is designed weirdly, like why they would make parts flexible in the first place of ridged when they wrote the base code I’m not exactly sure as it ended up causing what I would say were a good majority of the bugs in game and makes your craft go through minuscule joint flexes which create literal free energy from nothing and this is constant, kjr try’s to stop it and it only amplifies the free energy gained. By like a magnitude of 2 from what I’ve estimated

Edited by TheLoneOne
Link to comment
Share on other sites

27 minutes ago, TheLoneOne said:

Probs the joints messing up. kjr tends to ruin precise trajectories which programs struggle to adapt to as robots are very literal in terms of understanding things.

Yeah well it makes some sense, actually if I put manually the cursor on the "maneuver point" and then active mechjeb, it does his job flawlessly

 

Link to comment
Share on other sites

31 minutes ago, Makrom said:

Yeah well it makes some sense, actually if I put manually the cursor on the "maneuver point" and then active mechjeb, it does his job flawlessly

 

yea that helps a lot to do because principa likes to spin you right around 

Link to comment
Share on other sites

7 hours ago, TheLoneOne said:

like why they would make parts flexible in the first place of ridged when they wrote the base code

The Unity engine doesn't like rigidty when you have large multipart constructions, tends to make craft explode.

Link to comment
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.

 Share

×
×
  • Create New...