Jump to content

Hohmann Transfer calculation?


Recommended Posts

Hey. I'm really sick of having to use MechJeb everytime I want to rendezvous with something because it gets really boring when it's done for you automatically. And I'm also sick of making random nodes until I get a barely close enough interception.

Does Hohmann Transfer has a calculation? If it does, how do I do it? I'm mostly using it for LKO docking. I've seen tutorials on how to rendezvous with an object in orbit (and for some reason they don't work out well for me?..) and I'd like to know how to do the actual thing. Where to set up the node, how many orbits I gotta wait, how much adjustments do I need, etc. It'd be really cool if there's a way to calculate all of that and I'd really appreciate it if someone tells me about it.

Thank you in advance. (yes I'm sort of a newbie.. well a newbie at rendezvousing and docking in general).

Edit: a manual calculation would be better than a program or something that automatically calculates it :)

Edited by Martian Music
Link to comment
Share on other sites

For rendezvous, you're going to need Kepler's third law:

All orbits that have the same semi-major axis have the same orbital period, and the square of this period is proportional to the cube of the semi-major axis.

As an example: If the craft you'd like to meet is about ¼ of an orbit ahead of you at the intersect, you'll need to accelerate or decelerate at the intersect in such a way, that your final semi-major axis is gif.latex?\left(\frac{3}{4}&space;\right times the semi-major axis of the other craft in order to catch it within one orbit. If you want to rendezvous after 2 orbits, it's of course not (1-¼), but (1-⅛) in the first bracket and so on and so forth.

In order to get the required delta-V, have a look at Wikipedia's excellent article on Hohmann transfers, which not only gives you all the formulas, it also explains the derivation. Or, if you are in for a fun little exercise, derive it yourself. Here are some hints if you don't know where to start:

Spoiler
  • Gravity is a conservative force, so energy is conserved.
  • The problem is spherically symmetric, limiting motion to a plane. In other words: The direction of angular momentum is conserved.
  • For the same reason the angle in the plane of motion is a cyclic coordinate, meaning: The magnitude of angular momentum is conserved as well.

 

Edited by soulsource
Link to comment
Share on other sites

33 minutes ago, Martian Music said:

Hey. I'm really sick of having to use MechJeb everytime I want to rendezvous with something because it gets really boring when it's done for you automatically. And I'm also sick of making random nodes until I get a barely close enough interception.

Does Hohmann Transfer has a calculation? If it does, how do I do it? I'm mostly using it for LKO docking. I've seen tutorials on how to rendezvous with an object in orbit (and for some reason they don't work out well for me?..) and I'd like to know how to do the actual thing. Where to set up the node, how many orbits I gotta wait, how much adjustments do I need, etc. It'd be really cool if there's a way to calculate all of that and I'd really appreciate it if someone tells me about it.

Thank you in advance. (yes I'm sort of a newbie.. well a newbie at rendezvousing and docking in general).

Edit: a manual calculation would be better than a program or something that automatically calculates it :)

2 ships in LKO don't really need a Hohmann transfer. Using one in my opinion is like removing a screw with a pocket knife. Sure you can do it but there's a screwdriver RIGHT THERE.

If you have 2 ships in orbit around Kerbin, control the one you want to rendezvous with the other. Place a maneuver node anywhere on your orbit and draw it up to touch the other ship's orbit on the other side (that's actually a Hohmann transfer but we're not calculating anything here). It should get you some encounter markers. Unless you're extraordinarily lucky they'll not match up. Drag the maneuver node around the orbit and see if you can get them to. If so, great. Do that burn and then rendezvous.

If they're not (and it's likely they won't be) use the "+/-" buttons on the maneuver node (right click it to toggle between the "normal" maneuver node and this one) and increase the orbit once or more, until the two markers are close to each other. THEN drag it around (in that same +/- mode. Don't drag it in the other mode or KSP will "helpfully" snap it back to the current orbit, not the future orbit) until the two encounter markers match up.

Two mods that make this MUCH easier are precise node (so you can be 100% sure you're not going to screw up the future node by dragging it) and Kerbal Alarm Clock (so you can go do something else while waiting multiple orbits before your burn).

I apologize if this fits your definition of "making random nodes." It's really not, though. It's a specific process that you can follow and get exactly what you want every time.

Edited by 5thHorseman
Link to comment
Share on other sites

I'm not sure what you want to calculate here? Especially for rendezvous, which are more about eyeballing where you are in relation to your target.

Not sure what part of rendezvous tutorials "doesn't work out well" for you, but it's not complicated at all. There are just four steps to it.

1.) First, you assume an orbit that is similar to that of your target. Either put both periapsis and apoapsis a few kilometers higher, or both a few kilometers lower. Which one you should pick depends on where your target is. If it is in front of you, your AP and PE should be lower; if it is behind you, your AP and PE should be higher. Doing this ensures that the distance between you and your target decreases with every orbit, and you will eventually pass each other.

The bigger the difference in orbit altitude, the faster the distance between you and your target changes. It's safest to not make the difference too large. Experience will tell you how much is appropriate; until then, start with no more than 10 km difference. Also avoid putting your PE into the atmosphere, for obvious reasons :P

2.) Then, you match inclination. If you target your rendezvous partner, the game should display markers called "AN" and "DN" to you. Mouse over them to see the difference in inclination. If it's just something close to 0, you can ignore it, but everything above 0.5° you definitely want to adjust. To do this, make a maneuver node on either the AN or DN node, and apply only normal/antinormal dV. You can keep mousing over the AN/DN to see how your inclination difference changes. Try to get it close to 0, and then execute that node.

3.) Finally, with your AP and PE set where you want them to be, and your inclination zeroed out, you timewarp a little bit and watch yourself and the target get closer and closer. You want to wait until you are fairly close to passing by each other, but stop before that actually happens... like, maybe one orbit away from passing. Definitely not less than half an orbit from passing. Now, you make a maneuver node a few minutes in front of your ship. If your orbit is lower, you add prograde dV; if your orbit is higher, you add retrograde dV. You keep doing this until your orbit crosses that of the target. At this point, you see "closest approach" markers appearing (if they weren't already there before). Mouse over the markers to see how far apart you are. Then keep adding dV to make that value decrease. Unless adding dV makes it increase, in which case you should remove dV instead. You want a nice close approach, ideally under 0.5 km, but anything under 2 km works, really.

Note that you may get two sets of close approach markers in some situations. In that case, you should check both, but aim to perfect one of them only. Whichever of them is more convenient for you.

4.) Execute your maneuver and then timewarp forward until you are at your close approach point. Here, switch your navball to target mode (if it is not already), point at the retrograde marker, and burn until the navball shows 0.0 m/s velocity. You are now stationary relative to your target, which should only be a few hundred meters away. At such a short distance, you can simply point your nose right at it, and give a bit of thrust to approach it.

 

Voila, that's all you needed to do to rendezvous. You'll notice that at no point in this process did it ever matter how precisely you set up your Hohmann transfer - which is why asking for calculations here is pretty pointless. As long as you did step 1 and 2 properly, step 3 is 100% guaranteed to work with simply making a node a minute or two ahead of your ship and pulling prograde or retrograde until you magically have a close approach.

Sometimes you can get a better encounter if you drag and drop the node further ahead in the orbit, but since you waited until you were close to passing your target already, only a small dV expenditure a few minutes ahead should get you the encounter you want. You can also try to use the normal/antinormal and radial in/radial out directions to get a closer encounter, but if you did steps 1 and 2 properly it shouldn't be necessary.

Edited by Streetwind
Link to comment
Share on other sites

29 minutes ago, 5thHorseman said:

(in that same +/- mode. Don't drag it in the other mode or KSP will "helpfully" snap it back to the current orbit, not the future orbit)

Always something to learn. I've been playing for years, and have always been annoyed by it going back to the current orbit when you "slide" the node around. Had no idea you could get it to not do that in the +/- mode. 

Link to comment
Share on other sites

Yeah I get it. I can easily rendezvous if the orbit of my target is higher, it's like going from Kerbin to Duna, and I get encounters pretty easily there (sometimes at a height of ~20km or even right crashing into the planet) but my case here is that I'm docking with a station that's in a 70x70 orbit, so that's on the extreme edge of the atmosphere. And because the distance is so small, I can't manage to get any interceptions. I tried getting my ship's orbit (the one that's gonna rendezvous) to a 200x75 orbit and the process becomes a bit easier but still difficult.

I want a calculation for 2 reasons: one, because I hate making and experimenting with precise maneuver nodes (mostly because I use a laptop pad) and two is because I love to do the maths behind it :D or in other words, I'm making it feel like if I'm really working at NASA or something ;P

@soulsource I will try that and some other stuff I found on Google, and I'll get back to you.

Edited by Martian Music
Link to comment
Share on other sites

1 hour ago, Martian Music said:

I want a calculation for 2 reasons: one, because I hate making and experimenting with precise maneuver nodes (mostly because I use a laptop pad) and two is because I love to do the maths behind it :D or in other words, I'm making it feel like if I'm really working at NASA or something ;P

The below math is slightly wrong in that the calculator I was using (me) was doing cubes wrong. Ignore the wrong numbers though and the idea is sound :) Also, in my following reply, I used the correct cubes.

Well the math isn't that hard, it's just fiddly and I don't like it :)

Your orbit period cubed is equal to your semi-major axis squared, with a convenient constant thrown in. So for example Earth's SMA is 1 AU, and its orbit is 1 year, so the constant is 1 (due to how we chose our units). Mars' SMA is about 1.5, and its year should therefore be about sqrt(1.5 cubed) and sure enough, it is.

For your ships, then, you have one at say a 100km orbit and one at a 200km orbit (Orbiting at 70km is asking for trouble and I would say any permanent station be at LEAST 80km up and you may as well do it 100 for easier math). Of course, Kerbin's 600km in radius so your orbits are actually 700km and 800km. Let's say you're orbiting 100km and your station is 200km. Let's also say your 200km station's orbit is "1 time unit" and its orbit's radius is "1 distance unit". We can say 1 time unit cubed equals 1 distance unit squared, just like with Earth and years. Further, your lower ship's orbit is 7/8ths of a distance unit, so its period will be the square root of 7/8 cubed, or about 0.93 of the station's orbit. Note I'm not using km or seconds or anything, just comparing the two orbits using made up units that are more convenient. This is easier because you can then remove all units and just use ratios.

You will eventually be making a burn to turn your 100x100 (Periapsis x Apoapsis, not width x height) orbit into a 100x200 orbit, to go from where you are to where you're going. Remember that's actually a 700x800 orbit. The long width of that ellipse is 1500km, so the SMA is 750km. so it's 750/800ths the space station's orbit, so sqrt(750/800 cubed) is about 0.968. You'll eventually be traveling halfway around from your ship to your station, and in that half time you'll travel 0.484 while it travels 0.5.

0.5-0.484 is 0.016 orbit units, and an orbit is 360 degrees, so you want to be 360*0.016 = about 5.75 degrees behind the station when you do your burn to Hohmann transfer to it.

Now you see why I just make maneuver nodes and drag them around.

(I hope I didn't make any mistakes, either in the math or the idea. I'm pretty sure I didn't but I'm running on low sleep right now. Hopefully even where I do have any mistakes, I at least get the IDEA across so you can do it yourself with your own orbits)

Edited by 5thHorseman
Link to comment
Share on other sites

Ok this is either too complicated or it got complicated (to me), mostly because you assumed the 1 time unit and the 1 distance unit.

I understood the idea, but I still can't seem to be able to apply it, so can I give you my current stats for example, and you do me the calculations for once? After that I'll have probably picked it up. (yeah I know the 70km orbit is crazy but I have an even crazier reason behind it)

So the station is in a 70x70 orbit and the supply ship is in a 90x90 orbit (actually make it 100x100 for easier numbers). So now, how do I calculate the station's time unit and distance unit? Or in other words, what did you exactly meant by TU and DU? TU is the time it takes for the station to complete 1 orbit right? And the DU is the semi-major axis of it's orbit right? How do I calculate both of those?

And are they the only things I need? I mean the ship and station's orbit speeds for example, or their locations in the orbits, who's ahead and etc..

If I'm being too much of a pain in the butt then I'll just simply experiment with the nodes, but I really love to know the science behind everything and I believe that isn't a wrong thing, is it? Thanks a lot to all of you by the way :)

Link to comment
Share on other sites

EDIT: Oops I used 75km. I'm not going to re-do the math now though :)

"Time Unit" and "Distance Unit" was just to put your station in a similar situation to Earth in the Solar System. 1 AU is 1 AU because it's so darn convenient and for no other reason. 1 year is also super convenient for the SAME reason. We define our units in this way to make the math (which is the hard part) far easier. If you don't, you deal with the below.

Your station is in a 675km orbit, and orbits in (I'm guessing here) about 30 minutes. So we know that the square of the period (30 minutes) is the cube of the SMA (675km) with some constant based on our units (Above, I set the units so the constant would be 1 but here, we need to find it).

So, 30 squared is 900 and 675 cubed is 307546875, so 900*x = 307546875, so our constant here is 341718.75 or let's say 341000. Or 0.0000029 if you're going the other way.

So your ship orbiting at 100km is actually at 700km from Kerbin's radius. So we plug that into the square/cubed equation:

(SMA cubed = period squared * 341000)
(7003 = p2 * 341000)
(343000000 / 341000 = p2)
(31.7 minutes = p)

So your station orbits in 30 minutes, your 100km ship orbits in 31.7. To burn it down to the station, your transfer orbit's SMA will be exactly midway between 75 and 100km so at 87.5km which is 687.5km from Kerbin's center, so we do the same math:

(SMA cubed = period squared * 341000)
(687.53 = p2 * 341000)
(30.9 minutes = p)

So it would take your transferring craft 30.9/2 minutes to get from its 100km orbit down to the 75km orbit of the station (because it's a half orbit). The station in 15.45 minutes will travel 15.45/30 or 51.5 percent of its orbit, so you'd want to be 1.5 orbit percents ahead of the station when you burn down. 1.5 percent of 360 is 5.4 degrees.

I think I may have said that last part wrong in the original example.

Note this assumes that a 75km orbit is - indeed - 30 minutes exactly. But if it's not you can do the math yourself to figure it out.

Note also you can end run around the math by noting, for all 3 orbits (ship, station, and transfer) the time it takes to get from Pe to Ap. Double that is your orbital period in all 3 cases, and for every orbit in the game.

Edited by 5thHorseman
Link to comment
Share on other sites

2 hours ago, 5thHorseman said:

(in that same +/- mode. Don't drag it in the other mode or KSP will "helpfully" snap it back to the current orbit, not the future orbit)

Holy crap, I didn't really expect to learn that.

Link to comment
Share on other sites

@5thHorseman You're awesome dude. I'll try to do it and see how it goes. Thanks a lot!

Edit: I calculated the orbital period of 70km orbit using Kepler's Third Law (thanks @soulsource)  T = 2\pi\sqrt{a^3/\mu} and it's 30.4 mins, so you're close enough Horseman :P

I'm trying this all in-game tomorrow, and if it works out I'll write a QBasic program to automatically calculate it for me when I'm feeling lazy to do it on paper :D this is a lot more fun that messing with maneuver nodes! 

Edited by Martian Music
Link to comment
Share on other sites

On 17/04/2016 at 2:26 PM, FullMetalMachinist said:

Always something to learn. I've been playing for years, and have always been annoyed by it going back to the current orbit when you "slide" the node around. Had no idea you could get it to not do that in the +/- mode. 

Even if you don't want to use MJ to actually plot the transfer for you, you can still, if you want, use it's other tools to assist in you doing it - I'm specifically thinking of the Manoeuvre Node Editor, which has tools for tweaking the Nodes, snapping it to various events (such as Pe or AN), and adding/removing orbits - exactly what the game GUI can do, but is a lot less fiddly and easier to use.  That and the Kerbal Alarm Clock and both pretty useful.

Wemb

Link to comment
Share on other sites

 

@5thHorseman Okay so I made a quick QBasic program to calculate it and it went pretty well, BUT there are some cases I wanna ask about.

Firstly, do you mind downloading the program here? https://www.sendspace.com/file/2agn1b  and maybe mess around with it to check if it's doing it correctly. It's virus-free but feel free to scan it as well :)

On 4/17/2016 at 6:31 PM, 5thHorseman said:

So it would take your transferring craft 30.9/2 minutes to get from its 100km orbit down to the 75km orbit of the station (because it's a half orbit). The station in 15.45 minutes will travel 15.45/30 or 51.5 percent of its orbit, so you'd want to be 1.5 orbit percents ahead of the station when you burn down. 1.5 percent of 360 is 5.4 degrees.

You see that percentage? What are we exactly doing there? I mean.. not how we got it, but after we get it. In some cases I got a percentage of 60% for example, or even 120%. This is when my program gives me 0 degrees. Because the process I made here is, if X is between 50 and 60, then X = Y - 50 , where Y is the percentage we got. But when Y is 50 for example, we'd get 0 degrees?

One more thing, what if the orbit is 100 x 110 for example? What happens here?

Edited by Martian Music
Because I can. Huehue.
Link to comment
Share on other sites

I stumbled on a new-to-me technique for finding encounters while doing some asteroid intercepts over the weekend, using multiple maneuver nodes.

  1. Choose where to intercept; it's easiest to use the point on the target's orbit that's closest to your orbit (in my case, I used the asteroid's Kerbin SOI Pe).
  2. Choose when to intercept; this would either be the next time the target is at that location, or some future iteration (in my case, the asteroid was on an escape trajectory, so I only had one time to choose, which appeared when I hovered over its Pe marker). Write this time down (in my case, it was something like 85d 2h 12m).
  3. Place a maneuver node on your path (call it #1), and hover over it to see when it happens; drag it around and possibly use the +/- orbit buttons until the maneuver's time matches the chosen encounter time from step #2 as closely as possible; this node marks where your ship will be when you want the encounter to happen.
  4. Place a second maneuver (call it #2) closer to your current time/place, and make sure it happens before the other one, ideally far away from it, which we will use to establish the encounter.
  5. Now as you manipulate maneuver #2, maneuver node #1 will move around to show where your ship will be when you reach the time you chose for the encounter, even when you don't have any close approach markers! Rather than the usually random guesswork of trying one direction or another, you can quickly see which maneuver node handles move you closer and which move you farther away. As soon as you get maneuver #1 to the location you picked in step #1, you're done, since the time is already synced up. As a bonus, when you do get it nearby, the second maneuver node will force the patched conics to find the close approach nearest to your chosen time rather than some random noise from the next 1-2 orbits when you might not be nearby at all.

Once I realized this would work, I was able to forget about trying to make a spreadsheet that would calculate the optimum time to burn for that rendezvous. Before that, I kept ending up at my Pe when the roid was whizzing past my Ap due to close approach noise.

Link to comment
Share on other sites

6 hours ago, Martian Music said:

 

@5thHorseman Okay so I made a quick QBasic program to calculate it and it went pretty well, BUT there are some cases I wanna ask about.

Firstly, do you mind downloading the program here? https://www.sendspace.com/file/2agn1b  and maybe mess around with it to check if it's doing it correctly. It's virus-free but feel free to scan it as well :)

You see that percentage? What are we exactly doing there? I mean.. not how we got it, but after we get it. In some cases I got a percentage of 60% for example, or even 120%. This is when my program gives me 0 degrees. Because the process I made here is, if X is between 50 and 60, then X = Y - 50 , where Y is the percentage we got. But when Y is 50 for example, we'd get 0 degrees?

One more thing, what if the orbit is 100 x 110 for example? What happens here?

I'm on vacation this week and won't have much computer time for a while. But for that last one... I don't know. I can visualize it but not explain it. And I can't even begin to think of how to program it.

Link to comment
Share on other sites

I may just be explaining it poorly. It's just percent of the orbit. In 15.45 minutes (the time it takes to transfer) the station would travel 51.5% of its orbit. So you need to do you burn so you will hit the station's orbit at a point 51.5% of an orbit away. As your orbits are both circles to start, that means your higher orbiting ship needs to be 1.5% of a full circle ahead of the station when you burn.

And as every 1% of an orbit is 3.6%, 1.5% is 5.4°

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...