Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Rendezvous with space station from initial orbit of 210x400 km
- clearscreen.
- set pi to 3.1415926535897932384626433832795028841971693993751058209749445923.
- set mu to 3.986*(10^14).
- ag1 off.
- rcs on.
- sas off.
- gear off.
- set ship:control:neutralize to true.
- lock steering to prograde + r(0,0,180).
- set target to "LIESS".
- print "Awaiting AG1".
- wait until ag1.
- ag1 off.
- unlock steering.
- sas on.
- //I found that the initial orbit gains on the space station at 10 degrees
- //per orbit.
- set ang to 239485239.
- Until ang < 15 {
- print "Please wait. Circularization will occur when".
- print "initial phasing is complete".
- set ang to vang(ship:body:position,(target:position+ship:body:position)).
- print "Loop ends at zero: "+round(100*(ang-15)).
- wait 0.1.
- clearscreen.
- }
- set warp to 0.
- print "Circularizing at Apogee".
- if ship:verticalspeed > 0 {
- wait until ship:verticalspeed<0.
- } else {
- wait until ship:verticalspeed>0.
- wait until ship:verticalspeed<0.
- }
- //Circularizing
- set kpv to 1. //to control the vertical speed to keep it at zero
- sas off.
- lock steering to prograde + r(0,0,180).
- set ship:control:fore to 1. //burn
- set shipA to 0.
- set targetA to 29483924832.
- set A0 to ship:altitude.
- until ship:apoapsis>(A0+500) {
- print "Burning".
- wait 0.1.
- clearscreen.
- set ship:control:top to (kpv*ship:verticalspeed). //Controlling vertical speed
- }
- set ship:control:neutralize to true.
- print "Circularized at "+round(.5*(ship:apoapsis+ship:periapsis))+" meters".
- print "Awaiting AG1".
- wait until ag1.
- ag1 off.
- unlock steering.
- sas on.
- //second phasing orbit. This one gains on the space station at about 2.5 degrees
- //per orbit (400x400)
- set ang to 100000.
- Until ang < 2.5 {
- print "Please wait. Transfer will occur when".
- print "secondary phasing is complete".
- set ang to vang(ship:body:position,(target:position+ship:body:position)).
- print "Loop ends at zero: "+round(100*(ang-2.5)).
- wait 0.1.
- clearscreen.
- }
- print "Awaiting Station Apsis".
- set warp to 0.
- //the two spacecraft have a very low angular difference, so when the station is
- //at an apsis, the spacecraft is approximately at that apsis. Burning at this
- //point gives the chaser a similar argument of perigee
- wait until abs(target:verticalspeed<0.1).
- sas off.
- lock steering to prograde + r(0,0,180).
- print "Initiating Hohmann Transfer to 5km below Station Orbit".
- set ship:control:fore to 1.
- //stops burn when chaser apogee is at either target apogee or perigee
- if abs(target:altitude-target:periapsis)<1000 {
- wait until ship:apoapsis>(target:apoapsis-4750).
- } else {
- wait until ship:apoapsis>(target:periapsis-4750).
- }
- set ship:control:neutralize to true.
- print "Transfer Burn Complete".
- print "Awaiting AG1".
- wait until ag1.
- ag1 off.
- unlock steering.
- sas on.
- clearscreen.
- //stops at just below 5km
- until (target:altitude-ship:altitude)<5075 {
- print "Awaiting Apogee".
- print "Loop ends at zero: "+round((target:altitude-ship:altitude)-5075).
- wait 0.1.
- clearscreen.
- }
- set warp to 0.
- clearscreen.
- print "Awaiting AG1".
- wait until ag1.
- ag1 off.
- run fivekm.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement