Jump to content

[Java] Long Burn Calculator


Recommended Posts

Have you ever tried to perform a burn that lasted more than orbital period with your carefully designed super-sized mothership? Or have you just ever wonder in when to fire the engines when doing long burn to achieve correct orbit? If the answer is yes, that is something for you. If 'no' - do more KSP until your answer become 'yes'. :P

It's a long post that may be boring for some 'KSP Jedi', but I was always told to explain everything like I would be talking to a child :P

At first - the link to dropbox:

Download version 1.1

You have there a zipped folder with 3 elements:

oGNVb40.png

'configs' folder - it contains text files with numerical data of the planets

Jar file 'calc' - usually when you double click, it should start

bat file 'start' - if double clicking on Jar is not working, you can launch this file

Obviously to work it needs Java to be installed on computer. It should also work on all OS.

What about creating own configs for other planetary systems (by default there is only stock and RSS)? When looking on existing files you can see that in every line there is a planet name, gravitational parameter GM and radius in kilometers, separated with space. In addition in first line you can specify which planet loads as default.

The window itself looks like this:

Q7SYA4J.png

Short indtroduction what is where (detailed examples later):

The most upper panel there is possibility for choosing planetary system, and next to it, a planet or the moon above which is the manouver. There is also 'Calculate' button which is to be clicked in the end to get results.

In lower panel, in first row we have orbital shape parameters - Apoapsis, Periapsis - both in kilometers. In second row we have node parameters - delta-V in m/s and time in seconds between node and the Periapsis of the orbit.

Lower, on right side we have list of stages of our ship. 'Add stage" button adds a stage after the last existing one, and 'Remove last stage' removes last one. Then we have a table to fill: 'Start M' it's the start mass of given stage in tons, 'End M' it's end mass of the stage. 'Thrust' it's combined thrust of all the engines firing in the stage (in kN), and 'Isp' it's their specific impulse in seconds. By writting mass of a stage I mean mass of the whole rocket at the beginning of a stage and at burnout.

And on the left side there is free space which will fill with text after clicking "Calculate". There are, from top: duration of the whole burn, moment of firing the engines, moment of cutting off the engines, orbital parameters of the orbit we will achieve, its eccentricity, distance from a planet at cut off, actually used delta-V, losses expressed in m/s then in tons of fuel, and final mass of the ship.

And now the most important - how to use it?

The program works only for manouvers that have only prograde or retrograde components, so no normal or radial ones. But this shouldn't be a problem since any normal velocity can be brought to 0 by changing initial orbit inclination, and proper departure burn shouldn't have any radial velocity because it's the same as moving node in time. There is only one assumption - you have to direct your ship to prograde marker, not on the node (or retrograde if you're braking). That's all. Now it's time for ilustrated examples.

Example 1 - departure from low Kerbin orbit

We choose adequate planetary system - 'stock kerbol' in this case and the planet Kerbin (but it will choose itself by default). At first we fill in Apoapsis and Periapsis values. There's no need for extreme accuracy - if the Ap and Pe differ by no more that 10% you can consider orbit as circular and put their average value. Next we need to look at the mass of the ship.

IHAMU4r.png

After we plan our manouver we put its value to the program. We check also the parameters of the engine(s) - thrust and specific impulse to put them too.

k0Uw6IS.png

After filling those fields we look to the program to see if there are no datas missing. As we see 'Time from Pe' is set by default to 0, because on circular orbits (I assumed it's the most common initial orbit) it makes no difference where is the node relative to Periapsis. There's no need to touch this for now. Also I wrote nothing about the end mass. If we are sure that we have enough fuel we can leave this field empty - program will put 1t for calculations. Now, when we have everything, we click "Calculate" and observe the result.

X83etbx.png

We orient the rocket to prograde just like on screen and we wait. Program calculated that 'burn start' should occur in -1:57 which means we have to fire the engines 1 minute 57 seconds before the node. In reality, pressing 'shift' and increasing throttle from 0 to 100% takes about 2s so we should start at -1:58.

CxX6Mlh.png

After passing the node we do not delete it! We fly beyond remebering to orient ship to prograde all the time.

uBnmSIb.png

Program calculated that 'burn end' should occur at +2:05 so you have to cut off the engines 2 minutes and 5 seconds after the node. That's why you shouldn't delete the node - to see that time.

pnm1lxO.png

We compare orbits, target and real one. This time piloting was almost perfect.

l4t3xoQ.png

Example 2 - departure from elliptical Kerbin orbit

I won't write so detailed this time. We put Ap, Pe and mass.

yZBZIRY.png

We set burn of 1500m/s which occurs 2 minutes after the Periapsis just as the arrows shows. It means that in 'Time from Pe' field we put 120 (seconds). If the node would be before the Pe it will be -120.

rOF4cOD.png

We check the engine - 60kN of thrust and 800s of Isp (do you recognize that engine by its parameters? :P ).

tseqkDI.png

After entering data we get the results.

GiRRqLu.png

We fire the engine 3 minutes 5 seconds before the node.

37aj3Ge.png

And cut it off 4 minutes 10 seconds after.

eQpGVSz.png

This time I used 4x timewarp during burn. KSP apparently has some timeflow problem when doing this and you can't base engine cutoff decision on time. Mostly it should be enough to observe mass of the ship and end burn when it achieves a value predicted by program. But sometimes even that doesn't help. I have no idea about the cause but I'm starting to suspect that program solves rocket motion equations more accurately that the KSP itself.

ZxbesK9.png

I hope it was a understandable explanation :) Because entering all those values may seem to be pain in the you know what, I give you some advice to use my program efficiently:

First - the program is to calculate long manouvers, long that means comparable in duration with orbital period and in addition placed low in the gravity field. There is no use to calculate nodes in Kerbol orbit or 70000km above Kerbin. They can be executed symmetrically pointing rocket at the node or prograde. And that is exactly what the program would suggest to you.

Second - as mentioned before, burns not always are prefect. Possibly the KSP is inaccurate but that is not sure (I'm not blaming SQUAD :P ). And it's a lot easier to let MechJeb take care of the ships attitude.

Third - with multistage rocket, program assumes that they are jettisoned immidiately. However I think most of the burns are done with one transfer stage. It might be a problem sometimes to get the dry mass of the stage, but if I remember correctly Kerbal Engineer shows such information.

Also, the ship will not enter exactly the same orbit as predicted by the node. It will get an orbit with the same escape velocity and parallel asymptote direction (for hyperbolic target orbit) or Apoapsis placed at the same point (for elliptical).

Program is working for negative delta-V (braking manouver) but unlike accelerating nodes not every braking one is possible with only retrograde burning. Program may show impossible results or worse, plausible looking one which is in fact an impact trajectory. I think it was mostly fixed but be warned.

For practital reasons (potentially infinite computing time) program works only for burns shorter that 24h :P Also I'm not sure if the calculator is completely user-proof :D

And the most interesting thing - losses. It appears that TWR in space is also important. In long burning you lose fuel. But it's nonlinear function of burn time, so dividing it in two part would cause the combined loss to be smaller than when burning once.

I'm expecting many comments, that it's great, terrible, calculates incorrecly or greatly. Any feedback is welcomed :)

License

88x31.png

Long Burn Calculator is licensed by Creative Commons

Edited by von Ziegendorf
Link to comment
Share on other sites

This looks like a great tool. It would be nice to have a feature that can calculate orbit pumping for you, e.g. if I need to do a 15 minute low thrust burn to transfer to Jool, it's more efficient to do three burns on successive orbits. Pumping is hard to time for interplanetary transfers because of the intermediate orbits.

Link to comment
Share on other sites

I'm not sure if I see a problem in multiple burns and timing transfers - 1 or 2 days of difference (needed for additional orbits) doesn't change a lot when travelling to other planets. I wrote this program for my RSS gameplay and I'm performing burns in parts with no problem.

Link to comment
Share on other sites

  • 3 weeks later...

Yeah, you need to have no normal components, because they can be easily 'faked' if you depart from properly inclined orbit. Another solution is to make a prograde burn of slighlty less than escape velocity, then at Apoapsis cheaply perform plane change and finish the burn at next Periapsis. The main problem was that only prograde direction is well displayed by KSP. It would be hard to keep the rocket pointing in another direction. I wrote this calc mostly for my Real Solar System gameplay and I use this every time and get very good results :)

Link to comment
Share on other sites

  • 3 months later...
  • 1 year later...
  • 1 month later...
  • 5 weeks later...
On 20.04.2016 at 5:41 AM, HoveringKiller said:

May be too late and not work anymore, but I can't seem to get it to work. It keeps saying I don't have enough fuel but I know that I have plenty of Delta-v to calculate the maneuver. Does this still work?

Well, perhaps you have so low TWR that you waste a lot of fuel, that is why you can't make the manouver despite theoretically having enough dV.

Link to comment
Share on other sites

  • 1 month later...

like this:

On 31/07/2014 at 5:44 PM, von Ziegendorf said:

What about creating own configs for other planetary systems (by default there is only stock and RSS)? When looking on existing files you can see that in every line there is a planet name, gravitational parameter GM and radius in kilometers, separated with space. In addition in first line you can specify which planet loads as default.

So, i guess you can add some in the stock config or create a new one for OPM  :)

don't forget to share it, some other people could need it too.

 

Edited by Skalou
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...