Jump to content

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


r4m0n

Recommended Posts

It's not a ship design issue. I'm talking MJ sas works on one play of the same craft, then struggles the next time. Same craft, same variables. It's a pain having to exit ksp and re-load hoping MJ has sorted itself out. Sometimes it doesn't even try to turn me, it just feebly bobles a bit. Again, to re-iterate, RT flight computer can send signals and make changes no problem, as can a pilot with skills and regular old atmospheric control/gimbaling of engines/rcs/sas. Bug annoyingly appears at random. will start taking notes on conditions when it occurs.

Instead of exiting the entire game, do a quicksave then immediately quickload.

Aside from that, logs logs LOGS. Along with clear concise instructions for reproduction of the error, preferably in a stock+MechJeb environment only.

http://forum.kerbalspaceprogram.com/threads/92229

Edited by Starwaster
Link to comment
Share on other sites

OK, I'm having the bug, actively right now, but I don't know how to get a log. The game makes logs when it crashes and puts them in a folder for you, but how to I get it to generate one now? Also, quicksave; reload did not remedy. Further, seems more like MJ is fighting with something else to steer the vessel, but I can't figure out what as I am not stuck on one heading, I can still steer with my controls. It's like I'm stuck in space soup.

Link to comment
Share on other sites

OK, I'm having the bug, actively right now, but I don't know how to get a log. The game makes logs when it crashes and puts them in a folder for you, but how to I get it to generate one now? Also, quicksave; reload did not remedy. Further, seems more like MJ is fighting with something else to steer the vessel, but I can't figure out what as I am not stuck on one heading, I can still steer with my controls. It's like I'm stuck in space soup.

The game makes logs all the time or I wouldn't have said anything about them. I posted a link that explains these things to you, including how to find the logs. Here is the link again for your convenience.

http://forum.kerbalspaceprogram.com/threads/92229-VALUABLE-LINK-FOR-FINDING-LOGS

Link to comment
Share on other sites

Ok, I've got 8megabytes of log file for you, with no way of getting it to you. This forum page freezes if I try to paste everything from notepad into a forum post or pm.

Use dropbox.com or zip it up and host it with mediafire. (I'd go the dropbox route. It's the easiest thing in the world)

Link to comment
Share on other sites

https://www.dropbox.com/s/uv5vulnwdgtr433/mjbug.txt?dl=0

EDIT: I found out new behavior. So I was doing some docking maneuvers and I wanted to switch from RT flight comp control to the new pilot system/sas for docking. I noticed that it seemed like sas/pilot skills were already on and taking effect, even though the system was indicated by the HUD as off and had never been engaged during the flight. Once I "engaged it" and then "dis-engaged it" it was actually disengaged, my pod started rotating freely as well as with my input, and MJ SASS started working. Some how Jebadiah has ghost control of my ship with his pilot skills. Cool?

EDIT 2: At first thoughts were bug only arises when jumping into a ship rather then launching from VAB. Just undocked a vessel and the bug was present, however this time no pilot aboard and no SAS module, therefore no way to un-engage the ghost control...

Edited by Errol
Link to comment
Share on other sites

Forgive me if I'm being daft, but is there a way to create a maneuver node that will set my apoapsis/periapsis for the orbit to be a certain period of time, .e.g 2 hours, rather than distance. I can't seem to figure out how to do it with either the maneuver planner or the maneuver node editor (the later is way over my head). If this isn't possible in the current version, may I be so bold as to suggest it as a future feature?

Link to comment
Share on other sites

Minor problem:

With the number of biomes now, it is pretty useful to turn on "Biomes visible in map" on the Alt-F12 menu for some missions. Its also handy then to use MJ's Landing Guidance's 'Pick Target on Map'. But the colours of the biomes wash out the colours of the blue and red crosses, making them invisible against several of the biomes.

Link to comment
Share on other sites

@Higgs: Again with that "Launch to Rendezvous"? Haven't we told you yet that in case of non-equatorial orbit, you should use "Launch to Plane of Target" instead of "rendezvous"?

So much for a "Broken MechJeb". ;)

-edit-

I don't think I can attach them, but should I pastebin them or paste it into a code block or something?

Sorry for the long time to reply. Sure, use pastebin or whatever you wish to share that log. The

 parameter also works in the forums, but an output_log may be too big for a forum post.
Edited by Kowgan
Link to comment
Share on other sites

Sorry for the long time to reply. Sure, use pastebin or whatever you wish to share that log. The

 parameter also works in the forums, but an output_log may be too big for a forum post.[/QUOTE]
No worries about the delay, you're doing this in your free time and I appreciate the assistance. I'll paste them into a code block and hopefully that should keep them from making a huge post.
MechJeb2_Pod part.cfg
[CODE]
RESOURCE_DEFINITION
{
name = MJPropellant
density = 0.004
flowMode = NO_FLOW
transfer = NONE
}
PART {
// --- general parameters ---
name = mumech_MJ2_Pod
module = Part
author = r4m0n/The_Duck (code) || CardBoardBoxProcessor (model)
// --- asset parameters ---
mesh = model.mu
// --- node definitions ---
// definition format is Position X, Position Y, Position Z, Up X, Up Y, Up Z
node_stack_bottom = 0.0, -0.6010774, 0.0, 0.0, 1.0, 0.0, 1
fx_exhaustFlame_white_tiny = 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, running
// --- Sound FX definition ---
sound_vent_medium = engage
sound_rocket_mini = running
sound_vent_soft = disengage
// --- editor parameters ---
TechRequired = automation
entryCost = 250000
cost = 35000
category = Pods
subcategory = 0
title = Mechanical Jeb - Pod version 2.0
manufacturer = Anatid Robotics / Multiversal Mechatronics
description = After many years spent on research, our scientists still couldn't explain why Jebediah Kerman was such a good pilot, so we decided to make a mechanical copy of his brain to help pilot our ships. This is an unmanned pod version of MechJeb, designed to save the life of the brave Kerbals who volunteer to test new crafts.
// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
attachRules = 1,0,1,1,1

// --- standard part parameters ---
mass = 2
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.1
angularDrag = 2
crashTolerance = 10
maxTemp = 3400
vesselType = Probe
stagingIcon = COMMAND_POD

// --- internal setup ---
CrewCapacity = 0
MODULE
{
name = ModuleCommand
minimumCrew = 0

RESOURCE
{
name = ElectricCharge
rate = 0.005
}
}
MODULE
{
name = ModuleReactionWheel

PitchTorque = 6
YawTorque = 6
RollTorque = 6

RESOURCE
{
name = ElectricCharge
rate = 0.15
}
}
MODULE
{
name = ModuleSAS
}
MODULE
{
name = MechJebCore
MechJebLocalSettings {
MechJebModuleCustomWindowEditor { unlockTechs = start }
MechJebModuleSmartASS { unlockTechs = start }
MechJebModuleManeuverPlanner { unlockTechs = start }
MechJebModuleNodeEditor { unlockTechs = start }
MechJebModuleTranslatron { unlockTechs = start }
MechJebModuleWarpHelper { unlockTechs = start }
MechJebModuleAttitudeAdjustment { unlockTechs = start }
MechJebModuleThrustWindow { unlockTechs = start }
MechJebModuleRCSBalancerWindow { unlockTechs = start }
MechJebModuleRoverWindow { unlockTechs = start }
MechJebModuleAscentGuidance { unlockTechs = start }
MechJebModuleLandingGuidance { unlockTechs = start }
MechJebModuleSpaceplaneGuidance { unlockTechs = start }
MechJebModuleDockingGuidance { unlockTechs = start }
MechJebModuleRendezvousAutopilotWindow { unlockTechs = start }
MechJebModuleRendezvousGuidance { unlockTechs = start }
}
}
MODULE
{
name = MechJebPod
}
RESOURCE
{
name = ElectricCharge
amount = 10
maxAmount = 10
}
MODULE
{
name = ModuleGenerator
isAlwaysActive = true
OUTPUT_RESOURCE
{
name = ElectricCharge
rate = 0.25
}
}
MODULE
{
name = ModuleRCS
thrusterTransformName = RCSthruster
thrusterPower = 4
resourceName = MJPropellant
fxOffset = 0, 0, 0
atmosphereCurve
{
key = 0 260
key = 1 100
}
}
RESOURCE
{
name = MJPropellant
amount = 1000
maxAmount = 1000
}
MODULE
{
name = ModuleEngines
thrustVectorTransformName = engine
exhaustDamage = False
ignitionThreshold = 0.1
minThrust = 0
maxThrust = 100
heatProduction = 300
fxOffset = 0, 0, 7
PROPELLANT
{
name = MJPropellant
ratio = 1
DrawGauge = True
}
atmosphereCurve
{
key = 0 260
key = 1 100
}
}
MODULE
{
name = ModuleGimbal
gimbalTransformName = engine
gimbalRange = 1
useGimbalResponseSpeed = true
GimbalResponseSpeed = 0.1
}
MODULE
{
name = ModuleJettison
jettisonName = adapter
bottomNodeName = bottom
isFairing = True
jettisonedObjectMass = 0.1
jettisonForce = 5
jettisonDirection = 0 0 1
}
MODULE
{
name = ModuleLandingLeg
animationName = Legs_Extend
wheelColliderName = wheel1
suspensionTransformName = Leg001
suspensionUpperLimit = 14.3
impactTolerance = 300
suspensionSpring = 10
suspensionDamper = 1
}
MODULE
{
name = ModuleLandingLeg
animationName = Legs_Extend
wheelColliderName = wheel2
suspensionTransformName = Leg002
suspensionUpperLimit = 14.3
impactTolerance = 300
suspensionSpring = 10
suspensionDamper = 1
}
MODULE
{
name = ModuleLandingLeg
animationName = Legs_Extend
wheelColliderName = wheel3
suspensionTransformName = Leg003
suspensionUpperLimit = 14.3
impactTolerance = 300
suspensionSpring = 10
suspensionDamper = 1
}
MODULE
{
name = ModuleLandingLeg
animationName = Legs_Extend
wheelColliderName = wheel4
suspensionTransformName = Leg004
suspensionUpperLimit = 14.3
impactTolerance = 300
suspensionSpring = 10
suspensionDamper = 1
}
}

MechJeb2_AR202 part.cfg


PART {
// --- general parameters ---
name = mumech_MJ2_AR202
module = Part
author = r4m0n/The_Duck (code) || keptin (part)
// --- asset parameters ---
mesh = model.mu
rescaleFactor = 0.75
// --- node definitions ---
node_attach = 0.0, 0.0, 0.0, 1, 0, 0
// --- editor parameters ---
TechRequired = flightControl
entryCost = 15000
cost = 750
category = Control
subcategory = 0
title = MechJeb 2 (AR202 case)
manufacturer = Anatid Robotics
description = A ruggedized version of MechJeb's neural circuits in a radial-mount case.
// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
attachRules = 0,1,0,0,0
// --- standard part parameters ---
mass = 0.00001
dragModelType = default
maximum_drag = 0.0
minimum_drag = 0.0
angularDrag = 0
crashTolerance = 6
maxTemp = 2900
CrewCapacity = 0
vesselType = Probe
MODULE
{
name = ModuleCommand
minimumCrew = 0

RESOURCE
{
name = ElectricCharge
rate = 0.005
}
}
MODULE
{
name = MechJebCore
MechJebLocalSettings {
MechJebModuleCustomWindowEditor { unlockTechs = start }
MechJebModuleSmartASS { unlockTechs = start }
MechJebModuleManeuverPlanner { unlockTechs = start }
MechJebModuleNodeEditor { unlockTechs = start }
MechJebModuleTranslatron { unlockTechs = start }
MechJebModuleWarpHelper { unlockTechs = start }
MechJebModuleAttitudeAdjustment { unlockTechs = start }
MechJebModuleThrustWindow { unlockTechs = start }
MechJebModuleRCSBalancerWindow { unlockTechs = start }
MechJebModuleRoverWindow { unlockTechs = start }
MechJebModuleAscentGuidance { unlockTechs = start }
MechJebModuleLandingGuidance { unlockTechs = start }
MechJebModuleSpaceplaneGuidance { unlockTechs = start }
MechJebModuleDockingGuidance { unlockTechs = start }
MechJebModuleRendezvousAutopilotWindow { unlockTechs = start }
MechJebModuleRendezvousGuidance { unlockTechs = start }
}
}
MODULE
{
name = MechJebAR202
}
RESOURCE
{
name = ElectricCharge
amount = 5
maxAmount = 5
}
}
PART {
// --- general parameters ---
name = mumech_MJ2_AR202_features1
module = Part
author = r4m0n/The_Duck (code) || keptin (part)
// --- asset parameters ---
mesh = model.mu
rescaleFactor = 0.75
// --- editor parameters ---
TechRequired = advFlightControl
entryCost = 15000
cost = 750
category = none
subcategory = 0
title = MechJeb Features- Maneuver & Translatron
manufacturer = Anatid Robotics
description = Unlocks the following MechJeb windows: Maneuver Planner, Translatron, Warp Helper, Attitude Adjustment, Thrust Window, RCS Balancer. Once unlocked, all existing MechJeb modules will be automatically upgraded to latest firmware.
// --- standard part parameters ---
mass = 0.00001
dragModelType = default
maximum_drag = 0.0
minimum_drag = 0.0
angularDrag = 0
crashTolerance = 6
maxTemp = 2900
CrewCapacity = 0
vesselType = Probe
}
PART {
// --- general parameters ---
name = mumech_MJ2_AR202_features2
module = Part
author = r4m0n/The_Duck (code) || keptin (part)
// --- asset parameters ---
mesh = model.mu
rescaleFactor = 0.75
// --- editor parameters ---
TechRequired = fieldScience
entryCost = 15000
cost = 750
category = none
subcategory = 0
title = MechJeb Features- Rover Autopilot
manufacturer = Anatid Robotics
description = Unlocks the following MechJeb windows: Rover Autopilot. Once unlocked, all existing MechJeb modules will be automatically upgraded to latest firmware.
// --- standard part parameters ---
mass = 0.00001
dragModelType = default
maximum_drag = 0.0
minimum_drag = 0.0
angularDrag = 0
crashTolerance = 6
maxTemp = 2900
CrewCapacity = 0
vesselType = Probe
}
PART {
// --- general parameters ---
name = mumech_MJ2_AR202_features3
module = Part
author = r4m0n/The_Duck (code) || keptin (part)
// --- asset parameters ---
mesh = model.mu
rescaleFactor = 0.75
// --- editor parameters ---
TechRequired = unmannedTech
entryCost = 15000
cost = 750
category = none
subcategory = 0
title = MechJeb Features- Ascent, Landing, Spaceplane
manufacturer = Anatid Robotics
description = Unlocks the following MechJeb windows: Ascent Autopilot, Landing Autopilot, Spaceplane Guidance. Once unlocked, all existing MechJeb modules will be automatically upgraded to latest firmware.
// --- standard part parameters ---
mass = 0.00001
dragModelType = default
maximum_drag = 0.0
minimum_drag = 0.0
angularDrag = 0
crashTolerance = 6
maxTemp = 2900
CrewCapacity = 0
vesselType = Probe
}
PART {
// --- general parameters ---
name = mumech_MJ2_AR202_features4
module = Part
author = r4m0n/The_Duck (code) || keptin (part)
// --- asset parameters ---
mesh = model.mu
rescaleFactor = 0.75
// --- editor parameters ---
TechRequired = advUnmanned
entryCost = 15000
cost = 750
category = none
subcategory = 0
title = MechJeb Features- Rendezvous & Docking
manufacturer = Anatid Robotics
description = Unlocks the following MechJeb windows: Rendezvous Guidance, Rendezvous Autopilot, Docking Autopilot. Once unlocked, all existing MechJeb modules will be automatically upgraded to latest firmware.
// --- standard part parameters ---
mass = 0.00001
dragModelType = default
maximum_drag = 0.0
minimum_drag = 0.0
angularDrag = 0
crashTolerance = 6
maxTemp = 2900
CrewCapacity = 0
vesselType = Probe
}

EDIT: Nevermind, the techRequired sections also needed editing. It's working now. Thanks for your help

Edited by Leonastas
FIXED
Link to comment
Share on other sites

I have a rule with complex autopilot mods like MechJeb2. I always try to do the maneuver manually so I really understand what's going on. And then I start using the autopilot and see what it does and how I have to instruct it to get what I want. And I've been thinking and figuring about this sort of stuff since reading Von Braun's The Mars Project around 1980.

You have a polar orbit space station. You have a launch vehicle sending up a new component. You first have to launch in the same plane as the station. You have to fly to bring your launch vehicle's orbit to the same inclination, 90 degrees (which means taking out the eastward velocity component from planet rotation). You need more delta-V for the polar orbit and you need more for the rendezvous maneuvers. From experience, I know MechJeb's Ascent Guidance often has problems pushing all the way to 90 degrees inclination soon enough and completely enough, so you probably have to add manual inputs to the autopilot to force it sooner, by watching the orbit parameter display. You want a slightly lower or higher orbit if you want to wait out a close pass, or a lot of extra delta-V.

The way you're currently using MechJeb isn't working. You should trying following some of the advice here. You should also try just doing the launches differently and see what those differences do. That includes pulling other mods and building a new spacecraft to check to see if it's some weird mod interaction.

Edited by Jacke
remove specific response
Link to comment
Share on other sites

https://www.dropbox.com/s/uv5vulnwdgtr433/mjbug.txt?dl=0

EDIT: I found out new behavior. So I was doing some docking maneuvers and I wanted to switch from RT flight comp control to the new pilot system/sas for docking. I noticed that it seemed like sas/pilot skills were already on and taking effect, even though the system was indicated by the HUD as off and had never been engaged during the flight. Once I "engaged it" and then "dis-engaged it" it was actually disengaged, my pod started rotating freely as well as with my input, and MJ SASS started working. Some how Jebadiah has ghost control of my ship with his pilot skills. Cool?

EDIT 2: At first thoughts were bug only arises when jumping into a ship rather then launching from VAB. Just undocked a vessel and the bug was present, however this time no pilot aboard and no SAS module, therefore no way to un-engage the ghost control...

You're getting a lot of errors from MechJebFARExt.dll (Sarbian's FAR extensions for MJ)

An error at just the wrong time could prevent other functions from being called.

Not sure how your new observations fit into this...

But what I suggest is removing the FAR Extensions and seeing if the problem persists. Or see if there's an updated version of it.

Something else I noticed was a lot of RT errors, but that's a discussion for their thread. I enclose the error below: (the log said it was version 1.5 but there was an AVC log entry indicating it downloaded 1.5.2)


NullReferenceException: Object reference not set to an instance of an object
at kOS.SteeringHelper.GetThrustTorque (.Part p, .Vessel vessel) [0x00000] in <filename unknown>:0 at kOS.SteeringHelper.GetTorque (.Vessel vessel, Single thrust) [0x00000] in <filename unknown>:0 at RemoteTech.FlightComputer.updatePIDParameters () [0x00000] in <filename unknown>:0 at RemoteTech.FlightComputer.OnFixedUpdate () [0x00000] in <filename unknown>:0 at RemoteTech.ModuleSPU.FixedUpdate () [0x00000] in <filename unknown>:0

(Filename: Line: -1)

You have a polar orbit space station. You have a launch vehicle sending up a new component. You first have to launch in the same plane as the station. You have to fly to bring your launch vehicle's orbit to the same inclination, 90 degrees (which means taking out the eastward velocity component from planet rotation). You need more delta-V for the polar orbit and you need more for the rendezvous maneuvers. From experience, I know MechJeb's Ascent Guidance often has problems pushing all the way to 90 degrees inclination soon enough and completely enough, so you probably have to add manual inputs to the autopilot to force it sooner, by watching the orbit parameter display. You want a slightly lower or higher orbit if you want to wait out a close pass, or a lot of extra delta-V.

That's about what I would do. Launch into its plane at about 150km altitude. That will get a transfer window opening in a few hours at most, fine tune correction after the transfer and it's done. DV for the transfer is pretty negligible

Edited by Starwaster
Link to comment
Share on other sites

Forgive me if this has been dealt with but I couldn't find it.

My mechjeb's gone mental.

http://imgur.com/a/fwuMe

This is after the gravity turn. There's mad oscillation which I hope you can see on the pics.

I think it's something to with it wanting to spin, which it does when performing maneuvers.

A similar thing happens with maneuvers in that using stability control helps but it's all still a bit erratic

The only mod I use is mechjeb but I have doctored the cfg file to allow me to use it throughout career mode (I can't fly, sue me :) )

I'm entirely willing to accept that the problem lies between chair and keyboard. :D

Link to comment
Share on other sites

He also needs roll authority. There's not enough. If there's RCS then it's not active. And no control surfaces. (Would they still be effective at that altitude? Maybe maybe not)

Finally, turn off Stock SAS. MJ's interaction with Stock SAS is only effective at low altitudes.

Link to comment
Share on other sites

Fellow314, that looks like more of a ship rigidity issue. There's a heavy mass atop the rocket connected by a small joint, I bet if you strutted the upper 2.5m tank to the orange tank the oscillation problems would go away.

It's way more pronounced than a rigidity issue. It's definitely a control issue.

He also needs roll authority. There's not enough. If there's RCS then it's not active. And no control surfaces. (Would they still be effective at that altitude? Maybe maybe not)

Finally, turn off Stock SAS. MJ's interaction with Stock SAS is only effective at low altitudes.

Ah, this last bit may be my problem. Mechjeb turns the SAS on when in use though. Is there a switch somewhere I don't know about.

Oh, and thanks to both of you. :)

Link to comment
Share on other sites

The rigidity issue is exacerbated by the controlling part presumably being in the wobbly upper section while the main attitude control (the mainsail engine gimbal) is in the lower section.

Hadn't noticed that Ascent Guidance no longer disables the stock SAS, that's new. Might also be causing issues.

Link to comment
Share on other sites

It's way more pronounced than a rigidity issue. It's definitely a control issue.

Ah, this last bit may be my problem. Mechjeb turns the SAS on when in use though. Is there a switch somewhere I don't know about.

Oh, and thanks to both of you. :)

Yes it's Attitude Adjustment (Adjuster?). It's the second menu item in the main MJ menu. Look for 'Use Stock SAS'. For some reason it becomes ineffective above a certain altitude. I thought it was good up until at least 50km but it could be lower.

The rigidity issue is exacerbated by the controlling part presumably being in the wobbly upper section while the main attitude control (the mainsail engine gimbal) is in the lower section.

Hadn't noticed that Ascent Guidance no longer disables the stock SAS, that's new. Might also be causing issues.

No, it's old. There's been an option to engage it for quite awhile now. As I explained to Fellow314 above, in Attitude Adjustment. It works great, even better than MJ's PID, but only at low altitudes. In orbit, it's horrible however. Pretty much behaves as he indicated in those pictures. I have a feeling it has to do with how MJ is invoking it. Maybe something to do with the different frame of reference.

Edited by Starwaster
Link to comment
Share on other sites

Yes it's Attitude Adjustment (Adjuster?). It's the second menu item in the main MJ menu. Look for 'Use Stock SAS'. For some reason it becomes ineffective above a certain altitude. I thought it was good up until at least 50km but it could be lower.

No, it's old. There's been an option to engage it for quite awhile now. As I explained to Fellow314 above, in Attitude Adjustment. It works great, even better than MJ's PID, but only at low altitudes. In orbit, it's horrible however. Pretty much behaves as he indicated in those pictures. I have a feeling it has to do with how MJ is invoking it. Maybe something to do with the different frame of reference.

You total legend. Thank you.

Link to comment
Share on other sites

Perhaps if someone could post a video on how it should be done maybe it would be better than a wall of text each time, a picture speaks a thousand words this guy is frustrated and is seeing red with every comment making it harder to help him where a video would prove that it does work using the following procedure any budding cinema photographers out there.

Link to comment
Share on other sites

Tempers have been running awfully high in this thread recently. Please remember that KSP and many mods are undergoing active development, so expect changes and expect other players to be confused by those changes.

Jacke and Virtualgenius have given some excellent advice on how to use MechJeb (here) and how to provide support (above).

In addition, videos are the gold standard for requesting support – I had to provide one myself when another modder couldn't duplicate the issue based on my description and reproduction steps.

Finally, if you feel that posts are derailing the thread, hit the report button. That way, posts like g0tchas' here won't be lost.

Edited by Master Tao
Link to comment
Share on other sites

Forgive me if I'm being daft, but is there a way to create a maneuver node that will set my apoapsis/periapsis for the orbit to be a certain period of time, .e.g 2 hours, rather than distance. I can't seem to figure out how to do it with either the maneuver planner or the maneuver node editor (the later is way over my head). If this isn't possible in the current version, may I be so bold as to suggest it as a future feature?

As far as I can remember, there isn't a specific tool in MechJeb that allows you to set orbital period. However, it is easy to calculate it, and from a set periapsis / apoapsis to determine the other to get a specific period.

EDIT: You can also edit any MechJeb window to show the orbital period.

All of the information is in the Wikipedia article Standard gravity parameter. It's the value mu (lowercase Greek letter μ) which is equal to the product of the Gravitational Constant and the mass of an object (usually the central body), GM.

μ = G M

This is listed in the KSP Wiki for all bodies (start from the Kerbol System article). (It's a common value to use in real life as it is much more accurately known that either G or M.)

Then you use the gravitional formulation of Kepler's Third Law:

μ = 4 pi^2 a^3 / T^2

where a is the semimajor axis and T is the period. Solve for the semimajor axis:

a = ( (μ / (4 pi^2)) T^2) ^ (1/3)

which is also this:

2 a = 2 R + P + A

where R is the radius of the body and P and A are the periapsis and apoapsis altitudes from the surface, which is what is used in KSP and MJ.

So if you have a given P, to get a specific T, use this A:

A = 2 ( (μ / (4 pi^2)) T^2) ^ (1/3) - 2 R - P

As μ is given in units of metre^3/second^2, be sure you state T in seconds and R and P in metres. Get μ and R from the KSP Wiki articles for the major body you're orbiting.

Note that if the value for A comes out less that P, there's isn't a solution for an orbit of T seconds with a given periapsis altitude P.

Edited by Jacke
Link to comment
Share on other sites

Holy Smokes! Too much math ;)

It's easier to just get close enough and then do tiny prograde and retrograde burns until your vessel is at the desired orbital period. You'd have to turn your throttle down to 5% of course.

Link to comment
Share on other sites

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