Sunday, August 12, 2012

How to chase stuff in orbit (also known as randezvous)


EDIT 20.3.2013. Not that this post was made about old version of the KSP program, before the maneuver nodes were available and it is obsolete now, even though principles described still apply. For docking with new system check my first ever Kerbal Space Program youtube video here. Thank you!

Welcome to today lesson about new hardware and how to use it. With help of our brave pilot Jebediah Kerman, I hope to give you some useful information how to do orbital interceptions with brand new (new=buggy) targeting computer.

So this is the situation we have at the start.



We are trying simple things (it is rocket science, so it might not be that simple after all =) ). Our target is in circular orbit, or vessel in bit eccentric but not much, but our orbits are not parallel. All that we can see from default map view, but lets see what we got on our instruments. Flying by the numbers makes us appear more cool than flying by visual to the people who are in the know (and may yield results faster than guessing).


I have adjusted camera to show where our orbits intersect. You can see that target's orbit is almost parallel to equator while ours has angle. From the orbital information we can confirm that our angle to equator, inclination, is indeed 18.73 degrees.

So lets check what targeting computer does. In simple, it displays interesting data for us, target and differences between us and target. Lets start from bottom half. Nothing new here, we already know this from orbit data: inclination, LAN and eccentricity for both us and target. So it is obvious to make successful interception these data will have to match (or it wouldn't be here).

We will try the intercept in 2 steps:
1 - get in parallel orbit (match orbital planes)
2 - get at same point in space at same time

Step 1 : getting into parallel orbit - matching orbital planes

With inclination and LAN we can compare our orbits to see if they are parallel. Matching only one of those will do us no good. This is an example of 2 orbits with same inclination (or close enough), but without same LAN.



So it is important to match inclination, but also where we match it. The proper place to match orbits is in their intersection. The intersections are called An and Dn (for ascending and descending node, I believe) and our brand new targeting computer is showing us when we are going to reach those points:
Time to An - time to ascending node, intersection with target orbit
Time to Dn - time to descending node, intersection with target orbit

Note that An and Dn might be inverted, but you can easily deduct which point you are approaching by comparing time, your vessel heading with visual intersection of the orbits.

Relative inclination - showing the difference in inclination between ours and target orbit.

So this is out current situation:



We are approaching intersection in less than 5 minutes and we have almost 18 degrees difference in inclination. By comparing inclination of self and target it is evident we have to decrease our inclination. How? We will perform burn that is perpendicular to our current orbit. That way we will affect our inclination without affecting our orbit's apoapsis or periapsis(or or effect will be minor because it is hard to perfectly align vessel with required heading).

To select required heading info from Surface information panel will come handy. Which heading we need depends on intersection point. In our case we are intersecting target orbit by moving from above to bellow, so we'll need burn up to pull our orbit towards target orbit, so we need "Perpendicular heading -". If we were making the burn on the other side of the planet, where we intersect target orbit from bellow to above, we would need to burn down to pull our orbit downwards toward target orbit, so we would need "Perpendicular heading +".

Don't feel silly if you take opposite heading for your burn, it happens a lot and it gets better with practice.

Note that changing inclination is fuel/time demanding operation and it is likely you will not be able to completely match inclination in desired point in one go and will need to repeat action several times. Just make sure you stop burning after you have passed intersection.

You do not need perfect inclination match because it is likely you will mess it up a bit in next step of interception. Leave fine tuning of orbits for last stage.

So in our case our desired heading is 16 degrees, so we'll turn and wait for the burn. During burn expect that expect that required heading for the burn will shit and you'll need to make corrections.

So 2 major and several smaller burns after we have decent inclination match:



Time for step 2

Step 2 : getting into parallel orbit - getting at same point in space at same time


No that our inclination is good, time to get to same altitude. Lets see how our orbits look from above:



This is good. Both of our vessels are moving counter-clockwise. Our target is in front and above us. At this point it becomes tricky. As you already know, circular orbit is not only defined by altitude, but also speed. If we change one we will also change other, doesn't matter if we want it or not. That means once we are at same altitude as our target, we are also at same speed. That means we can't just get so same orbit then speed up/slow down to reach our target. These are not cars, this is rocket science! It is hard!

It is not really "hard", it is just different to what you are used to and adapting the way you think to achieve what you want is the hard part. Personally, I think I heard some cogs breaking in my brain while I was fiddling with this stuff.

So to simplify things, upper orbits are slow, lower orbits are fast. The greater the difference in altitudes, the greater the difference in (circular) speeds.

Now comes the estimation part. We need to speed up to go higher, increase our apoapsis. But what we want is that when we actually get to that point the target vessel is also there. So when we are starting your burn to speed up we want to be somewhat behind, because we will be faster moving trough lower orbit then our target. Estimating how much behind you need to be is another tricky part :)

By speeding up we will change our orbit from fairly circular to somewhat eccentric. This maneuver is actually called Hohmann transfer orbit and there is maths to make it more precise, but I like estimation, it shows skill (and I'm not very fond (or good at) maths). So lets do this!

This is how our orbit looks like after the burn:



Now wait till we get to new apoapsis to see the result:



I so did this from first try and I did NOT used saved games. That is my story and I'm sticking to it!

So as you can see, we are still behind, but also bit bellow. Lower = faster, so we want to keep this orbit until we catch up, we will circularize orbit at current apoapsis height. We are guessing a bit again, hoping to get close to target in apoapsis and then circularize our orbit to match target.



Our orbit is slightly eccentric ans slightly above target. Reason for this is we are now slightly in front of target. Higher = slower, so we want now for target to catch up with us. On targeting computer you can see the distance is actually decreasing (- sign marking decrease in distance compared to last measurement). I have jetted main stage, from now it is all small engine and RCS thrusters. Hair spray bursts :)

This is where it gets complicated. From now on you will be repeating steps one and two as you see fit. For start I want to match inclination, this time as close as possible, using the RCS. Once that is done I want to decrease my altitude but while keeping circular orbit, also using RCS, combining up/forward/down/reverse controls. This is veeery tricky to get right because effect on orbit depends if you are reaching apoapsis or periapsis.

This is kind of position where you want to get yourself to eventually:



The inclinations are perfectly aligned and target is straight in the middle of the screen. That means we are directly behind it, it is not going left or right. Target is slightly in front of us still, but we are in very circular orbit just slightly bellow target. Lower = faster, we are slowly gaining on target and we'll (eventually) reach it. I really can't give you any kind of "do this and you will get exactly this" on this point. You will have to practice.

After this it is step one and two and again and again, but in diminutive form

Some general advice I can give you:
- do not go over +/- 200 meters difference in altitude once you get under 10 km range
- pay attention to An and Dn times for correcting orbital plane alignment
- it is difficult to visually gain position of the target relative to you. Use "relative altitude" and your own "altitude" to judge how much bellow/above and how much behind/forward target is
- pay attention NOT to have RCS on in combination with SAS when you are speeding up time, SAS will exhaust RCS tank fast!
- do not try to go directly towards target until you are under 500m at least, you will achieve nothing
- practice, this part is really skill (until I figure out how to make docking computer)

And once you make it right, this is the result



I'm so going to pretend that was easy for me and I didn't retry for hours. These tutorials are practice for me too, to get things right, test what works and write it down. I hope you enjoyed reading at least a bit as I enjoyed writing =)

Happy huntings

Note, I have updated link for my version of MechJeb in previous blog.


Thursday, August 9, 2012

More data available to our brave kerbonauts!

I got my hands on MechJeb plugin source code  for Kerbal Space Program and decided to "improve" it. This "improvement" is completely subjective and more like "bending to my liking". I don't want ANYTHING to touch my controls instead of me so I ripped out anything that would automate vector change and showed more information in format that I fancy. This butchering of poor MechJeb has reached a point where is mature enough to show to people. So here it comes...



Getting to know new data : Surface information

Surface information is relative to your  referent orbital body (the body you are orbiting).

Altitude - not the same as altitude on the top of the screen. This is actual distance to ground. Very handy for landings, you probably noticed when you land on the Mun that altitude on top of the screen did not reach 0, but probably something around 2000m. Well, time to get it right =)

Heading, Pitch and Roll - direction of your vessel. Same as what you can read from the navigation ball, just without guessing =)

Prograde heading and Retrograde heading - are again same as you can read from the navigation ball but with exact number attached to it. And makes easier to know where to turn when icons are not visible on the ball (quite an annoyance with hard-to-turn pigs I love to fly).

Perpendicular heading + and Perpendicular heading - are headings perpendicular to your orbital direction. These are what you need when you want to tilt the orbit (orbital plane). Required for orbital plane synchronisation when intercepting another vessel (or not if you like the guesswork...).

Vertical speed - speed relative to ground. Again, handy for landings. If it is positive, you are ascending. If negative, you are descending. It is normal for this speed to be not equal to 0 for non-circular orbits. It will be positive when moving from Pe to Ap and negative when moving from Ap to Pe. You can use this value to try to circularize your orbit outside of Ap/Pe (use at own risk).

Time to surface - estimated time to ground relative to your current speed. It does not take into account if you are accelerating, so if you are descending with increasing speed you are going to hit the ground sooner than it is displayed! I might "improve" (fix) this eventually, I got distracted with other shiny things. It is "good enough" as is for now. It will display time only if your current trajectory is touching ground (you are not in orbit).

Getting to know new data : Orbital information

Orbiting - displays body you are currently orbiting. Easy!

Orbital speed - displays your... wait for it... orbital speed! It is same as one displayed on top of the navigation ball, but you have to look around the screen less when doing delicate orbital corrections.

Apoapsis and Periapsis - altitude of your apoapsis/periapsis, same as one displayed at map screen when you hover over it. This is easier to read and available outside of map view too and you does not  depend on the position of your mouse cursor.

Time to apoapsis/periapsis - time remaining until you reach apoapsis/periapsis. Handy for time warps and timing of burn.

Period - time required for full orbit. It may be handy sometime. I guess... It looked nice.

LAN - longitudinal ascend node, of course. What is it, you ask? Well... errr... (*google mode on*)ahem... it is an coordinate (longitude) where your orbit intersects with equator, when moving from down up. It is mostly not very useful piece of information, but it might get handy for comparison with orbit of the target when you are chasing other vessel.

LPe- is... errr... I don't know! I thought it was simmilar to LAN, only opposite side of the planet, but the maths doesn't match (or I'm doing it wrong). I'll have to check it out.

Inclination - it is an angle at which your orbit is intersecting equator in LAN. Now, this is important data when chasing something. To match orbits/intercept something, you need to match inclination in the point where your orbits intersect. This is interesting not only for vessel chasing, but also for Minimus insertions because it's orbit is not parallel to Kerbin's equator!

Eccentricity - measure how circular your orbit is. The lower the number, the more circular your orbit is. Important peace of information because circular orbits are easier to manipulate, less guesswork involved.

Semimajor axis- I guess I know but don't really care about it. I found it there and it is staying for now. I don't see any practical use for it at the moment, but who knows?

So to present important things again in a picture:

Getting to know new data : Vessel information

Total mass - well, the sum of mass of all your parts and fuel currently attached into mess you call a vessel.

Total thrust - sum of thrust all engines available in current stage. Mostly bragging rights.

TWR - thrust to weight ratio. Basically, how much is your vessel overpowered/power starved. If the ratio is bellow 1 you will not be able to defeat gravity at lift-off. interesting for different configurations testing.

Fuel available - sum of all fuel available in your tanks that are still attached to your vessel, in liters. Solid booster fuel and RCS fuel are not added to this. no direct use of this information, but its shiny.

Note : There is additional display available, the fable "Targeting computer". This gadget is used for chasing other vessels in current body orbit. Its description and use will be topic of another tutorial blog.

Part where you get to enjoy all these shiny things

And the updated plugin - link (updated 2012.09.22 12:08:25 for version 0.17) It is replacement of default MuMech plugin, so you need to have that one installed then replace dll in plugins directory with one from the linked archive.

Monday, July 30, 2012

How to land on the Mun and come back to brag about it (Kerbal Space Program tutorial)

First of all, thank you, Drill :P You made me make a blog... (I couldn't figure out simple way to throw bunch of pictures and text together)

Anyway. To the Mun and back!

OKi, I was about to start tutorial on how to control your craft, but I just found out if I leave my ride on the landing pad without SAS for longer than a minute its starts spinning :|


Lets put some support to that


OK, that is better

Now, where were we? Lets do quick inspection of this potential bomb. It is a 6 stage monster (this is a fairly simple one for my design, I like lots of stages...). First 3 stages are used for orbit and hopefully lunar injection, if there is any fuel left. 6th stage is composed of solid boosters, that we will jet as soon as they are spent, and main engine.

The ball in the bottom of the screen is most important thing. You cannot fly on visual, not a chance! This is instrumental flying only, most relevant data in all screenshots is on the ball.

For a start we'll set throttle to 20% to get some initial speed, let the solid boosters do the main work.

Liftoff!



After 25 seconds solid boosters are spent. Drop them as soon as possible, we don't need to spend fuel on that weight. Increase throttle to compensate for loss of thrust.



All looking good. Feel free to experiment with throttle levels, I get really different fuel consumption on each launch.



Time to check the map



We have some speed to the side but the apopapsis needs to be out of atmosphere, so keep burning until it is higher than 63 Km, like this:


Now turn your heading to 90 degrees (right on the line between blue and brown part of the ball) and start adding speed for orbit until we get full circular trajectory, like this:


Time to check fuel. About 10% of one tank left, we'll use that for lunar insertion (sounds so pro). For the reference, on this same build I got to this part with full 2nd tank. So experiment with throttle on liftoff!


Time to shoot for the moon (Mun). Apparently, you should start the burn when you see the moon rising. It works, so it is good enough for me. Moon is still behind Kerbin.




Align your vessel to orbit and wait for the burn.



This is what we got from fuel that was left in the tank. Note that orbit increases faster at later stages so keep cutting down throttle or you might miss the sweet spot and have to make corrections.



Jetting the orbit stage, no need for it any more.



This is looking good. Brown trajectory is our moon orbit/trajectory.



Mun, here we come!

Highlighted blue circle is where we enter moon orbit. Brown circle above is where we would leave it without correctional burn. So we have trajectory, not an orbit, I guess =)


OK, we are in moon's zone of influence:




Highlighted Mun escape point if we do not slow down



We are going to wait till periapsis to start de-orbit burn



We are facing opposite of our direction and starting de-orbit burn



We have landing spot on the Mun



Check the fuel levels. I have spent 10% of a single small tank for both finishing lunar insertion and de-orbit burn. Once outside atmosphere bit of fuel can take you long way!



Now I want to land straight down, so I'm setting my heading 90 degrees and burning until circle with x gets on the north of the ball.


This is good enough for now, I'm slowing down the descent (under 100 m/s as soon as possible, under 10 m/s for last stage). I'm also correcting trajectory to get that circle with cross on top. Be very very careful with throttle, it is easy to put too much. That thing on top of the screen on the right of the altitude is very useful for this part, it is showing how fast you are descending/ascending. If it is on 0 you are not moving up or down. You want to have it between 0 and -5 for final stage.



Just nice and slow...



Photo opportunity with Kerbin in background



Turning on RCS, it can come handy for very delicate final corrections when you want to lose some speed to the side and can't risk turning rocket. Gear down. This is important =)



Oh, that reminds me. See that landing gear? It is pure trouble. It is not wide enough so lander is unstable. That is why I don't do single stack landers any more, this was my first successful lander design.

Almost there...



Landed! Errrr... I need to get that landing gear bit more to the bottom of the lander, I think I'm sitting on RCS fuel tank :|



Mandatory EVA



Weeeeeeee...



I believe I can fly...



OK, pack up, time to go home. Now, this is important. We want to go heading 270, opposite side of the moon orbit. You can go 90, but it is more complicated because you are going same way as the Mun, so its gravity can mess your trajectory. If you go the other way you lose the moon influence as soon as possible. Waiting for apoapsis to correct the orbit.



After that we wait until we are on the opposite side of the moon from the planet to extend our orbit towards Kerbin. Time to do the burn.



This should get us to Kerbin orbit at 63Km. Lets hope it actually does, not like the last time...



Riding the Kerbal orbit



I have placed new vehicle on the ramp at space centre so I get the icon on the planet. I'll try to land close. It is possible to read the position of the space centre from the ball (one of the other 2 icons) but I never really figured out how.


I still have one and a half tank fuel left =)



Orbit looks good, I'll start de-orbit burn at periapsis. It is right on the 65Km, so I should be in atmosphere fast. Once there drag will do the rest.



OK, that is it. Notice I'm overshooting, but trajectory projection does not account for drag. So I'm guessing the proper trajectory. I should do more tests for this stuff.



Fuck, again... Overshot.


Well, I'm getting better at this. Last one was just under 100 km.


Not too bad



That concludes our going to space and actually coming back tutorial =)

Just for bonus points, here is the vehicle from tutorial, the magnificent Mun Lander 1! Just unpack and put in your KSP_win\Ships\VAB\ folder