sarbian

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

Recommended Posts

2 hours ago, Loren Pechtel said:

In my experience the MechJeb oscillation problem is a derivative of the underlying game oscillation problem.  You need more control authority.  What happens is that it does not correctly figure out when to start countering a turn and overshoots the target--so now it goes in the other direction.  If the control authority is low enough it overshoots by more each time.

I have seen this is stock with an EVA kerbal.  Turn the jetpack way down and tell the Kerbal to stabilize.

it doesn't work, PID create oscillation by overshooting of horizontal force and when I add some more control autority it creates bigger oscillation. And it rotate rocket during ascending.

Edited by Alexoff

Share this post


Link to post
Share on other sites
21 hours ago, Alexoff said:

it doesn't work, PID create oscillation by overshooting of horizontal force and when I add some more control autority it creates bigger oscillation. And it rotate rocket during ascending.

If you are getting oscilations the PID is overshooting and addding more control autority will  make it even worse. You should try the opposite. More is not always better.

 

Share this post


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

It helps to see a picture of your rocket. Does it look like a realistic rocket or is it a silly looking thing only a Kerbal would fly? I design my launches to have a 1.4 starting TWR

I'd like to think it's something that is fairly realistic.  See picture.  Second stage TWR may be a bit high but I'll deal with that after I can get past the first stage.  

https://imgur.com/a/83LmrPL

23 hours ago, Tonka Crash said:

What works for me for other options is:

  • Limit Q on 20000 (default)
  • Force Roll climb at whatever roll attitude you climb out at.
  • Corrective Steering Gain On (0.6) 
  • Classic Ascent Profile (Altitude & Velocity sliders all the way to the left) 
  • Classic Ascent Profile Turn Shape 60%

Pretty much yes to all the things above.  

Share this post


Link to post
Share on other sites
5 minutes ago, Eugene Moreau said:

I'd like to think it's something that is fairly realistic.  See picture.  Second stage TWR may be a bit high but I'll deal with that after I can get past the first stage.  

https://imgur.com/a/83LmrPL

Pretty much yes to all the things above.  

It looks pretty basic, but since you're using mods I don't recognize it's hard for me to judge. The TWR isn't that big a deal, I use 1.4 as a guideline not a hard requirement. But the 2nd stage TWR indicates you may be able to go to a smaller/lighter engine and shed some weight on the 2nd stage. What I don't see is a reaction wheel. If there's one in the payload it may be too small to manage the entire rocket. I'd add one to the second stage below the fairing and see it that cleans up the handling. 

What is expected to control your rocket? Do your engines gimbal? With only one engine in the first stage I'd consider gimballing a requirement. I only use fixed engines for strap-on side boosters. Do the control fins move? For something this small fixed fins can be enough with a gimballing engine. The fins might be too large if they move, you can try turning down their control authority and/or like I suggested above limit them to only pitch and yaw. As mentioned above some oscillations can be caused by too much control power where a small perturbation leads to too much of a counter-reaction and induces a divergent oscillation. Also control fins need speed to function, so they won't help immediately off the launch pad until you've got some speed built up.

For that small a payload on a 1.25m rocket I'd expect a LV-T45 1st stage with 3 small fixed fins and a reaction wheel on a Spark or Terrier 2nd stage to be trivial for MechJeb to control.

It's hard to tell, but it looks like the payload may not be perfectly symmetric. If the CoG of the payload is offset a little bit from the rocket centerline this will want to induce a small rotation under thrust. A gimballing engine will usually counter this and you would never notice it or reaction wheels can be used to counter the torqure.

When you use MechJeb you have to design to what works with MechJeb and not necessarily what you can fly by hand and reaction wheels always seem to help MechJeb maintain control. 

Share this post


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

You should try the opposite. More is not always better.

In many cases too much of a gimbal range was the reason for oscillations.

In atmosphere ascent, use hybrid. As soon as reached space, switch to mj pid.

Plus, I fiddled a patch to counter this months ago:

GameData\zFinal\zzz_useGimbalReponseTime.cfg
https://www.dropbox.com/s/8qrgvmzqxedl2az/zzz_useGimbalReponseTime.cfg?dl=1

Don't just put it in place, open it and read it. There is some info at the end. For 100% checkers.

Share this post


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

It looks pretty basic, but since you're using mods I don't recognize it's hard for me to judge. The TWR isn't that big a deal, I use 1.4 as a guideline not a hard requirement. But the 2nd stage TWR indicates you may be able to go to a smaller/lighter engine and shed some weight on the 2nd stage. What I don't see is a reaction wheel. If there's one in the payload it may be too small to manage the entire rocket. I'd add one to the second stage below the fairing and see it that cleans up the handling. 

 What is expected to control your rocket? Do your engines gimbal? With only one engine in the first stage I'd consider gimballing a requirement. I only use fixed engines for strap-on side boosters. Do the control fins move? For something this small fixed fins can be enough with a gimballing engine. The fins might be too large if they move, you can try turning down their control authority and/or like I suggested above limit them to only pitch and yaw. As mentioned above some oscillations can be caused by too much control power where a small perturbation leads to too much of a counter-reaction and induces a divergent oscillation. Also control fins need speed to function, so they won't help immediately off the launch pad until you've got some speed built up.

For that small a payload on a 1.25m rocket I'd expect a LV-T45 1st stage with 3 small fixed fins and a reaction wheel on a Spark or Terrier 2nd stage to be trivial for MechJeb to control.

It's hard to tell, but it looks like the payload may not be perfectly symmetric. If the CoG of the payload is offset a little bit from the rocket centerline this will want to induce a small rotation under thrust. A gimballing engine will usually counter this and you would never notice it or reaction wheels can be used to counter the torqure.

When you use MechJeb you have to design to what works with MechJeb and not necessarily what you can fly by hand and reaction wheels always seem to help MechJeb maintain control. 

So it's been a week or so since I looked at this, but I thought I had  an  engine that gimbals on there, but I had an LVT-30 with.  Took off the fins(yes they were control surfaces for steering and put on a LVT-45 and she flies like charm under mechjeb now.  Not sure what it's fighting against, maybe not playing well with FAR?  

Now just need to fix the second stage flipping out on separation.

 

 

Share this post


Link to post
Share on other sites

So is there any way to make mechjeb take staging into account when executing maneuvers? Say I have a stage that will burn for 23 more seconds with 500 dV but the maneuver requires 800 (they have different TWR). Currently MechJeb only uses the current stage when calculating how far ahead of the node to start the burn. Id like to have it take into account the time that stage will burn for, and if its lower than the burn time, take into account the second stage.

Share this post


Link to post
Share on other sites
On 12/6/2018 at 10:08 AM, X1machinemaker1X said:

So is there any way to make mechjeb take staging into account when executing maneuvers? Say I have a stage that will burn for 23 more seconds with 500 dV but the maneuver requires 800 (they have different TWR). Currently MechJeb only uses the current stage when calculating how far ahead of the node to start the burn. Id like to have it take into account the time that stage will burn for, and if its lower than the burn time, take into account the second stage.

It does take that into account, the countdown timer is coming from KSP itself though which does not.  

Share this post


Link to post
Share on other sites
On 12/2/2018 at 4:06 AM, Alexoff said:

This oscillation and rotation started at 1.3 as I remember. It happened with big rockets everytime. I suppose that the problem is PID regulator, maybe it use FPS in calculation and when you has significant drop of frame rate SAS module work wrong. There is one possible and stupid way to repair ascending - you can start fast clicking Q and E buttons during ascending. It helps mechjeb by some way. Maybe there is another way - fixing of mechjeb PID regulator, but Sarbian still ignoring this issue.

MJ probably has the best PID controllers in KSP-land since Sarbian put a ton of time into the "MJ" PID and then went and ported over the kOS PID controllers and integrated them.

What we're left with is that this is not an easy problem, and nobody in KSP-land seems to have general purpose solutions to it.

I think real life spacecraft (at least shuttle-sized ones) don't use PID controllers and the attitude controllers are tuned by calculus of variations solutions to the problem given the torques, moment of inertias and response rates.  But that is some solidly graduate level math.  Other people have tried and failed at non-PID controllers in KSP-land before because high-school level algebra/calculus isn't sufficient to solve that problem so PID controllers have historically been used instead.

In Chapter 9 of "Optimal Control with Aerospace Applications" example 9.1 on page 179 is "Single-axis spacecraft attitude control problem"

https://www.amazon.com/Optimal-Control-Aerospace-Applications-Technology-ebook/dp/B00GG9YORO

That is probably the direction that attitude control needs to go to improve it to the point where it doesn't need user tweaking.

Pull Requests accepted.

Up until then, users are absolutely expected to learn to create rockets that the PIDs can handle better (e.g. less control authority => less wobbling), or to learn to tune the PIDs themselves.

Share this post


Link to post
Share on other sites

For all of you having issues with rocket wobble who are *fixed* by going to the HybridController -- what happens if the MaxStoppingTime is dropped down to 2 or 1 or 0.5 during launch?  Do the wobbles come back?  If the wobbles don't come back, does the HybridController get better at executing nodes in orbit without wasting piles of RCS?

Share this post


Link to post
Share on other sites

Hey everyone, new to Mechjeb, was planning a rover race using Mechjeb, I know how to set waypoints, but the rover doesn’t follow the right direction, alter its speed or brake.  The wheels only serve to support the rover, propulsion is done via jet engines.  What else do I need to set up so the rovers do what I want them to?

Share this post


Link to post
Share on other sites

Okay build 820 is available that all it does is drop the hybrid controller's max stopping time default down to 2 from 10.  That should cause the hybrid controller to match the kos controller in terms of how much RCS gets used, and how fast vessels rotate.  I think that should make the HybridController the better PID now.

Also just like that there's a build 821 which sets the default controller to the hybrid controller.

I don't think that affects anyone's existing config (whatever you've set it to manually will overwrite the defaults) but it should hopefully suppress the need to every other page tell some new user to use the hybrid controller.

Actually that makes it somewhat difficult for anyone to test these changes, your configs won't get modified at all...

So I guess carry on...

 

Share this post


Link to post
Share on other sites

After looking at the code, I'd actually suggest everyone use the HybridController with a max stopping time of 2, and I'm reasonable certain it is all around better than the kOS controller and fixes at least one known bug with the kOS controller.  Would love to know if I'm incorrect and there's some benefit to the kOS controller that isn't just a difference in the settings.

Share this post


Link to post
Share on other sites

Hey, for some reason none of the download links in the OP are working for me. This the case for anyone else? 2.8.1 doesn't seem to be on github either, releases are only listed up to 2.7. Whats going on?

Share this post


Link to post
Share on other sites
3 hours ago, 101m4n said:

Hey, for some reason none of the download links in the OP are working for me. This the case for anyone else? 2.8.1 doesn't seem to be on github either, releases are only listed up to 2.7. Whats going on?

jenkins dead, gotta wait for @sarbian to fix.

Share this post


Link to post
Share on other sites

jenkins is back.

build #822 also just landed.

this has fixes for what I call "pid wiggles" which turned out to be every 10 degrees the attitude of ship changed the PID controller would get reset which would cause transient wiggles with the hybrid and kos controllers.

it also has fixes for the delta-v stats for parts with multiple moduleengines (ie. engines with integrated verniers), fixes for non-ISP fuels (HTP), and fixes for something (RealismOverhaul?) leaving random bits of unburned propellant behind in ullage stages confusing MJ as to if the engine could be lit or not.

in particular if i screwed something up with the dV stats i could use knowing about it.  it is very delicate and complicated code in there (best of luck with 1.6 squad...)

Share this post


Link to post
Share on other sites

Thanks, Jim, that's great.

Do you have an alternate download source, while Jenkins is down?

Share this post


Link to post
Share on other sites
13 hours ago, El Sancho said:

Do you have an alternate download source, while Jenkins is down?

It is back up since yesterday.

(and no, if it goes down, builds go offline, would have to manually build them and upload somewhere)

Edited by Jim DiGriz

Share this post


Link to post
Share on other sites
On 12/10/2018 at 8:44 PM, Jim DiGriz said:

After looking at the code, I'd actually suggest everyone use the HybridController with a max stopping time of 2, and I'm reasonable certain it is all around better than the kOS controller and fixes at least one known bug with the kOS controller.  Would love to know if I'm incorrect and there's some benefit to the kOS controller that isn't just a difference in the settings.

Jim, I have downloaded 823, and I must confess I have no idea what is "Hybrid Controller" or how to select it. I was thinking it was that little dropdown near bottom of Ascent Guidance window, but that says-

Classic Ascent Profile

Stock style gravity turn

Powered explicit guidance

So I'm lost. Would you please be so kind as to enlighten my ignorance? :)

Share this post


Link to post
Share on other sites

In the main menu, open the "Attitude Adjustment" menu and "HybridController" is right at the top

Share this post


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

In the main menu, open the "Attitude Adjustment" menu and "HybridController" is right at the top

OK, got it, thanks very much for the explanation. I always wondered what that window was about.

For me, the Hybrid Controller didn't seem to make any noticeable difference, but then again, I wasn't having a problem to begin with.

Share this post


Link to post
Share on other sites

Using the latest dev build, I'm still having issues with ascent guidance rotating my ship 90°. It seems to do this regardless of how the ship is rotated in the VAB. I have a spaceplane with side boosters. MechJeb wants to fly it slicing through the air like a knife instead of level flight. SmartASS does the same thing.

Thinking this was an issue with the Mark IV Spaceplane mod from Nertea, I checked some older, standard rockets of mine and noticed the cockpit windows on those were getting rotated 90° as well (you can look "up" and see the old runway island out the window).

In prior builds, I could overcome this by using "Control from here" on the MechJeb unit attached to the side of my ship. Aside from wobbles (presumably fixed now), this trick would fly my ship "properly" (though the navball looked scary). Now, however, this same trick causes MechJeb to immediately nosedive my craft, causing it to break apart.

Using stock attitude control, I can launch my spaceplane without issues. It is stable, does not fall apart, and performs well. I've had to stop using MechJeb for launches, which is a shame because I like to take breaks while the ship is going up to do other things.

Edited by JonathanPerregaux

Share this post


Link to post
Share on other sites

Hello, I'm returning after a lengthily time away (last version played with mods was game version 1.3). After installing and reinstalling mechjeb I seem to have encountered a bug with 2.8.1.0 (as listed by CKAN). Despite setting the ascent path to 8.1km, it doesn't seem to have any effect, and the ascent guidance constantly starts to bank over at an altitude of less than 2000m.

Share this post


Link to post
Share on other sites
22 minutes ago, elanachan said:

Hello, I'm returning after a lengthily time away (last version played with mods was game version 1.3). After installing and reinstalling mechjeb I seem to have encountered a bug with 2.8.1.0 (as listed by CKAN). Despite setting the ascent path to 8.1km, it doesn't seem to have any effect, and the ascent guidance constantly starts to bank over at an altitude of less than 2000m.

Did you also increase the velocity limit?

Share this post


Link to post
Share on other sites

Thanks, forgot/overlooked that it said "or" not "and" for the velocity limit.

Edited by elanachan

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.