KOS Wiki
Register
Advertisement

Summary[]

Provides a library of scripts for

  1. launching with atmosphere and in vacuum (ltoa, ltov). Staging to be managed using when commands from the main script.
  2. landing orbit with periapsis 30 degree off the zenith (landnode). Enables landing on the sunny side.
  3. land in vacuum (landv), same script for Mun and Minmus
  4. highly accurate maneuver node execution program (exenode). Better than 0.1% deltav accuracy.
  5. orbital maneuvering (aponode, perinode)
  6. Kerbin maneuvers for Mun and Minmus (soinode)
  7. inclination maneuvers for Minmus transfer (incnode)
  8. Mun and Minmus escape maneuvers to return to Kerbin on a low deltav trajectory (krbnode)

The scripts rely on physics and math to calculate the maneuver properties. Usually 2D there will be some vector math in the inclination and landing node scripts.

Requirements[]

Works with KSP 0.23.5 and kOS 12.2p1

What's new?[]

  1. Kerbin - Mun/Minmus transfer and return node creation
  2. orbit inclination adjustment
  3. ascent w/o atmosphere
  4. descent & landing w/o atmosphere
  5. warpinsoi, warpoutsoi and warpdist scripts to wait for an soi change
  6. exenode script improvements for better accuracy

Mun & Minmus mission scripts[]

Kerbal Automated Mission Challenge scripts. The Minmus missions illustrate how to customize the mission scripts for specific vessels.

Mun mission[]

  1. Vessel: Mun Lander 1b
    run kamc0. // outbound
    run kamc1. // return

Minmus mission "Wikinger"[]

  1. This vessels' stage 2 separation requires two stage statements.
  2. You'll know why I call it "Viking" when you see the lander.
  3. Vessel: Minmus Lander 1b
    run kamc2. // outbound
    run kamc4. // return

Minmus mission 2[]

  1. This vessels' stage 2 separation requires one stage statements.
  2. Vessel: Minmus Lander 1c
    run kamc3. // outbound
    run kamc4. // return

Known issues[]

  1. When planet and moon are aligned with the sun it may happen that the lander travels in the planet's or moon's shadow for prolonged times during transfer. During those periods of travel in the dark the battery may run empty and shut down the kOS module due to lack of electricity. This will stop the script and require manual restarting of the mission script to execute the remaining commands.

Launch & Landing scripts[]

Launch to Orbit / Atmosphere[]

run ltoa.
  1. Thrust limited by max q during ascent. Max q defaults to 7000.
  2. Gravity turn: pitch depending on cos(altitude). Default: start at 1.000, ends at 50.000. I found these parameters to use least fuel. Can you configure it better?
  3. Staging separated from trajectory control (thrust/pitch). Staging to be implemented in main script using when clauses.
  4. Compensating for atmospheric drag when coasting to apoapsis.
  5. Time warp while coasting to apoapsis.
  6. Calculation of target velocity for circular orbit using aponode.

Launch to Orbit / Vacuum[]

run ltov.
  1. Thrust limited during initial ascent until craft points to the horizon. Thrust limit shall prevent reaching low orbit altitude during first 2 seconds (this is a problem on Minmus).
  2. Gravity turn delayed by 2 seconds to gain some altitude (non-quantitative). Turn will reduce pitch to the horizon compensated for gravitation (which is approx 1 degree on Mun).
  3. Staging separated from trajectory control (thrust/pitch). Staging to be implemented in main script using when clauses.
  4. Time warp while coasting to apoapsis.
  5. Calculation of target velocity for circular orbit using aponode.

Land / Vacuum[]

run landv(ecoh). // ecoh: engine cut-off height
  1. Landing script works in four phases loosely based on the real Apollo mission descent planning:
    1. deceleration from orbit (retrograde burn) until 1/4 of periapsis velocity or radar altimeter starts working
    2. retrograde burn while reducing velocity proportional to radar altitude
    3. high gate (150m): descend and reduce surface velocity (thrusting downwards angled towards surface velocity vector)
    4. low gate (15m and surface velocity is less than 0.1m/s): descend vertically for landing
  2. downward vertical velocity builds only through gravity (in contrast to the Apollo lander which thrusted upward to build downward velocity early in the burn).
  3. engine cut-off when landing gear almost touches the ground. Implemented using the control unit's radar altitude on the ground (ecoh parameter).

Node Runner[]

run exenode.
  1. Maneuver node execution script
  2. Mission toolkit node scripts assume impulsive burns, i.e. deltav happens instantly. Of course, this is not possible, but the node runner script runs the engines at full throttle to achieve shortest possible burn times.
  3. The script will
    1. warp to 1min before burn
    2. orient the ship for the burn
    3. warp to burn
    4. burn full throttle, then
    5. for very accurately changing deltav (better 0.1%) throttle down nearing burn end.
  4. Workhorse of any mission script. Usually used alternating with maneuver node generator scripts.

Orbital Maneuvering[]

Apoapsis maneuver[]

run aponode(altitude).
  1. create maneuver node at apoapsis for changing periapsis altitude

Periapsis maneuver[]

run perinode(altitude).
  1. create maneuver node at periapsis for changing apoapsis altitude
  2. See also: http://en.wikipedia.org/wiki/Oberth_effect

Landing orbit maneuver[]

run landnode(altitude).
  1. Lowers periapsis to altitude
  2. Assumes a circular orbit
  3. Periapsis will be 30 degrees "after" the zenith (orbitwise) on the dayside of the body. In that position potential pilots and observers will have a good lighting conditions to view the vessel (no beams needed) and its shadow to judge altitude.

Inclination adjustment[]

run incnode(tgtbody).
  1. Adjusts the orbits inclination to match tgtbodies' orbit inclination around the central body.
  2. Assumes a circular orbit

Intraplanetary Transfers[]

Intraplanetary Hohmann outbound transfer[]

run hohnode(tgtbody).
  1. creates a maneuver node for Kerbin to Mun or Minmus Hohmann transfer
  2. requires a circular orbit
  3. apoapsis defaults to half of the target bodies' soi
  4. for Minmus transfers detects whether Mun is in the way. The script then delays the maneuver for one orbit (until Mun is no longer in the way).
  5. maneuver angle is calculated based on:
    1. Hohmann transfer time
    2. target bodies' orbital period

Intraplanetary Hohmann inbound transfer[]

run krbnode(peri_radius).
  1. creates a maneuver node for Mun or Minmus to Kerbin return Hohmann transfer
  2. the peri_radius parameter is the periapsis radius for the target body, NOT the periapsis altitude. peri_radius = planet_radius + periapis (altitude). This is to allow usage with other planets. The planets radius is injected as a parameter and does not need to be "guessed" by the program.
  3. requires a circular orbit
  4. more tricky since as a first step the moon's soi must be left, i.e. an escape trajectory
  5. maneuver is setup to leave the moon's soi
    1. opposite of the moon's direction of travel
    2. velocity after leaving soi matches an orbit with a) moon's apoapsis and b) periapsis as specified in the parameter.
  6. CAVEAT: it seems like the moon's frame of reference is rotating. Thus an ejection angle of 90 degrees does lead to a distorted velocity vector once leaving the soi! I have solved this by calibrating the ejection angle.

Warping[]

by duration[]

run warpfor(secs).
  1. warps for duration

until sunrise[]

run warpday.
  1. warps until sunrise

by distance[]

run warpdist(refbody, dist).
  1. warps until passing distance dist relative to refbody
  2. automatically recognizes whether to warp in or out
  3. determines velocity to/from refbody by measuring distance change regularly. The measurement time interval depends on the current warp factor.
  4. used by soi warp programs

until entering soi[]

run warpinsoi(tgtbody).
  1. warps until entering soi of tgtbody
  2. current body is used as refbody
  3. tgtbody is required to positively recognize new soi

until leaving soi[]

run warpoutsoi(refbody, tgtbody).
  1. TODO: to be changed to run warpoutsoi. to simplify interface. Parameters are not needed.
  2. warps until leaving soi of a body
  3. refbody is required to calculate distance (even after leaving soi)
  4. tgtbody is used to positively recognize new soi

Miscellaneous[]

Body properties database[]

run bodyprops.
  1. Sets a body's properties global variables. A.k.a. "body database" by other kOS developers. Loads body specific properties for the current body.
  2. currently works for Kerbin, Mun and Minmus.

Check vessel compatibility[]

run checkvessel(vesselname).
  1. checks for a match of the vesselname
  2. intended for the mission script to check whether used with a compatible vessel
  3. remember: the mission script encodes staging behavior in when..then commands

Turn to sun[]

run tts.
  1. turns the vessel facing 90 degress from the sun
  2. makes sure simple solar cells receive light
  3. baloan: I had vessels running out of electricity because maneuver burn vectors accidentally were oriented towards the sun or away.

Sphere of influence[]

run soi(refbody).
  1. return the refbody's soi in the soi variable
  2. is required by the intraplanetary maneuver scripts
  3. it does NOT use a database but calculates using the body:mu values. See also SOI

Prepare[]

run prep.
  1. copied to the ship's local volume 1 when the mission scripts start
  2. contains initialization to restart scripts after a KSP restart; currently just switches to volume 0 and runs bodyprops

Steer[]

run steer.
  1. wait for ship to orient, then return
  2. deprecated. to be removed in next mission toolkit
  3. see tts

Planned extensions[]

  1. warp to lunar position which avoids prolonged transfer in the dark (without light for the solar cells)
  2. interplanetary transfers
  3. docking (requires kOS thruster support)

Download files[]


  • The wiki doesn't like spaces in external links so you have to look for the craft file for yourself here: craft file directory

Baloan

Advertisement