.. default-domain:: lua .. highlight:: lua .. currentmodule:: MechJeb AscentGuidance ============== .. class:: AscentGuidance The Ascent Guidance window, which flies the vessel to orbit. .. note:: See the `MechJeb wiki `_ for how to set up this autopilot. .. attribute:: enabled: boolean Whether the module is enabled. :Attribute: Can be read or written .. attribute:: status: string The autopilot status, which depends on the selected ascent type. :Attribute: Read-only, cannot be set .. attribute:: ascent_type: MechJeb.AscentType The ascent type. :Attribute: Can be read or written .. note:: Setting it disengages the autopilot of the other type. .. attribute:: settings: MechJeb.AscentSettings The Ascent Settings window. :Attribute: Read-only, cannot be set .. attribute:: psg_settings: MechJeb.PSGSettings The settings of the :data:`MechJeb.AscentType.psg` ascent, from the Ascent Settings window and the PSG Stages window. :Attribute: Read-only, cannot be set .. attribute:: classic_path: MechJeb.ClassicPath The Ascent Path Editor window, with the settings of the :data:`MechJeb.AscentType.classic` ascent. :Attribute: Read-only, cannot be set .. attribute:: desired_orbit_altitude: number The altitude of the final circular orbit, in meters. :Attribute: Can be read or written .. note:: Applies to the :data:`MechJeb.AscentType.classic` ascent. .. attribute:: desired_inclination: number The inclination of the final orbit, in degrees. :Attribute: Can be read or written .. attribute:: periapsis_altitude: number The altitude of the periapsis of the target orbit, in meters. :Attribute: Can be read or written .. note:: Applies to the :data:`MechJeb.AscentType.psg` ascent. .. attribute:: apoapsis_altitude: number The altitude of the apoapsis of the target orbit, in meters. :Attribute: Can be read or written .. note:: Applies to the :data:`MechJeb.AscentType.psg` ascent. A value below :attr:`MechJeb.AscentGuidance.periapsis_altitude`, such as 0, gives a circular orbit, and a negative value a hyperbolic one. .. attribute:: burnout_altitude_flag: boolean Whether to reach the target orbit at :attr:`MechJeb.AscentGuidance.burnout_altitude`. :Attribute: Can be read or written .. note:: Applies to the :data:`MechJeb.AscentType.psg` ascent. When every stage has a fixed burn time, the ascent always burns out at :attr:`MechJeb.AscentGuidance.burnout_altitude`. .. attribute:: burnout_altitude: number The altitude at which the ascent reaches the target orbit, in meters. MechJeb's window calls it the attach altitude. :Attribute: Can be read or written .. note:: Applies to the :data:`MechJeb.AscentType.psg` ascent. See :attr:`MechJeb.AscentGuidance.burnout_altitude_flag`. .. attribute:: flight_path_angle: number The flight path angle at burnout, in degrees. :Attribute: Can be read or written .. note:: Applies to the :data:`MechJeb.AscentType.psg` ascent, when every stage has a fixed burn time. .. attribute:: argument_of_periapsis_flag: boolean Whether to aim for :attr:`MechJeb.AscentGuidance.argument_of_periapsis`. :Attribute: Can be read or written .. note:: Applies to the :data:`MechJeb.AscentType.psg` ascent. .. attribute:: argument_of_periapsis: number The argument of periapsis of the target orbit, in degrees. :Attribute: Can be read or written .. note:: Applies to the :data:`MechJeb.AscentType.psg` ascent. Requires :attr:`MechJeb.AscentGuidance.argument_of_periapsis_flag`. .. attribute:: desired_lan: number The longitude of the ascending node of a launch to a LAN, in degrees. See :meth:`MechJeb.AscentGuidance.launch_to_lan`. :Attribute: Can be read or written .. attribute:: launch_lan_difference: number The difference from the target's longitude of the ascending node of a launch into the target's plane, in degrees. :Attribute: Can be read or written .. attribute:: override_warp_to_plane: boolean Whether a timed launch launches at once, rather than at the time it computes. :Attribute: Can be read or written .. attribute:: warp_count_down: number The time before a timed launch at which time warp stops, in seconds. :Attribute: Can be read or written .. attribute:: launch_mode: MechJeb.AscentLaunchMode The launch mode, which gives whether a timed launch is counting down. :Attribute: Read-only, cannot be set .. attribute:: time_to_launch: number The time until a timed launch, in seconds. :Attribute: Read-only, cannot be set .. note:: Requires a :attr:`MechJeb.AscentGuidance.launch_mode` other than :data:`MechJeb.AscentLaunchMode.normal`. .. method:: abort_timed_launch() Abort a timed launch. .. method:: launch_to_target_plane() Count down to a launch into the plane of the target, and set :attr:`MechJeb.AscentGuidance.desired_inclination` to match. Throws an exception if there is no target orbiting the body the vessel is on. .. note:: The countdown runs while the autopilot is enabled. .. method:: launch_to_target_lan() Count down to a launch into the plane with the target's longitude of the ascending node, less :attr:`MechJeb.AscentGuidance.launch_lan_difference`, and inclination :attr:`MechJeb.AscentGuidance.desired_inclination`. Throws an exception if there is no target orbiting the body the vessel is on, or the ascent type is not :data:`MechJeb.AscentType.psg`. .. note:: The countdown runs while the autopilot is enabled. .. method:: launch_to_lan() Count down to a launch into the plane with longitude of the ascending node :attr:`MechJeb.AscentGuidance.desired_lan` and inclination :attr:`MechJeb.AscentGuidance.desired_inclination`. Throws an exception if the ascent type is not :data:`MechJeb.AscentType.psg`. .. note:: The countdown runs while the autopilot is enabled. .. class:: AscentType The ascent type. See :attr:`MechJeb.AscentGuidance.ascent_type`. .. data:: classic The classic ascent path. See :attr:`MechJeb.AscentGuidance.classic_path`. .. data:: psg Polynomial SQP Guidance, an optimized ascent, for RSS/RO. See :attr:`MechJeb.AscentGuidance.psg_settings`. .. class:: AscentLaunchMode The launch mode of the ascent autopilot. See :attr:`MechJeb.AscentGuidance.launch_mode`. .. data:: normal No timed launch is counting down. .. data:: target_plane A timed launch into the plane of the target. See :meth:`MechJeb.AscentGuidance.launch_to_target_plane`. .. data:: target_lan A timed launch to the target's longitude of the ascending node. See :meth:`MechJeb.AscentGuidance.launch_to_target_lan`. .. data:: lan A timed launch to a longitude of the ascending node. See :meth:`MechJeb.AscentGuidance.launch_to_lan`. AscentSettings -------------- .. class:: AscentSettings The Ascent Settings window, which holds the settings shared by the ascent types. .. attribute:: force_roll: boolean Whether the autopilot controls the roll. :Attribute: Can be read or written .. attribute:: vertical_roll: number The roll during the vertical climb, in degrees. :Attribute: Can be read or written .. note:: Requires :attr:`MechJeb.AscentSettings.force_roll`. .. attribute:: turn_roll: number The roll during the turn, in degrees. :Attribute: Can be read or written .. note:: Requires :attr:`MechJeb.AscentSettings.force_roll`. .. attribute:: roll_altitude: number The altitude above which the autopilot controls the roll, in meters. :Attribute: Can be read or written .. note:: Requires :attr:`MechJeb.AscentSettings.force_roll`. .. attribute:: auto_deploy_solar_panels: boolean Whether the ascent keeps the solar panels retracted in the atmosphere, and extends them above it. :Attribute: Can be read or written .. attribute:: auto_deploy_antennas: boolean Whether the ascent keeps the antennas retracted in the atmosphere, and extends them above it. :Attribute: Can be read or written .. attribute:: autostage: boolean Whether the autopilot stages when the current stage runs out of fuel. :Attribute: Can be read or written .. attribute:: staging: MechJeb.AscentStaging The staging settings of the ascent, which apply in place of :attr:`MechJeb.Utilities.staging` while the autopilot is enabled. :Attribute: Read-only, cannot be set .. attribute:: thrust: MechJeb.AscentThrustLimits The throttle limits of the ascent, which apply in place of :attr:`MechJeb.Utilities.thrust` while the autopilot is enabled. :Attribute: Read-only, cannot be set .. attribute:: autowarp: boolean Whether to warp time during the launch countdown and the coasts of the ascent. :Attribute: Can be read or written .. attribute:: limiting_angle_of_attack: boolean Whether the angle of attack limit is limiting the steering. :Attribute: Read-only, cannot be set .. attribute:: current_max_angle_of_attack: number The largest angle of attack the limit allows now, in degrees. :Attribute: Read-only, cannot be set AscentStaging ------------- .. class:: AscentStaging The staging settings of the ascent, from the Ascent Settings window. .. note:: The ascent starts with a copy of :attr:`MechJeb.Utilities.staging`, and keeps its own settings after that. .. attribute:: autostage_pre_delay: number The delay before each staging, in seconds. :Attribute: Can be read or written .. attribute:: autostage_post_delay: number The delay after each staging, in seconds. :Attribute: Can be read or written .. attribute:: autostage_limit: number The last stage the ascent activates. :Attribute: Can be read or written .. attribute:: fairing_max_dynamic_pressure_enabled: boolean Whether to wait for :attr:`MechJeb.AscentStaging.fairing_max_dynamic_pressure` to jettison a fairing. :Attribute: Can be read or written .. attribute:: fairing_max_dynamic_pressure: number The largest dynamic pressure at which the ascent jettisons a fairing, in pascals. :Attribute: Can be read or written .. note:: Requires :attr:`MechJeb.AscentStaging.fairing_max_dynamic_pressure_enabled`. .. attribute:: fairing_min_altitude_enabled: boolean Whether to wait for :attr:`MechJeb.AscentStaging.fairing_min_altitude` to jettison a fairing. :Attribute: Can be read or written .. attribute:: fairing_min_altitude: number The lowest altitude at which the ascent jettisons a fairing, in meters. :Attribute: Can be read or written .. note:: Requires :attr:`MechJeb.AscentStaging.fairing_min_altitude_enabled`. .. attribute:: fairing_max_aerothermal_flux_enabled: boolean Whether to wait for :attr:`MechJeb.AscentStaging.fairing_max_aerothermal_flux` to jettison a fairing. :Attribute: Can be read or written .. attribute:: fairing_max_aerothermal_flux: number The largest aerothermal flux at which the ascent jettisons a fairing, in :math:`\mathrm{W/m^{2}}`. :Attribute: Can be read or written .. note:: Requires :attr:`MechJeb.AscentStaging.fairing_max_aerothermal_flux_enabled`. .. attribute:: clamp_auto_stage_thrust_pct: number The fraction of full thrust at which the ascent releases the launch clamps. :Attribute: Can be read or written .. attribute:: hot_staging: boolean Whether the ascent ignites the next stage before the current one burns out. :Attribute: Can be read or written .. attribute:: hot_staging_lead_time: number The time before burnout at which a hot staging happens, in seconds. :Attribute: Can be read or written .. note:: Requires :attr:`MechJeb.AscentStaging.hot_staging`. .. attribute:: drop_solids: boolean Whether the ascent drops the solid boosters of the next stage early, once their thrust no longer pays for their mass. :Attribute: Can be read or written .. attribute:: drop_solids_twr_pct: number The fraction of the vessel's thrust-to-weight ratio at which the solid boosters drop, between 0 and 1. :Attribute: Can be read or written .. note:: Requires :attr:`MechJeb.AscentStaging.drop_solids`. AscentThrustLimits ------------------ .. class:: AscentThrustLimits The throttle limits of the ascent, from the Ascent Settings window. .. note:: The ascent starts with a copy of :attr:`MechJeb.Utilities.thrust`, and keeps its own limits after that. The :data:`MechJeb.AscentType.psg` ascent ignores :attr:`MechJeb.AscentThrustLimits.limit_throttle` and :attr:`MechJeb.AscentThrustLimits.electric_throttle`. .. attribute:: limit_to_prevent_overheats: boolean Whether to limit the throttle to keep parts from overheating. :Attribute: Can be read or written .. attribute:: limit_dynamic_pressure: boolean Whether to limit the dynamic pressure. :Attribute: Can be read or written .. attribute:: max_dynamic_pressure: number The largest dynamic pressure, in pascals. :Attribute: Can be read or written .. note:: Requires :attr:`MechJeb.AscentThrustLimits.limit_dynamic_pressure`. .. attribute:: limit_acceleration: boolean Whether to limit the acceleration. :Attribute: Can be read or written .. attribute:: max_acceleration: number The largest acceleration, in :math:`\mathrm{m/s^{2}}`. :Attribute: Can be read or written .. note:: Requires :attr:`MechJeb.AscentThrustLimits.limit_acceleration`. .. attribute:: limit_throttle: boolean Whether to limit the throttle. :Attribute: Can be read or written .. attribute:: max_throttle: number The largest throttle, between 0 and 1. :Attribute: Can be read or written .. note:: Requires :attr:`MechJeb.AscentThrustLimits.limit_throttle`. .. attribute:: limiter_min_throttle: boolean Whether to keep the throttle above :attr:`MechJeb.AscentThrustLimits.min_throttle`. :Attribute: Can be read or written .. attribute:: min_throttle: number The smallest throttle, between 0 and 1. :Attribute: Can be read or written .. note:: Requires :attr:`MechJeb.AscentThrustLimits.limiter_min_throttle`. .. attribute:: electric_throttle: boolean Whether to limit the throttle of electric engines to the available power. :Attribute: Can be read or written .. attribute:: electric_throttle_lo: number The charge level at which electric engines stop, between 0 and 1. :Attribute: Can be read or written .. note:: Requires :attr:`MechJeb.AscentThrustLimits.electric_throttle`. .. attribute:: electric_throttle_hi: number The charge level at which electric engines run at full throttle, between 0 and 1. :Attribute: Can be read or written .. note:: Requires :attr:`MechJeb.AscentThrustLimits.electric_throttle`. .. attribute:: limit_to_prevent_unstable_ignition: boolean Whether to hold the throttle at zero while the engines' fuel is unstable. :Attribute: Can be read or written .. note:: MechJeb shows this setting only with Real Fuels, as stock engines have stable fuel. .. attribute:: auto_rcs_ullaging: boolean Whether to fire the RCS forward to settle the fuel before the engines ignite. :Attribute: Can be read or written .. note:: MechJeb shows this setting only with Real Fuels, as stock engines have stable fuel. PSGSettings ----------- .. class:: PSGSettings The settings of the Polynomial SQP Guidance ascent, from the Ascent Settings window and the PSG Stages window, and the state of its guidance. .. note:: PSG plans which stages burn and coast from the vessel. The target orbit is set in :class:`MechJeb.AscentGuidance`. .. attribute:: pitch_start_height: number The height above the launch site at which the pitch program starts, in meters. :Attribute: Can be read or written .. attribute:: pitch_rate: number The pitch rate of the pitch program, in :math:`\mathrm{deg/s}`. :Attribute: Can be read or written .. attribute:: drag_coefficient: number The drag coefficient guidance plans with. :Attribute: Can be read or written .. note:: Ignored with :attr:`MechJeb.PSGSettings.auto_aero`. .. attribute:: reference_area: number The reference area guidance plans with, in :math:`\mathrm{m^{2}}`. :Attribute: Can be read or written .. note:: Ignored with :attr:`MechJeb.PSGSettings.auto_aero`. .. attribute:: auto_aero: boolean Whether guidance works out :attr:`MechJeb.PSGSettings.drag_coefficient` and :attr:`MechJeb.PSGSettings.reference_area` from the vessel before each solve. :Attribute: Can be read or written .. attribute:: limit_q_alpha: number The limit on dynamic pressure times angle of attack, in :math:`\mathrm{Pa \cdot rad}`. :Attribute: Can be read or written .. note:: 0 turns the limit off. MechJeb clamps it to at most 10000. .. attribute:: min_delta_v: number The smallest delta-v of a stage that guidance plans with, in :math:`\mathrm{m/s}`. :Attribute: Can be read or written .. attribute:: max_coast: number The longest coast guidance plans, in seconds. :Attribute: Can be read or written .. attribute:: min_coast: number The shortest coast guidance plans, in seconds. :Attribute: Can be read or written .. attribute:: ullage_lead_time: number The time before an ignition at which RCS settles the propellant, in seconds. :Attribute: Can be read or written .. attribute:: spinup_lead_time: number The time before staging at which the spin-up starts, in seconds. :Attribute: Can be read or written .. attribute:: spinup_angular_velocity: number The angular velocity of the spin-up, in :math:`\mathrm{rad/s}`. :Attribute: Can be read or written .. note:: MechJeb's window shows it in revolutions per minute. .. attribute:: has_solution: boolean Whether guidance has a solution. :Attribute: Read-only, cannot be set .. attribute:: guidance_status: string The status of guidance. :Attribute: Read-only, cannot be set .. attribute:: time_to_go: number The time to the end of the current burn of the solution, in seconds. :Attribute: Read-only, cannot be set .. note:: Requires :attr:`MechJeb.PSGSettings.has_solution`. .. attribute:: velocity_to_go: number The delta-v left in the solution, in :math:`\mathrm{m/s}`. :Attribute: Read-only, cannot be set .. note:: Requires :attr:`MechJeb.PSGSettings.has_solution`. .. attribute:: pitch: number The pitch guidance commands, in degrees. :Attribute: Read-only, cannot be set .. note:: Requires :attr:`MechJeb.PSGSettings.has_solution`. .. attribute:: heading: number The heading guidance commands, in degrees. :Attribute: Read-only, cannot be set .. note:: Requires :attr:`MechJeb.PSGSettings.has_solution`. ClassicPath ----------- .. class:: ClassicPath The settings of the classic ascent path, from the Ascent Path Editor window and the Ascent Settings window. .. attribute:: turn_start_altitude: number The altitude at which the turn starts, in meters. :Attribute: Can be read or written .. attribute:: turn_start_velocity: number The speed at which the turn starts, in :math:`\mathrm{m/s}`. :Attribute: Can be read or written .. attribute:: turn_end_altitude: number The altitude at which the turn ends, in meters. :Attribute: Can be read or written .. attribute:: turn_end_angle: number The final flight path angle, in degrees. :Attribute: Can be read or written .. attribute:: turn_shape_exponent: number The steepness of the turn, between 0 and 1. :Attribute: Can be read or written .. attribute:: auto_path: boolean Whether the autopilot chooses the turn altitudes and speed. :Attribute: Can be read or written .. attribute:: auto_turn_percent: number The altitude at which an automatic turn starts, as a fraction of the height of the atmosphere. :Attribute: Can be read or written .. note:: Requires :attr:`MechJeb.ClassicPath.auto_path`. .. attribute:: auto_turn_speed_factor: number The factor that sets the speed at which an automatic turn starts. :Attribute: Can be read or written .. note:: Requires :attr:`MechJeb.ClassicPath.auto_path`. .. attribute:: auto_turn_start_altitude: number The altitude at which an automatic turn starts, in meters. :Attribute: Read-only, cannot be set .. attribute:: auto_turn_start_velocity: number The speed at which an automatic turn starts, in :math:`\mathrm{m/s}`. :Attribute: Read-only, cannot be set .. attribute:: auto_turn_end_altitude: number The altitude at which an automatic turn ends, in meters. :Attribute: Read-only, cannot be set .. attribute:: corrective_steering: boolean Whether the autopilot steers by the velocity vector rather than the position vector. :Attribute: Can be read or written .. note:: It is more accurate, though large craft may do better without it. .. attribute:: corrective_steering_gain: number The gain of the corrective steering. :Attribute: Can be read or written .. note:: Requires :attr:`MechJeb.ClassicPath.corrective_steering`. .. attribute:: limit_angle_of_attack: boolean Whether to limit the angle of attack. :Attribute: Can be read or written .. attribute:: max_angle_of_attack: number The largest angle of attack, in degrees. :Attribute: Can be read or written .. note:: Requires :attr:`MechJeb.ClassicPath.limit_angle_of_attack`. .. attribute:: angle_of_attack_limit_fadeout_pressure: number The dynamic pressure below which the angle of attack limit fades out, in pascals. :Attribute: Can be read or written .. note:: Requires :attr:`MechJeb.ClassicPath.limit_angle_of_attack`. .. attribute:: skip_circularization: boolean Whether to skip the circularization burn. :Attribute: Can be read or written