Jump to content

[PART, 1.0.2] Anatid Robotics / MuMech - MechJeb - Autopilot - Historical thread


r4m0n

Recommended Posts

Better is better. With so many different kinds of conditions to land in, it's a difficult thing to program.

Then why is it waiting until it's almost hit the ground on Eve to do the burn?

Here's the latest fail to land on Eve. There were three Cirrus bags on that, and three LV909 engines. Modified from the ship in the second picture. I put the gear down manually. MechJeb waited until an even lower far too late altitude to start the final burn and smacked down at 9 meters per second instead of the 0.5 it was set to. Broke 4 of the 10 legs, fell over and blew up.

Perhaps if I adjusted the four radial chutes to open higher? Or more chutes? I can't put anything on top of the lander because that's where other things will be docked (with the bags turned straight down) for the trip from Kerbin.

I think I'll try some Landertrons the next time to see if they can do what MechJeb isn't.

Adjust your radials...? Are you using RealChutes? Does MJ take into account that they jave custom opening altitudes?

Also, to throw something else into this discussion, I routinely land things on Duna semi curiosity style. But with FAR & RSS.

By curiosity style I mean it pops its chute about 11km up to slow it then after decelleration jettison the chute. MJ seems to have no problems with me doing that and if landing were so horribly broken, you would think that would surely cause problems, confusing it horribly

Link to comment
Share on other sites

When does MJ think to itself, "This is as close as I'm gonna get" and just put the thing on the turf rather than keep trying to correct?

As far as I am aware, the answer to that is "Never" - Would be nice if it did though.

Link to comment
Share on other sites

Steam does not clean anything. You may have old MJ in Gamedata or worse : in the old parts & plugins folder.

The view in the editor will not show 2 part with the same internal name but the R&D view does.

Ah, thanks for the hint, I will have a closer look at the folders and files once I get home. Would be great if thats it and I can use MJ today...I still have to do a rescue mission to Duna, and it could really help there ;)

Link to comment
Share on other sites

First of all, I don't understand why it missed the landing so badly; the vessel mass, the number of available chutes, the engine thrust and fuel load were all available, and this was a very easy west-to-east landing approach. Second, having missed by a couple kilometers while hanging from parachutes at 8 - 10 km above the targeted landing site, why was MJ so aggressive in trying to "correct" when the vessel clearly didn't have the lateral cross-range while under parachutes necessary to make it, to the extent that it broke the lander? When does MJ think to itself, "This is as close as I'm gonna get" and just put the thing on the turf rather than keep trying to correct?

Oh, I missed that one. Let me reply (not to you in particular but to some of the posters)

Well, let me explain why MJ mess up from time to time. First read this nice post by Majiir : A brief look at plugin line counts.

You'll see that MJ is (or at least was at the time of the post) the largest code base of KSP plugin. The second largest one is four time smaller. MJ does a lot of things, works not too badly with most mods and most of the time it fly better than I do (not a high standard, but one I know well).

So yes, sometimes it won't fly as nicely as a 50 millions dollar Lockheed Martin rocket guidance or it won't land as smoothly as a Space X Grasshopper. But it is a large code base, and large code base have bugs. Even more when you have to deal with large code change in KSP and tons of mods.

I understand that most of you are not coders or willing to debug someone else code instead of playing. But keep in mind that we do that on our own free time and that something that looks simple can actually be quite complex. So bear with the bug, use F5 before trusting MJ blindly and for the love of whatever you love : do meaningful bug report and don't come here just to rant (as I am doing right now).

Ans if you have the time and competence to help have a look at the code. You don't have to write the patch yourself but if you can just point me to a logic/match/other error it will help everyone.

Edited by sarbian
Link to comment
Share on other sites

Oh, I missed that one. Let me reply (not to you in particular but to some of the posters)

Well, let me explain why MJ mess up from time to time. First read this nice post by Majiir : A brief look at plugin line counts.

You'll see that MJ is (or at least was at the time of the post) the largest code base of KSP plugin. The second largest one is four time smaller. MJ does a lot of things, works not too badly with most mods and most of the time it fly better than I do (not a high standard, but one I know well).

So yes, sometimes it won't fly as nicely as a 50 millions dollar Lockheed Martin rocket guidance or it won't land as smoothly as a Space X Grasshopper. But it is a large code base, and large code base have bugs. Even more when you have to deal with large code change in KSP and tons of mods.

I understand that most of you are not coders or willing to debug someone else code instead of playing. But keep in mind that we do that on our own free time and that something that looks simple can actually be quite complex. So bear with the bug, use F5 before trusting MJ blindly and for the love of whatever you love : do meaningful bug report and don't come here just to rant (as I am doing right now).

Ans if you have the time and competence to help have a look at the code. You don't have to write the patch yourself but if you can just point me to a logic/match/other error it will help everyone.

First off let me apologize if my post you quoted above was insulting; I certainly didn't intend it to be. I understand you and the rest of the people who contribute are doing this for basically fun as a hobby and I appreciate your work.

My particular post was to try to gain some insight into why MJ borked this particular landing, to the extent it broke my lander in half trying to keep fixing the aim point. And more to the point, I'm wondering if there's any internal logic inside MJ's landing code that says, like I posted above, "We've missed the landing, we're outside [sOME ARBITRARY LANDING ELLIPSE ] so just put it on the ground." If there's not, could there be?

Again no criticism is intended, I'm just trying to discuss the matter and see what others think. The last time I coded re-entry simulations it was for an orbital dynamics class in college in 1989 ... I doubt my coding skills are up to the effort required, but I'd love to discuss the logic and decision-making aspects on a higher level, to better understand the complexity and try to help improve it if possible.

Thank you, and codepoet and anyone else helping out with this project.

Link to comment
Share on other sites

Don't worry. It was not aimed at you, your post just triggered it and I rant a lot :)

As for you landing problem : the next version with codepoet patch will most likely fix most landing with parachute problems.

Then we'll have to hunt the other landing problems.

BARCLONE: Good luck ^^

Link to comment
Share on other sites

Is there a way to get the Orbital Information to display tenths or even hundredths of seconds for the Period data, instead of just whole hours/minutes/seconds? That level of precision is very helpful when synchronizing constellations of satellites to mitigate drift for years at a time under high timewarp.

I can get very close by tweaking the engine thrust down to minimum and cutting the throttle right as the seconds counter flips to the next number, but I'd like to have a way of knowing that they all have identical periods (without installing KER for just that one thing).

Edited by RoboRay
Link to comment
Share on other sites

Adjust your radials...? Are you using RealChutes? Does MJ take into account that they jave custom opening altitudes?

Also, to throw something else into this discussion, I routinely land things on Duna semi curiosity style. But with FAR & RSS.

By curiosity style I mean it pops its chute about 11km up to slow it then after decelleration jettison the chute. MJ seems to have no problems with me doing that and if landing were so horribly broken, you would think that would surely cause problems, confusing it horribly

I don't use FAR or anything that modifies drag or parameters of stock parts. ReStock and KSPX make copies and mash-ups of stock parts as different parts, but don't alter the regular stock parts.

Mods I have with dll files are Hooligan Labs, Infernal Robotics, Haystack, Editor Extensions, Quantum Struts, Texture Compressor 1_1, KAS, Procedural Fairings, Kerbal Joint Reinforcement, HyperEdit, Kethane, SelectRoot, Stretchy Tanks/SRBs, TAC Fuel Balancer, Kerbal Alarm Clock, Module Manager 1.5.6 used only to add MechJeb to command parts.

All except the texture compressor are the latest releases. None of them should be having any effect on parts drag in atmosphere. Everything I've tried to land on Eve (with enough engine power to actually land) has tested fine on Kerbin with the suicide burn starting plenty high enough.

I figured I'd be using the new tweakables feature quite a lot but haven't used it at all yet, mostly due to the joint reinforcement mod and improvements to MechJeb removing the need to lock gimbals on some first stage engines before launch.

Link to comment
Share on other sites

Ok, here we are. Time to start the 2014 season.

Today builds :

#151 : ModuleControlSurface torque. I failled to see that Squad moved to module for control surface in .23. It means that anything with control Surface (and without FAR) was less stable than it should have been. Sorry for that, it's fixed now, and thanks Mogeley on github for seeing it.

#152 : a small fix for the RendezVous AP. If the ship or the target moved to and other sphere of influence then the AP was getting stuck

#153 : the big one. Codepoet newest set of change to parachute assisted landings (and fix to all landings). It works with stock parachute (no RealParachute for now).

The landing AP still needs some change on my end for powered landing but it's a large step ahead.

Link to comment
Share on other sites

UPDATE: Extraplanetary Launchpads work well. I now have landers on Mun and Minmus, I've just finished Keth and Ore scans of Mun, there's a Keth scanner around Minmus, and I've landed in the grids without the loss of anything.

Next to test: Romfarer's Lazor pack.

Now it seems I also need to update MJ again :D ...

Sarbian, one thing I've noticed about the AG and Manuver Planner autopilots is the tightness of circularized orbits. Most have been less than 500m between Ap and Pe points. Very nice! When things work like they're supposed to, KSP is fun! When rockets dance a jig during ascent, though, not so fun...

Link to comment
Share on other sites

Something happened to a Mun lander as it descended to the surface. About 50-100m up, the lander's head (the Stayputnik) just exploded like the victim in a bad Halloween movie. The remainder of the lander fell uncontrolled and exploded on impact.

Here's pieces from the log:

[LOG 18:37:02.467] [Orbit Targeter]: Target is null

[LOG 18:37:09.583] dT is NaN! tA: 1.18334889411926, E: 0, M: 0, T: NaN

[LOG 18:37:09.583] dT is NaN! tA: 2.156662940979, E: 0, M: 0, T: NaN

[LOG 18:37:09.583] dT is NaN! tA: 6.22787976264954, E: 0, M: 0, T: NaN

[LOG 18:37:38.672] dT is NaN! tA: 1.14904522895813, E: 0, M: 0, T: NaN

[LOG 18:37:38.672] dT is NaN! tA: 2.15593856573105, E: 0, M: 0, T: NaN

[LOG 18:37:38.672] dT is NaN! tA: 6.19338059425354, E: 0, M: 0, T: NaN

...

[EXC 18:40:09.669] IndexOutOfRangeException: Array index is out of range.

...

[EXC 18:41:22.924] ArgumentOutOfRangeException: Argument is out of range.

Parameter name: index

Link to comment
Share on other sites

Sarbian, dev153 has a real problem. I just tried to land a second bug on Mun using this dev, and this time it settled through the texture map almost to being completely hidden before exploding. Changing from dev150 to dev153 was the only change made this round.

This is being done with the Landing Guidance module, of course. The Ascent Guidance module seems to be fine.

Log snips:

[LOG 19:07:20.074] dT is NaN! tA: 6.11910629272461, E: 0, M: 0, T: NaN

[LOG 19:07:20.074] dT is NaN! tA: 2.91674511134624, E: 0, M: 0, T: NaN

[LOG 19:07:20.146] [PlanetariumCamera]: Focus: Mun

[LOG 19:07:36.095] [Orbit Targeter]: Target is null

[LOG 19:08:40.923] dT is NaN! tA: 1.01060461997986, E: 0, M: 0, T: NaN

[LOG 19:08:40.923] dT is NaN! tA: 2.90387865900993, E: 0, M: 0, T: NaN

[LOG 19:08:40.923] dT is NaN! tA: 3.21209236234427, E: 0, M: 0, T: NaN

[LOG 19:09:26.460] dT is NaN! tA: 1.05772256851196, E: 0, M: 0, T: NaN

[LOG 19:09:26.461] dT is NaN! tA: 2.90179628133774, E: 0, M: 0, T: NaN

[LOG 19:09:26.461] dT is NaN! tA: 3.26118633896112, E: 0, M: 0, T: NaN

...

[EXC 19:11:55.853] NullReferenceException: Object reference not set to an instance of an object

[LOG 19:11:56.564] Packing Frontiersman IX [LV] for orbit

[LOG 19:11:56.565] Packing Frontiersman IX [LV] Debris for orbit

[EXC 19:11:58.944] IndexOutOfRangeException: Array index is out of range.

[ERR 19:12:01.016] MechJeb module MechJebModuleTargetController threw an exception in OnFixedUpdate: System.ArgumentOutOfRangeException: Argument is out of range.

Parameter name: index

at System.Collections.Generic.List`1[PQSLandControl+LandClass].get_Item (Int32 index) [0x00000] in <filename unknown>:0

at PQSLandControl.OnVertexBuildHeight (.VertexBuildData data) [0x00000] in <filename unknown>:0

at PQS.Mod_OnVertexBuildHeight (.VertexBuildData data) [0x00000] in <filename unknown>:0

at PQS.GetSurfaceHeight (Vector3d radialVector) [0x00000] in <filename unknown>:0

at MuMech.CelestialBodyExtensions.TerrainAltitude (.CelestialBody body, Double latitude, Double longitude) [0x00000] in <filename unknown>:0

at MuMech.PositionTarget.Update (.CelestialBody body, Double latitude, Double longitude) [0x00000] in <filename unknown>:0

at MuMech.MechJebModuleTargetController.OnFixedUpdate () [0x00000] in <filename unknown>:0

at MuMech.MechJebCore.FixedUpdate () [0x00000] in <filename unknown>:0

...

[ERR 19:12:33.464] MechJeb module MechJebModuleTargetController threw an exception in OnFixedUpdate: System.IndexOutOfRangeException: Array index is out of range.

at PQSLandControl.OnVertexBuildHeight (.VertexBuildData data) [0x00000] in <filename unknown>:0

at PQS.Mod_OnVertexBuildHeight (.VertexBuildData data) [0x00000] in <filename unknown>:0

at PQS.GetSurfaceHeight (Vector3d radialVector) [0x00000] in <filename unknown>:0

at MuMech.CelestialBodyExtensions.TerrainAltitude (.CelestialBody body, Double latitude, Double longitude) [0x00000] in <filename unknown>:0

at MuMech.PositionTarget.Update (.CelestialBody body, Double latitude, Double longitude) [0x00000] in <filename unknown>:0

at MuMech.MechJebModuleTargetController.OnFixedUpdate () [0x00000] in <filename unknown>:0

at MuMech.MechJebCore.FixedUpdate () [0x00000] in <filename unknown>:0

[WRN 19:12:38.552] Vessel Frontiersman IX [LV] Debris crashed through terrain on the Mun

...

[EXC 19:12:42.763] ArgumentOutOfRangeException: Argument is out of range.

Parameter name: index

[ERR 19:12:44.035] MechJeb module MechJebModuleLandingAutopilot threw an exception in Drive: System.IndexOutOfRangeException: Array index is out of range.

at PQSLandControl.OnVertexBuildHeight (.VertexBuildData data) [0x00000] in <filename unknown>:0

at PQS.Mod_OnVertexBuildHeight (.VertexBuildData data) [0x00000] in <filename unknown>:0

at PQS.GetSurfaceHeight (Vector3d radialVector) [0x00000] in <filename unknown>:0

at MuMech.CelestialBodyExtensions.TerrainAltitude (.CelestialBody body, Double latitude, Double longitude) [0x00000] in <filename unknown>:0

at MuMech.MechJebModuleLandingAutopilot.get_LandingAltitude () [0x00000] in <filename unknown>:0

at MuMech.MechJebModuleLandingAutopilot.DecelerationEndAltitude () [0x00000] in <filename unknown>:0

at MuMech.MechJebModuleLandingAutopilot.Drive (.FlightCtrlState s) [0x00000] in <filename unknown>:0

at MuMech.MechJebCore.Drive (.FlightCtrlState s) [0x00000] in <filename unknown>:0

[EXC 19:13:07.746] ArgumentOutOfRangeException: Argument is out of range.

Parameter name: index

Edited by BARCLONE
Link to comment
Share on other sites

#153 : the big one. Codepoet newest set of change to parachute assisted landings (and fix to all landings). It works with stock parachute (no RealParachute for now).

The landing AP still needs some change on my end for powered landing but it's a large step ahead.

It's good to know that you and Codepoet are working on the landing... thanks!

Link to comment
Share on other sites

having serious issues with this mod. when i click moon and auto rendevous, it just crashes me into the planet. landing dosent work wither....not sure what the problem is

That's because you don't rendezvous with a moon, you use the Hohmann Transfer. Then when that finishes use Fine Tune Closest Approach. For Mun set it to 20KM for your first attempt. That should (in map view) get your course line arcing past the Mun with a Pe marker. Once you have that, use Circularize and change it to Periapsis.

Enable Auto Warp and if your ship has enough thrust and power you can sit back and watch it go to Mun orbit on its own.

To land on an airless body your ship must have a TWR>1 That is a Thrust to Weight Ratio greater than 1. Like how an F-15 Eagle jet fighter's engines together have 47,540 pounds of thrust while the plane weighs 44,500 pounds so it can accelerate straight up, until it runs out of dense enough air for the engines.

If your ship's thrust does not at least exactly equal the weight of the ship by the time it reaches the surface, CRASH. It's better to have more thrust than weight right from the start of the landing procedure.

With an atmosphere and parachutes you can land a ship with a TWR<1 but (if it doesn't crash) it won't be able to take off again.

Link to comment
Share on other sites

Sarbian, dev153 has a real problem. I just tried to land a second bug on Mun using this dev, and this time it settled through the texture map almost to being completely hidden before exploding. Changing from dev150 to dev153 was the only change made this round.

This is being done with the Landing Guidance module, of course. The Ascent Guidance module seems to be fine.

Log snips:

I have seen some of the problems you describe in development and testing - however I think they became apparent to me when I moved up to 0.23, so I had concluded that they were a 0.23 thing. Interestingly they all seem to relate to the terrain system, which I have discussed a lot with Sarbian. In my own game I sometimes see distortions in the terrain (see picture below) after moving to 0.23 and the log that you quoted contains exceptions all related to terrain vertices and "PQS" which I do not understand, but believe is related to the celestial body / terrain system. In my own game I sometimes see a log saying "PQS Duna: Restarted", at which point the terrain visual distortion disappears. Finally on your report that a part of your craft magically exploded - I once had a similar thing happen in testing - one of my engines exploded when I was 1000m AGL. When I checked the flight report (f3) it said that the engine had impacted the ground, which sounds a bit like the terrain had momentarily rush up to mee the craft.

So I have my suspicions that there is something wacky going on with the terrain system. I also have suspicions that it is related to thread saftey, so perhaps there is a way forward to address it.

screenshot1.png

I am sure that you will understand why getting a landing autopilot to work well in an environment when the ground you are trying to land on is literally constantly shifting is a challenge!!

Edited by codepoet
changed one of my verbs from perfect to pluperfect tense
Link to comment
Share on other sites

Just got done with some tests on build 153. The results were not so good.

Rather than tempt fate with Eve for the umpteenth time I excavated an old AARP Stock Lander 1, built of all stock parts back in .21. Didn't want any non-stock parts to possibly cause any problems. Hyperedited to a 20KM Mun orbit, picked a smooth looking spot as a landing target, zeroed to put it right on the equator then poked the land at target button.

It turned retrograde, did the initial deorbit burn, flipped prograde to do a little correction burn then it kept the engine at idle, burning prograde and headed for higher altitude.

Reset the orbit with Hyperedit, reselected target. This time it did one little correction burn after the deorbit burn and then stopped doing anything. Sailed right past the target. So I tried it a third time, got a repeat of the first attempt.

Next try was a jump to 71KM Kerbin orbit. I have a flag planted a bit south of KSC. The lander came down within 200 meters of the flag, but waitaminute?! Dude! Where's the ground! It was at night so I'm not sure but I think I could make out mountains in the distance but there was no KSC buildings or land there, the flag had dropped to sea level. MechJeb hovered the lander at the altitude where the surface should have been. When it was nearly out of fuel, the Kraken blew it up.

I went back to the VAB for another lander, put it in a 71KM orbit to try the landing again. There was ground to land on this time and the flag was back where I'd planted it but there were some dark, wedge shaped cracks radiating from the touchdown point and I could see stars through them. One really large crack ran from the touchdown point beneath the VAB and could be seen from several thousand meters up. I got a couple of screenshots but they're at night so the cracks are hard to see - dead black against not so black, except where lit by the landing lights.

Both landings on Kerbin, it started the landing burn at around 2,000KM. No parachutes on this lander.

I decided to try Mun again. Got a repeat of the second attempt where it quit doing anything. I let it ride down to 5,000 meters then tried the land somewhere button. That worked perfectly. I launched it up to around 3,000 meters, unguided, then did land somewhere again. Worked just fine again.

Time to finish it off (there were no Kerbals on this flight, it has an RGU under the three man pod). I used ascent guidance to go to a 20KM Mun orbit. Lifted fine, did the circularization burn fine too. Then it aimed the engine straight down, running at very low throttle and doing a bit of a wobbly dance while very very slowly gaining altitude. It was maintaining a circular orbit but with its center shifting off the Mun's center.

So I shut it down, aimed it retrograde, burned what was left of the fuel and crashed it.

Many revisions back with MechJeb, in either .21 or .22, I've had it quit like this during landing and I've had it burn the wrong way a few times too, but I'm pretty certain never with this lander.

I tried switching control between the RGU and the pod but it didn't change anything.

Build 153's record not so good here. Four failed targeted landings on Mun, two perfect land somewheres, one failed Mun ascent, one failed Kerbin landing (due to vanishing ground) one perfect Kerbin landing, with some funky cracks in the ground I've never seen before.

It's 2:40 AM here now, probably won't try build 152 tonight.

Link to comment
Share on other sites

Any reason as to why MJ all of a sudden cant control my craft? When I enable autopilot for anything MJ just shakes the craft in place. Any solutions?

Right click on a part with control capability then click the control from here button. If you loaded a save from an earlier version into .23, crafts already in space may have their control selection un-set.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...