Jump to content

check

Members
  • Posts

    203
  • Joined

  • Last visited

Everything posted by check

  1. This makes sense to me... I think. So I'm assuming that point would be Lat 0, Long 0? Or does it not rotate along with the planet? Hopefully it does... and hopefully it's a consistent point across all planets/moons so that conversion to something useful will be possible... otherwise velocity:surface is going to be a pain to work with.
  2. My Curiosity Rover + Skycrane Entry, Descent, Landing... This was made using 0.5. I haven't updated it to take advantage of some of the new functions in 0.61 yet. Video of the sequence in action: Code: clearscreen. Set ln to 0. Set lt to 0. set flag1 to 0. set t to 1. Print "EXECUTING PROGRAM...". Print "Rover Landing by check.". Print "". //Launch program lock steering to up + R(0,0,180). lock throttle to 1. Print missiontime + " Launching...". Stage. // Rolls rocket 90 degrees... for fun. Useful in some situations Wait until alt:radar > 200. Lock steering to up + R(0,0,270). Print missiontime + " ROLL Prog.". //While in flight, auto throttles based on current velocity vs ideal velocity. If current vertical speed // > ideal velocity, throttle down, else throttle up. // When boosters are drained, ditched them. Until altitude > 8000 { if verticalspeed > 102.9 * (1.0001005^altitude) { set t to t - 0.05.}. if verticalspeed < 102.9 * (1.0001005^altitude) { set t to t + 0.05.}. //So when the rocket has < 450 fuel, it means the boosters are dry, so stage. BUT you only want to stage once, // so that's where the flag comes in. after you staged once, change the flag value so you don't stage again. If stage:liquidfuel < 450 AND flag1 = 0 { stage. set t to 1. set flag1 to 1. Print missiontime + " Booster Separation.". }. If t < 0 {set t to 0.}. If t > 1 {set t to 1.}. Lock throttle to t. }. Lock throttle to 1. // Gravity turn Lock steering to up + R(-45,1,180). Print missiontime + " Gravity turn.". Wait until stage:liquidfuel = 0. Stage. Lock throttle to 0. // Ditch the booster when it's dry. Print missiontime + " Stage 1 Sep.". // Coast past apoapsis and reorient retrograde the craft when it's below 7500 m. Wait until verticalspeed < 0 AND altitude < 75000. Lock steering to retrograde +R(0,0,180). // deploy the chute at 8000m and unlock the steering Wait until altitude <8000. Stage. Print missiontime+ " Drogue Deployed". Unlock steering. // jettison the heatsheild at 2200m Wait until alt:radar < 2200 and alt:radar > -1. Stage. Print missiontime + " HEATSHEILD Sep.". Wait until alt:radar < 1000. stage. // detach from chute/backshell at 1000m Print missiontime + " BACKSHELL Sep.". Wait 1. // deviate by 10 degrees (yaw / roll?) + 45 degrees pitch and fire engines. Numbers kind of arbitrary. mostly wanted // to test the horizontal velocity killing technique. // This is to move away from the parachute/backshell and not have it land on us later. Lock steering to up + R(10,45,180). Wait 1. Lock throttle to 0.3. Stage. Print missiontime + " Deviation mnvr.". wait 2. // Measures horizontal 'velocity' direction (not magnitude) and pitches/rolls the craft to compensate. // If longitude/latitude is increasing/decreasing, roll to fire engine in the opposite direction. // orient UP when surface velocity is < 1m/s. Until surfacespeed < 1 OR alt:radar < 510{ Set long1 to longitude. Set long2 to longitude. Set lat1 to latitude. Set lat2 to latitude. If long2 < long1 {set ln to -15.}. If long2 > long1 {set ln to 15.}. If lat2 < lat1 {set lt to -15.}. If lat2 > lat1 {set lt to 15.}. if abs(lat2-lat1) < 0.000005 {set lt to 0.}. if abs(long2-long1) < 0.000005 {set ln to 0.}. Lock steering to up + R(lt,ln,180). }. Set ln to 0. Set lt to 0. Lock throttle to 0. lock steering to up + R(0,0,180). // After 500 m, fire the throttle at 1.8 Gs. Wait until alt:radar < 500. Print missiontime + " Approach.". Lock throttle to (1.8 * 9.81 * mass/maxthrust). // wait until veritcal speed >-30.... self explainitory. Wait until verticalspeed >-30. // Adjust throttle to either 1.7Gs or 1.0 Gs depending on if vertical speed is <-15 m/s or >-10 m/s until 120 m Until alt:radar < 120 { If verticalspeed <-15 {Lock throttle to (1.7 * 9.81 * mass/maxthrust).}. If verticalspeed >-10 {Lock throttle to (9.81 * mass/maxthrust).}. }. // Adjust throttle to either 1.4Gs or 1.1 Gs depending on if vertical speed is <-3 m/s or >-1 m/s until 2.5 m // Adjust pitch/roll based on horizontal velocity direction, like in deviation mod but with finer adjustments Print missiontime + " Final approach.". Until alt:radar < 2.5 { Set long1 to longitude. Set long2 to longitude. Set lat1 to latitude. Set lat2 to latitude. If long2 < long1 {set ln to -2.}. If long2 > long1 {set ln to 2.}. If lat2 < lat1 {set lt to -2.}. If lat2 > lat1 {set lt to 2.}. if abs(lat2-lat1) < 0.000005 {set lt to 0.}. if abs(long2-long1) < 0.000005 {set ln to 0.}. Lock steering to up + R(lt,ln,180). If verticalspeed <-3 {Lock throttle to (1.4 * 9.81 * mass/maxthrust).}. If verticalspeed >-1 {Lock throttle to (1.1* 9.81 * mass/maxthrust).}. }. // At 2.5 m, pitch over 5 degrees, lock throttle to 2Gs, put the brakes on the rover wheels, jettison the skycrane. Lock steering to up+R(-5,0,180). Lock throttle to (2 * 9.81 * mass/maxthrust). Brakes on. Stage. Lock throttle to 0. Unlock throttle. Unlock steering. Wait 5. // After 5 seconds, open the com dish and extend the antennae. Toggle AG1. Print missiontime +" Landed.".
  3. Yeah, I don't recall learning that either. Seems bizarre to me the way it does it. Unrelated, any way to pull the current attitude of the spacecraft? The manual is in sore need of an update. lol.
  4. For people wondering what the Q() function is and why it's better than R(), check out: And then this:
  5. Would relaying programs be possible then? Say you've written a program, saved it to the archive and want to send it to a rover on Duna. But you don't want a bajillion antennas on your tiny rover, just enough to reach an orbiting satellite. Could you relay the program via that satellite?
  6. The lander is surprising large for their first soft landing attempt: As is the rover: They also have a backup spacecraft, Chang'e 4, which will launch in 2015. Good for them. China is certainly taking a measured and deliberate approach to their space program. While the focus of their manned program at the moment is development of a space station, I can imagine that if Chang'e 3 is successful, there will be a major push towards a manned lunar landing perhaps a bit sooner than the 2030 timeframe they estimate.
  7. See, I was having a weird issue where the (x,y,z) components were showing large values >1 or <-1 and my ship was stationary. I decided to check the surface velocity on just a command pod while on the ground and then again while on top of a 60m tall launch clamp. On the ground I was getting near 0 but on the clamp I was showing a steady value of ~1.2 m/s in th x component, with the other two showing near 0. So I thought something else was going on. But after resetting the game and trying it again, the numbers look ok now. Weird...
  8. Can someone explain what exactly surface velocity is measuring? Because it's not measuring my velocity with respect to the ground. That's for sure.
  9. Just watched the video. Lots of awesome new features! Thanks! My first immediate question is when you lock to a specific heading, how do you adjust the roll now to keep it locked at the new heading with the desired roll?
  10. That's pretty much what I did, but I still found that it moved around too much too be useful... but I had it set up like: If blah blah { set time1 to missiontime. set v1 to verticalspeed. set time2 to missiontime. set v2 to verticalspeed. set a to (v2-v1)/(time2-time1). blah blah blah blah blah blah }. But I guess if I have time1 & v1 and time2 & v2 spaced farther apart (with the blah blah blah code in the middle) it might smooth out the numbers more. Yeah, I'm sure a 'universal time' function is on its way. It's probably pretty easy to do.
  11. Took a look at your code, but didn't run it yet. Very nice. But how jittery are your velocity measurements? I tried doing something similar to calculate acceleration and it was all over the place. In the long run, it averaged out to what it should be but instantaneously it just jumped around too much to be much use. Nice. Will definitely be useful once we get the right code to allow for automated interplanetary missions.
  12. That's bizarre about the skycrane flipping over. Is your kOS control pod on the skycrane or the rover? I think my code is robust enough to work on different designs. It 'mostly' adjust throttle settings to achieve specific TWR rather than an absolute value, so the same code should work on heavier and lighter landers. I haven't tried it out yet. I've been thinking of a workaround for this too, though not too seriously because I'm sure a 'surfaceprograde' code is probably coming very soon. I suppose you could determine your surface prograde direction by subtracting your 'orbital velocity' from the rotation speed of kerbin, based on your latitude and extended up to your altitude... and then taking into account the change in longitude and latitude over time... (which won't be precise... it'll be jittery based on how long it takes your computer to run each command in kOS). Anyway, I'd be interested to see your solution.
  13. The program is checking to see if longitude and latitude are increasing/decreasing. If they are, it pitches and rolls in the opposite direction to compensate until the change between the two measured longitudes/latitudes is < 0.000005 degrees... which is kind of arbitrary because what velocity that corresponds to entirely depends on how quickly the program is executing..which varies all the time... but it puts it in roughly the 0.25 m/s range if theres a 200 ms delay between each command. (I've found that it varies between 100 ms and 250 ms). Anyway, some hastily annotated code: clearscreen. Set ln to 0. Set lt to 0. set flag1 to 0. set t to 1. Print "EXECUTING PROGRAM...". Print "Rover Landing by check.". Print "". //Launch program lock steering to up + R(0,0,180). lock throttle to 1. Print missiontime + " Launching...". Stage. // Rolls rocket 90 degrees... for fun. Useful in some situations Wait until alt:radar > 200. Lock steering to up + R(0,0,270). Print missiontime + " ROLL Prog.". //While in flight, auto throttles based on current velocity vs ideal velocity. If current vertical speed // > ideal velocity, throttle down, else throttle up. // When boosters are drained, ditched them. Until altitude > 8000 { if verticalspeed > 102.9 * (1.0001005^altitude) { set t to t - 0.05.}. if verticalspeed < 102.9 * (1.0001005^altitude) { set t to t + 0.05.}. //So when the rocket has < 450 fuel, it means the boosters are dry, so stage. BUT you only want to stage once, // so that's where the flag comes in. after you staged once, change the flag value so you don't stage again. If stage:liquidfuel < 450 AND flag1 = 0 { stage. set t to 1. set flag1 to 1. Print missiontime + " Booster Separation.". }. If t < 0 {set t to 0.}. If t > 1 {set t to 1.}. Lock throttle to t. }. Lock throttle to 1. // Gravity turn Lock steering to up + R(-45,1,180). Print missiontime + " Gravity turn.". Wait until stage:liquidfuel = 0. Stage. Lock throttle to 0. // Ditch the booster when it's dry. Print missiontime + " Stage 1 Sep.". // Coast past apoapsis and reorient retrograde the craft when it's below 7500 m. Wait until verticalspeed < 0 AND altitude < 75000. Lock steering to retrograde +R(0,0,180). // deploy the chute at 8000m and unlock the steering Wait until altitude <8000. Stage. Print missiontime+ " Drogue Deployed". Unlock steering. // jettison the heatsheild at 2200m Wait until alt:radar < 2200 and alt:radar > -1. Stage. Print missiontime + " HEATSHEILD Sep.". Wait until alt:radar < 1000. stage. // detach from chute/backshell at 1000m Print missiontime + " BACKSHELL Sep.". Wait 1. // deviate by 10 degrees (yaw / roll?) + 45 degrees pitch and fire engines. Numbers kind of arbitrary. mostly wanted // to test the horizontal velocity killing technique. // This is to move away from the parachute/backshell and not have it land on us later. Lock steering to up + R(10,45,180). Wait 1. Lock throttle to 0.3. Stage. Print missiontime + " Deviation mnvr.". wait 2. // Measures horizontal 'velocity' direction (not magnitude) and pitches/rolls the craft to compensate. // If longitude/latitude is increasing/decreasing, roll to fire engine in the opposite direction. // orient UP when surface velocity is < 1m/s. Until surfacespeed < 1 OR alt:radar < 510{ Set long1 to longitude. Set long2 to longitude. Set lat1 to latitude. Set lat2 to latitude. If long2 < long1 {set ln to -15.}. If long2 > long1 {set ln to 15.}. If lat2 < lat1 {set lt to -15.}. If lat2 > lat1 {set lt to 15.}. if abs(lat2-lat1) < 0.000005 {set lt to 0.}. if abs(long2-long1) < 0.000005 {set ln to 0.}. Lock steering to up + R(lt,ln,180). }. Set ln to 0. Set lt to 0. Lock throttle to 0. lock steering to up + R(0,0,180). // After 500 m, fire the throttle at 1.8 Gs. Wait until alt:radar < 500. Print missiontime + " Approach.". Lock throttle to (1.8 * 9.81 * mass/maxthrust). // wait until veritcal speed >-30.... self explainitory. Wait until verticalspeed >-30. // Adjust throttle to either 1.7Gs or 1.0 Gs depending on if vertical speed is <-15 m/s or >-10 m/s until 120 m Until alt:radar < 120 { If verticalspeed <-15 {Lock throttle to (1.7 * 9.81 * mass/maxthrust).}. If verticalspeed >-10 {Lock throttle to (9.81 * mass/maxthrust).}. }. // Adjust throttle to either 1.4Gs or 1.1 Gs depending on if vertical speed is <-3 m/s or >-1 m/s until 2.5 m // Adjust pitch/roll based on horizontal velocity direction, like in deviation mod but with finer adjustments Print missiontime + " Final approach.". Until alt:radar < 2.5 { Set long1 to longitude. Set long2 to longitude. Set lat1 to latitude. Set lat2 to latitude. If long2 < long1 {set ln to -2.}. If long2 > long1 {set ln to 2.}. If lat2 < lat1 {set lt to -2.}. If lat2 > lat1 {set lt to 2.}. if abs(lat2-lat1) < 0.000005 {set lt to 0.}. if abs(long2-long1) < 0.000005 {set ln to 0.}. Lock steering to up + R(lt,ln,180). If verticalspeed <-3 {Lock throttle to (1.4 * 9.81 * mass/maxthrust).}. If verticalspeed >-1 {Lock throttle to (1.1* 9.81 * mass/maxthrust).}. }. // At 2.5 m, pitch over 5 degrees, lock throttle to 2Gs, put the brakes on the rover wheels, jettison the skycrane. Lock steering to up+R(-5,0,180). Lock throttle to (2 * 9.81 * mass/maxthrust). Brakes on. Stage. Lock throttle to 0. Unlock throttle. Unlock steering. Wait 5. // After 5 seconds, open the com dish and extend the antennae. Toggle AG1. Print missiontime +" Landed.". Available here too: https://docs.google.com/file/d/0BwrMAqirhs-BZTlLWlFMTGF5UXM
  14. In the future, potentially. Right now it's missing a few key commands, like knowing exactly where you are along your orbit or where the planets/moons are plus many others... but I'm sure those are coming. There are also many bugs to work out. But even in its preliminary state, you can do a lot.
  15. Woops! missed a letter in the URL. It's up now. Cheers.
  16. So I was able to make a Curiosity+Skycrane lik EDL system (minus the tether) , fully automated using kOS. Check out the video: If starts by launching a rocket on a suborbital trajectory. It automatically adjusts the thrust of the rocket to match the terminal velocity, based on an empirical formula I got from a line of best fit from the table on the KSP wiki... It throws the rover/skycrane up to about 113 km and then proceeds with a landing sequence (500 km away) which includes: Drogue chute deployment, Heatshield jettison. Chute release. Deviation. Nulling horizontal velocity. Slowing to -30 m/s, then -12 m/s/ Nulling horizontal velocity with pitch and rolls. Slowing velocity to ~ -1 m/s. Dropping the rover at 2.5 m above the ground. Deviating and shooting off the skycrane into the distance. Yaowzers! I love this mod. The script: clearscreen. Set ln to 0. Set lt to 0. set flag1 to 0. set t to 1. Print "EXECUTING PROGRAM...". Print "Rover Landing by check.". Print "". lock steering to up + R(0,0,180). lock throttle to 1. Print missiontime + " Launching...". Stage. Wait until alt:radar > 200. Lock steering to up + R(0,0,270). Print missiontime + " ROLL Prog.". Until altitude > 8000 { if verticalspeed > 102.9 * (1.0001005^altitude) { set t to t - 0.05.}. if verticalspeed < 102.9 * (1.0001005^altitude) { set t to t + 0.05.}. If stage:liquidfuel < 450 AND flag1 = 0 { stage. set t to 1. set flag1 to 1. Print missiontime + " Booster Separation.". }. If t < 0 {set t to 0.}. If t > 1 {set t to 1.}. Lock throttle to t. }. Lock throttle to 1. Lock steering to up + R(-45,1,180). Print missiontime + " Gravity turn.". Wait until stage:liquidfuel = 0. Stage. Lock throttle to 0. Print missiontime + " Stage 1 Sep.". Wait until verticalspeed < 0 AND altitude < 75000. Lock steering to retrograde +R(0,0,180). Wait until altitude <8000. Stage. Print missiontime+ " Drogue Deployed". Unlock steering. Wait until alt:radar < 2200 and alt:radar > -1. Stage. Print missiontime + " HEATSHEILD Sep.". Wait until alt:radar < 1000. stage. Print missiontime + " BACKSHELL Sep.". Wait 1. Lock steering to up + R(10,45,180). Wait 1. Lock throttle to 0.3. Stage. Print missiontime + " Deviation mnvr.". wait 2. Until surfacespeed < 1 OR alt:radar < 510{ Set long1 to longitude. Set long2 to longitude. Set lat1 to latitude. Set lat2 to latitude. If long2 < long1 {set ln to -15.}. If long2 > long1 {set ln to 15.}. If lat2 < lat1 {set lt to -15.}. If lat2 > lat1 {set lt to 15.}. if abs(lat2-lat1) < 0.000005 {set lt to 0.}. if abs(long2-long1) < 0.000005 {set ln to 0.}. Lock steering to up + R(lt,ln,180). }. Set ln to 0. Set lt to 0. Lock throttle to 0. lock steering to up + R(0,0,180). Wait until alt:radar < 500. Print missiontime + " Approach.". Lock throttle to (1.8 * 9.81 * mass/maxthrust). Wait until verticalspeed >-30. Until alt:radar < 120 { If verticalspeed <-15 {Lock throttle to (1.7 * 9.81 * mass/maxthrust).}. If verticalspeed >-10 {Lock throttle to (9.81 * mass/maxthrust).}. }. Print missiontime + " Final approach.". Until alt:radar < 2.5 { Set long1 to longitude. Set long2 to longitude. Set lat1 to latitude. Set lat2 to latitude. If long2 < long1 {set ln to -2.}. If long2 > long1 {set ln to 2.}. If lat2 < lat1 {set lt to -2.}. If lat2 > lat1 {set lt to 2.}. if abs(lat2-lat1) < 0.000005 {set lt to 0.}. if abs(long2-long1) < 0.000005 {set ln to 0.}. Lock steering to up + R(lt,ln,180). If verticalspeed <-3 {Lock throttle to (1.4 * 9.81 * mass/maxthrust).}. If verticalspeed >-1 {Lock throttle to (1.1* 9.81 * mass/maxthrust).}. }. Lock steering to up+R(-5,0,180). Lock throttle to (2 * 9.81 * mass/maxthrust). Brakes on. Stage. Lock throttle to 0. Unlock throttle. Unlock steering. Wait 5. Toggle AG1. Print missiontime +" Landed.".
  17. My first KSP video: I used the amazing new kOS Scriptable Autopilot system mod: http://forum.kerbalspaceprogram.com/showthread.php/47399-kOS-Scriptable-Autopilot-System-0-5 The potential for this mod is immense!
  18. For Kerbin and Eve I usually just wait until I'm falling more or less straight down unless I have a specific target in mind and find that I'm going to overshoot it. Then I'll deploy it a bit earlier to kill some of the horizontal velocity. On Duna, I try to keep my entry angle as shallow as possible that will still aerobrake me enough to get me to the ground, but I'll use drogue chutes while still high up and going fast. Drogue chutes are awesome on Duna.
  19. So maybe it's something that I haven't noticed before and it's a problem with KSP in general... but what the heck is going on with longitude??? -447 degrees?? Does longitude just go stupid when you're in orbit?
  20. Are you writing lock steering to R(0, 0, 180) or lock steering to Up +R(0, 0, 180)? It should be the latter.
  21. Ah, makes sense. I hadn't actually played around with kOS until a couple of hours ago.. it is unbelievable. The potential with this is insane. Awesome work.
  22. That's good enough for a minimum accuracy of about 100 meters on Kerbin, near the equator (120 m for Eve, 35 m for the Mun). Four decimal places would probably be optimal.
  23. Not sure if this has been mentioned, but would it be possible to assign specific parts a name or tag by right clicking them? Here's the idea: right click a part and you can name it to whatever you want to be called up by kOS or have the ability to assign that part to a group. So for example: Right-click an outer engine and rename it as "engine2" or "engine2:outer", the latter assigns the engine to the "outer" group. Then you can independently throttle that engine (presumably), or disable that group's gimbals, or if you do it to fuel tanks, transfer fuel from one specific part to another, activate specific solar panels or antennae, etc etc. Possible?
  24. Finally being able to do some science is awesome! The new subassembly loader will make building space-shuttle-esque craft easier. Still hoping for more symmetry options in the VAB, though. I also hope they eventually add a seperate folder/subfolders for mod parts. I'd like to be able to easily reference which is a stock part and which is a mod part. Outro was wicked.
×
×
  • Create New...