Jump to content

TheGreatFez

Members
  • Posts

    9
  • Joined

  • Last visited

Reputation

0 Neutral

Profile Information

  • About me
    Bottle Rocketeer

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hello! Love this kind of challenge! Here is my entry: Mods: - kOS - FAR Album of pictures Description of code: - Begin ascent following a predefined square root profile and the throttle locked to a preset value (in this case 40%) - The script has a persistent staging code. It will automatically stage when fuel has run out. - After the Dynamic Pressure drops below 90% of the max the script switches from following the predefined pitch to orbital prograde. - Wait until the ships pitch (ship pointed straight up is 0 degrees) exceeds 75 degrees. Then full throttle. - Maintain full throttle until apoapsis is 90% of target altitude. Then reduce throttle to 50%. - End burn when apoapsis is greater than target altitude, maintain surface prograde (to reduce drag) until outside the atmosphere. Then warp to apoapsis. - Point ship orbital prograde with SAS, wait until estimated half way burn time eta to apoapsis. Begin burn at full throttle. - Cut off when periapsis is greater than 180 km. Final liquid fuel: 142.96 Script: declare parameter OrbitAlt. set ship:control:pilotmainthrottle to 0. clearscreen. set circstage to 3. set flightmode to 0. set compass to 90. //set OrbitAlt to 100000. lock pitch to sqrt((90^2)*altitude/70000). lock steering to heading(compass,90-pitch). set thrustset to .4. lock throttle to thrustset. stage. set starttime to time:seconds. wait 1. set MAX to maxthrust. set BurnTime to 0. set DeltaV to 0. lock e to ship:orbit:eccentricity. lock a to ship:orbit:semimajoraxis. lock u to ship:body:mu. when maxthrust < MAX OR availablethrust = 0 then { lock throttle to 0. stage. lock throttle to thrustset. set MAX to maxthrust. preserve. } lock Q to 1000*ship:dynamicpressure. set MaxQ to Q. lock AeroSwitch to Q/MaxQ. until periapsis >= 180000 { if MaxQ <= Q { set MaxQ to Q. } if flightmode = 0 and AeroSwitch < .1 { lock FPAorbit to VANG(UP:vector,velocity:orbit). lock pitch to FPAorbit. set flightmode to 1. } if flightmode = 1 AND pitch >= 75 { set thrustset to 1. set flightmode to 2. } if flightmode = 2 AND apoapsis >= .9*OrbitAlt { lock throttle to .5. wait .5. set flightmode to 3. } if flightmode <= 3 AND apoapsis >= OrbitAlt { lock throttle to 0. wait .5. set flightmode to 4. } if flightmode = 4 { lock Vapo to sqrt(((1-e)*u)/((1+e)*a)). lock Vcir to sqrt(u/(apoapsis + ship:body:radius)). lock DeltaV to Vcir - Vapo. lock BurnTime to .5*DeltaV*(mass/max(.0001,availablethrust)). lock steering to srfprograde. set flightmode to 5. } if flightmode = 5 AND altitude >= 70000 { unlock steering. set SASMODE to "PROGRADE". SAS ON. wait 5. warpto(time:seconds + eta:apoapsis - BurnTime - 10). set flightmode to 6. } if flightmode = 6 AND BurnTime >= eta:apoapsis { lock throttle to DeltaV*(mass/max(.0001,availablethrust)). set flightmode to 7. } print "Flight Mode " + flightmode at (0,1). print "MaxQ " + round(MaxQ,2) at (0,2). print "Q " + round(Q,2) at (0,3). print "Pitch " + round(pitch,2) at (0,4). print "Ship Pitch " + round(VANG(UP:vector,ship:facing:vector),2) at (0,5). print "Apoapsis " + round(apoapsis,2) at (0,6). print "Target Apoapsis " + round(OrbitAlt,2) at (0,7). print "Time to Apoapsis " + round(eta:apoapsis,2) at (0,8). print "BurnTime " + round(BurnTime,2) at (0,9). print "Throttle " + round(throttle,2) at (0,10). } lock throttle to 0. unlock all. set finishtime to time:seconds. set totaltime to finishtime - starttime. print "Time to Ascent " + round(totaltime,2) at (0,20).
  2. Okay, I reallly hope this doesn't sound rude. But I am not sure exactly why a pre-calculated script is needed. Is it so you get the proper launch window to get to Mun? Could you explain in more detail why it is that you need to launch at exactly UT 0? My issue here in understanding is that since you dont have any life support needed, then can you not get into orbit and then wait until you reach the proper phase angle to launch? After I understand the issue better I might be able to aid you guys by somehow starting the game for your test runs at the same time OR more helpfully I might be able to give you guys some help into solving the issue. I would greatly appreciate your input! - - - Updated - - - I also want to point out one thing to help incase anyone does not know already: You can determine what the Longitude and Latitude of Mun is in respect to Kerbin. For example, if you "print MUN:LONGITUDE." it will give you the longitude that Mun is currently at on Kerbin. This is kind of important since you can use this data to then get a phase angle between you and Mun. Using this you can then figure out when to launch, based on what altitude your parking orbit is. That part you will need to Google and find out yourself but I hope this helps others!
  3. Let me think about this... FAR does add difficulty since you can't make sharp easy turns. The reason for its addition is the emphasis on efficiency for Tier 1 and Tier 3 and to a lesser extent Tier 2. FAR is much more efficient than stock aerodynamics so I wanted to give them the best chance they had. If I let people enter without FAR it might be concidered cheap since its there is much larger margins for error in stock than FAR. Which also makes it easier to write scripts... However the players without would suffer from efficiency so it might be counteracted by this. You are welcome to run things at a precalculated date. I can start a new save file if necessary. However... I suggest that you write into your code to determine when to launch based on the Universal Time. Since you can accelerate time to whatever date you wish at the launch pad you can move to the launch date that would best help you. After all, all launch windows come up every day/month with respect to Mun. Hope this answers your questions! Let me know if you would still like to participate. I might add a section on those who do not wish to use FAR if there are enough people who wish to do this...
  4. Yeah its not too bad to install and get started. If you are looking for any help, the documentation sight is a great place to start. Also, you can learn a lot from /r/kOS on Reddit!
  5. Hello all, I am a moderator on the /r/kOS subreddit. I have been spending the last couple weeks working out the kinks in this challenge to post on the subreddit. To get more exposure I wanted to post it on here so that others might find interest in it! I have also posted this on the Challenges section of the KSP Forum so you might have already seen this. The challenge will require you to code an autopilot script and design a ship to fly to Mun and Land with 3 different difficulty of objectives. Here is the link to the Google Doc with the description on it. Its quite lengthy but I believe it covers much of any issues that might arise with this competition. If you have any issues/questions/comments please let me know! Deadline for submissions is April 4th at 11:59pm (UTC -6). Good luck!
  6. Hello all, EDITS: Procedural Fairings mod added, Team Entries are allowed, Entry Due Date extended I am a moderator on the /r/kOS subreddit. I have been spending the last couple weeks working out the kinks in this challenge to post on the subreddit. To get more exposure I wanted to post it on here so that others might find interest in it! If you don't know what kOS is, its a mod for KSP that allows you to write automated scripts that control your rocket using a language called Kerbo Script. Here is a link to the forum on the mod. The challenge will require you to code an autopilot script and design a ship to fly to Mun and Land with 3 different difficulty of objectives. Here is the link to the Google Doc with the description on it. Its quite lengthy but I believe it covers much of any issues that might arise with this competition. If you have any issues/questions/comments please let me know! Deadline for submissions is April 25th at 11:59pm (UTC-6). Good luck!
  7. Hello all, I was told to try and post my endeavor here on this thread. I created an automated flight to land on Mun and back to Kerbin. The reason I did this was to have something cool to put on my resume that involved orbital mechanics to apply to SpaceX. I compiled the flight into a video explaining what I did technically speaking. Here is the link to the video (audio might be a bit bad but its my first video ever ). I dont know if this counts as an official post to the challenge but I figured a video would be sufficient instead of screen shots. Problems I see: -I use Engineer to get data read outs. I know its supposed to be all stock so if this disqualifies me I understand. -The video is meant to show just the major technical achievements so its cut in places to shorten the 30 trip to about 10 min. I dont know if that would change the validity of my post. -If you need the code/craft files I can give them to you here but in the link to the video there is a link to the craft files and code in the description if you are interested. Please let me know if this is acceptable as a post and if not please let me know how I can make it acceptable! Thanks!
  8. Nope! Honestly I am probably a very lousy rocket designer when it comes to KSP. Until recently, I thought making things aerodynamic made a difference... it doesnt haha. Most of my designs have completely seperate stages (like the saturn v) so there was no need to code anything crazy. I also just looked up what asparagus staging was, thats pretty awesome! And your code is really neat, if I ever need it I am just going to check with yours haha. Thanks!
  9. Hello all, just joined the forums cause I have been working on this launch program and it has been finished! Thanks to the new update I was able to create the best criteria that I can think of for getting a rocket to the correct (and nearly perfect) circular orbit! Here is a list of the implementations I have added to my launcher that I set out to accomplish: During the vertical ascent and beginning the gravity turn: I created a loop between ground and 25,000m that adjusts the throttle so the craft is always flying at terminal velocity. This from what I have read is the most optimal solution. Once desired circular orbit altitude has been reached: I created a control logic that keeps slightly adjusting the apogee during atmospheric ascent. This produces consistent results of the apogee being within 10m of desired circular orbit altitude. Example: if I set my desired circular orbit to 100km the biggest difference I have seen is 100,010m. Upon reaching apoapsis and beginning burn to circularize orbit: I created a control logic that adjust the angle of the burn so the craft is always behind or at the apoapsis until the vehicle reaches the appropriate orbital velocity. With arcsin arccos and arctan functions (which I hope will be implemented! ) I can make the logic more concrete and physics based. I am really proud of it and I wanted to show it off for people to see and comment on it. If you have any questions, comments, or what to know more feel free to ask. Also if you have any other challenges you think I can take up please let me know! I am excited to use this mod more! // Set FINAL to your desired circular orbit. set FINAL to 100,000. stage. set thrust to 0. lock throttle to thrust. lock steering to heading 90 by 90. set m to mass. set D to (mass*9.81)/6500. set Qmax to (mass*9.81)/D. clearscreen. print "T-minus 5". wait 1. print "4". wait 1. print "3". wait 1. print "2". wait 1. print "1". wait 1. print "Launch". set thrust to 1. stage. wait 1. clearscreen. set Cd to .2. set p0 to 1.223125. set e to 2.71828. set q to 0. print "Vertical Ascent" at (0,0). print "Q-Max" at (0,1). print "Dynamic Pressure" at (0,2). until q > Qmax*.9 { set H to altitude/(-5000). set p to p0*(e^H). set q to (.5*(verticalspeed^2)*p). set Qmax to (mass*9.81)/D. print Qmax at (20,1). print q at (20,2). }. // Throttle is reduced to maintain a constant terminal velocity. clearscreen. print "Throttle down to reduce drag losses" at (0,0). wait 1. clearscreen. print "Throttle" at (0,1). print "Speed" at (0,2). print "Density" at (0,3). print "Dynamic Pressure" at (0,4). print "Q-Max" at (0,5). set x to .5. until altitude > 25000 { set H to altitude/(-5000). set p to p0*(e^H). set q to (.5*(verticalspeed^2)*p). set Qmax to (mass*9.81)/D. if altitude > 10000 AND x < 1 { lock steering to heading 90 by 60. print "Begin gravity turn" at (0,7). set x to x+1. }. if altitude > 15000 and x < 2 { lock steering to heading 90 by 30. set x to x+1. }. if q < Qmax AND thrust < 1 { set thrust to thrust + .05. }. if q > Qmax { set thrust to (((q*Cd*m*.008)/maxthrust)+thrust*1.25)/2. }. print thrust*100+"%" at (20,1). print verticalspeed at (20,2). print p at (20,3). print q at (20,4). print Qmax at (20,5). if stage:liquidfuel = 0 { stage. }. }. // After 25,000m the effects of drag are minimal so thrust is set to 100%. // Burn to desired circular orbit altitude. clearscreen. print "Burn to " + FINAL*.001 + "Km apogee". lock steering to heading 90 by 30. set thrust to 1. until apoapsis > FINAL*.9 { if stage:liquidfuel = 0 { stage. }. }. set thrust to 0. lock steering to prograde. clearscreen. // Adjust final apoapsis until out of drag effects. print "Coast to Space". set x to 2.5. until altitude > 70000 { if apoapsis < FINAL { set thrust to .1*x. }. if apoapsis >.99*FINAL { set x to .1. }. if apoapsis > FINAL { set thrust to 0. }. }. // For extremely high altitudes (such as geosynchronous) this is needed-. // since burn will continue out of atmosphere. if apoapsis < FINAL { set thrust to .1. wait until apoapsis >.999*FINAL. set thrust to .01. wait until apoapsis > FINAL. set thrust to 0. }. clearscreen. //Calculate circular velocity at apoapsis altitude set x to 1. set theta to (5*100000)/FINAL. set GM to 3.5316*(10^12). set r to apoapsis+600,000. set vcir to (GM/r)^.5. set v to 0. // Warp! print "Warp to Apogee". set warp to 4. wait until eta:apoapsis < 1000. set warp to 3. wait until eta:apoapsis < 50. set warp to 0. lock steering to heading 90 by 0. clearscreen. // Waiting on apoapsis arrival. print "Vertical Speed" at (0,1). until verticalspeed < 3 { print verticalspeed at (20,1). print "T-minus " + eta:apoapsis + " to Apoapsis" at (0,0). }. clearscreen. // Burn to circularize, theta is used to maintain the apogee infront of the craft print "Burn to Circularize Orbit" at (0,0). print "Vertical Speed" at (0,1). print "Orbital Speed" at (0,2). print "Vcir" at (0,3). print vcir at (20,3). print "Theta" at (0,4). print theta at (20,4). set par to altitude/(-10000000). set tval to .75*(e^par). set y to .5. until v > vcir*.9995 { set thrust to 1*x. set vec to velocity:orbit. set vx to vec:x. set vy to vec:y. set vz to vec:z. set v to ((vx^2)+(vy^2)+(vz^2))^.5. if stage:liquidfuel = 0 { stage. }. if v > vcir*.9 AND y < 1{ set x to tval. set y to y+1. }. if v > vcir*.99 AND y < 2{ set x to .1. set y to y+1. }. if verticalspeed < 0 { lock steering to heading 90 by theta. }. if verticalspeed > 0 { lock steering to heading 90 by 0. }. print verticalspeed at (20,1). print v at (20,2). }. lock throttle to 0. clearscreen. // DONE! set e to (apoapsis-periapsis)/(apoapsis+periapsis). print "Eccentricity" at (0,0). print e at (20,0). set avg to (apoapsis+periapsis)/2-FINAL. set error to avg/FINAL*100. print "Error " + error + "%" at (0,1). wait 10.
×
×
  • Create New...