Tuesday, July 23, 2013

Mission 1: Operation Orbit

For our first mission, we're going to tackle the simplest of tasks: sending a manned craft into orbit around Kerbin, the home planet of the Kerbals and our analogy of Earth. Along the way, we'll develop and enact a solid system to recover Kerbals landing after re-entry and dive deep into the wonderful world of calculus and trigonometry as we learn how to calculate a rocket's potential delta/V and how to calculate the delta/V of a trip, or, in layman's terms, see if you got enough gas!













Before we get into that, however, we need to tackle some of the basics of Kerbal Space Program. First and foremost, this is the home base of the Kerbal Space Program. From left to right, we have the airplane hanger and runway, where we can build and fly airplanes, spaceplanes, and dirigibles; in the center is the VAB, or Vehicle Assembly Building, where all the rockets and spaceships are built, connected to the launch pad, in upper right, and finally, the tracking and communication center is on the bottom right where all the flights are coordinated and Mission Command is located.

Next, we need to know a little bit more about the Kerbol system. There are six planets, some with moons, and Kerbol, the mid sized star at the center of it all. Next up is Moho, the second smallest planet and analogous of Mercury. Eve is next, a harsh planet with a thick atmosphere and high temperatures, much like Venus. Kerbin is the third planet, homeworld of the Kerbals and our base of operations. Duna, or Mars, is next, followed by Jool, Saturn, and Eeloo, or Pluto. Unlike the real Earth, Kerbin is markedly smaller than Earth, yet it has two moons, Mun and Minmus, rather than just one moon.

Now, before we just jump into launching into orbit, we need to consider the cleanup first. Getting into orbit is relatively easy, but it leaves us with a huge problem: when the capsule containing the brave souls comes back down to Kerbin soil, it could land anywhere, and I need to be ready to save them.

Introducing the Pelican class recovery seaplane! I decided to go with a seaplane because there is just as good of a chance that my astronauts could splash down into the ocean as on land, and I need to be able to get there quickly. The Pelican is designed to be relatively slow, but have a lot of lift and be capable of very short landings and takeoffs, allowing it to land almost anywhere. It takes two Kerbals to run, a pilot and a navigator, and it carries accommodations and liquor for up to four returning Kerbals in a passanger compartment in the rear. The yellow and blue indicators show the Pelican's center of mass and center of lift. You want the center of lift to be slightly above and behind the center of mass. This way, when the craft pivots, there is always a little mass acting like a pendulum to bring the craft back into line.

Sitting on the runway and warming up it's twin radial engines, the KSS Welcome Wagon is the first production model of the Pelican class. As you can see in this frame, the plane is built with an integrated safety system that will, in the event of emergency or extreme spin, automatically detach the cockpit from the rest of the craft and float it gently to the ground on a pair of parachutes.

Success! The Welcome Wagon is airborne, managing to take off in less than 300 feet and at 35 m/s. Piloted by the brave Elbree and Bob Kerman, so far, the craft is performing exceptionally!

 After performing a few manouevers to ensure the Welcome Wagon is air worthy, Elbree and Bob report back to base that all is well and they are preparing to perform a water landing to prove that the Welcome Wagon is sea worthy as well. The plane descended smoothly as Elbree Kerman expertly guided the plane in slowly, and managed a successful landing at an incredibly low stall speed of 50m/s. This news is especially encouraging, because most planes need to land at 75 m/s or often above, so the Pelican's slow stall speed means that it can take off and land in very short distances, as designed.




With the tests a stunning success, the Welcome Wagon is back in the air and on approach to the Kerbal Space Center. Elbree is left in the front cabin flying the plane, while Bob is in the back, enjoying his post-rescue Big K and rum.

As Bob dries out, it's now time for the final test: landing the seaplane on dry land. All signs are good so far, and Elbree lines up the Welcome Wagon with the runway.

Disaster! As the Welcome Wagon lands, the left side landing gear collapses due to insufficient structural support and throws the Welcome Wagon into a terrifying crash-landing on the runway. Shortly after touching down, sparks from the scraping metal body ignite fuel leaking from a damaged fuel tank and a large fireball erupts, swallowing most of the craft.



After the dust settles, amazingly, thanks to the aforementioned cockpit separation system Elbree is able to crawl out of the badly damaged, yet intact, wreckage of the cockpit unharmed. Debris litters the runway, and unfortunately, there is no sign of the passenger compartment or Bob Kerman, both swallowed by the fireball.



After the crash landing, Elbree was put through standard-issue grief rehab after finding Bob's charred, twisted corpse (the suits are really, really good at keeping in both Kerbalnauts and fire, although the two rarely mix that well) and Bob Kerman was most ceremoniously swept off the runway and his family and loved ones issued the government standard grief fruit assortment and $5 gift card to Starbucks. The Pelican Class, however, was approved for active duty as the KSP standard recovery plane, with future pilots given strict orders to be more careful on landing.

With a recovery system now in place, we can begin building a rocket to take us on our mission into orbit. Building a rocket is no easy feat, as getting into orbit is no easy task. It's not as simple as shooting a rocket straight up into space. When in orbit, a Kerbalnaut is often referred to as being in "zero gravity", but this is not true. The gravity of Kerbin (or earth) is still pulling down on the craft very hard, but the catch is when you are in orbit, you are moving forward at the same speed as you are falling towards the Earth. So, when you are "stationary" in orbit, what's actually happening is that you are falling towards the Earth at say, 2,500 m/s, but, you are also moving forwards at 2,500 m/s, cancelling out. (In simple terms.)



For example, let's say that you fire a cannonball from the top of a mountain so tall that the top of it is technically in space and out of the atmosphere, so that there is no air resistance to slow the cannonball down. If you fire the cannon, it would follow it's normal ballistic trajectory and go forwards for awhile until the force of gravity pulls the cannonball down to the surface. Now, fire the cannon again, but with twice as much gunpowder, so the cannonball goes twice as fast. This time, the cannonball is going forwards so fast that it travels farther before the force of gravity can pull it down, and it ends up landing halfway around the globe. Now, imagine that you pack the cannon with so much powder that when it fires, it's going so fast that it can go the entire way around the globe before gravity can pull it down. Rockets work the same way. You must first get your rocket high enough to get out of the atmosphere, where air resistance will slow you down, and then introduce enough horizontal speed so that you equal the speed at which gravity is pulling you back down and viola! You're in orbit. Speed up a bit, and you will be moving faster than gravity is pulling you down and your orbit will begin to rise up and away from the planet, slow down and your orbit will fall back to earth. For more information read here.


Before we launch, we need 
to do some math and make sure it will work on paper before we strap in 
whatever Kerbal would volunteer to be shot into space. There's a couple 
things we need to worry about, the thrust-to-weight ratio and the 
Delta/V of the rocket. The thrust to weight ratio of a rocket is 
important, it's a fancy way of saying how much power does your rocket 
have compared to it's overall weight. The formula is relatively simple,
 it's just mass/power. So, by carefully keeping track of what I'm adding
 to the Doogey, I know that topped to the brim with fuel, weighs in at 38.4 tons. However, most rockets work in stages, and the Doogey
 is no different. There are three seperate stages to the rocket, and 
three seperate motors. As the rocket rises into space, used up sections 
of rocket will drop off at different points so that the rocket doesn't 
have to keep lugging up the dead weight of empty fuel tanks and spent 
rockets. So, I'll 
have to do three different calculations, one for each motor. The bottom,
 or first stage, has to be the biggest, as it's responsible for breaking
 the pull of gravity and getting the whole thing moving. I know the 
weight is 38.4 kg, and I installed a motor that produces 1.7kN  of 
thrust. I have tons and kN, or kilo-newtons, which are incompatible 
units, and I also need to account for the force of gravity pulling back 
down on the rocket, but I can take care of both of these problems by 
converting the 38.4 kg into newtons, for which the formula is simply 
kg*m/s², where the m/s² is the downward force of gravity. On Kerbin, the 
force of gravity is 9.81m/s², so I multiply 38.4*9.81 to get 376.704N. 
Back to the original formula, I can now divide 1700/376.704 to get 4.51.
 This final number, 4.51, is the thrust to weight ratio for the first 
stage of the Doogie. Thrust lifts you up, weight pulls you down. 
So, if the number is greater than 1, then you have positive thrust and 
you will take to the skies, the higher the number the faster, and if you
 have less than 1, your rocket will not be able to lift itself off the 
ground. Thus, 4.51 is great, and following through on the other stages, I
 calculate that that the other two stages have a TWR of 3.48 and 1.38, 
which indicates that the Doogie should be a very nimble, fast craft with no problem lifting off.

If your brain doesn't hurt enough, it's really about to get it. All that acceleration is awesome, but it'll blow if we get halfway up and run out of fuel. I can easily get a TWR of upwards of 1,000 or so by strapping a huge motor to a tiny fuel tank, and it's be the fastest rocket on the face of Kerbal, but big motors are notoriously fuel hungry, and that rocket will run out of fuel in five or ten seconds, and you'll only get up a few hundred feet before you're running on E. You need to strike a balance between carrying enough fuel and not being too heavy. For this, we can use what is called the rocket's delta/V, or change in velocity. This figure represents not your current velocity, but how much velocity you need to generate to get from a standstill to where you want to go and then establish an orbit, or simpler, it's how far up your ship is capable of going. By checking the Kerbin page on the Kerbal Space Program Wikipedia, I can find that the delta/V to get into an orbit 100km above the surface is  ≈4700 m/s, and I also have to burn higher to get to an altitude of 600,000m for my goal. So, like I calculated the TWR for each of the Doogie's stages earlier, I need to calculate the delta/V of each stage and add them up, in order for my mission to be successful, the total needs to be over the total delta/V I calculate for the journey. To find the delta/V of each stage, I can use the Tsiolkovsky rocket equation, which states that:




In this equation, the triangle V is delta/V, our answer, Ve is the specific impulse, or fuel efficiency of the motor used, ln is a natural logarithm, M0 is the full weight of the rocket, and M1 is the dry weight of the rocket. So, plugging in numbers, I know the specific impulse of the motor I used is 280, the full weight is 38.4kg, and the dry weight without fuel is 28.15 kg. This leaves me with delta/V = 280*ln(38.4/28.15), which works out to a tidy delta/v = 1737 m/s. Saving you the time, stage two brings the delta/V up to 3290m/s, and stage three puts it at a total delta/V of 5579m/s. 

Now, we know from the Kerbal wikipedia that the delta/V needed to get to 100km orbit is 4700m/s, but I want to go a bit higher than that, let's say, 600km. To do that, I need to calculate the delta/V it will take to raise the orbit from 100km to 600km. To do this, we can perform what's known as a Hohmann Transfer Orbit. To do a Hohmann, a ship travels to it's apoapsis, where it's travelling the slowest, and performs a progressive (forward) burn to speed up a bit. This causes the point on the opposite side of the orbit, the periapsis, to begin to rise in altitude, and balloon out. When the periapsis reaches the desired altitude, 600km, the ship drifts around to the new periapsis and performs another progressive burn, speeding up again. This time, the point on the opposite side, the apoapsis, to rise in altitude as well until it is also at 600km, resulting in a nice, tidy circular orbit. 

We can calculate the amount of delta/V we'll need to perform this maneuver by following the formulas below, called the Hohmann Equation:
 




The first forumla, solving for v1, will tell us the amount of delta/V the first burn will require, and the second formula will tell us the amount of delta/V the second burn will require. Add them up, and you have the total amount of delta/V you will need to generate in order to perform the entire maneuver. It looks big and scary, but it's really not. The weird triangle in front of the v1 is the greek letter for delta, so it's just saying delta/V. The weird little u is the greek letter Mu, and it stands for the gravitational parameter of a planet, or it's force of gravity relative to it's size. R1 is the beginning radius, or altitude, and R2 is the desired ending altitude. We can look up Kerbin on the Kerbal Space Program wiki, and find that Kerbin's gravitational parameter is 3.5316000×1012 m3/s2. Or, if we wanted to be all fancy, we could find it for our selves with this formula:

This the Standard Gravitational Parameter Formula, which states that the mu, or parameter, of a planet is the product of the gravitational constant and the mass of the planet. Wiki states that the gravitational constant, or 'Big G', is 6.674x10-11 , and we can also read on the wiki that the mass of Kerbin is 5.2915793×1022 kg, so, multiply the two, and you get 3,531,600,024,820, or 3.5316000×1012 m3/s2, right on the money.

The only other trick is that the 600km altitude we want reach and the 100km altitude we are starting with are measured from sea level, and this equation needs the measurement to be from the center of mass of the object we are orbiting, which is the exact center of the planet. Again checking the Kerbin Wiki page, we can find that the Equatorial Radius of the planet is 600km, which means the planet is 600km thick. So, we need to add that to our original and ending altitudes, so that the original 100km becomes 700km, and the desired 600km doubles to 1200km. Now that we have all this information, we can plug it into the Hohmann forumla and find out how much delta/V it will require. 



I'm old school, and I prefer my math on pen and paper. So, you can follow my math if you like, but I figured that the first burn will take 278.2967m/s, and the second 242.9344m/s, or a combined total of 521.2311 delta/V. Going back to the beginning, we know that we need 4,700m/s of delta/V to get into orbit at 100km, and we need 522m/s to get to 600km, for a total of 5222 m/s. We also need to worry about bringing Jebediah back home. In order to do this, we'll pull a neat little trick called aerobraking. Basically, if we are orbiting a planet with a thick atmosphere like Kerbin, if we put our periapsis just low enough that the craft skims through the upper atmosphere, the air resistance will slow the craft down a bit, and then each time the craft loops around again and skims the atmosphere, it slows it down a little bit more and more until the craft fully re-enters the atmosphere and lands. So, we have one final calculation to do. After we're done playing around in orbit, we'll need to do a single burn to move the periapsis from 600km to about 40km, where the atmosphere will begin aerobraking the craft. 

To do this, we we'll need to perform a retro (or reverse) burn at the apoapsis to slow the craft down and pull in the periapsis. (don't worry if this sounds confusing, it will make a lot of sense later when you can see it happening.) Because delta/V is a total change in velocity, and doesn't care which direction the ship is pointed in, we can use the Hohmann formula again to find the delta/V for the burn, even though it's a retro burn instead of a progressive burn. 



So, this time around, I'll only use the first formula, since I'm only performing the first burn. I can figure that my r1 will be 1,200,000m, right were we ended the last one, and the r2 will be 640,000m, for 40,000m plus the equatorial radius of Kerbin, and after working through it, I found that we'd have a delta/V for a safe descent of 284.77m/s. Add this to our early total of 5222 m/s, and we find we need  5507m/s of total delta/V for the flight. Earlier, we found that the KSS Doogey can provide a total of 5579m/s of delta/V, which means that the Doogey is perfectly capable of making the journey and returning Jebediah back to saftey. However, these figures are all assuming that the pilot is not an inept Kerbal or inebriated player, which tends to lead to piloting errors that cost precious wasted delta/V! I gotta stay on my toes!







Now that the KSS Doogey has been cleared by the mathematicians and eggheads for launch, we find ourselves in the bright Kerbin afternoon on the launchpad with the infamous Jebediah Kerman strapped into the pilot's seat, ready and willing to be the first Kerman flung into space. On the runway, another Pelican, the KSS Maybe Not, sits idling, awaiting the return of the Doogey to pick up Jeb from wherever he lands.


5... 4... 3... 2... 1... BLASTOFF! With a huge grin, Jebediah Kerman and the Doogey fling skywards. All systems are turning green lights, and the launch struts let go of the craft with no problem.


As predicted, the Doogey is a remarkably fast craft. Ten seconds into flight, the rocket has already reached a speed of nearly 250m/s, or 559.24 mph, and is pushing 1500 feet. So far, the mission is off to a great start!


At 9,400 feet, the first stage runs out of fuel. No problem! The explosive decoupler flairs and the first stage motor and fuel tank drop away from the rising Doogey, and the second stage, a twin engine, 350kN combined thrust motor fires and continues the merciless ascent. At this point, it's going to be a good idea to lean the rocket over about 10 degrees on the nav ball so that I can begin to introduce horizontal speed to my orbit.


With Jebediah grinning from ear to ear, the Doogey  leaves Kerbin's atmosphere and officially enters space! The second stage motor doesn't have much fuel left, but there is still a whole third stage to go. So far so good!


Switching to the orbital view, we can see that the Doogey is approaching the Ap marker, or the apoapsis of it's orbit. The Apoapsis of an orbit is the exact point at which a ship is farthest away from the object it is orbiting. This is an important point, because at the apoapsis, a pilot can make the most effective changes in their orbit while using the least amount of fuel possible. We're going to stay about 30 seconds from reaching the apoapsis when we begin to burn, so that we don't accidentally pass it.
 


With a poof and a thud, the now-empty second stage of the Doogey separates and the final motor begins to fire.  Still checking the orbital map, we can see that the orbit is starting to balloon out nicely and we've barely tapped into the third stage's fuel tank.


Viola! The Doogey is now in stable orbit around Kerbin, and has just enough fuel to hopefully get Jebediah home again. Looks like we got the math right! Mission mostly successful! Let's have some fun!




With a huge grin, Jebediah Kerman pops up the cabin of the Doogey and embarks on the first ever spacewalk! The view is simply stellar from up here!



 After spending a few hours playing around in space and giggling at how lightheaded taking off his helmet made him, brave Jebediah Kerman returns to the Doogey as the craft slips into the pitch black of the night side of the planet, all of the light from the sun blocked by Kerbin itself. Turning the ship around so the rockets are now firing the opposite direction and slowing the craft down, known as a retro-burn, Jeb begins to bring the Doogey back down to Kerman. Notice how I overshot the Kerbal Space Center (the other icon on the ground) by a good few hundred kilometers. This is on purpose, because when the Doogey encounters the atmosphere again, the air resistance will slow it down dramatically and the line will move back towards the Space Center.





 Now well into the atmosphere and relatively safe, it looks like all the math we did earlier paid off immensely. We calculated that the rocket could produce 5579m/s worth of delta/V, and with a perfect launch our voyage would require 5507m/s of delta/V, meaning we could get up and down with a tiny margin of 70/ms of wiggle room, which translates into a few scare liters of fuel left over. Sure enough, we went up, we came down, and as Jebediah passes over the Kerbal Space Center, he burns off the last few scare liters of fuel in a retro burn to help slow down a bit.

Once all of the fuel runs out, the Doogey fires it's last decoupler and ditches all of it's weight except for the cabin holding intrepid Jebediah and a lone parachute. This is where it gets intense for Jebediah!

As the reminants of the Doogey hit the much thicker lower atmosphere, the capsule begins to get so hot from friction due to air resistance that the heat shield begins to glow bright red, but never fear, it's well within parameters and Jebediah is still relatively safe. As planned, at 22,000 meters, the main parachute deploys and begins to slow the pod down even more.
At 10,000 meters, the parachute has slowed the Doogey down dramatically to around 300m/s. All is well and there is really no reason for this picture other than during the descent, I couldn't help but notice something strange on this island about 25km into the ocean. It's obviously manmade, and stationary. There is a chance it could be the first stage of the Doogey, landed earlier and washed up ashore, but it looks far too large. Either way, it's something for investigation!


SUCCESS! At 500 meters above the surface, the main parachute catches and slows the pod down, for a gentle splashdown in the Kerbin Ocean. 



After a short swim, Jebediah reaches the KSS Maybe Not unharmed but with wet socks. This concludes the mission! What a stunning success! Stay tuned next time, for when we check out mystery island!







No comments:

Post a Comment